Skip to content

Commit

Permalink
qubes/tests: start qrexec policy responder for system tests
Browse files Browse the repository at this point in the history
  • Loading branch information
woju authored and marmarek committed Jun 20, 2017
1 parent 71a4390 commit bec58fc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions qubes/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
import lxml.etree
import pkg_resources

import qubes.api
import qubes.api.admin
import qubes.backup
import qubes.config
import qubes.devices
Expand Down Expand Up @@ -589,6 +591,13 @@ def setUp(self):
)
os.environ['QUBES_XML_PATH'] = XMLPATH

self.qrexec_policy_server = self.loop.run_until_complete(
qubes.api.create_server(
qubes.api.internal.QUBESD_INTERNAL_SOCK,
qubes.api.internal.QubesInternalAPI,
app=self.app,
debug=True))

def init_default_template(self, template=None):
if template is None:
template = self.host_app.default_template
Expand Down Expand Up @@ -671,8 +680,15 @@ def save_and_reload_db(self):
self.reload_db()

def tearDown(self):
# close the server before super(), because that might close the loop
for sock in self.qrexec_policy_server.sockets:
os.unlink(sock.getsockname())
self.qrexec_policy_server.close()
self.loop.run_until_complete(self.qrexec_policy_server.wait_closed())

super(SystemTestsMixin, self).tearDown()
self.remove_test_vms()

# remove all references to VM objects, to release resources - most
# importantly file descriptors; this object will live
# during the whole test run, but all the file descriptors would be
Expand Down

0 comments on commit bec58fc

Please sign in to comment.