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

Patch fixes issue when login in BMC/eBMC is successful but response bo… #863

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

PraveenPenguin
Copy link
Collaborator

…dy has only Token

before FIx:

Traceback (most recent call last):
File "/home/shirisha_g/Desktop/Reinstall-202132021432/OPTEST-SETUP/op-test/common/OpTestUtil.py", line 2576, in login
.format(r.status_code, json_data['status'],
KeyError: 'status'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/shirisha_g/Desktop/Reinstall-202132021432/OPTEST-SETUP/op-test/OpTestConfiguration.py", line 939, in objs
password=self.args.bmc_password)
File "/home/shirisha_g/Desktop/Reinstall-202132021432/OPTEST-SETUP/op-test/common/OpTestEBMC.py", line 55, in init
r = self.conf.util_bmc_server.login()
File "/home/shirisha_g/Desktop/Reinstall-202132021432/OPTEST-SETUP/op-test/common/OpTestUtil.py", line 2599, in login
.format(self._url(uri), username, password, e))
common.Exceptions.HTTPCheck: Something happened with the HTTP Server. Review the following for more details Message="Requests post problem, check that your credentials are properly

@PraveenPenguin
Copy link
Collaborator Author

log :

, 'Date': 'Mon, 02 Sep 2024 04:58:13 GMT', 'Content-Length': '37'}
{
  "token": "u1Wj5VGqRqGk8FtJwqlk"
}
my debug data ---------
{'data': "User 'admin' logged in", 'message': '200 OK', 'status': 'ok'}
200




2024-09-01 23:58:11,185:op-test.common.OpTestHMC:connect:INFO:De-activating the console
command-line line 0: Unsupported option "afstokenpassing"
Last login: Mon Sep  2 04:54:13 2024 from 9.43.21.18
hscroot@hmc:~> which bash && exec bash --norc --noprofile
PS1=\[console-expect\]#
which bash && exec bash --norc --noprofile
which: no bash in (/hmcrbin/:/usr/hmcrbin)
hscroot@hmc:~> PS1=\[console-expect\]#
[console-expect]#which stty && stty cols 300;which stty && stty rows 30
which stty && stty cols 300;which stty && stty rows 30
which: no stty in (/hmcrbin/:/usr/hmcrbin)
which: no stty in (/hmcrbin/:/usr/hmcrbin)
[console-expect]#export LANG=C
export LANG=C
[console-expect]#

common/OpTestUtil.py Outdated Show resolved Hide resolved
@PraveenPenguin PraveenPenguin changed the title Patch fixes issue when login in BMC/EMB is successful but response bo… Patch fixes issue when login in BMC/eBMC is successful but response bo… Sep 2, 2024
@abdhaleegit abdhaleegit self-requested a review September 2, 2024 11:53
common/OpTestUtil.py Outdated Show resolved Hide resolved
Depending on code level running on BMC/eBMC, expected format
for a response on successful login operation may differ.

Expected: status': 'ok'
Actual: "token":"<token>"

This patch adds code to handle this valid response.

before FIx:

Traceback (most recent call last):
  File "/home/shirisha_g/Desktop/Reinstall-202132021432/OPTEST-SETUP/op-test/common/OpTestUtil.py", line 2576, in login
    .format(r.status_code, json_data['status'],
KeyError: 'status'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/shirisha_g/Desktop/Reinstall-202132021432/OPTEST-SETUP/op-test/OpTestConfiguration.py", line 939, in objs
    password=self.args.bmc_password)
  File "/home/shirisha_g/Desktop/Reinstall-202132021432/OPTEST-SETUP/op-test/common/OpTestEBMC.py", line 55, in __init__
    r = self.conf.util_bmc_server.login()
  File "/home/shirisha_g/Desktop/Reinstall-202132021432/OPTEST-SETUP/op-test/common/OpTestUtil.py", line 2599, in login
    .format(self._url(uri), username, password, e))
common.Exceptions.HTTPCheck: Something happened with the HTTP Server.  Review the following for more details
Message="Requests post problem, check that your credentials are properly

Signed-off-by: Praveen K Pandey <[email protected]>
Copy link
Collaborator

@abdhaleegit abdhaleegit left a comment

Choose a reason for hiding this comment

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

LGTM

@abdhaleegit
Copy link
Collaborator

one run on P10 and P11 bmc/ebmc would be better.. with these changes

@abdhaleegit abdhaleegit merged commit b71ad3c into open-power:master Sep 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants