From 273238bd2a7cd62d54821611ace3f9cd26828b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 21 Sep 2019 05:26:33 +0200 Subject: [PATCH] tests: fix qrexec abort test Exit code depends on when exactly the other end was terminated. --- qubes/tests/integ/vm_qrexec_gui.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qubes/tests/integ/vm_qrexec_gui.py b/qubes/tests/integ/vm_qrexec_gui.py index 1d9f8ca7..98211cad 100644 --- a/qubes/tests/integ/vm_qrexec_gui.py +++ b/qubes/tests/integ/vm_qrexec_gui.py @@ -285,10 +285,14 @@ class TC_00_AppVMMixin(object): with self.qrexec_policy('test.Abort', self.testvm1, 'dom0'): try: + # two possible exit codes, depending on when exactly dom0 + # service terminates: + # exit code 141: EPIPE (no buffered data) + # exit code 1: ECONNRESET (some buffered data remains) stdout, _ = self.loop.run_until_complete(asyncio.wait_for( self.testvm1.run_for_stdio('''\ /usr/lib/qubes/qrexec-client-vm dom0 test.Abort \ - /bin/cat /dev/zero; test $? -eq 141'''), + /bin/cat /dev/zero; test $? -eq 141 -o $? -eq 1'''), timeout=10)) except asyncio.TimeoutError: self.fail("Timeout, probably stdout wasn't closed")