adb: fix test_sighup. am: 470622f064 am: 8baf1198ee
am: 48ba39854e
Change-Id: I318a37faf0f015450520e6d53fe3db16db13a38d
This commit is contained in:
commit
7617a039f6
1 changed files with 5 additions and 4 deletions
|
|
@ -522,13 +522,14 @@ class ShellTest(DeviceTest):
|
||||||
trap "echo SIGINT > {path}; exit 0" SIGINT
|
trap "echo SIGINT > {path}; exit 0" SIGINT
|
||||||
trap "echo SIGHUP > {path}; exit 0" SIGHUP
|
trap "echo SIGHUP > {path}; exit 0" SIGHUP
|
||||||
echo Waiting
|
echo Waiting
|
||||||
while true; do sleep 100; done
|
read
|
||||||
""".format(path=log_path)
|
""".format(path=log_path)
|
||||||
|
|
||||||
script = ";".join([x.strip() for x in script.strip().splitlines()])
|
script = ";".join([x.strip() for x in script.strip().splitlines()])
|
||||||
|
|
||||||
process = self.device.shell_popen(
|
process = self.device.shell_popen([script], kill_atexit=False,
|
||||||
["sh", "-c", "'{}'".format(script)], kill_atexit=False, stdout=subprocess.PIPE)
|
stdin=subprocess.PIPE,
|
||||||
|
stdout=subprocess.PIPE)
|
||||||
|
|
||||||
self.assertEqual("Waiting\n", process.stdout.readline())
|
self.assertEqual("Waiting\n", process.stdout.readline())
|
||||||
process.send_signal(signal.SIGINT)
|
process.send_signal(signal.SIGINT)
|
||||||
|
|
@ -536,7 +537,7 @@ class ShellTest(DeviceTest):
|
||||||
|
|
||||||
# Waiting for the local adb to finish is insufficient, since it hangs
|
# Waiting for the local adb to finish is insufficient, since it hangs
|
||||||
# up immediately.
|
# up immediately.
|
||||||
time.sleep(0.25)
|
time.sleep(1)
|
||||||
|
|
||||||
stdout, _ = self.device.shell(["cat", log_path])
|
stdout, _ = self.device.shell(["cat", log_path])
|
||||||
self.assertEqual(stdout.strip(), "SIGHUP")
|
self.assertEqual(stdout.strip(), "SIGHUP")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue