Skip to content

Commit a4c0913

Browse files
committed
test: simplify assertion that ensures Firecracker got killed
- utils.check_output already asserts `rc == 0` - `output.find("firecracker") == -1` is an unidiomatic version of "firecracker" not in output. Signed-off-by: Patrick Roy <[email protected]>
1 parent 4628cde commit a4c0913

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/framework/microvm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,12 @@ def kill(self):
297297
# checking if the process is killed.
298298
time.sleep(1)
299299
# filter ps results for the jailer's unique id
300-
rc, stdout, stderr = utils.check_output(
300+
_, stdout, stderr = utils.check_output(
301301
f"ps aux | grep {self.jailer.jailer_id}"
302302
)
303303
# make sure firecracker was killed
304304
assert (
305-
rc == 0 and stderr == "" and stdout.find("firecracker") == -1
305+
stderr == "" and "firecracker" not in stdout
306306
), f"Firecracker pid {self.firecracker_pid} was not killed as expected"
307307

308308
# Mark the microVM as not spawned, so we avoid trying to kill twice.

0 commit comments

Comments
 (0)