mirror of
https://github.com/rancher/os.git
synced 2025-07-06 11:36:15 +00:00
30 lines
934 B
Python
30 lines
934 B
Python
import subprocess
|
|
|
|
import pytest
|
|
import rostest.util as u
|
|
|
|
ssh_command = ['./scripts/ssh', '--qemu']
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def qemu(request):
|
|
q = u.run_qemu(request, ['--no-format'])
|
|
u.flush_out(q.stdout)
|
|
return q
|
|
|
|
|
|
@pytest.mark.timeout(40)
|
|
def test_ros_install_on_formatted_disk(qemu):
|
|
u.wait_for_ssh(qemu, 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.4-dev' + u.suffix],
|
|
stderr=subprocess.STDOUT, universal_newlines=True)
|
|
|
|
subprocess.call(ssh_command + ['sudo', 'reboot'],
|
|
stderr=subprocess.STDOUT, universal_newlines=True)
|
|
|
|
u.wait_for_ssh(qemu, ssh_command)
|