-
Notifications
You must be signed in to change notification settings - Fork 32
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
network interact tests: fix SSH check #1071
network interact tests: fix SSH check #1071
Conversation
- Fix SSH connection checks There are serveral places where a test checks that an SSH connection to a VM on a specific interface can not be established. Doing so by checking for the specific error "no route to host" is potentially wrong, because this presumes that the host executing the test even knows how to route to the network. This isn't always the case, e.g. when executing the test suite on a developer workstation instead of a CI server. In those cases there may be an SSH error "network unreachable" instead, which should also be acceptable to let the test pass. To allow for this case, instead of checking the output of the SSH command for a specific substring, checking for the return code 255 is better, because it allows for different kind of errors and is less fragile than searching for a string in the command output. - Mark networking tests with @pytest.mark.networks This includes the network interaction tests when selecting tests with the pytest mark "networks" - Fix SSH connection with paramiko when the ssh agent contains keys, but password authentication is used By defaul paramiko will try to use key based authentication using whichever keys it finds in the ssh-agent. In this case however password based authentication is used and paramiko should not try to use the keys from the ssh-agent. Otherwise it may be confused and error out. Signed-off-by: Moritz Röhrich <[email protected]>
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.
The change looks fine to me, but tested on harvester-runtests#459
(this PR, modified) and harvester-runtests#460
(original), modified get more fails.
I feel there might have some bugs inside which not caused by this change.
btw, for reviewers, we can just simply add harvester/qa
team them all QAs will receive the mail to review this PR.
This change worked perfectly fine for me on a clean cluster:
It might be worth looking at the logs to see if there is anything damning in there |
Fix SSH connection checks There are serveral places where a test checks that an SSH connection to a VM on a specific interface can not be established. Doing so by checking for the specific error "no route to host" is potentially wrong, because this presumes that the host executing the test even knows how to route to the network. This isn't always the case, e.g. when executing the test suite on a developer workstation instead of a CI server. In those cases there may be an SSH error "network unreachable" instead, which should also be acceptable to let the test pass.
To allow for this case, instead of checking the output of the SSH command for a specific substring, checking for the return code 255 is better, because it allows for different kind of errors and is less fragile than searching for a string in the command output.
Mark networking tests with @pytest.mark.networks This includes the network interaction tests when selecting tests with the pytest mark "networks"
Fix SSH connection with paramiko when the ssh agent contains keys, but password authentication is used
By defaul paramiko will try to use key based authentication using whichever keys it finds in the ssh-agent. In this case however password based authentication is used and paramiko should not try to use the keys from the ssh-agent. Otherwise it may be confused and error out. This is the same problem that was fixed in networking tests: fix ssh auth, clean up code #1060 for other tests