mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-04 00:05:26 +00:00
test/ext-tty: return an error if a child isn't killed by SIGHUP
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
d55a1fdd31
commit
aa40501d95
@@ -1,6 +1,6 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
import subprocess
|
import subprocess
|
||||||
import pty
|
import os, sys, time, signal, pty
|
||||||
import os, sys, time
|
|
||||||
|
|
||||||
master, slave = pty.openpty()
|
master, slave = pty.openpty()
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ os.waitpid(-1, os.WNOHANG) # is the process alive
|
|||||||
|
|
||||||
os.close(new_master)
|
os.close(new_master)
|
||||||
_, status = os.wait()
|
_, status = os.wait()
|
||||||
if not os.WIFSIGNALED(status) or not os.WTERMSIG(status):
|
if not os.WIFSIGNALED(status) or os.WTERMSIG(status) != signal.SIGHUP:
|
||||||
print status
|
print status
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user