Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[1LP][RFR] CLI - Testing restoring DB using NFS - negative #9823

Conversation

dgaikwad
Copy link
Contributor

@dgaikwad dgaikwad commented Jan 9, 2020

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 }}

@dgaikwad dgaikwad force-pushed the test_appliance_console_restore_db_network_negative branch from f88cc7d to f5e7e76 Compare January 10, 2020 10:08
@dgaikwad dgaikwad changed the title [WIPTEST] CLI - Testing restoring DB using NFS - negative [RFR] CLI - Testing restoring DB using NFS - negative Jan 10, 2020
@john-dupuy john-dupuy added the test-automation To be applied on PR's which are automating existing manual cases label Jan 10, 2020
Copy link
Contributor

@john-dupuy john-dupuy left a 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!

cfme/tests/cli/test_appliance_console.py Outdated Show resolved Hide resolved
cfme/tests/cli/test_appliance_console.py Show resolved Hide resolved
@john-dupuy john-dupuy changed the title [RFR] CLI - Testing restoring DB using NFS - negative [WIPTEST] CLI - Testing restoring DB using NFS - negative Jan 10, 2020
@dgaikwad dgaikwad changed the title [WIPTEST] CLI - Testing restoring DB using NFS - negative [RFR] CLI - Testing restoring DB using NFS - negative Jan 10, 2020
@dgaikwad dgaikwad force-pushed the test_appliance_console_restore_db_network_negative branch from f5e7e76 to 640a652 Compare January 13, 2020 09:23
@dgaikwad dgaikwad changed the title [RFR] CLI - Testing restoring DB using NFS - negative [WIPTEST] CLI - Testing restoring DB using NFS - negative Jan 13, 2020
@dgaikwad dgaikwad changed the title [WIPTEST] CLI - Testing restoring DB using NFS - negative [RFR] CLI - Testing restoring DB using NFS - negative Jan 13, 2020
Copy link
Contributor

@john-dupuy john-dupuy left a 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

@john-dupuy john-dupuy changed the title [RFR] CLI - Testing restoring DB using NFS - negative [1LP][RFR] CLI - Testing restoring DB using NFS - negative Jan 13, 2020
@jawatts jawatts self-assigned this Jan 15, 2020
@@ -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)
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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:

  1. Line 60, change this from debug to info. We should be logging the result of each command on each iteration
  2. Remove output as an arg and the if statement on line 61. Code on line 62 and 62 should always be run.
  3. 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!

Copy link
Contributor Author

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.

Copy link
Contributor

@jawatts jawatts left a comment

Choose a reason for hiding this comment

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

Two comments

@jawatts jawatts changed the title [1LP][RFR] CLI - Testing restoring DB using NFS - negative [1LP][WIPTEST] CLI - Testing restoring DB using NFS - negative Jan 16, 2020
@dgaikwad dgaikwad requested a review from jawatts January 20, 2020 06:04
@dgaikwad dgaikwad changed the title [1LP][WIPTEST] CLI - Testing restoring DB using NFS - negative [1LP][RFR] CLI - Testing restoring DB using NFS - negative Jan 20, 2020
@jawatts jawatts changed the title [1LP][RFR] CLI - Testing restoring DB using NFS - negative [1LP][WIPTEST] CLI - Testing restoring DB using NFS - negative Jan 21, 2020
@dgaikwad dgaikwad force-pushed the test_appliance_console_restore_db_network_negative branch 2 times, most recently from 32bd0d0 to 9bf6609 Compare January 21, 2020 17:46
@dgaikwad dgaikwad changed the title [1LP][WIPTEST] CLI - Testing restoring DB using NFS - negative [1LP][RFR] CLI - Testing restoring DB using NFS - negative Jan 21, 2020
@dgaikwad dgaikwad force-pushed the test_appliance_console_restore_db_network_negative branch 2 times, most recently from 7cdfa07 to 269de7b Compare January 21, 2020 18:32
@dgaikwad dgaikwad changed the title [1LP][RFR] CLI - Testing restoring DB using NFS - negative [1LP][WIPTEST] CLI - Testing restoring DB using NFS - negative Jan 21, 2020
@dgaikwad dgaikwad changed the title [1LP][WIPTEST] CLI - Testing restoring DB using NFS - negative [1LP][RFR] CLI - Testing restoring DB using NFS - negative Jan 22, 2020
@jawatts
Copy link
Contributor

jawatts commented Jan 22, 2020

@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?

@dgaikwad dgaikwad force-pushed the test_appliance_console_restore_db_network_negative branch from 269de7b to 3fa9b5a Compare January 23, 2020 06:14
@dgaikwad dgaikwad changed the title [1LP][RFR] CLI - Testing restoring DB using NFS - negative [1LP][WIPTEST] CLI - Testing restoring DB using NFS - negative Jan 23, 2020
@dgaikwad dgaikwad changed the title [1LP][WIPTEST] CLI - Testing restoring DB using NFS - negative [1LP][RFR] CLI - Testing restoring DB using NFS - negative Jan 23, 2020
@dgaikwad
Copy link
Contributor Author

@jawatts Based on your last comment I have done the changes

@jawatts jawatts merged commit 1943da5 into ManageIQ:master Jan 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lint-ok test-automation To be applied on PR's which are automating existing manual cases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants