Skip to content

Commit 4100110

Browse files
committed
refactor(test): prefer os.kill over shelling out
Use os.kill in test_serial_io instead of using a shell to invoke `kill`. Signed-off-by: Patrick Roy <[email protected]>
1 parent 4106863 commit 4100110

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tests/integration_tests/functional/test_serial_io.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import fcntl
66
import os
77
import platform
8-
import subprocess
8+
import signal
99
import termios
1010
import time
1111

@@ -184,9 +184,8 @@ def test_serial_block(uvm_plain_any):
184184
fc_metrics = test_microvm.flush_metrics()
185185
init_count = fc_metrics["uart"]["missed_write_count"]
186186

187-
screen_pid = test_microvm.screen_pid
188187
# Stop `screen` process which captures stdout so we stop consuming stdout.
189-
subprocess.check_call("kill -s STOP {}".format(screen_pid), shell=True)
188+
os.kill(test_microvm.screen_pid, signal.SIGSTOP)
190189

191190
# Generate a random text file.
192191
test_microvm.ssh.check_output(

0 commit comments

Comments
 (0)