Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7617a039 authored by Josh Gao's avatar Josh Gao Committed by android-build-merger
Browse files

adb: fix test_sighup. am: 470622f0 am: 8baf1198

am: 48ba3985

Change-Id: I318a37faf0f015450520e6d53fe3db16db13a38d
parents 1ba3df98 48ba3985
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -522,13 +522,14 @@ class ShellTest(DeviceTest):
            trap "echo SIGINT > {path}; exit 0" SIGINT
            trap "echo SIGHUP > {path}; exit 0" SIGHUP
            echo Waiting
            while true; do sleep 100; done
            read
        """.format(path=log_path)

        script = ";".join([x.strip() for x in script.strip().splitlines()])

        process = self.device.shell_popen(
            ["sh", "-c", "'{}'".format(script)], kill_atexit=False, stdout=subprocess.PIPE)
        process = self.device.shell_popen([script], kill_atexit=False,
                                          stdin=subprocess.PIPE,
                                          stdout=subprocess.PIPE)

        self.assertEqual("Waiting\n", process.stdout.readline())
        process.send_signal(signal.SIGINT)
@@ -536,7 +537,7 @@ class ShellTest(DeviceTest):

        # Waiting for the local adb to finish is insufficient, since it hangs
        # up immediately.
        time.sleep(0.25)
        time.sleep(1)

        stdout, _ = self.device.shell(["cat", log_path])
        self.assertEqual(stdout.strip(), "SIGHUP")