1
0
mirror of https://github.com/rancher/os.git synced 2025-07-06 19:38:37 +00:00
os/tests/integration/rancherostest/test_04_ros_install.py
2015-10-01 16:55:34 +05:00

29 lines
918 B
Python

import pytest
import rancherostest.util as u
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.0-dev-test.135'],
stderr=subprocess.STDOUT, universal_newlines=True)
subprocess.call(ssh_command + ['sudo', 'reboot'],
stderr=subprocess.STDOUT, universal_newlines=True)
u.wait_for_ssh(ssh_command)