1
0
mirror of https://github.com/rancher/os.git synced 2025-07-04 18:46:15 +00:00
os/tests/integration/rostest/test_00_system.py

50 lines
1.1 KiB
Python
Raw Normal View History

2015-09-09 06:33:54 +00:00
from __future__ import print_function
2015-05-07 13:59:48 +00:00
import subprocess
import pytest
2015-11-18 09:27:54 +00:00
import rostest.util as u
2015-05-07 13:59:48 +00:00
@pytest.fixture(scope="module")
def qemu(request):
2015-05-08 09:10:17 +00:00
return u.run_qemu(request)
@pytest.mark.timeout(30)
def test_system_boot(qemu):
2016-05-23 06:51:46 +00:00
u.flush_out(qemu.stdout)
2015-05-07 16:01:19 +00:00
busybox = {'amd64': 'busybox', 'arm': 'armhf/busybox', 'arm64': 'aarch64/busybox'}
2015-05-08 10:15:14 +00:00
@pytest.mark.timeout(60)
2015-05-07 16:01:19 +00:00
def test_run_system_container(qemu):
u.wait_for_ssh(qemu)
2015-05-08 11:23:12 +00:00
2015-05-07 16:01:19 +00:00
ssh = subprocess.Popen(
'./scripts/ssh --qemu sudo system-docker run --rm ' + busybox[u.arch] + ' /bin/true',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
2015-05-07 16:01:19 +00:00
2015-09-01 14:11:02 +00:00
for ln in u.iter_lines(ssh.stdout):
2015-09-09 06:33:54 +00:00
print(ln)
2015-09-01 14:11:02 +00:00
ssh.wait()
2015-05-08 09:25:11 +00:00
assert ssh.returncode == 0
2016-02-04 16:25:36 +00:00
@pytest.mark.timeout(60)
def test_ros_dev(qemu):
u.wait_for_ssh(qemu)
ssh = subprocess.Popen(
'./scripts/ssh --qemu sudo ros dev',
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