From c688641363f431137f442e749fdd5d6aff19a313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 15 Jul 2018 22:29:22 +0200 Subject: [PATCH] tests: fix DispVM related tests - fix regex for editor window search - 'disp*' matches 'disk_space.py' (a dom0 local widget...) - increase a timeout for automatic DispVM cleanup --- qubes/tests/integ/dispvm.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qubes/tests/integ/dispvm.py b/qubes/tests/integ/dispvm.py index b852d827..b8a95c83 100644 --- a/qubes/tests/integ/dispvm.py +++ b/qubes/tests/integ/dispvm.py @@ -69,7 +69,7 @@ class TC_04_DispVM(qubes.tests.SystemTestCase): self.assertEqual(lines[0], "test") dispvm_name = lines[1] # wait for actual DispVM destruction - self.loop.run_until_complete(asyncio.sleep(1)) + self.loop.run_until_complete(asyncio.sleep(5)) self.assertNotIn(dispvm_name, self.app.domains) def test_003_cleanup_destroyed(self): @@ -88,7 +88,7 @@ class TC_04_DispVM(qubes.tests.SystemTestCase): p.stdin.write(b"sudo poweroff\n") # do not close p.stdin on purpose - wait to automatic disconnect when # domain is destroyed - timeout = 30 + timeout = 70 lines_task = asyncio.ensure_future(p.stdout.read()) self.loop.run_until_complete(asyncio.wait_for(p.wait(), timeout)) self.loop.run_until_complete(lines_task) @@ -171,7 +171,7 @@ class TC_20_DispVMMixin(object): del dispvm # give it a time for shutdown + cleanup - self.loop.run_until_complete(asyncio.sleep(2)) + self.loop.run_until_complete(asyncio.sleep(5)) self.assertNotIn(dispvm_name, self.app.domains, "DispVM not removed from qubes.xml") @@ -252,7 +252,8 @@ class TC_20_DispVMMixin(object): while True: search = self.loop.run_until_complete( asyncio.create_subprocess_exec( - 'xdotool', 'search', '--onlyvisible', '--class', 'disp*', + 'xdotool', 'search', '--onlyvisible', '--class', + 'disp[0-9]*', stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)) stdout, _ = self.loop.run_until_complete(search.communicate())