mirror of
https://github.com/rancher/os.git
synced 2025-09-08 10:11:46 +00:00
Integration tests: make sure qemu exits in fixture finalizer
Also, make sure qemu is alive in wait_for_ssh.
This commit is contained in:
@@ -1,20 +1,21 @@
|
||||
import pytest
|
||||
import rostest.util as u
|
||||
import subprocess
|
||||
|
||||
import pytest
|
||||
import rostest.util as u
|
||||
|
||||
ssh_command = ['./scripts/ssh', '--qemu']
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def qemu(request):
|
||||
return u.run_qemu(request, ['--no-format'])
|
||||
q = u.run_qemu(request, ['--no-format'])
|
||||
u.flush_out(q.stdout)
|
||||
return q
|
||||
|
||||
|
||||
@pytest.mark.timeout(40)
|
||||
def test_ros_install_on_formatted_disk(qemu):
|
||||
assert qemu is not None
|
||||
u.wait_for_ssh(ssh_command)
|
||||
u.wait_for_ssh(qemu, ssh_command)
|
||||
subprocess.check_call(ssh_command + ['sudo', 'mkfs.ext4', '/dev/vda'],
|
||||
stderr=subprocess.STDOUT, universal_newlines=True)
|
||||
|
||||
@@ -25,4 +26,4 @@ def test_ros_install_on_formatted_disk(qemu):
|
||||
subprocess.call(ssh_command + ['sudo', 'reboot'],
|
||||
stderr=subprocess.STDOUT, universal_newlines=True)
|
||||
|
||||
u.wait_for_ssh(ssh_command)
|
||||
u.wait_for_ssh(qemu, ssh_command)
|
||||
|
Reference in New Issue
Block a user