1
0
mirror of https://github.com/rancher/os.git synced 2025-09-06 01:01:43 +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:
Ivan Mikushin
2015-12-17 14:59:52 +05:00
parent d57c9ecd81
commit ac3d7afca6
8 changed files with 66 additions and 61 deletions

View File

@@ -1,7 +1,8 @@
from __future__ import print_function
import itertools as it
import pytest
import subprocess
import pytest
import rostest.util as u
@@ -14,21 +15,12 @@ def qemu(request):
def test_system_boot(qemu):
version = u.rancheros_version('./build.conf')
print('parsed version: ' + version)
def has_ros_started_substr(s):
return str.find(s, 'RancherOS {v} started'.format(v=version)) > -1
for _ in it.ifilter(has_ros_started_substr,
it.imap(u.with_effect(print), u.iter_lines(qemu.stdout))):
assert True
return
assert False
u.flush_out(qemu.stdout, 'RancherOS {v} started'.format(v=version))
@pytest.mark.timeout(60)
def test_run_system_container(qemu):
assert qemu is not None
u.wait_for_ssh()
u.wait_for_ssh(qemu)
ssh = subprocess.Popen(
'./scripts/ssh --qemu sudo system-docker run --rm busybox /bin/true',