on xenial help sign in
Make sure maliit-server doesn't break 'stopping unity8' and ensure it's running for 'starting unity8'
441f0b0Christopher Lee
tests/autopilot/unity8/shell/tests/__init__.py+16
@@ -294,12 +294,28 @@ class UnityTestCase(AutopilotTestCase):
294 logger.info("Cleaning up launching unity")
294 logger.info("Cleaning up launching unity")
295 subprocess.call(["/sbin/initctl", "unset-env", "QT_LOAD_TESTABILITY"])
295 subprocess.call(["/sbin/initctl", "unset-env", "QT_LOAD_TESTABILITY"])
296
296
297+ if model() != "Desktop":
298+ try:
299+ logger.info("Stopping maliit-server before unity.")
300+ subprocess.check_call(["/sbin/initctl", "stop", "maliit-server"])
301+ except subprocess.CalledProcessError:
302+ logger.warning("Appears that maliit-server was already stopped!")
303+
297 try:
304 try:
298 logger.info("Stopping unity")
305 logger.info("Stopping unity")
299 subprocess.check_call(["/sbin/initctl", "stop", "unity8"])
306 subprocess.check_call(["/sbin/initctl", "stop", "unity8"])
300 except subprocess.CalledProcessError:
307 except subprocess.CalledProcessError:
301 logger.warning("Appears unity was already stopped!")
308 logger.warning("Appears unity was already stopped!")
302
309
310+
311+ if model() != "Desktop":
312+ try:
313+ logger.info("Starting maliit-server again.")
314+ subprocess.check_call(["/sbin/initctl", "start", "maliit-server"])
315+ except subprocess.CalledProcessError as e:
316+ e.args += ("Failed to restart maliit-server.", )
317+ raise
318+
303 def patch_lightdm_mock(self, mock_type='single'):
319 def patch_lightdm_mock(self, mock_type='single'):
304 self._lightdm_mock_type = mock_type
320 self._lightdm_mock_type = mock_type
305 logger.info("Setting up LightDM mock type '%s'", mock_type)
321 logger.info("Setting up LightDM mock type '%s'", mock_type)