Skip to content

Commit 347e810

Browse files
committed
test: Check return code of command run on guest
Without this change, it ignores non-0 exits that don't print anything on stderr. Signed-off-by: Takahiro Itazuri <[email protected]>
1 parent 4d7b7e0 commit 347e810

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/framework/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,8 @@ def assert_seccomp_level(pid, seccomp_level):
434434

435435
def run_guest_cmd(ssh_connection, cmd, expected, use_json=False):
436436
"""Runs a shell command at the remote accessible via SSH"""
437-
_, stdout, stderr = ssh_connection.run(cmd)
437+
rc, stdout, stderr = ssh_connection.run(cmd)
438+
assert rc == 0
438439
assert stderr == ""
439440
stdout = stdout if not use_json else json.loads(stdout)
440441
assert stdout == expected

0 commit comments

Comments
 (0)