From 4d59f883a0f2323c24b6e7347644a6d48b0808da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 16 Jan 2018 21:41:38 +0100 Subject: [PATCH] tests: minor fixes - FD leak - switch to xterm to test also on minimal template --- qubes/tests/integ/backup.py | 5 ++++- qubes/tests/integ/vm_qrexec_gui.py | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/qubes/tests/integ/backup.py b/qubes/tests/integ/backup.py index 52ddced9..cf1576d7 100644 --- a/qubes/tests/integ/backup.py +++ b/qubes/tests/integ/backup.py @@ -90,7 +90,10 @@ class BackupTestsMixin(object): block_size = 4096 self.log.debug("Filling %s" % path) - f = open(path, 'wb+') + try: + f = open(path, 'rb+') + except FileNotFoundError: + f = open(path, 'wb+') if size is None: f.seek(0, 2) size = f.tell() diff --git a/qubes/tests/integ/vm_qrexec_gui.py b/qubes/tests/integ/vm_qrexec_gui.py index e6ca70e1..e818c8cd 100644 --- a/qubes/tests/integ/vm_qrexec_gui.py +++ b/qubes/tests/integ/vm_qrexec_gui.py @@ -925,15 +925,17 @@ int main(int argc, char **argv) { # it is important to have some changing content there, to generate # content update events (aka damage notify) proc = yield from self.testvm1.run( - 'gnome-terminal --full-screen -e top') + 'xterm -maximized -e top') # help xdotool a little... yield from asyncio.sleep(2) + if proc.returncode is not None: + self.fail('xterm failed to start') # get window ID winid = (yield from asyncio.get_event_loop().run_in_executor(None, subprocess.check_output, ['xdotool', 'search', '--sync', '--onlyvisible', '--class', - self.testvm1.name + ':.*erminal'])).decode() + self.testvm1.name + ':xterm'])).decode() xprop = yield from asyncio.get_event_loop().run_in_executor(None, subprocess.check_output, ['xprop', '-notype', '-id', winid, '_QUBES_VMWINDOWID'])