tests: fix vm_qrexec_gui/TC_10_Generic/test_000_anyvm_deny_dom0

When method (as expected) raise an exception, service output would not be
assigned. Extract it from exception object.
This commit is contained in:
Marek Marczykowski-Górecki 2017-06-21 00:10:25 +02:00
parent a469c565f4
commit 72240c13b6
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -983,10 +983,12 @@ class TC_10_Generic(qubes.tests.SystemTestsMixin, qubes.tests.QubesTestCase):
self.loop.run_until_complete(self.vm.start())
with self.qrexec_policy('test.AnyvmDeny', self.vm, '$anyvm'):
with self.assertRaises(subprocess.CalledProcessError,
msg='$anyvm matched dom0'):
stdout, stderr = self.loop.run_until_complete(
msg='$anyvm matched dom0') as e:
self.loop.run_until_complete(
self.vm.run_for_stdio(
'/usr/lib/qubes/qrexec-client-vm dom0 test.AnyvmDeny'))
stdout = e.exception.output
stderr = e.exception.stderr
self.assertFalse(os.path.exists(flagfile),
'Flag file created (service was run) even though should be denied,'
' qrexec-client-vm output: {} {}'.format(stdout, stderr))