Assert against the return code of the executed commands

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-09-21 20:38:04 +01:00 committed by Pedro Algarvio
parent 31f50159a6
commit 676a3f39cf

View file

@ -229,8 +229,10 @@ def docker_master(
# container.container_start_check(confirm_container_started, container)
with container.started() as factory:
for user in ("bob", "fnord"):
container.run(f"adduser {user}")
container.run(f"passwd -d {user}")
ret = container.run(f"adduser {user}")
assert ret.returncode == 0
ret = container.run(f"passwd -d {user}")
assert ret.returncode == 0
yield factory