Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rspconfig admin_password for OpenBMC #4371

Merged
merged 4 commits into from
Nov 28, 2017
Merged

rspconfig admin_password for OpenBMC #4371

merged 4 commits into from
Nov 28, 2017

Conversation

xuweibj
Copy link

@xuweibj xuweibj commented Nov 24, 2017

#4196

  • rspconfig admin_password
# rspconfig mid05tor12cn02 admin_passwd=0penBmc,0penBmc1
mid05tor12cn02: BMC Setting Password...
  • run when xcatdebugmode=1
# rspconfig mid05tor12cn02 admin_passwd=0penBmc,0penBmc1
Fri Nov 24 03:07:07 2017 mid05tor12cn02: [openbmc_debug] curl -k -c cjar -H "Content-Type: application/json" -d '{ "data": ["root", "xxxxxx"] }' https://172.11.139.2/login
Fri Nov 24 03:07:07 2017 mid05tor12cn02: [openbmc_debug] login_response 200 OK
Fri Nov 24 03:07:07 2017 mid05tor12cn02: [openbmc_debug] curl -k -b cjar -X POST -H "Content-Type: application/json" -d '{"data":["0penBmc1"]}' https://172.11.139.2/xyz/openbmc_project/user/root/action/SetPassword
Fri Nov 24 03:07:07 2017 mid05tor12cn02: [openbmc_debug] rspconfig_set_response 200 OK
mid05tor12cn02: BMC Setting Password...
  • currentpasswd is wrong
# rspconfig mid05tor12cn02 admin_passwd=0penBmc1,0penBmc
mid05tor12cn02: Please input correct BMC password.
  • error
# rspconfig mid05tor12cn16 admin_passwd=0penBmc1,0penBmc,222
mid05tor12cn16: Error: Invalid parameter for option admin_passwd: 0penBmc1,0penBmc,222

When test, encountered that received "500 Internal Error" from OpenBMC. But run again success.

# curl -k -b cjar -X POST -H "Content-Type: application/json" -d '{ "data" : ["0penBmc"] }' https://172.11.139.2/xyz/openbmc_project/user/root/action/SetPassword
{
  "data": {
    "description": "Internal Server Error",
    "exception": "DBusException('The operation failed internally.',)",
    "traceback": [
      "Traceback (most recent call last):",
      "  File \"/usr/lib/python2.7/site-packages/bottle.py\", line 862, in _handle",
      "    return route.call(**args)",
      "  File \"/usr/lib/python2.7/site-packages/obmc/wsgi/apps/rest_dbus.py\", line 913, in __call__",
      "    return self.callback(*a, **kw)",
      "  File \"/usr/lib/python2.7/site-packages/obmc/wsgi/apps/rest_dbus.py\", line 970, in wrap",
      "    return callback(*a, **kw)",
      "  File \"/usr/lib/python2.7/site-packages/obmc/wsgi/apps/rest_dbus.py\", line 1153, in __call__",
      "    return self.callback(*a, **kw)",
      "  File \"/usr/lib/python2.7/site-packages/obmc/wsgi/apps/rest_dbus.py\", line 1127, in wrap",
      "    return self.to_jsonp(callback(*a, **kw))",
      "  File \"/usr/lib/python2.7/site-packages/bottle.py\", line 1734, in wrapper",
      "    rv = callback(*a, **ka)",
      "  File \"/usr/lib/python2.7/site-packages/obmc/wsgi/apps/rest_dbus.py\", line 1092, in wrap",
      "    data = callback(*a, **kw)",
      "  File \"/usr/lib/python2.7/site-packages/obmc/wsgi/apps/rest_dbus.py\", line 1021, in wrap",
      "    return callback(*a, **kw)",
      "  File \"/usr/lib/python2.7/site-packages/obmc/wsgi/apps/rest_dbus.py\", line 1052, in wrap",
      "    return callback(*a, **kw)",
      "  File \"/usr/lib/python2.7/site-packages/obmc/wsgi/apps/rest_dbus.py\", line 209, in __call__",
      "    return getattr(self, 'do_' + request.method.lower())(**kw)",
      "  File \"/usr/lib/python2.7/site-packages/obmc/wsgi/apps/rest_dbus.py\", line 349, in do_post",
      "    item(*request.parameter_list)",
      "  File \"/usr/lib/python2.7/site-packages/dbus/proxies.py\", line 145, in __call__",
      "    **keywords)",
      "  File \"/usr/lib/python2.7/site-packages/dbus/connection.py\", line 651, in call_blocking",
      "    message, timeout)",
      "DBusException: xyz.openbmc_project.Common.Error.InternalFailure: The operation failed internally."
    ]
  },
  "message": "500 Internal Server Error",
  "status": "error"
}

