-
Notifications
You must be signed in to change notification settings - Fork 165
[1LP][RFR] CLI - Testing restoring DB using NFS - negative #9823
[1LP][RFR] CLI - Testing restoring DB using NFS - negative #9823
Conversation
f88cc7d
to
f5e7e76
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small questions. Thanks for all the automation work @dgaikwad!
f5e7e76
to
640a652
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for this PR
cfme/utils/appliance/console.py
Outdated
@@ -59,7 +59,7 @@ def run_commands(self, commands, autoreturn=True, timeout=10, channel=None, outp | |||
stdout.append(result) | |||
logger.debug(result) | |||
if output: | |||
logger.info("commands output: %s" % result) | |||
logger.info("commands output: %s" % stdout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should just be result, we don't want to print the entire stout everytime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are interested in CLI behavior for entire commands not only for the last command which we executed from command list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are just printing stdout
once after all commands execution is done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dgaikwad After seeing your explanation, I brought up this up in the reviewers call and we are suggesting the following updates:
- Line 60, change this from
debug
toinfo
. We should be logging the result of each command on each iteration - Remove
output
as an arg and the if statement on line 61. Code on line 62 and 62 should always be run. - Line 37, we should be creating a dict here instead, the key being the command, and the value being the result. Then log that dict on line 62.
I hope that makes sense!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jawatts Thank you for the first two suggestion but in third suggestion, if we make dict instead of list then here we are going to override result.
Example:
commands = ("ap", "", "5", "2", "1", "2", "2")
In above example we will not able to store result separately for all 2
and 1
command and we will not get which command executed first due to its dict
type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two comments
32bd0d0
to
9bf6609
Compare
7cdfa07
to
269de7b
Compare
@dgaikwad I think there is one more case here: https://github.com/ManageIQ/integration_tests/blob/master/cfme/tests/cli/test_appliance_console.py#L1368 Perhaps your PR isn't on the latest commit? |
269de7b
to
3fa9b5a
Compare
@jawatts Based on your last comment I have done the changes |
Purpose or Intent
Adding tests Testing restoring DB using NFS via appliance console by providing negative input.
PRT Run
{{pytest: ./cfme/tests/cli/test_appliance_console.py::test_appliance_console_network_conf_negative ./cfme/tests/cli/test_appliance_console.py::test_appliance_console_static_ip_negative ./cfme/tests/cli/test_appliance_console.py::test_appliance_console_key_fetch_negative ./cfme/tests/cli/test_appliance_console.py::test_appliance_console_restore_db_network_negative ./cfme/tests/cli/test_appliance_console.py::test_appliance_console_key_fetch_negative -v }}