From d787336ae11a48405293335983e556f148ba451d Mon Sep 17 00:00:00 2001 From: Dmitry Rozenshtein Date: Thu, 8 Sep 2011 10:21:46 +0300 Subject: [PATCH] Changes: Add functional test - invoker kills application when applauncherd dies RevBy: Nimika Keshri --- debian/changelog | 2 +- tests/harmattan/invoker-tests/tests.xml | 4 ++++ tests/harmattan/testscripts/test-invoker.py | 24 ++++++++++++++++++++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index d1f168d..c487816 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ applauncherd (1.1.1) unstable; urgency=low - * + * Changes: Add functional test - invoker kills application when applauncherd dies -- Olli Leppanen Wed, 7 Sep 2011 15:12:13 +0300 diff --git a/tests/harmattan/invoker-tests/tests.xml b/tests/harmattan/invoker-tests/tests.xml index 63f5f1f..eaf86cd 100644 --- a/tests/harmattan/invoker-tests/tests.xml +++ b/tests/harmattan/invoker-tests/tests.xml @@ -87,6 +87,10 @@ source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_invoker_bogus_apptype + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_invoker_applauncherd_dies + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_daemons diff --git a/tests/harmattan/testscripts/test-invoker.py b/tests/harmattan/testscripts/test-invoker.py index ddb4e16..59a03ec 100644 --- a/tests/harmattan/testscripts/test-invoker.py +++ b/tests/harmattan/testscripts/test-invoker.py @@ -513,7 +513,29 @@ class InvokerTests(unittest.TestCase): kill_process(PREFERED_APP) - + + def test_invoker_applauncherd_dies(self): + """ + Test that invoker kills application and exits if applauncherd dies + """ + if get_pid(PREFERED_APP) != None: + kill_process(PREFERED_APP) #just to be sure application is not running prior the test + + if get_pid('applauncherd') == None: + start_applauncherd() #just to be sure applauncherd is running + + p = run_app_as_user_with_invoker(PREFERED_APP, booster = 'm') + + pid = wait_for_app(PREFERED_APP) + self.assert_(pid != None, "The application was not launched") + + stop_applauncherd() + time.sleep(20) #wait app to be terminated and invoker to exit + + pid = wait_for_app(PREFERED_APP, timeout = 2) #don't need to wait long since the app supposed not running + if pid != None: + kill_process(PREFERED_APP) + self.assert_(pid == None, "The application is still running!") # main if __name__ == '__main__':