@xuweibj xuweibj added this to the 2.13.9 milestone Nov 24, 2017
@xuweibj xuweibj requested a review from whowutwut November 24, 2017 08:26
@xcatbot
Copy link

xcatbot commented Nov 24, 2017

CI CHECK RESULT : > PR FORMAT CORRECT> BUILD SUCCESSFUL > INSTALL XCAT SUCCESSFUL> CODE SYNTAX CORRECT> FAST REGRESSION TEST Successful: Totalcase 215 Pass 215 failed 0

@whowutwut
Copy link
Member

@xuweibj At what level of the FW code is this enabled?

Could we also add in UT cases for this, I have PR #4379 If @hu-weihua merges it, we can add in the basic UT cases that you printed above and build up the automation. If we do something to set/change this, we should set it back to what it was at the end of the testing... Or just not automate that.

@@ -310,6 +310,14 @@ my %status_info = (
RSPCONFIG_GET_RESPONSE => {
process => \&rspconfig_response,
},
RSPCONFIG_PASSWD_REQUEST => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we use "PASSWD_REQUEST" as the name for this? The action is "SetPassword" , should it be RSPCONFIG_SET_PASSWD?

@@ -2477,9 +2503,20 @@ sub rspconfig_response {
}
}

if ($node_info{$node}{cur_status} eq "RSPCONFIG_PASSWD_VERIFY") {
if ($status_info{RSPCONFIG_PASSWD_VERIFY}{argv} ne $node_info{$node}{password}) {
xCAT::SvrUtils::sendmsg("Please input correct BMC password.", $callback, $node);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always try to avoid using "Please" if possible.

Suggest: Current BMC password is incorrect, cannot set the new password.

if ($node_info{$node}{cur_status} eq "RSPCONFIG_SET_RESPONSE") {
if ($response_info->{'message'} eq $::RESPONSE_OK) {
xCAT::SvrUtils::sendmsg("BMC Setting Hostname...", $callback, $node);
if (defined $status_info{RSPCONFIG_SET_RESPONSE}{argv} and $status_info{RSPCONFIG_SET_RESPONSE}{argv} eq "password") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we auto generate this message based on the {argv} passed in? If it's hostname or password. The danger here is if we get into this call with something else as argv... not hostname or password... it will always print Setting Hostname and we won't know what value was passed in.

But if we take argv and run it though ucfirst we can automatically generate the msg.

@xuweibj xuweibj force-pushed the T4196 branch 2 times, most recently from 927cbce to aaf3c0f Compare November 28, 2017 06:32
@xuweibj
Copy link
Author

xuweibj commented Nov 28, 2017

@whowutwut Yes, it's enabled. The output in the description is my UT result.

@whowutwut
Copy link
Member

whowutwut commented Nov 28, 2017

@xuweibj What I meant for the UT is to create automation UT cases. I'd like the developers to start creating these instead of relying on FVT team to handle all the burden. On each FW update that we get, we have to have a regression suite to make sure we didn't regress.. (As seen in #4378) and things are working OK. Manually running it cannot be the solution. If you can create PR to include the UT and associate it with #4196, that would be great!

Copy link
Member

@whowutwut whowutwut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am OK with these changes.

@whowutwut whowutwut merged commit 4fcd15c into xcat2:master Nov 28, 2017
@xuweibj xuweibj deleted the T4196 branch November 29, 2017 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants