test_11_environment.py 842 B

12345678910111213141516171819202122232425
  1. import pytest
  2. import rostest.util as u
  3. from rostest.util import SSH
  4. ssh_command = ['./scripts/ssh', '--qemu', '--key', './tests/integration/assets/test.key']
  5. cloud_config_path = {'amd64': './tests/integration/assets/test_11/cloud-config.yml',
  6. 'arm': './tests/integration/assets/test_11/cloud-config_arm.yml',
  7. 'arm64': './tests/integration/assets/test_11/cloud-config_arm64.yml'}
  8. @pytest.fixture(scope="module")
  9. def qemu(request):
  10. q = u.run_qemu(request, ['--cloud-config', cloud_config_path[u.arch]])
  11. u.flush_out(q.stdout)
  12. return q
  13. @pytest.mark.timeout(40)
  14. def test_rancher_environment_in_system_service(qemu):
  15. SSH(qemu, ssh_command).check_call('''
  16. sudo system-docker logs env | grep A=A
  17. sudo system-docker logs env | grep BB=BB
  18. sudo system-docker logs env | grep BC=BC
  19. ''')