test_18_network_on_boot.py 863 B

123456789101112131415161718192021222324252627
  1. import pytest
  2. import rostest.util as u
  3. from rostest.util import SSH
  4. pytestmark = pytest.mark.skipif(u.arch != 'amd64', reason='amd64 network setup impossible to replicate for arm64')
  5. cloud_config_path = './tests/integration/assets/test_18/cloud-config.yml'
  6. net_args_arch = {'amd64': ['-net', 'nic,vlan=1,model=virtio'],
  7. 'arm64': ['-device', 'virtio-net-device']}
  8. net_args_arch['arm'] = net_args_arch['arm64']
  9. net_args = net_args_arch[u.arch]
  10. @pytest.fixture(scope="module")
  11. def qemu(request):
  12. q = u.run_qemu(request,
  13. run_args=['--cloud-config', cloud_config_path] +
  14. net_args + net_args + net_args)
  15. u.flush_out(q.stdout)
  16. return q
  17. def test_network_resources_loaded(qemu):
  18. SSH(qemu).check_call("apt-get --version")
  19. SSH(qemu).check_call("sudo system-docker images | grep tianon/true")