on xenial help sign in
Commit on workaround code and pep8 cleanup.
9de554cChristopher Lee
tests/autopilot/unity8/shell/tests/__init__.py+15−4
@@ -294,12 +294,19 @@ 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+ # Workaround for issue: lp:1239491
297 if model() != "Desktop":
298 if model() != "Desktop":
298 try:
299 try:
299 logger.info("Stopping maliit-server before unity.")
300 logger.info("Stopping maliit-server before unity.")
300− subprocess.check_call(["/sbin/initctl", "stop", "maliit-server"])
301+ subprocess.check_call([
302+ "/sbin/initctl",
303+ "stop",
304+ "maliit-server"
305+ ])
301 except subprocess.CalledProcessError:
306 except subprocess.CalledProcessError:
307+ logger.warning(
302− logger.warning("Appears that maliit-server was already stopped!")
308+ "Appears that maliit-server was already stopped!"
309+ )
303
310
304 try:
311 try:
305 logger.info("Stopping unity")
312 logger.info("Stopping unity")
@@ -307,11 +314,15 @@ class UnityTestCase(AutopilotTestCase):
307 except subprocess.CalledProcessError:
314 except subprocess.CalledProcessError:
308 logger.warning("Appears unity was already stopped!")
315 logger.warning("Appears unity was already stopped!")
309
316
310−
317+ # Workaround for issue: lp:1238645 and lp:1239491
311 if model() != "Desktop":
318 if model() != "Desktop":
312 try:
319 try:
313 logger.info("Starting maliit-server again.")
320 logger.info("Starting maliit-server again.")
314− subprocess.check_call(["/sbin/initctl", "start", "maliit-server"])
321+ subprocess.check_call([
322+ "/sbin/initctl",
323+ "start",
324+ "maliit-server"
325+ ])
315 except subprocess.CalledProcessError as e:
326 except subprocess.CalledProcessError as e:
316 e.args += ("Failed to restart maliit-server.", )
327 e.args += ("Failed to restart maliit-server.", )
317 raise
328 raise