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

[1LP][RFR] Prepare connect_ssh#10056

Merged
mshriver merged 7 commits intoManageIQ:masterfrom
jarovo:connect_ssh
May 21, 2020
Merged

[1LP][RFR] Prepare connect_ssh#10056
mshriver merged 7 commits intoManageIQ:masterfrom
jarovo:connect_ssh

Conversation

@jarovo
Copy link
Contributor

@jarovo jarovo commented Apr 15, 2020

Prepare connect_ssh for the use in vm snapshot tests.

{{pytest: -v --use-provider complete --long-running cfme/utils/tests/test_connect_ssh.py cfme/tests/configure/test_proxy.py cfme/tests/cli/test_appliance_console_db_restore.py}}

I see no failures related to this PR. I see failures like: http://10.16.45.124/pr10056-r2183-downstream-510z-yfvrVf/artifacts/report.html

Connection reset by peer is bugging me long time.
Then there are timeouts caused by other than connect_ssh reslated things.

@jarovo jarovo changed the title Connect ssh Prepare connect_ssh Apr 15, 2020
@jarovo jarovo requested a review from prichard77 April 15, 2020 13:13
@dajoRH dajoRH added the lint-ok label Apr 15, 2020
@dajoRH dajoRH added needs-lint and removed lint-ok labels Apr 30, 2020
@jarovo jarovo changed the title Prepare connect_ssh [WIPTEST] Prepare connect_ssh May 4, 2020
@jarovo jarovo mentioned this pull request May 5, 2020
@jarovo jarovo changed the title [WIPTEST] Prepare connect_ssh [RFR] Prepare connect_ssh May 5, 2020
@dajoRH dajoRH removed the WIP-testing label May 5, 2020
@prichard77
Copy link
Contributor

Jaroslav, I'll take a look at this, but I am not an official approver. We'll need to get others involved in this review. I am still trying to understand all of the deficiencies this PR was meant to fix. I was just trying to use connect_ssh in PR#9952. I am very willing to help with this where I can, just want to get the proper support.

@jarovo jarovo changed the title [RFR] Prepare connect_ssh [WIPTEST] Prepare connect_ssh May 5, 2020
@jarovo
Copy link
Contributor Author

jarovo commented May 5, 2020

Jaroslav, I'll take a look at this, but I am not an official approver. We'll need to get others involved in this review. I am still trying to understand all of the deficiencies this PR was meant to fix. I was just trying to use connect_ssh in PR#9952. I am very willing to help with this where I can, just want to get the proper support.

The names of methods and places where they were used (related to being "private" and "public"). Also, I was asked to check why I cannot use wait_for. I found I can use it and do not have to reinvent the wheel.

Jaroslav Henner added 4 commits May 6, 2020 12:09
Having the rounds parameter may not be the best idea. Perhaps it
is better to make it mandatory parameter.

Setting it to math.inf will result in ininite ammount of attempts to
connect.
@jarovo jarovo changed the title [WIPTEST] Prepare connect_ssh [RFR] Prepare connect_ssh May 6, 2020
@dajoRH dajoRH removed the WIP-testing label May 6, 2020
@mshriver mshriver self-assigned this May 7, 2020
@mshriver mshriver self-requested a review May 7, 2020 12:50
@prichard77
Copy link
Contributor

I created a local copy of the branch for this PR and was trying to run test_snapshot.py::verify_revert_snapshot with the updates I had made earlier to make this work. I am getting a timeout here connection, _ = wait_for(try_batch_of_ips, num_sec=num_sec, delay=delay) net.py line 123. I am still looking to see if I did something in the test to cause this, but wanted to let you know.

Copy link
Contributor

@prichard77 prichard77 left a comment

Choose a reason for hiding this comment

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

Cool Jarsolav, I didn't know I had the permissions to do this. I knew I could leave comments, but not review. For clarity I am re-posting the comment I made to the general PR.
I created a local copy of the branch for this PR and was trying to run test_snapshot.py::verify_revert_snapshot with the updates I had made earlier to make this work. I am getting a timeout here connection, _ = wait_for(try_batch_of_ips, num_sec=num_sec, delay=delay) net.py line 123. I am still looking to see if I did something in the test to cause this, but wanted to let you know.

I'll be testing more and I'll post back when/if I find anything additional.

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.

2 small comments but LGTM, nice PR @JaryN!

Add more doc, accept only kwargs.
* The SSHClient does not connect in the object creation time.
"""
if kwargs['hostname'] is None:
raise ValueError(f'The hostname argument cannot be None!')
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't need to be an f-string anymore.

@dajoRH
Copy link
Contributor

dajoRH commented May 18, 2020

I detected some fixture changes in commit c225cd8

The global fixture utility_vm_nfs_ip is used in the following files:

  • cfme/tests/cli/test_appliance_console_db_restore.py

The global fixture utility_vm_samba_ip is used in the following files:

  • cfme/tests/cli/test_appliance_console_db_restore.py

The global fixture utility_vm_proxy_data is used in the following files:

  • cfme/tests/configure/test_proxy.py
    • prepare_proxy_specific
    • prepare_proxy_default

The global fixture utility_vm_ssh is used in the following files:

  • cfme/tests/configure/test_proxy.py
    • validate_proxy_logs
    • prepare_proxy_specific
    • prepare_proxy_default
    • test_proxy_valid
    • test_proxy_override

The local fixture nosleep is used in the following files:

  • cfme/utils/tests/test_connect_ssh.py

The local fixture vm_mock is used in the following files:

  • cfme/utils/tests/test_connect_ssh.py
    • test_connect_ssh

The local fixture vm_mock2 is used in the following files:

  • cfme/utils/tests/test_connect_ssh.py
    • test_connect_ssh

Please, consider creating a PRT run to make sure your fixture changes do not break existing usage 😃

@john-dupuy john-dupuy changed the title [RFR] Prepare connect_ssh [1LP][RFR] Prepare connect_ssh May 20, 2020
Copy link
Member

@mshriver mshriver left a comment

Choose a reason for hiding this comment

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

Better be ready to fix any SSH issues that come up next sprint :)

Thanks for the enhancement @JaryN!

@mshriver mshriver merged commit f9b19da into ManageIQ:master May 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants