From cf8e3bdda444ecd0c6eda68fd3535b9c44e30498 Mon Sep 17 00:00:00 2001 From: Thyagarajan Balakrishnan Date: Thu, 20 Oct 2011 11:56:10 +0300 Subject: [PATCH] Changes: updated invalid test cases in func-tests and removed 1 invalid test case in daemon-tests RevBy: Dmitry Rozenshtein --- debian/changelog | 1 + tests/harmattan/daemon-tests/tests.xml | 4 -- tests/harmattan/functests/tests.xml | 16 +++--- tests/harmattan/testscripts/test-daemons.py | 10 ---- .../testscripts/test-func-launcher.py | 51 +++++++++---------- 5 files changed, 34 insertions(+), 48 deletions(-) diff --git a/debian/changelog b/debian/changelog index 26e1f35..891d4ac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ applauncherd (2.0.6) unstable; urgency=low * Changes: test fixed test_launched_app_wm_class_m + * Changes: updated invalid test cases in func-tests and removed 1 invalid test case in daemon-tests -- Thyagarajan Balakrishnan Fri, 14 Oct 2011 14:40:32 +0300 diff --git a/tests/harmattan/daemon-tests/tests.xml b/tests/harmattan/daemon-tests/tests.xml index 5b88092..5eeffb1 100644 --- a/tests/harmattan/daemon-tests/tests.xml +++ b/tests/harmattan/daemon-tests/tests.xml @@ -16,10 +16,6 @@ source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-daemons.py test_launcher_exist - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-daemons.py test_daemon_list - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-daemons.py test_daemon_second_instance diff --git a/tests/harmattan/functests/tests.xml b/tests/harmattan/functests/tests.xml index 95194cf..b408ae5 100644 --- a/tests/harmattan/functests/tests.xml +++ b/tests/harmattan/functests/tests.xml @@ -166,6 +166,10 @@ /usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120 + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_zombie_state_q + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_fd_booster_q @@ -174,6 +178,10 @@ source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_dirPath_filePath_q + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_qttas_load_booster_q + + false true @@ -195,10 +203,6 @@ source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launch_multiple_apps_qml - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_one_instance_qml - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launch_multiple_apps_cont_qml @@ -260,10 +264,6 @@ source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launch_multiple_apps_e - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_one_instance_e - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_fd_booster_e diff --git a/tests/harmattan/testscripts/test-daemons.py b/tests/harmattan/testscripts/test-daemons.py index c486629..bb279fb 100644 --- a/tests/harmattan/testscripts/test-daemons.py +++ b/tests/harmattan/testscripts/test-daemons.py @@ -52,16 +52,6 @@ class DaemonTests(unittest.TestCase): self.sighup_applauncherd() self.test_launcher_exist(False) - def test_daemon_list(self): - """ - To List the daemons running using invoker after boot - """ - st, op = commands.getstatusoutput("ps ax | grep invoker") - count = len(op.split("\n")) - for i in xrange(count-2): - if op.split("\n")[i].find("prestart") == -1: - debug("%s" %op.split("\n")[i]) - def test_daemon(self): """ Test that the --daemon parameter works for applauncherd diff --git a/tests/harmattan/testscripts/test-func-launcher.py b/tests/harmattan/testscripts/test-func-launcher.py index d1b4f04..3fe97e4 100644 --- a/tests/harmattan/testscripts/test-func-launcher.py +++ b/tests/harmattan/testscripts/test-func-launcher.py @@ -142,6 +142,9 @@ class launcher_tests (unittest.TestCase): def test_zombie_state_qml(self): self._test_zombie_state(PREFERED_APP_QML,'d') + def test_zombie_state_q(self): + self._test_zombie_state(PREFERED_APP,'q') + def test_zombie_state_e(self): self._test_zombie_state(PREFERED_APP, 'e') @@ -167,11 +170,11 @@ class launcher_tests (unittest.TestCase): kill_process(prefered_app) time.sleep(4) - process_id1 = get_pid(prefered_app) + process_id2 = get_pid(prefered_app) debug("The pid of %s id %s" %(prefered_app, process_id1)) - self.assert_(process_id != process_id1 , "New Process not launched") - self.assert_(process_id1 == None , "Process still running") + self.assert_(process_id != process_id1 , "New Process not launched (zombie exists)") + self.assert_(process_id2 == None , "Process still running") if(sighup): self.sighup_applauncherd() self._test_zombie_state(prefered_app, btype, False) @@ -214,12 +217,6 @@ class launcher_tests (unittest.TestCase): def test_one_instance_m(self): self._test_one_instance(PREFERED_APP, 'm') - def test_one_instance_qml(self): - self._test_one_instance(PREFERED_APP_QML, 'd') - - def test_one_instance_e(self): - self._test_one_instance(PREFERED_APP, 'e') - def _test_one_instance(self, prefered_app, btype, sighup = True): """ To test that only one instance of a application exist @@ -234,16 +231,16 @@ class launcher_tests (unittest.TestCase): process_handle = run_app_as_user_with_invoker(prefered_app, booster=btype) process_id = wait_for_app(prefered_app) debug("PID of first %s" % process_id) - time.sleep(3) process_handle1 = run_app_as_user_with_invoker(prefered_app, booster=btype) time.sleep(3) - process_id = wait_for_app(prefered_app) - debug("PID of 2nd %s" % process_id) + process_id1 = wait_for_app(prefered_app) + debug("PID of 2nd %s" % process_id1) + st, pids = commands.getstatusoutput("pgrep %s" % prefered_app) #get all pids of the app kill_process(prefered_app) - self.assert_( len(process_id.split(' ')) == 1, "Only one instance of app not running") + self.assert_( len(pids.split()) == 1, "Only one instance of app not running") if(sighup): self.sighup_applauncherd() self._test_one_instance(prefered_app, btype, False) @@ -632,32 +629,34 @@ class launcher_tests (unittest.TestCase): def test_unix_signal_handlers(self, sighup = True): """ - Test unixSignalHandlers by killing booster-m and booster-d, signal hup + Test unixSignalHandlers by killing booster-m,d,q,e with signal hup """ - mpid = get_pid('booster-m') - st, op = commands.getstatusoutput('kill -hup %s' % mpid) - time.sleep(2) - mpid_new = wait_for_app('booster-m') - self.assert_(mpid != mpid_new, "booster-m pid is not changed") - - - dpid = get_pid('booster-d') - st, op = commands.getstatusoutput('kill -hup %s' % dpid) - time.sleep(2) - dpid_new = wait_for_app('booster-d') - self.assert_(dpid != dpid_new, "booster-d pid is not changed") + self._test_sighup_booster('m') + self._test_sighup_booster('d') + self._test_sighup_booster('q') + self._test_sighup_booster('e') if(sighup): self.sighup_applauncherd() self.test_unix_signal_handlers(False) + def _test_sighup_booster(self, btype): + pid = get_pid('booster-%s' % btype) + st, op = commands.getstatusoutput('kill -hup %s' % pid) + time.sleep(2) + pid_new = wait_for_app('booster-%s' % btype) + self.assert_(pid != pid_new, "booster-%s pid is not changed" % btype) + def test_qttas_load_booster_d(self): self._test_qttas_load_booster(PREFERED_APP_QML, 'd') def test_qttas_load_booster_m(self): self._test_qttas_load_booster(PREFERED_APP, 'm') + def test_qttas_load_booster_q(self): + self._test_qttas_load_booster(PREFERED_APP, 'q') + def _test_qttas_load_booster(self, testapp, btype, sighup = True): """ To test invoker that qttestability plugin is loaded with -testability argument for booster-d