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

Test: additional, optional wait for vm to be reachable via ssh #1988

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
3 participants
@dperpeet
Copy link
Member

commented Mar 23, 2015

This time is sometimes necessary for network init

@stefwalter

This comment has been minimized.

Copy link
Contributor

commented Mar 24, 2015

The code above the stuff you added waits for the VM To report that the network is initialized, and times out if it doesn't. Why would waiting further solve the issue?

@dperpeet

This comment has been minimized.

Copy link
Member Author

commented Mar 24, 2015

The code waits until everything is set up properly inside the vm. On my machines (nested virtualization) sometimes the guest isn't yet reachable from the host via ssh when the vm declares itself ready.

I will investigate this further - waiting for an ssh connection to become available as suggested by @jscotka might be the cleaner solution here instead of a hardcoded wait.

@dperpeet dperpeet added needswork and removed question labels Mar 24, 2015

@dperpeet dperpeet force-pushed the dperpeet:test_delay branch from 36e4805 to 9378b4e Mar 24, 2015

@dperpeet dperpeet removed the needswork label Mar 24, 2015

@dperpeet

This comment has been minimized.

Copy link
Member Author

commented Mar 24, 2015

The existing wait code waits for user login in the vm to become available. Sometimes, especially under load, network init can take longer.

@dperpeet dperpeet changed the title Test: add optional delay while waiting for vm to have booted Test: additional, optional wait for vm to be reachable via ssh Mar 24, 2015

@dperpeet dperpeet force-pushed the dperpeet:test_delay branch from 9378b4e to d724ca9 Mar 24, 2015

dperpeet added a commit to dperpeet/cockpit that referenced this pull request Mar 24, 2015

Test: wait for vm to be reachable via ssh after boot
This time is sometimes necessary for network init

Closes cockpit-project#1988
@dperpeet

This comment has been minimized.

Copy link
Member Author

commented Mar 24, 2015

replaced telnet call with python socket

@@ -665,6 +665,22 @@ def _parse_cockpit_canary(self, canary, output):
return None
return output[beg:end].strip()

def wait_ssh(self):

This comment has been minimized.

Copy link
@stefwalter

stefwalter Mar 24, 2015

Contributor

Technically this should go on 'Machine' instead of 'QemuMachine'

@@ -698,6 +714,9 @@ def wait_boot(self):
raise Failure("qemu did not run successfully: %d" % (p.returncode, ))

self.address = address
if not self.wait_ssh():
raise Failure("Unable to contact machine via ssh.")

This comment has been minimized.

Copy link
@stefwalter

stefwalter Mar 24, 2015

Contributor

This will produce weird messages in the machine logs. But I guess that's not a problem.

This comment has been minimized.

Copy link
@dperpeet

dperpeet Mar 24, 2015

Author Member

This will produce weird messages in the machine logs. But I guess that's not a problem.

More meaningful error:
Unable to reach machine %s via ssh. where the parameter is the vm's IP address

Test: wait for vm to be reachable via ssh after boot
This time is sometimes necessary for network init

Closes #1988

@dperpeet dperpeet force-pushed the dperpeet:test_delay branch from d724ca9 to 8242bbe Mar 24, 2015

@dperpeet dperpeet removed the needswork label Mar 24, 2015

@dperpeet dperpeet closed this in 5be56c2 Mar 24, 2015

@dperpeet dperpeet deleted the dperpeet:test_delay branch Apr 15, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.