1
0
mirror of https://github.com/rancher/os.git synced 2025-07-15 23:55:51 +00:00
os/tests/integration/rostest/test_04_ros_install.py

29 lines
899 B
Python
Raw Normal View History

2015-10-01 11:45:27 +00:00
import pytest
2015-11-18 09:27:54 +00:00
import rostest.util as u
2015-10-01 11:45:27 +00:00
import subprocess
ssh_command = ['./scripts/ssh', '--qemu']
@pytest.fixture(scope="module")
def qemu(request):
return u.run_qemu(request, ['--no-format'])
@pytest.mark.timeout(40)
def test_ros_install_on_formatted_disk(qemu):
assert qemu is not None
u.wait_for_ssh(ssh_command)
subprocess.check_call(ssh_command + ['sudo', 'mkfs.ext4', '/dev/vda'],
stderr=subprocess.STDOUT, universal_newlines=True)
subprocess.check_call(ssh_command + ['sudo', 'ros', 'install', '-f', '--no-reboot', '-d', '/dev/vda',
'-i', 'rancher/os:v0.4.1'],
2015-10-01 11:45:27 +00:00
stderr=subprocess.STDOUT, universal_newlines=True)
subprocess.call(ssh_command + ['sudo', 'reboot'],
stderr=subprocess.STDOUT, universal_newlines=True)
u.wait_for_ssh(ssh_command)