diff --git a/qubes/tests/__init__.py b/qubes/tests/__init__.py index 60ed9a7e..edaff02a 100644 --- a/qubes/tests/__init__.py +++ b/qubes/tests/__init__.py @@ -1260,9 +1260,9 @@ class SystemTestCase(QubesTestCase): file.write(content) self.addCleanup(os.unlink, filename) - def create_remote_file(self, vm, filename, content): + def create_remote_file(self, vm, filename, content, mode=0o755): self.loop.run_until_complete(vm.run_for_stdio( - 'cat > {}'.format(shlex.quote(filename)), + 'cat > {0}; chmod {1:o} {0}'.format(shlex.quote(filename), mode), user='root', input=content.encode('utf-8'))) @asyncio.coroutine diff --git a/qubes/tests/integ/vm_qrexec_gui.py b/qubes/tests/integ/vm_qrexec_gui.py index ce886170..0e6b369c 100644 --- a/qubes/tests/integ/vm_qrexec_gui.py +++ b/qubes/tests/integ/vm_qrexec_gui.py @@ -239,10 +239,9 @@ class TC_00_AppVMMixin(object): self.loop.run_until_complete(asyncio.wait([ self.wait_for_session(self.testvm1), self.wait_for_session(self.testvm2)])) - self.loop.run_until_complete(self.testvm2.run_for_stdio( - 'cat > /etc/qubes-rpc/test.EOF', - user='root', - input=b'/bin/cat')) + self.create_remote_file(self.testvm2, + '/etc/qubes-rpc/test.EOF', + '#!/bin/sh\n/bin/cat\n') with self.qrexec_policy('test.EOF', self.testvm1, self.testvm2): try: