tests: minor fixes

- FD leak
- switch to xterm to test also on minimal template
This commit is contained in:
Marek Marczykowski-Górecki 2018-01-16 21:41:38 +01:00
parent 06e82eccb0
commit 4d59f883a0
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 8 additions and 3 deletions

View File

@ -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()

View File

@ -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'])