mirror of
https://github.com/rancher/os.git
synced 2025-07-31 14:41:14 +00:00
use with
for ssh subprocess
This commit is contained in:
parent
83f0b3057a
commit
b64b31a952
@ -32,17 +32,14 @@ def test_system_boot(qemu):
|
||||
@pytest.mark.timeout(40)
|
||||
def test_run_system_container(qemu):
|
||||
assert qemu.returncode is None
|
||||
|
||||
u.wait_for_ssh()
|
||||
ssh = subprocess.Popen(
|
||||
'./scripts/ssh sudo system-docker run --rm busybox /bin/true', shell=True,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
|
||||
|
||||
try:
|
||||
with ssh.stdout as f:
|
||||
for ln in iter(f.readline, ''):
|
||||
print(str.strip(ln))
|
||||
ssh.wait()
|
||||
assert ssh.returncode == 0
|
||||
finally:
|
||||
if ssh.returncode is None:
|
||||
ssh.terminate()
|
||||
with ssh, ssh.stdout as f:
|
||||
for ln in iter(f.readline, ''):
|
||||
print(str.strip(ln))
|
||||
|
||||
assert ssh.returncode == 0
|
||||
|
Loading…
Reference in New Issue
Block a user