test_04_ros_install.py 934 B

123456789101112131415161718192021222324252627282930
  1. import subprocess
  2. import pytest
  3. import rostest.util as u
  4. ssh_command = ['./scripts/ssh', '--qemu']
  5. @pytest.fixture(scope="module")
  6. def qemu(request):
  7. q = u.run_qemu(request, ['--no-format'])
  8. u.flush_out(q.stdout)
  9. return q
  10. @pytest.mark.timeout(40)
  11. def test_ros_install_on_formatted_disk(qemu):
  12. u.wait_for_ssh(qemu, ssh_command)
  13. subprocess.check_call(ssh_command + ['sudo', 'mkfs.ext4', '/dev/vda'],
  14. stderr=subprocess.STDOUT, universal_newlines=True)
  15. subprocess.check_call(ssh_command + ['sudo', 'ros', 'install', '-f', '--no-reboot', '-d', '/dev/vda',
  16. '-i', 'rancher/os:v0.4.4-dev' + u.suffix],
  17. stderr=subprocess.STDOUT, universal_newlines=True)
  18. subprocess.call(ssh_command + ['sudo', 'reboot'],
  19. stderr=subprocess.STDOUT, universal_newlines=True)
  20. u.wait_for_ssh(qemu, ssh_command)