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