1
0
mirror of https://github.com/rancher/os.git synced 2025-07-05 19:16:13 +00:00
os/tests/integration/rancherostest/test_00_system.py
Ivan Mikushin 25fa1b769d add --qind to scripts/run and scripts/ssh
also add `--fresh` to `scripts/run` to run with a clean state HDD,
make `--qemu` the default in `scripts/run` and `scripts/ssh`
2015-09-23 10:20:28 +05:00

42 lines
1.0 KiB
Python

from __future__ import print_function
import itertools as it
import pytest
import subprocess
import rancherostest.util as u
@pytest.fixture(scope="module")
def qemu(request):
return u.run_qemu(request)
@pytest.mark.timeout(30)
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
@pytest.mark.timeout(60)
def test_run_system_container(qemu):
assert qemu is not None
u.wait_for_ssh()
ssh = subprocess.Popen(
'./scripts/ssh --qemu sudo system-docker run --rm busybox /bin/true',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
for ln in u.iter_lines(ssh.stdout):
print(ln)
ssh.wait()
assert ssh.returncode == 0