test_13_cloud_config_hostname.py 572 B

12345678910111213141516171819202122
  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 = './tests/integration/assets/test_13/cloud-config.yml'
  6. @pytest.fixture(scope="module")
  7. def qemu(request):
  8. q = u.run_qemu(request, ['--cloud-config', cloud_config_path])
  9. u.flush_out(q.stdout)
  10. return q
  11. @pytest.mark.timeout(40)
  12. def test_cloud_config_hostname(qemu):
  13. SSH(qemu, ssh_command).check_call('''
  14. hostname | grep rancher-test
  15. cat /etc/hosts | grep rancher-test
  16. ''')