W/A for CI test case - Accept empty user name
W/A code added for CI Test cases to pass, which uses empty
user name with 0penBmc as password. The following code
allows the same to keep the test case going.
This commit has to be removed once test cases are updated to
include "-U root" option.
Unit-Test:
1. Verfied by issuing
ipmitool -I lanplus -C 3 -H X.X.X.X -P 0penBmc raw 6 1
Change-Id: I9e9d6ead0630a553efbd66d6bbee3ddb7eef527e
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
diff --git a/command/session_cmds.cpp b/command/session_cmds.cpp
index 5c74d28..bbc1459 100644
--- a/command/session_cmds.cpp
+++ b/command/session_cmds.cpp
@@ -41,6 +41,18 @@
return outPayload;
}
+ // TODO: W/A code added to allow CI test cases to pass.
+ // Once test cases are updated to add -U option, the following
+ // code has to be removed
+ if (session->userName.empty())
+ {
+ // update current privilege of the session.
+ session->curPrivLevel =
+ static_cast<session::Privilege>(reqPrivilegeLevel);
+ response->newPrivLevel = reqPrivilegeLevel;
+ return outPayload;
+ }
+
uint8_t userId = ipmi::ipmiUserGetUserId(session->userName);
if (userId == ipmi::invalidUserId)
{