@@ -19,7 +19,7 @@
1919
2020"""Tests for system integration."""
2121
22−import os
22+import subprocess
2323
2424from unity8.shell.emulators import UnityEmulatorBase
2525from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
@@ -31,5 +31,9 @@ class SystemIntegrationTests(UnityTestCase):
3131 scenarios = _get_device_emulation_scenarios()
3232
3333 def test_networkmanager_integration(self):
34− retvalue = os.system("pkcheck --action-id org.freedesktop.NetworkManager.enable-disable-network --process `pidof -s unity8`")
34+ self.launch_unity()
35+
36+ # invoke policykit to check permissions
37+ pid = subprocess.check_output("pidof -s unity8", shell=True)
38+ retvalue = subprocess.check_call("pkcheck --action-id org.freedesktop.NetworkManager.enable-disable-network --process " + pid, shell=True)
3539 self.assertThat(retvalue, Equals(0))