1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 23:04:41 +00:00

wip: test cloud-config

This commit is contained in:
Ivan Mikushin
2015-05-08 15:15:14 +05:00
parent b64b31a952
commit 070162eb55
5 changed files with 66 additions and 3 deletions

View File

@@ -0,0 +1,28 @@
import pytest
import rancherostest.util as u
import subprocess
ssh_command = ['ssh', '-p', '2222', '-F', './assets/scripts_ssh_config', '-i', './tests/integration/assets/test.key',
'rancher@localhost']
@pytest.fixture(scope="module")
def qemu(request):
return u.run_qemu(request, ['--cloud-config', './tests/integration/assets/cloud-config-1.yml'])
@pytest.mark.timeout(40)
def test_check_whats_going_on(qemu):
assert qemu.returncode is None
u.wait_for_ssh(ssh_command)
ssh = subprocess.Popen(
ssh_command + ['sudo', 'rancherctl', 'c', 'get', 'environment'],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
with ssh, ssh.stdout as f:
for ln in iter(f.readline, ''):
print(str.strip(ln))
assert ssh.returncode == 0