From 6efe9e255ee0476d80deaa43bd4635da104cfb78 Mon Sep 17 00:00:00 2001 From: Marek Ruszczak Date: Fri, 18 Nov 2011 16:35:30 +0200 Subject: [PATCH] Changes: Adds test for bug #291089 "Installation of clock application fails when applauncherd daemon stopped" RevBy: Thyagarajan Balakrishnan --- tests/harmattan/red-tests/tests.xml | 8 +++++++ tests/harmattan/testscripts/test-security.py | 22 ++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/tests/harmattan/red-tests/tests.xml b/tests/harmattan/red-tests/tests.xml index 043cde2..9fa5978 100644 --- a/tests/harmattan/red-tests/tests.xml +++ b/tests/harmattan/red-tests/tests.xml @@ -106,6 +106,14 @@ insignificant="true"> source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-security.py test_that_other_apps_dont_gain_new_token + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-security.py test_installation_of_new_token_when_deamon_is_disabled + initctl start xsession/pkgm-timed-checks diff --git a/tests/harmattan/testscripts/test-security.py b/tests/harmattan/testscripts/test-security.py index 1352322..36e2a1c 100644 --- a/tests/harmattan/testscripts/test-security.py +++ b/tests/harmattan/testscripts/test-security.py @@ -526,7 +526,29 @@ class SecurityTests(unittest.TestCase): kill_process(appName) self.__test_reexec_remove_test_package(packageName) + def test_installation_of_new_token_when_deamon_is_disabled(self): + """ + Test that isntallation of new package with new security token is going well + when applauncherd daemon is disabled (stoped). + """ + + packageFileName = '/usr/share/fala_images/applauncherd-token-test_1.0_armel.deb' + packageName = 'applauncherd-token-test' + + st = stop_applauncherd() + self.assertEqual(st, 0, "Fail to stop service 'xsession/applauncherd'. Error code: %s " %(st)) + debug ("Service 'xsession/applauncherd' has been stoped.") + + try : + debug('Installing test packege "%s"...' %(packageName)) + st, op = commands.getstatusoutput('dpkg -i %s' %(packageFileName)) + self.assertEqual(st, 0, 'Installation of "%s" failed see:\n%s' %(packageName, op)) + debug('...Instalation was successful.') + + self.__test_reexec_remove_test_package(packageName) + finally : + self.assert_(start_applauncherd(), "Fail to restore service 'xsession/applauncherd'") # main if __name__ == '__main__':