From 0e93b25b6f99943117ba4360ef1ed29e9b95132d Mon Sep 17 00:00:00 2001 From: Nimika Keshri Date: Wed, 10 Aug 2011 14:56:52 +0300 Subject: [PATCH] Changes: Refactored tests RevBy: Olli Leppanen Description: 1. unused scripts removed 2. tests categorized 3. stable tests moved from red to functional tests --- debian/applauncherd-testscripts.install | 7 - tests/harmattan/art-tests/tests.xml | 12 +- tests/harmattan/functests/tests.xml | 426 ++++++++---- tests/harmattan/red-tests/tests.xml | 180 ----- tests/harmattan/testscripts/CMakeLists.txt | 7 - .../testscripts/{ => old}/check_pipes.py | 0 .../testscripts/{ => old}/fala_xres_wl | 0 .../testscripts/{ => old}/fala_xres_wol | 0 .../testscripts/{ => old}/tc_theming.rb | 0 .../testscripts/{ => old}/test-core-dump.py | 0 .../{ => old}/test-perf-mbooster.py | 0 .../testscripts/{ => old}/ts_prestartapp.rb | 0 .../testscripts/signal-forward/fala_sf_d.py | 2 +- .../testscripts/signal-forward/fala_sf_e.py | 2 +- .../testscripts/signal-forward/fala_sf_m.py | 2 +- .../testscripts/signal-forward/fala_sf_qt.py | 2 +- tests/harmattan/testscripts/test-daemons.py | 143 +++- .../testscripts/test-func-launcher.py | 636 +++--------------- tests/harmattan/testscripts/test-invoker.py | 323 +++++++++ tests/harmattan/testscripts/utils.py | 12 +- 20 files changed, 847 insertions(+), 907 deletions(-) rename tests/harmattan/testscripts/{ => old}/check_pipes.py (100%) rename tests/harmattan/testscripts/{ => old}/fala_xres_wl (100%) rename tests/harmattan/testscripts/{ => old}/fala_xres_wol (100%) rename tests/harmattan/testscripts/{ => old}/tc_theming.rb (100%) rename tests/harmattan/testscripts/{ => old}/test-core-dump.py (100%) rename tests/harmattan/testscripts/{ => old}/test-perf-mbooster.py (100%) rename tests/harmattan/testscripts/{ => old}/ts_prestartapp.rb (100%) diff --git a/debian/applauncherd-testscripts.install b/debian/applauncherd-testscripts.install index c5fd080..7ee4c84 100644 --- a/debian/applauncherd-testscripts.install +++ b/debian/applauncherd-testscripts.install @@ -1,8 +1,4 @@ usr/share/applauncherd-testscripts/test-func-launcher.py -usr/share/applauncherd-testscripts/ts_prestartapp.rb -usr/share/applauncherd-testscripts/check_pipes.py -usr/share/applauncherd-testscripts/test-perf-mbooster.py -usr/share/applauncherd-testscripts/tc_theming.rb usr/share/applauncherd-testscripts/tc_splash.rb usr/share/applauncherd-testscripts/test-perf.rb usr/share/applauncherd-testscripts/get-coordinates.rb @@ -13,8 +9,5 @@ usr/share/applauncherd-testscripts/test-daemons.py usr/share/applauncherd-testscripts/test-boot-mode.py usr/share/applauncherd-testscripts/view.qml usr/bin/fala_wid -usr/share/applauncherd-testscripts/fala_xres_wl -usr/share/applauncherd-testscripts/fala_xres_wol usr/share/applauncherd-testscripts/signal-forward/* usr/share/applauncherd-testscripts/test-single-instance.py -usr/share/applauncherd-testscripts/test-core-dump.py diff --git a/tests/harmattan/art-tests/tests.xml b/tests/harmattan/art-tests/tests.xml index 0164ca6..00d4628 100644 --- a/tests/harmattan/art-tests/tests.xml +++ b/tests/harmattan/art-tests/tests.xml @@ -11,16 +11,16 @@ - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launch_multiple_apps + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launch_multiple_apps_m - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_one_instance + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_one_instance_m - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_zombie_state + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_zombie_state_m diff --git a/tests/harmattan/functests/tests.xml b/tests/harmattan/functests/tests.xml index 6656a62..250f957 100644 --- a/tests/harmattan/functests/tests.xml +++ b/tests/harmattan/functests/tests.xml @@ -5,66 +5,54 @@ - - - /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-daemons.py test_001_daemon_list - - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_daemon - - - true - true - - - - + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_daemons /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_launcher_exist + 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-func-launcher.py test_applications_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 + - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_zombie_state + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-daemons.py test_writable_executable_mem - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launch_multiple_apps + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-daemons.py test_applauncherd_fd_close - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_one_instance + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-daemons.py test_applauncherd_fd_kill + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-daemons.py test_nonlaunchable_apps + - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launch_multiple_apps_cont + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-daemons.py test_daemon - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_daemons + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_daemons + - true + false true - - + @@ -72,55 +60,109 @@ /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_signal_forwarding + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_oom_adj_minus_two + + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_signal_forwarding - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_invoker_delay + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_invoker_delay - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_invoker_usage_printing + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_invoker_usage_printing - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_invoker_search_prog + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_invoker_search_prog - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_wait_term - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_invoker_exit_status + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_invoker_exit_status - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_invoker_gid_uid + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_invoker_gid_uid - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launch_wo_applauncherd + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_launch_wo_applauncherd + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_invoker_signal_forward + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_wrong_type + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_unknown_parameter + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_non_existing_binary_launch + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_invoker_symlink + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_app_link + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_D_and_G_option + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_app_directory + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_unsetPATH_launch + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_invoker_wait_term + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_relative_path_search + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_invoker_param_creds + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_invoker_param_respawn_delay + + + + 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-func-launcher.py start_daemons + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_daemons - true + false true - + + - /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 stop_daemons + /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_unix_signal_handlers + + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_applications_exist + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_restart_booster @@ -129,23 +171,129 @@ source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_booster_pid_change + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_booster_killed_or_restarted + + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launched_app_name + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_daemons + + + + false + true + + + + + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_daemons + /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-invoker.py test_wait_term_m + + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_zombie_state_m + + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launch_multiple_apps_m + + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_one_instance_m + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_fd_booster_m + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_qttas_load_booster_m + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_qttas_load_env_booster_m + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_signal_status_m + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_argv_mbooster_limit + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_argv_mbooster_over_limit + + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launch_multiple_apps_cont_m + + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_daemons + + + false + true + + + + + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_daemons + /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_fd_booster_q - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_booster_killed_or_restarted + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_dirPath_filePath_q - - + + false + true + + + + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_daemons + /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_qml + + + + 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 + + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_wait_term_qml + + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_fd_booster_d + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_qttas_load_booster_d @@ -153,28 +301,75 @@ source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_qttas_load_env_booster_d + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_signal_status_qml + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_argv_dbooster_limit + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_argv_mbooster_over_limit + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_dirPath_filePath_d + - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_qttas_load_booster_m + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_daemons + + + + false + true + + + + + + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_daemons + /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-invoker.py test_wait_term_e - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_qttas_load_env_booster_m + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_zombie_state_e + + + + 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 + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_dirPath_filePath_e + + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launch_multiple_apps_cont_e source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_daemons - - true + false true - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_daemons /usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120 @@ -188,8 +383,7 @@ source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-security.py test_invoker_creds - - + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-security.py test_correct_creds @@ -207,30 +401,14 @@ - + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_daemons /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-single-instance.py test_single_instance_window_raise_without_invoker @@ -246,19 +424,23 @@ source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-single-instance.py test_single_instance_abnormal_lock_release_without_invoker + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_daemons + - true + false true + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_daemons /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-single-instance.py test_single_instance_window_raise_with_invoker @@ -274,91 +456,57 @@ source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-single-instance.py test_single_instance_abnormal_lock_release_with_invoker + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_daemons + - true + false true - - - + - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_daemons /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_qml - - - - 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 + + source /tmp/session_bus_address.user; DISPLAY=:0 /usr/share/applauncherd-testscripts/tc_splash.rb --name test_splash - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_wait_term_qml + + source /tmp/session_bus_address.user; DISPLAY=:0 /usr/share/applauncherd-testscripts/tc_splash.rb --name test_splash_landscape - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_fd_booster_d + + source /tmp/session_bus_address.user; DISPLAY=:0 /usr/share/applauncherd-testscripts/tc_splash.rb --name test_no_splash - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_daemons - - true true - - - + - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_daemons /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_e + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-boot-mode.py test_change_to_normal_mode - - 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-boot-mode.py test_boot_mode_and_normal_mode - - - 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-single-instance.py test_single_instance_window_raise_with_script - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launch_multiple_apps_cont_e - - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_wait_term_e + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-boot-mode.py test_SIGUSR2 - - - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_fd_booster_e + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-boot-mode.py test_SIGUSR1 - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_daemons - - true true diff --git a/tests/harmattan/red-tests/tests.xml b/tests/harmattan/red-tests/tests.xml index 79c6dfd..2139e10 100644 --- a/tests/harmattan/red-tests/tests.xml +++ b/tests/harmattan/red-tests/tests.xml @@ -14,196 +14,16 @@ source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_dirPath_filePath_m - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_dirPath_filePath_d - - - 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_dirPath_filePath_e - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-security.py test_correct_creds - - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_writable_executable_mem - - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_unix_signal_handlers - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_nonlaunchable_apps - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_signal_status_m - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_signal_status_qml - - - - - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_oom_adj_minus_one - - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launched_app_name - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_argv_mbooster_limit - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_argv_dbooster_limit - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_argv_mbooster_over_limit - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_argv_mbooster_over_limit - - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_invoker_param_creds - - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_invoker_param_respawn_delay - - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_invoker_bogus_apptype - - - - - - - - true - true - - - - - - /usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120 - - - - source /tmp/session_bus_address.user; DISPLAY=:0 /usr/share/applauncherd-testscripts/tc_splash.rb --name test_splash - - - - source /tmp/session_bus_address.user; DISPLAY=:0 /usr/share/applauncherd-testscripts/tc_splash.rb --name test_splash_landscape - - - - source /tmp/session_bus_address.user; DISPLAY=:0 /usr/share/applauncherd-testscripts/tc_splash.rb --name test_no_splash - - true true - - - /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-boot-mode.py test_change_to_normal_mode - - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-boot-mode.py test_boot_mode_and_normal_mode - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-single-instance.py test_single_instance_window_raise_with_script - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_applauncherd_fd_close - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_applauncherd_fd_kill - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-boot-mode.py test_SIGUSR2 - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-boot-mode.py test_SIGUSR1 - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_daemon_second_instance - - - true - true - - - - - /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-invoker.py test_invoker_signal_forward - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_wrong_type - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_unknown_parameter - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_non_existing_binary_launch - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_invoker_symlink - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_app_link - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_D_and_G_option - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_app_directory - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_unsetPATH_launch - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_invoker_wait_term - - - source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_relative_path_search - - - true - true - - diff --git a/tests/harmattan/testscripts/CMakeLists.txt b/tests/harmattan/testscripts/CMakeLists.txt index bb72fdd..59f19d2 100644 --- a/tests/harmattan/testscripts/CMakeLists.txt +++ b/tests/harmattan/testscripts/CMakeLists.txt @@ -4,26 +4,19 @@ endif ($ENV{MEEGO}) if ($ENV{HARMATTAN}) install(FILES - test-perf-mbooster.py - check_pipes.py test-func-launcher.py utils.py test-security.py test-invoker.py test-daemons.py test-single-instance.py - test-core-dump.py test-boot-mode.py DESTINATION /usr/share/applauncherd-testscripts) install(PROGRAMS - ts_prestartapp.rb - tc_theming.rb tc_splash.rb get-coordinates.rb test-perf.rb - fala_xres_wl - fala_xres_wol DESTINATION /usr/share/applauncherd-testscripts) install(PROGRAMS fala_wid DESTINATION /usr/bin/) diff --git a/tests/harmattan/testscripts/check_pipes.py b/tests/harmattan/testscripts/old/check_pipes.py similarity index 100% rename from tests/harmattan/testscripts/check_pipes.py rename to tests/harmattan/testscripts/old/check_pipes.py diff --git a/tests/harmattan/testscripts/fala_xres_wl b/tests/harmattan/testscripts/old/fala_xres_wl similarity index 100% rename from tests/harmattan/testscripts/fala_xres_wl rename to tests/harmattan/testscripts/old/fala_xres_wl diff --git a/tests/harmattan/testscripts/fala_xres_wol b/tests/harmattan/testscripts/old/fala_xres_wol similarity index 100% rename from tests/harmattan/testscripts/fala_xres_wol rename to tests/harmattan/testscripts/old/fala_xres_wol diff --git a/tests/harmattan/testscripts/tc_theming.rb b/tests/harmattan/testscripts/old/tc_theming.rb similarity index 100% rename from tests/harmattan/testscripts/tc_theming.rb rename to tests/harmattan/testscripts/old/tc_theming.rb diff --git a/tests/harmattan/testscripts/test-core-dump.py b/tests/harmattan/testscripts/old/test-core-dump.py similarity index 100% rename from tests/harmattan/testscripts/test-core-dump.py rename to tests/harmattan/testscripts/old/test-core-dump.py diff --git a/tests/harmattan/testscripts/test-perf-mbooster.py b/tests/harmattan/testscripts/old/test-perf-mbooster.py similarity index 100% rename from tests/harmattan/testscripts/test-perf-mbooster.py rename to tests/harmattan/testscripts/old/test-perf-mbooster.py diff --git a/tests/harmattan/testscripts/ts_prestartapp.rb b/tests/harmattan/testscripts/old/ts_prestartapp.rb similarity index 100% rename from tests/harmattan/testscripts/ts_prestartapp.rb rename to tests/harmattan/testscripts/old/ts_prestartapp.rb diff --git a/tests/harmattan/testscripts/signal-forward/fala_sf_d.py b/tests/harmattan/testscripts/signal-forward/fala_sf_d.py index eef304b..ffbdcba 100755 --- a/tests/harmattan/testscripts/signal-forward/fala_sf_d.py +++ b/tests/harmattan/testscripts/signal-forward/fala_sf_d.py @@ -6,7 +6,7 @@ import commands #Launching application from the script os.system("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_d.sh &") -time.sleep(3) +time.sleep(4) st, op = commands.getstatusoutput("pgrep fala_qml_helloworld") #Killing application with a signal 15 (Terminated) diff --git a/tests/harmattan/testscripts/signal-forward/fala_sf_e.py b/tests/harmattan/testscripts/signal-forward/fala_sf_e.py index ea82bc6..e99cbbe 100755 --- a/tests/harmattan/testscripts/signal-forward/fala_sf_e.py +++ b/tests/harmattan/testscripts/signal-forward/fala_sf_e.py @@ -6,7 +6,7 @@ import commands #Launching application from the script os.system("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_e.sh &") -time.sleep(3) +time.sleep(4) st, op = commands.getstatusoutput("pgrep fala_qml_helloworld") #Killing application with a signal 15 (Terminated) diff --git a/tests/harmattan/testscripts/signal-forward/fala_sf_m.py b/tests/harmattan/testscripts/signal-forward/fala_sf_m.py index 3bbd20b..80a7396 100755 --- a/tests/harmattan/testscripts/signal-forward/fala_sf_m.py +++ b/tests/harmattan/testscripts/signal-forward/fala_sf_m.py @@ -6,7 +6,7 @@ import commands #Launching application from the script os.system("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_m.sh &") -time.sleep(2) +time.sleep(4) st, op = commands.getstatusoutput("pgrep fala_ft_hello") #Killing application with a signal 11 (Segmentation Fault) diff --git a/tests/harmattan/testscripts/signal-forward/fala_sf_qt.py b/tests/harmattan/testscripts/signal-forward/fala_sf_qt.py index bde5367..d636d9c 100755 --- a/tests/harmattan/testscripts/signal-forward/fala_sf_qt.py +++ b/tests/harmattan/testscripts/signal-forward/fala_sf_qt.py @@ -6,7 +6,7 @@ import commands #Launching application from the script os.system("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_qt.sh &") -time.sleep(3) +time.sleep(4) st, op = commands.getstatusoutput("pgrep fala_ft_hello") #Killing application with a signal 11 (Segmentation Fault) diff --git a/tests/harmattan/testscripts/test-daemons.py b/tests/harmattan/testscripts/test-daemons.py index 86cfdcf..4e341fa 100644 --- a/tests/harmattan/testscripts/test-daemons.py +++ b/tests/harmattan/testscripts/test-daemons.py @@ -31,7 +31,14 @@ class DaemonTests(unittest.TestCase): def tearDown(self): debug("tearDown") - def test_001_daemon_list(self): + def test_launcher_exist(self): + """ + To test if the launcher exists and is executable or not + """ + self.assert_(os.path.isfile(LAUNCHER_BINARY), "Launcher file does not exist") + self.assert_(os.access(LAUNCHER_BINARY, os.X_OK), "Launcher exists, but is not executable") + + def test_daemon_list(self): """ To List the daemons running using invoker after boot """ @@ -41,6 +48,140 @@ class DaemonTests(unittest.TestCase): 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 + """ + + stop_applauncherd() + + remove_applauncherd_runtime_files() + + p = run_cmd_as_user('/usr/bin/applauncherd.bin --daemon') + + time.sleep(5) + + st, op = commands.getstatusoutput('pgrep -lf "applauncherd.bin --daemon"') + p_id = op.split(" ")[0] + debug("The pid of applauncherd --daemon is %s" %op) + + # filter some cruft out from the output and see how many + # instances are running + op = filter(lambda x: x.find("sh ") == -1, op.split("\n")) + count = len(op) + + debug("count = %d" % count) + + self.assert_(count == 1, "applauncherd was not daemonized (or too many instances running ..)") + + # try to launch an app + run_cmd_as_user('/usr/bin/fala_ft_hello') + time.sleep(2) + + pid = wait_for_app('fala_ft_hello') + + if pid != None: + kill_process(apppid = pid) + else: + self.assert_(False, "fala_ft_hello was not launched!") + + # only the daemonized applauncherd should be running now + kill_process(apppid = p_id) + #commands.getstatusoutput('pkill applauncherd') + + remove_applauncherd_runtime_files() + + start_applauncherd() + + def test_daemon_second_instance(self): + """ + Test that second instance of applauncherd cannot be started + """ + daemon_pid = get_pid("applauncherd") + if daemon_pid == None: + start_applauncherd + daemon_pid = get_pid("applauncherd") + debug("start applauncherd again") + st, op = commands.getstatusoutput("initctl start xsession/applauncherd") + time.sleep(3) + daemon_pid_new = get_pid("applauncherd") + self.assert_(daemon_pid == daemon_pid_new, "New instance of applauncherd started") + self.assert_(st != 0, "Second instance of applauncherd started") + + def test_writable_executable_mem(self): + """ + Test that applauncherd does not have the writable and executable memory + """ + + pid = get_pid('applauncherd') + st, op = commands.getstatusoutput("grep wx /proc/%s/smaps" %pid) + debug("The value of status is %d" %st) + debug("The value of output is %s" %op) + self.assert_(st != 0, "applauncherd has writable and executable memory") + + def test_applauncherd_fd_close(self): + self._test_applauncherd_fd() + + def test_applauncherd_fd_kill(self): + self._test_applauncherd_fd(False) + + def _test_applauncherd_fd(self, close = True): + """ + To test that file descriptors are closed before calling application main + """ + #get fd of booster before launching application + debug("get fd of applauncherd before launching application") + pid = commands.getoutput("pgrep applauncherd") + init_count = commands.getoutput('ls -l /proc/%s/fd/ | wc -l' % str(pid)) + debug("\nThe count of initial file descriptors is : %s\n" %init_count) + time.sleep(3) + + #launch application using booster + debug("launch fala_wl using booster") + status = os.system('invoker --type=m /usr/bin/fala_wl &') + + #get fd of booster after launching the application + debug("get fd of booster after launching the application") + if status == 0: + launch_count = commands.getoutput('ls -l /proc/%s/fd/ | wc -l' % str(pid)) + debug("\nThe count of file descriptors after launch : %s\n" %launch_count) + time.sleep(3) + + #Close application + if close: + st, wid = commands.getstatusoutput(\ + "xwininfo -root -tree| awk '/Applauncherd testapp/ {print $1}'") + os.system("/usr/bin/xsendevent close %s" %wid) + else: + pid_app = commands.getoutput('pgrep fala_wl') + kill_process(apppid=pid_app) + time.sleep(3) + + #get fd of booster after closing the application + debug("get fd of booster after closing the application") + close_count = commands.getoutput('ls -l /proc/%s/fd/ | wc -l' % str(pid)) + debug("\nThe count file descriptors after close: %s\n" %close_count) + self.assert_(int(launch_count) == int(init_count) +1, "The file descriptors was not changed") + self.assert_(close_count == init_count, "The file descriptors was changed") + + def test_nonlaunchable_apps(self): + """ + Test that Booster gives warning while trying to launch non launchable applications + Here fala_wid is a shell script and libebooster.so is a library + """ + st, op = commands.getstatusoutput("/usr/bin/invoker --type=m /usr/bin/fala_wid") + debug("The Warning is %s" %(op.split("\n")[0])) + pos = op.split("\n")[0].find("Booster: Loading invoked application failed:") + self.assert_(pos != -1, "The booster did not give warning") + + st, op = commands.getstatusoutput("/usr/bin/invoker --type=m /usr/lib/applauncherd/libebooster.so") + debug("The Warning is %s" %(op.split("\n")[0])) + pos = op.split("\n")[0].find("Booster: Loading symbol 'main' failed:") + self.assert_(pos != -1, "The booster did not give warning") + + + + if __name__ == '__main__': tests = sys.argv[1:] diff --git a/tests/harmattan/testscripts/test-func-launcher.py b/tests/harmattan/testscripts/test-func-launcher.py index bbfc128..621f0d6 100644 --- a/tests/harmattan/testscripts/test-func-launcher.py +++ b/tests/harmattan/testscripts/test-func-launcher.py @@ -45,24 +45,8 @@ from subprocess import Popen from utils import * from os.path import basename -LAUNCHER_BINARY='/usr/bin/applauncherd' -DEV_NULL = file("/dev/null","w") -LAUNCHABLE_APPS = ['/usr/bin/fala_ft_hello','/usr/bin/fala_ft_hello1', '/usr/bin/fala_ft_hello2'] -LAUNCHABLE_APPS_QML = ['/usr/bin/fala_qml_helloworld','/usr/bin/fala_qml_helloworld1', '/usr/bin/fala_qml_helloworld2'] -PREFERED_APP = '/usr/bin/fala_ft_hello' -PREFERED_APP_QML = '/usr/bin/fala_qml_helloworld' -GET_COORDINATE_SCRIPT = '/usr/share/applauncherd-testscripts/get-coordinates.rb' -PIXELCHANHED_BINARY = '/usr/bin/fala_pixelchanged' - using_scratchbox = False -def start_launcher_daemon(): - temp = basename(LAUNCHER_BINARY) - st, op = commands.getstatusoutput("pgrep %s" %temp) - if st == 0: - debug("Launcher already started") - return op - def check_prerequisites(): if os.getenv('DISPLAY') == None: error("DISPLAY is not set. Check the requirements.") @@ -74,8 +58,6 @@ def check_prerequisites(): for app in LAUNCHABLE_APPS: assert len(basename(app)) <= 15, "For app: %s , base name !<= 14" %app - - class daemon_handling (unittest.TestCase): def stop_daemons(self): @@ -109,12 +91,6 @@ class launcher_tests (unittest.TestCase): start_daemons() #Testcases - def test_launcher_exist(self): - """ - To test if the launcher exists and is executable or not - """ - self.assert_(os.path.isfile(LAUNCHER_BINARY), "Launcher file does not exist") - self.assert_(os.access(LAUNCHER_BINARY, os.X_OK), "Launcher exists, but is not executable") def test_applications_exist(self): """ @@ -126,7 +102,7 @@ class launcher_tests (unittest.TestCase): failed_apps.append(app) self.assert_(failed_apps == [], "Some applications do not have the launch files, list: %s" % str(failed_apps)) - def test_zombie_state(self): + def test_zombie_state_m(self): self._test_zombie_state(PREFERED_APP,'m') def test_zombie_state_qml(self): @@ -163,7 +139,7 @@ class launcher_tests (unittest.TestCase): self.assert_(process_id != process_id1 , "New Process not launched") self.assert_(process_id1 == None , "Process still running") - def test_launch_multiple_apps(self): + def test_launch_multiple_apps_m(self): self._test_launch_multiple_apps(LAUNCHABLE_APPS, 'm') def test_launch_multiple_apps_qml(self): @@ -192,10 +168,10 @@ class launcher_tests (unittest.TestCase): self.fail("%s was not launched using applauncherd") pidlist.append(pid) - kill_launched(pidlist) + self.assert_(len(pidlist) == len(launchable_apps),"All apps were not launched") - def test_one_instance(self): + def test_one_instance_m(self): self._test_one_instance(PREFERED_APP, 'm') def test_one_instance_qml(self): @@ -229,7 +205,7 @@ class launcher_tests (unittest.TestCase): self.assert_( len(process_id.split(' ')) == 1, "Only one instance of app not running") - def test_launch_multiple_apps_cont(self): + def test_launch_multiple_apps_cont_m(self): self._test_launch_multiple_apps_cont(LAUNCHABLE_APPS, 'fala_ft_hello', 'm') def test_launch_multiple_apps_cont_qml(self): @@ -253,128 +229,10 @@ class launcher_tests (unittest.TestCase): process_id = get_pid(app_common_prefix) pid_list = process_id.split() - - self.assert_(len(pid_list) == len(launchable_apps), "All Applications were not launched using launcher") - for pid in pid_list: kill_process(apppid=pid) - def test_wait_term(self): - self._test_wait_term('/usr/bin/fala_ft_hello', 'fala_ft_hello', 'm') - - def test_wait_term_qml(self): - self._test_wait_term('/usr/bin/fala_qml_helloworld', 'fala_qml_helloworld', 'd') - - def test_wait_term_e(self): - self._test_wait_term('/usr/bin/fala_ft_hello', 'fala_ft_hello', 'e') - - def _test_wait_term(self, app_path, app_name, btype): - """ - When calling invoker with --wait-term and killing invoker, - the launched application should die too. - """ - - # Launch the app with invoker using --wait-term - p = run_app_as_user_with_invoker(app_path,booster = btype, arg = '--wait-term' ) - - time.sleep(2) - - # Retrieve their pids - invoker_pid = wait_for_app('invoker') - app_pid = wait_for_app(app_name) - - # Make sure that both apps started - self.assert_(invoker_pid != None, "invoker not executed?") - self.assert_(app_pid != None, "%s not launched by invoker?" % app_path) - - # Send SIGTERM to invoker, the launched app should die - debug(" Send SIGTERM to invoker, the launched app should die") - kill_process(None, invoker_pid, 15) - - time.sleep(2) - - # This should be None - app_pid2 = get_pid(app_name) - self.assert_(app_pid2 == None, "%s was not killed" % app_path) - - - - def test_daemon(self): - """ - Test that the --daemon parameter works for applauncherd - """ - - stop_applauncherd() - - remove_applauncherd_runtime_files() - - p = run_cmd_as_user('/usr/bin/applauncherd.bin --daemon') - - time.sleep(5) - - st, op = commands.getstatusoutput('pgrep -lf "applauncherd.bin --daemon"') - p_id = op.split(" ")[0] - debug("The pid of applauncherd --daemon is %s" %op) - - # filter some cruft out from the output and see how many - # instances are running - op = filter(lambda x: x.find("sh ") == -1, op.split("\n")) - count = len(op) - - debug("count = %d" % count) - - self.assert_(count == 1, "applauncherd was not daemonized (or too many instances running ..)") - - # try to launch an app - run_cmd_as_user('/usr/bin/fala_ft_hello') - time.sleep(2) - - pid = wait_for_app('fala_ft_hello') - - if pid != None: - kill_process(apppid = pid) - else: - self.assert_(False, "fala_ft_hello was not launched!") - - # only the daemonized applauncherd should be running now - kill_process(apppid = p_id) - #commands.getstatusoutput('pkill applauncherd') - - remove_applauncherd_runtime_files() - - start_applauncherd() - - def test_invoker_delay(self): - """ - Test the --delay parameter of the invoker. - """ - - # launch an app with invoker --delay n - debug("launching fala_ft_hello ...") - p = Popen(['/usr/bin/invoker', '--delay', '10', '--type=m', '--no-wait', - '/usr/bin/fala_ft_hello'], - shell=False, - stdout=DEV_NULL, stderr=DEV_NULL) - - # wait a little - debug("waiting ...") - time.sleep(5) - - success = True - - if p.poll() == None: - debug("NOT DEAD") - else: - debug("DEAD") - success = False - - debug("waiting for invoker to terminate ...") - p.wait() - - debug("terminating fala_ft_hello ...") - Popen(['pkill', 'fala_ft_hello']).wait() - - self.assert_(success, "invoker terminated before delay elapsed") + self.assert_(len(pid_list) == len(launchable_apps), "All Applications were not launched using launcher") def test_fd_booster_m(self): @@ -452,197 +310,6 @@ class launcher_tests (unittest.TestCase): self.assert_(epid_new != None, "No booster process running") self.assert_(epid_new != epid, "booster process was not killed") - def test_invoker_exit_status(self): - """ - To test that invoker returns the same exit status as the application - """ - #Run application without invoker and get the exit status - debug("Run application without invoker and get the exit status") - st, op = commands.getstatusoutput('/usr/bin/fala_status') - app_st_wo_inv = os.WEXITSTATUS(st) - debug("The exit status of app without invoker is : %d" %app_st_wo_inv) - - #Run application with invoker and get the exit status - booster-m case - debug("Run application with invoker and get the exit status") - st, op = commands.getstatusoutput('invoker --type=m --wait-term /usr/bin/fala_status') - app_st_w_inv = os.WEXITSTATUS(st) - debug("The exit status of app with invoker (booster-m) is : %d" %app_st_w_inv) - - #Run application with invoker and get the exit status - booster-e case - debug("Run application with invoker and get the exit status") - st, op = commands.getstatusoutput('invoker --type=e --wait-term /usr/bin/fala_status') - app_st_we_inv = os.WEXITSTATUS(st) - debug("The exit status of app with invoker (booster-e) is : %d" %app_st_we_inv) - - self.assert_(app_st_wo_inv == app_st_w_inv, "The invoker returns a wrong exit status for booster-m") - self.assert_(app_st_wo_inv == app_st_we_inv, "The invoker returns a wrong exit status for booster-e") - - def test_invoker_gid_uid(self): - """ - To Test that the set gid and uid is passed from invoker process to launcher - """ - debug("This test uses a test application that returns the uid and gid and exits") - #get the id in user mode - debug("Get the system's uid and gid in User Mode \n") - st, op = commands.getstatusoutput('su user -c ' "id") - usr_id1 = op.split(' ')[0].split('(')[0] - grp_id1 = op.split(' ')[1].split('(')[0] - debug("System %s \tSyetem %s" %(usr_id1, grp_id1)) - - #get invokers's uid and gid by running the application using invoker in user mode - debug("get invoker's uid and gid by running the application using invoker in user mode") - app = "invoker --type=m --no-wait /usr/bin/fala_status" - st, op = commands.getstatusoutput('su user -c "%s"' %app ); - usr_id = op.split('\n')[1] - grp_id = op.split('\n')[2] - debug("Invoker %s \tInvoker %s" %(usr_id, grp_id)) - - #get application's uid and gid by running the application without invoker in user mode - debug("get application's uid and gid by running the application without invoker in user mode") - app = "/usr/bin/fala_status" - st, op = commands.getstatusoutput('su user -c "%s"' %app ); - usr_id2 = op.split('\n')[-2] - grp_id2 = op.split('\n')[-1] - debug("Application %s \tApplication %s" %(usr_id2, grp_id2)) - - self.assert_(usr_id == usr_id1, "The correct UID is not passed by invoker") - self.assert_(grp_id == grp_id1, "The correct GID is not passed by invoker") - - self.assert_(usr_id == usr_id2, "The correct UID is not passed by invoker") - self.assert_(grp_id == grp_id2, "The correct GID is not passed by invoker") - - #get the id in root mode - debug("Get the Sysem's uid and gid in Root Mode \n") - st, op = commands.getstatusoutput("id") - usr_id1 = op.split(' ')[0].split('(')[0] - grp_id1 = op.split(' ')[1].split('(')[0] - debug("System %s \tSyetem %s" %(usr_id1, grp_id1)) - - #get id by running the application using invoker in root mode - debug("get invoker's uid and gid by running the application using invoker in root mode") - app = "invoker --type=m --no-wait /usr/bin/fala_status" - st, op = commands.getstatusoutput("%s" %app ); - usr_id = op.split('\n')[1] - grp_id = op.split('\n')[2] - debug("Invoker %s \tInvoker %s" %(usr_id, grp_id)) - - #get id by running the application without invoker in root mode - debug("get application's uid and gid by running the application without invoker in root mode") - app = "/usr/bin/fala_status" - st, op = commands.getstatusoutput("%s" %app ); - usr_id2 = op.split('\n')[-2] - grp_id2 = op.split('\n')[-1] - debug("Application %s \tApplication %s" %(usr_id2, grp_id2)) - - self.assert_(usr_id == usr_id1, "The correct UID is not passed by invoker") - self.assert_(grp_id == grp_id1, "The correct GID is not passed by invoker") - - self.assert_(usr_id == usr_id2, "The correct UID is not passed by invoker") - self.assert_(grp_id == grp_id2, "The correct GID is not passed by invoker") - - - def test_signal_forwarding(self): - """ - To test that invoker is killed by the same signal as the application - """ - #Test for m-booster - debug("Test for m-booster") - st, op = commands.getstatusoutput("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_m.py") - time.sleep(3) - debug("The Invoker killed by : <%s>" %op.split ('\n')[-1]) - - self.assert_(op.split('\n')[-1].startswith('Segmentation fault') == True, "The invoker(m-booster) was not killed by the same signal") - time.sleep(2) - - #Test for d-booster - debug("Test for d-booster") - st, op = commands.getstatusoutput("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_d.py") - time.sleep(3) - debug("The Invoker killed by : %s" % op.split('\n')[-1]) - - self.assert_(op.split('\n')[-1].startswith('Terminated') == True, "The invoker(d-booster) was not killed by the same signal") - time.sleep(2) - - #Test for e-booster - debug("Test for e-booster") - st, op = commands.getstatusoutput("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_e.py") - time.sleep(3) - debug("The Invoker killed by : %s" % op.split('\n')[-1]) - - self.assert_(op.split('\n')[-1].startswith('Terminated') == True, "The invoker(e-booster) was not killed by the same signal") - time.sleep(2) - - #This case is launching the application in user mode - #Test for q-booster - debug("Test for q-booster") - st, op = commands.getstatusoutput("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_qt.py") - time.sleep(3) - debug("The Invoker killed by : %s" %op.split('\n')[-1]) - - self.assert_(op.split('\n')[-1].startswith('Aborted') == True, "The invoker(q-booster) was not killed by the same signal") - time.sleep(2) - - def test_launch_wo_applauncherd(self): - """ - To Test that invoker can launch applications when the - applauncherd is not running. Try launching applications with - all boosters - """ - - stop_applauncherd() - if get_pid(PREFERED_APP) != None: - kill_process(PREFERED_APP) - - p = run_app_as_user_with_invoker(PREFERED_APP, booster = 'm') - pid1 = wait_for_app(PREFERED_APP) - self.assert_(pid1 != None, "Application was executed") - kill_process(PREFERED_APP) - - p = run_app_as_user_with_invoker(PREFERED_APP, booster = 'e') - pid1 = wait_for_app(PREFERED_APP) - self.assert_(pid1 != None, "Application was executed") - kill_process(PREFERED_APP) - - p = run_app_as_user_with_invoker(PREFERED_APP, booster = 'q') - pid1 = wait_for_app(PREFERED_APP) - self.assert_(pid1 != None, "Application was executed") - kill_process(PREFERED_APP) - - p = run_app_as_user_with_invoker(PREFERED_APP, booster = 'd') - pid1 = wait_for_app(PREFERED_APP) - self.assert_(pid1 != None, "Application was executed") - kill_process(PREFERED_APP) - - start_applauncherd() - - def test_invoker_search_prog(self): - """ - Test that invoker can find programs from directories listed in - PATH environment variable and that it doesn't find something - that isn't there. - """ - - # invoker searches PATH for the executable - p = run_app_as_user_with_invoker(PREFERED_APP, booster = 'm', arg = '--no-wait') - self.assert_(p.wait() == 0, "Couldn't launch fala_ft_hello") - time.sleep(2) - kill_process('fala_ft_hello') - - # launch with relative path - - p = run_cmd_as_user('cd /usr/share/; invoker --type=m --no-wait ' + - "../bin/fala_ft_hello") - self.assert_(p.wait() == 0, "Couldnt launch fala_ft_hello" + - " with relative path") - time.sleep(2) - kill_process('fala_ft_hello') - - # and finally, try to launch something that doesn't exist - p = run_cmd_as_user('invoker --type=m --no-wait spam_cake') - self.assert_(p.wait() != 127, "Found spam_cakefor some reason") - time.sleep(2) - kill_process('spam_cake') - def test_booster_killed_or_restarted(self): """ Test that boosters are killed if applauncherd is stopped @@ -739,34 +406,6 @@ class launcher_tests (unittest.TestCase): self.assert_(epid_new != None, "No booster process running") self.assert_(epid_new != epid, "booster process was not killed") - def test_invoker_param_creds(self): - p = run_cmd_as_user('invoker --creds') - self.assert_(p.wait() == 0, "'invoker --creds' failed") - - def test_invoker_param_respawn_delay(self): - p = run_cmd_as_user('invoker --respawn 10 --type=q --no-wait fala_ft_hello') - - time.sleep(7) - - pid = get_pid('booster-q') - self.assert_(pid == None, "'booster-q' was respawned too soon") - - time.sleep(7) - - pid = get_pid('booster-q') - self.assert_(pid != None, "'booster-q' was not respawned in time") - - p = run_cmd_as_user('invoker --respawn 256 --type=q --no-wait fala_ft_hello') - self.assert_(p.wait() != 0, "invoker didn't die with too big respawn delay") - kill_process('fala_ft_hello') - - def test_invoker_bogus_apptype(self): - p = run_cmd_as_user('invoker --type=foobar fala_ft_hello') - self.assert_(p.wait() != 0, "invoker didn't die with bogus apptype") - - p = run_cmd_as_user('invoker fala_ft_hello') - self.assert_(p.wait() != 0, "invoker didn't die with empty apptype") - def test_booster_pid_change(self): """ Test that application pid changes to the booster 'x' when application @@ -791,11 +430,11 @@ class launcher_tests (unittest.TestCase): time.sleep(4) app_pid = get_pid('fala_qml_helloworld') dpid_new = get_pid('booster-d') + kill_process('fala_qml_helloworld') self.assert_(app_pid != None, "Application is not running") self.assert_(app_pid == dpid, "Application is not assigned the booster-d pid") self.assert_(dpid_new != None, "No booster process running") self.assert_(dpid_new != dpid, "booster-d process did not receive the new pid") - kill_process('fala_qml_helloworld') #Launching application with booster-e epid = get_pid('booster-e') @@ -803,11 +442,11 @@ class launcher_tests (unittest.TestCase): time.sleep(4) app_pid = get_pid('fala_ft_hello') epid_new = get_pid('booster-e') + kill_process('fala_ft_hello') self.assert_(app_pid != None, "Application is not running") self.assert_(app_pid == epid, "Application is not assigned the booster-e pid") self.assert_(epid_new != None, "No booster process running") self.assert_(epid_new != epid, "booster-e process did not receive the new pid") - kill_process('fala_ft_hello') #Launching application with booster-q qpid = get_pid('booster-q') @@ -815,11 +454,11 @@ class launcher_tests (unittest.TestCase): time.sleep(4) app_pid = get_pid('fala_ft_hello') qpid_new = get_pid('booster-q') + kill_process('fala_ft_hello') self.assert_(app_pid != None, "Application is not running") self.assert_(app_pid == qpid, "Application is not assigned the booster-q pid") self.assert_(qpid_new != None, "No booster process running") self.assert_(qpid_new != qpid, "booster-q process did not receive the new pid") - kill_process('fala_ft_hello') def test_stress_boosted_apps(self): @@ -852,10 +491,10 @@ class launcher_tests (unittest.TestCase): time.sleep(3) debug("Sleeping for 3 secs") app_pid = get_pid(app_name) + kill_process(app_name) self.assert_(pid == app_pid, "Same instance of application not running") st, op = commands.getstatusoutput('ps ax | grep invoker | grep %s| grep -v -- -sh | wc -l' % app_name) count = int(op) - kill_process(app_name) def test_launched_app_name(self): """ @@ -872,8 +511,8 @@ class launcher_tests (unittest.TestCase): #check through the window property st, op = commands.getstatusoutput("xwininfo -root -tree| awk '/Applauncherd testapp/ {print $1}'") st, op1 = commands.getstatusoutput("xprop -id %s | awk '/WM_COMMAND/{print $4}'" %op) - self.assert_(op1.split(",")[0] == '"fala_wl"','Application name is incorrect') kill_process('fala_wl') + self.assert_(op1.split(",")[0] == '"fala_wl"','Application name is incorrect') #For booster-d #Check though the process list @@ -886,8 +525,8 @@ class launcher_tests (unittest.TestCase): #check through the window property st, op = commands.getstatusoutput("xwininfo -root -tree| awk '/Applauncherd QML testapp/ {print $1}'") st, op1 = commands.getstatusoutput("xprop -id %s | awk '/WM_COMMAND/{print $4}'" %op) - self.assert_(op1.split(",")[0] == '"fala_qml_helloworld"','Application name is incorrect') kill_process('fala_qml_helloworld') + self.assert_(op1.split(",")[0] == '"fala_qml_helloworld"','Application name is incorrect') #For booster-e #Check though the process list @@ -900,8 +539,8 @@ class launcher_tests (unittest.TestCase): #check through the window property st, op = commands.getstatusoutput("xwininfo -root -tree| awk '/Applauncherd testapp/ {print $1}'") st, op1 = commands.getstatusoutput("xprop -id %s | awk '/WM_COMMAND/{print $4}'" %op) - self.assert_(op1.split(",")[0] == '"fala_wl"','Application name is incorrect') kill_process('fala_wl') + self.assert_(op1.split(",")[0] == '"fala_wl"','Application name is incorrect') #For booster-q #Check though the process list @@ -914,45 +553,10 @@ class launcher_tests (unittest.TestCase): #check through the window property st, op = commands.getstatusoutput("xwininfo -root -tree| awk '/Applauncherd testapp/ {print $1}'") st, op1 = commands.getstatusoutput("xprop -id %s | awk '/WM_COMMAND/{print $4}'" %op) - self.assert_(op1.split(",")[0] == '"fala_wl"','Application name is incorrect') kill_process('fala_wl') + self.assert_(op1.split(",")[0] == '"fala_wl"','Application name is incorrect') - def test_oom_adj_zero(self): - """ - Test that oom.adj is 0 for launched application process - """ - p = run_app_as_user_with_invoker(PREFERED_APP, booster = 'm') - time.sleep(2) - pid = get_pid(PREFERED_APP) - st, op = commands.getstatusoutput('cat /proc/%s/oom_adj' %pid) - self.assert_(op == '0',"oom.adj of the launched process is not 0") - kill_process(PREFERED_APP) - - def test_oom_adj_minus_one(self): - """ - Test that oom.adj is -1 for launched application process when using - invokers -o param - """ - - p = run_app_as_user_with_invoker(PREFERED_APP, booster = 'm', - arg = '-o') - time.sleep(2) - - pid = get_pid(PREFERED_APP) - - st, op = commands.getstatusoutput('cat /proc/%s/oom_adj' % pid) - - self.assert_(op == '-2', "oom.adj of the launched process is not -1") - - kill_process(PREFERED_APP) - - def test_invoker_usage_printing(self): - """ - Test that applauncherd invoker --help usage printing ok - """ - p = run_cmd_as_user('invoker --help') - self.assert_(p.wait() == 0, "'invoker --help' failed") def test_unix_signal_handlers(self): """ @@ -972,28 +576,19 @@ class launcher_tests (unittest.TestCase): dpid_new = wait_for_app('booster-d') self.assert_(dpid != dpid_new, "booster-d pid is not changed") - - - - def test_writable_executable_mem(self): - """ - Test that applauncherd does not have the writable and executable memory - """ + def test_qttas_load_booster_d(self): + self._test_qttas_load_booster(PREFERED_APP_QML, 'd') - pid = get_pid('applauncherd') - st, op = commands.getstatusoutput("grep wx /proc/%s/smaps" %pid) - debug("The value of status is %d" %st) - debug("The value of output is %s" %op) - self.assert_(st != 0, "applauncherd has writable and executable memory") + def test_qttas_load_booster_m(self): + self._test_qttas_load_booster(PREFERED_APP, 'm') - def test_qttas_load_booster_d(self): + def _test_qttas_load_booster(self, testapp, btype): """ To test invoker that qttestability plugin is loaded with -testability argument for booster-d """ for i in range(2): debug("Running cycle %s" %i) - testapp = PREFERED_APP_QML - p = run_app_as_user_with_invoker("%s -testability" %testapp, booster = 'd') + p = run_app_as_user_with_invoker("%s -testability" %testapp, booster = btype) time.sleep(2) pid = get_pid(testapp) @@ -1014,43 +609,20 @@ class launcher_tests (unittest.TestCase): time.sleep(2) - def test_qttas_load_booster_m(self): - """ - To test invoker that qttestability plugin is loaded with -testability argument for booster-m - """ - for i in range(2): - debug("Running cycle %s" %i) - testapp = PREFERED_APP - p = run_app_as_user_with_invoker("%s -testability" %testapp, booster = 'm') - time.sleep(2) - - pid = get_pid(testapp) - self.assert_(pid != None, "Can't start application %s" %testapp) - - st_tas, op_tas = commands.getstatusoutput("grep -c libtestability.so /proc/%s/maps" %pid) - debug("The value of status is %d" %st_tas) - debug("The value of output is %s" %op_tas) - - st_tas_plug, op_tas_plug = commands.getstatusoutput("grep -c libqttestability.so /proc/%s/maps" %pid) - debug("The value of status is %d" %st_tas_plug) - debug("The value of output is %s" %op_tas_plug) - - kill_process(apppid=pid) - - self.assert_(st_tas == 0,"libtestability.so not loaded") - self.assert_(st_tas_plug == 0,"libqttestability.so not loaded") + def test_qttas_load_env_booster_d(self): + self._test_qttas_load_env_booster(PREFERED_APP_QML, 'd') - time.sleep(2) + def test_qttas_load_env_booster_m(self): + self._test_qttas_load_env_booster(PREFERED_APP, 'm') - def test_qttas_load_env_booster_d(self): + def _test_qttas_load_env_booster(self, testapp, btype): """ To test invoker that qttestability plugin is loaded with QT_LOAD_TESTABILITY env variable for booster-d """ for i in range(2): debug("Running cycle %s" %i) - testapp = PREFERED_APP_QML cmd = ['su', '-', 'user', '-c'] - invoke="export QT_LOAD_TESTABILITY=1; /usr/bin/invoker --type=d %s" %testapp + invoke="export QT_LOAD_TESTABILITY=1; /usr/bin/invoker --type=%s %s" %(btype, testapp) cmd.append(invoke) p = subprocess.Popen(cmd, shell = False, stdout = DEV_NULL, stderr = DEV_NULL) @@ -1076,39 +648,6 @@ class launcher_tests (unittest.TestCase): time.sleep(2) - def test_qttas_load_env_booster_m(self): - """ - To test invoker that qttestability plugin is loaded with QT_LOAD_TESTABILITY env variable for booster-m - """ - for i in range(2): - debug("Running cycle %s" %i) - testapp = PREFERED_APP - cmd = ['su', '-', 'user', '-c'] - invoke="export QT_LOAD_TESTABILITY=1; /usr/bin/invoker --type=m %s" %testapp - cmd.append(invoke) - - p = subprocess.Popen(cmd, shell = False, stdout = DEV_NULL, stderr = DEV_NULL) - - time.sleep(2) - - pid = get_pid(testapp) - self.assert_(pid != None, "Can't start application %s" %testapp) - - st_tas, op_tas = commands.getstatusoutput("grep -c libtestability.so /proc/%s/maps" %pid) - debug("The value of status is %d" %st_tas) - debug("The value of output is %s" %op_tas) - - st_tas_plug, op_tas_plug = commands.getstatusoutput("grep -c libqttestability.so /proc/%s/maps" %pid) - debug("The value of status is %d" %st_tas_plug) - debug("The value of output is %s" %op_tas_plug) - - kill_process(apppid=pid) - - self.assert_(st_tas == 0,"libtestability.so not loaded") - self.assert_(st_tas_plug == 0,"libqttestability.so not loaded") - - time.sleep(2) - def test_dirPath_filePath_m(self): self._test_dirPath_filePath('m', "/usr/share/fala_images", "fala_hello") @@ -1138,54 +677,9 @@ class launcher_tests (unittest.TestCase): dirpath = op.split("\n")[0].split(" ")[2] self.assert_(dirpath == path, "Wrong dirPath: %s" % dirpath) filepath = op.split("\n")[1].split(" ")[2] - self.assert_(filepath == "%s/%s" % (path, testapp), "Wrong filePath: %s" % filepath) kill_process(apppid=pid) + self.assert_(filepath == "%s/%s" % (path, testapp), "Wrong filePath: %s" % filepath) - def test_applauncherd_fd_close(self): - self._test_applauncherd_fd() - - def test_applauncherd_fd_kill(self): - self._test_applauncherd_fd(False) - - def _test_applauncherd_fd(self, close = True): - """ - To test that file descriptors are closed before calling application main - """ - #get fd of booster before launching application - debug("get fd of applauncherd before launching application") - pid = commands.getoutput("pgrep applauncherd") - init_count = commands.getoutput('ls -l /proc/%s/fd/ | wc -l' % str(pid)) - debug("\nThe count of initial file descriptors is : %s\n" %init_count) - time.sleep(3) - - #launch application using booster - debug("launch fala_wl using booster") - status = os.system('invoker --type=m /usr/bin/fala_wl &') - - #get fd of booster after launching the application - debug("get fd of booster after launching the application") - if status == 0: - launch_count = commands.getoutput('ls -l /proc/%s/fd/ | wc -l' % str(pid)) - debug("\nThe count of file descriptors after launch : %s\n" %launch_count) - time.sleep(3) - - #Close application - if close: - st, wid = commands.getstatusoutput(\ - "xwininfo -root -tree| awk '/Applauncherd testapp/ {print $1}'") - os.system("/usr/bin/xsendevent close %s" %wid) - else: - pid_app = commands.getoutput('pgrep fala_wl') - kill_process(apppid=pid_app) - time.sleep(3) - - #get fd of booster after closing the application - debug("get fd of booster after closing the application") - close_count = commands.getoutput('ls -l /proc/%s/fd/ | wc -l' % str(pid)) - debug("\nThe count file descriptors after close: %s\n" %close_count) - self.assert_(int(launch_count) == int(init_count) +1, "The file descriptors was not changed") - self.assert_(close_count == init_count, "The file descriptors was changed") - def test_argv_mbooster_limit(self): self._test_argv_booster_limit("m", "fala_wl") @@ -1208,8 +702,8 @@ class launcher_tests (unittest.TestCase): st, op = commands.getstatusoutput("grep argv: /tmp/%s.log | tail -2" % testapp) original_argv = op.split("\n")[0] cache_argv = op.split("\n")[1] - self.assert_(original_argv == cache_argv, "Wrong arguments passed.\nOriginal: %s\nCached: %s" % (original_argv, cache_argv)) kill_process(apppid=pid) + self.assert_(original_argv == cache_argv, "Wrong arguments passed.\nOriginal: %s\nCached: %s" % (original_argv, cache_argv)) def test_argv_mbooster_over_limit(self): self._test_argv_booster_over_limit("m", "fala_wl") @@ -1230,6 +724,7 @@ class launcher_tests (unittest.TestCase): p = run_cmd_as_user('invoker --type=%s /usr/bin/%s --log-args 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z' % (btype, testapp)) time.sleep(4) pid = get_pid(testapp) + kill_process(apppid=pid) self.assert_(pid != None, "The application was not launched") debug("get arguments from log file") st, op = commands.getstatusoutput("grep argv: /tmp/%s.log | tail -2" % testapp) @@ -1238,37 +733,57 @@ class launcher_tests (unittest.TestCase): self.assert_(len(cache_argv) == ARGV_LIMIT, "Wrong number of arguments passed.\nOriginal: %s\nCached: %s" % (original_argv, cache_argv)) for i in range(ARGV_LIMIT): self.assert_(original_argv[i] == cache_argv[i], "Wrong arguments passed.\nOriginal: %s\nCached: %s" % (original_argv, cache_argv)) - kill_process(apppid=pid) - def test_daemon_second_instance(self): + def test_signal_status_m(self): + self._test_signal_status("fala_wl", "fala_wol") + + def test_signal_status_qml(self): + self._test_signal_status("fala_qml_wl", "fala_qml_wol") + + def _test_signal_status(self, app_wl, app_wol): """ - Test that second instance of applauncherd cannot be started + Test that values of SigBlk, SigIgn and SigCgt in /proc/pid/status + is same for both boosted and non boosted applications """ - daemon_pid = get_pid("applauncherd") - if daemon_pid == None: - start_applauncherd - daemon_pid = get_pid("applauncherd") - debug("start applauncherd again") - st, op = commands.getstatusoutput("initctl start xsession/applauncherd") - time.sleep(3) - daemon_pid_new = get_pid("applauncherd") - self.assert_(daemon_pid == daemon_pid_new, "New instance of applauncherd started") - self.assert_(st != 0, "Second instance of applauncherd started") + #Get status for non boosted apps + os.system("initctl restart xsession/mthome") + time.sleep(5) + st, op = commands.getstatusoutput("%s -a %s" %(GET_COORDINATE_SCRIPT, app_wol)) + time.sleep(2) + pos = op.split("\n")[-1] - def test_nonlaunchable_apps(self): - """ - Test that Booster gives warning while trying to launch non launchable applications - Here fala_wid is a shell script and libebooster.so is a library - """ - st, op = commands.getstatusoutput("/usr/bin/invoker --type=m /usr/bin/fala_wid") - debug("The Warning is %s" %(op.split("\n")[0])) - pos = op.split("\n")[0].find("Booster: Loading invoked application failed:") - self.assert_(pos != -1, "The booster did not give warning") + os.system("%s -c %s -q" %(PIXELCHANHED_BINARY, pos)) + time.sleep(2) + + pid = get_pid(app_wol) + st, SigBlk_wol = commands.getstatusoutput("cat /proc/%s/status | grep SigBlk" %pid) + st, SigIgn_wol = commands.getstatusoutput("cat /proc/%s/status | grep SigIgn" %pid) + st, SigCgt_wol = commands.getstatusoutput("cat /proc/%s/status | grep SigCgt" %pid) + + kill_process(app_wol) + time.sleep(2) + + #Get status for booster application + os.system("initctl restart xsession/mthome") + time.sleep(5) + st, op = commands.getstatusoutput("%s -a %s" %(GET_COORDINATE_SCRIPT, app_wl)) + time.sleep(2) + pos = op.split("\n")[-1] + + os.system("%s -c %s -q" %(PIXELCHANHED_BINARY, pos)) + time.sleep(2) + + pid = get_pid(app_wl) + st, SigBlk_wl = commands.getstatusoutput("cat /proc/%s/status | grep SigBlk" %pid) + st, SigIgn_wl = commands.getstatusoutput("cat /proc/%s/status | grep SigIgn" %pid) + st, SigCgt_wl = commands.getstatusoutput("cat /proc/%s/status | grep SigCgt" %pid) + + kill_process(app_wl) + time.sleep(2) - st, op = commands.getstatusoutput("/usr/bin/invoker --type=m /usr/lib/applauncherd/libebooster.so") - debug("The Warning is %s" %(op.split("\n")[0])) - pos = op.split("\n")[0].find("Booster: Loading symbol 'main' failed:") - self.assert_(pos != -1, "The booster did not give warning") + self.assert_(SigBlk_wol == SigBlk_wl, "The SigBlk is not same for both apps") + self.assert_(SigIgn_wol == SigIgn_wl, "The SigIgn is not same for both apps") + self.assert_(SigCgt_wol == SigCgt_wl, "The SigCgt is not same for both apps") def test_signal_status_m(self): self._test_signal_status("fala_wl", "fala_wol") @@ -1330,7 +845,6 @@ if __name__ == '__main__': using_scratchbox = True check_prerequisites() - start_launcher_daemon() tests = sys.argv[1:] try: mysuite = unittest.TestSuite(map(launcher_tests, tests)) diff --git a/tests/harmattan/testscripts/test-invoker.py b/tests/harmattan/testscripts/test-invoker.py index 837750d..ddb4e16 100644 --- a/tests/harmattan/testscripts/test-invoker.py +++ b/tests/harmattan/testscripts/test-invoker.py @@ -34,6 +34,11 @@ from os.path import basename class InvokerTests(unittest.TestCase): def setUp(self): debug("setUp") + if daemons_running(): + stop_daemons() + self.START_DAEMONS_AT_TEARDOWN = True + else: + self.START_DAEMONS_AT_TEARDOWN = False if get_pid('applauncherd') == None: start_applauncherd() @@ -43,8 +48,300 @@ class InvokerTests(unittest.TestCase): start_applauncherd() wait_for_single_applauncherd() + if self.START_DAEMONS_AT_TEARDOWN: + start_daemons() #Testcases + def test_wait_term_m(self): + self._test_wait_term('/usr/bin/fala_ft_hello', 'fala_ft_hello', 'm') + + def test_wait_term_qml(self): + self._test_wait_term('/usr/bin/fala_qml_helloworld', 'fala_qml_helloworld', 'd') + + def test_wait_term_e(self): + self._test_wait_term('/usr/bin/fala_ft_hello', 'fala_ft_hello', 'e') + + def _test_wait_term(self, app_path, app_name, btype): + """ + When calling invoker with --wait-term and killing invoker, + the launched application should die too. + """ + + # Launch the app with invoker using --wait-term + p = run_app_as_user_with_invoker(app_path,booster = btype, arg = '--wait-term' ) + + time.sleep(4) + + # Retrieve their pids + invoker_pid = wait_for_app('invoker') + app_pid = wait_for_app(app_name) + + # Make sure that both apps started + self.assert_(invoker_pid != None, "invoker not executed?") + self.assert_(app_pid != None, "%s not launched by invoker?" % app_path) + + # Send SIGTERM to invoker, the launched app should die + debug(" Send SIGTERM to invoker, the launched app should die") + kill_process(None, invoker_pid, 15) + + time.sleep(4) + + # This should be None + app_pid2 = get_pid(app_name) + self.assert_(app_pid2 == None, "%s was not killed" % app_path) + + def test_launch_wo_applauncherd(self): + """ + To Test that invoker can launch applications when the + applauncherd is not running. Try launching applications with + all boosters + """ + + stop_applauncherd() + if get_pid(PREFERED_APP) != None: + kill_process(PREFERED_APP) + + p = run_app_as_user_with_invoker(PREFERED_APP, booster = 'm') + pid1 = wait_for_app(PREFERED_APP) + self.assert_(pid1 != None, "Application was executed") + kill_process(PREFERED_APP) + + p = run_app_as_user_with_invoker(PREFERED_APP, booster = 'e') + pid1 = wait_for_app(PREFERED_APP) + self.assert_(pid1 != None, "Application was executed") + kill_process(PREFERED_APP) + + p = run_app_as_user_with_invoker(PREFERED_APP, booster = 'q') + pid1 = wait_for_app(PREFERED_APP) + self.assert_(pid1 != None, "Application was executed") + kill_process(PREFERED_APP) + + p = run_app_as_user_with_invoker(PREFERED_APP, booster = 'd') + pid1 = wait_for_app(PREFERED_APP) + self.assert_(pid1 != None, "Application was executed") + kill_process(PREFERED_APP) + + start_applauncherd() + + def test_signal_forwarding(self): + """ + To test that invoker is killed by the same signal as the application + """ + #Test for m-booster + debug("Test for m-booster") + st, op = commands.getstatusoutput("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_m.py") + time.sleep(3) + debug("The Invoker killed by : <%s>" %op.split ('\n')[-1]) + + self.assert_(op.split('\n')[-1].startswith('Segmentation fault') == True, "The invoker(m-booster) was not killed by the same signal") + time.sleep(2) + + #Test for d-booster + debug("Test for d-booster") + st, op = commands.getstatusoutput("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_d.py") + time.sleep(3) + debug("The Invoker killed by : %s" % op.split('\n')[-1]) + + self.assert_(op.split('\n')[-1].startswith('Terminated') == True, "The invoker(d-booster) was not killed by the same signal") + time.sleep(2) + + #Test for e-booster + debug("Test for e-booster") + st, op = commands.getstatusoutput("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_e.py") + time.sleep(3) + debug("The Invoker killed by : %s" % op.split('\n')[-1]) + + self.assert_(op.split('\n')[-1].startswith('Terminated') == True, "The invoker(e-booster) was not killed by the same signal") + time.sleep(2) + + #This case is launching the application in user mode + #Test for q-booster + debug("Test for q-booster") + st, op = commands.getstatusoutput("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_qt.py") + time.sleep(3) + debug("The Invoker killed by : %s" %op.split('\n')[-1]) + + self.assert_(op.split('\n')[-1].startswith('Aborted') == True, "The invoker(q-booster) was not killed by the same signal") + time.sleep(2) + + + def test_invoker_delay(self): + """ + Test the --delay parameter of the invoker. + """ + + # launch an app with invoker --delay n + debug("launching fala_ft_hello ...") + p = Popen(['/usr/bin/invoker', '--delay', '10', '--type=m', '--no-wait', + '/usr/bin/fala_ft_hello'], + shell=False, + stdout=DEV_NULL, stderr=DEV_NULL) + + # wait a little + debug("waiting ...") + time.sleep(5) + + success = True + + if p.poll() == None: + debug("NOT DEAD") + else: + debug("DEAD") + success = False + + debug("waiting for invoker to terminate ...") + p.wait() + + debug("terminating fala_ft_hello ...") + Popen(['pkill', 'fala_ft_hello']).wait() + + self.assert_(success, "invoker terminated before delay elapsed") + + def test_invoker_exit_status(self): + """ + To test that invoker returns the same exit status as the application + """ + #Run application without invoker and get the exit status + debug("Run application without invoker and get the exit status") + st, op = commands.getstatusoutput('/usr/bin/fala_status') + app_st_wo_inv = os.WEXITSTATUS(st) + debug("The exit status of app without invoker is : %d" %app_st_wo_inv) + + #Run application with invoker and get the exit status - booster-m case + debug("Run application with invoker and get the exit status") + st, op = commands.getstatusoutput('invoker --type=m --wait-term /usr/bin/fala_status') + app_st_w_inv = os.WEXITSTATUS(st) + debug("The exit status of app with invoker (booster-m) is : %d" %app_st_w_inv) + + #Run application with invoker and get the exit status - booster-e case + debug("Run application with invoker and get the exit status") + st, op = commands.getstatusoutput('invoker --type=e --wait-term /usr/bin/fala_status') + app_st_we_inv = os.WEXITSTATUS(st) + debug("The exit status of app with invoker (booster-e) is : %d" %app_st_we_inv) + + self.assert_(app_st_wo_inv == app_st_w_inv, "The invoker returns a wrong exit status for booster-m") + self.assert_(app_st_wo_inv == app_st_we_inv, "The invoker returns a wrong exit status for booster-e") + + def test_invoker_search_prog(self): + """ + Test that invoker can find programs from directories listed in + PATH environment variable and that it doesn't find something + that isn't there. + """ + + # invoker searches PATH for the executable + p = run_app_as_user_with_invoker(PREFERED_APP, booster = 'm', arg = '--no-wait') + self.assert_(p.wait() == 0, "Couldn't launch fala_ft_hello") + time.sleep(2) + kill_process('fala_ft_hello') + + # launch with relative path + + p = run_cmd_as_user('cd /usr/share/; invoker --type=m --no-wait ' + + "../bin/fala_ft_hello") + self.assert_(p.wait() == 0, "Couldnt launch fala_ft_hello" + + " with relative path") + time.sleep(2) + kill_process('fala_ft_hello') + + # and finally, try to launch something that doesn't exist + p = run_cmd_as_user('invoker --type=m --no-wait spam_cake') + self.assert_(p.wait() != 127, "Found spam_cakefor some reason") + time.sleep(2) + kill_process('spam_cake') + + def test_invoker_gid_uid(self): + """ + To Test that the set gid and uid is passed from invoker process to launcher + """ + debug("This test uses a test application that returns the uid and gid and exits") + #get the id in user mode + debug("Get the system's uid and gid in User Mode \n") + st, op = commands.getstatusoutput('su user -c ' "id") + usr_id1 = op.split(' ')[0].split('(')[0] + grp_id1 = op.split(' ')[1].split('(')[0] + debug("System %s \tSyetem %s" %(usr_id1, grp_id1)) + + #get invokers's uid and gid by running the application using invoker in user mode + debug("get invoker's uid and gid by running the application using invoker in user mode") + app = "invoker --type=m --no-wait /usr/bin/fala_status" + st, op = commands.getstatusoutput('su user -c "%s"' %app ); + usr_id = op.split('\n')[1] + grp_id = op.split('\n')[2] + debug("Invoker %s \tInvoker %s" %(usr_id, grp_id)) + + #get application's uid and gid by running the application without invoker in user mode + debug("get application's uid and gid by running the application without invoker in user mode") + app = "/usr/bin/fala_status" + st, op = commands.getstatusoutput('su user -c "%s"' %app ); + usr_id2 = op.split('\n')[-2] + grp_id2 = op.split('\n')[-1] + debug("Application %s \tApplication %s" %(usr_id2, grp_id2)) + + self.assert_(usr_id == usr_id1, "The correct UID is not passed by invoker") + self.assert_(grp_id == grp_id1, "The correct GID is not passed by invoker") + + self.assert_(usr_id == usr_id2, "The correct UID is not passed by invoker") + self.assert_(grp_id == grp_id2, "The correct GID is not passed by invoker") + + #get the id in root mode + debug("Get the Sysem's uid and gid in Root Mode \n") + st, op = commands.getstatusoutput("id") + usr_id1 = op.split(' ')[0].split('(')[0] + grp_id1 = op.split(' ')[1].split('(')[0] + debug("System %s \tSyetem %s" %(usr_id1, grp_id1)) + + #get id by running the application using invoker in root mode + debug("get invoker's uid and gid by running the application using invoker in root mode") + app = "invoker --type=m --no-wait /usr/bin/fala_status" + st, op = commands.getstatusoutput("%s" %app ); + usr_id = op.split('\n')[1] + grp_id = op.split('\n')[2] + debug("Invoker %s \tInvoker %s" %(usr_id, grp_id)) + + #get id by running the application without invoker in root mode + debug("get application's uid and gid by running the application without invoker in root mode") + app = "/usr/bin/fala_status" + st, op = commands.getstatusoutput("%s" %app ); + usr_id2 = op.split('\n')[-2] + grp_id2 = op.split('\n')[-1] + debug("Application %s \tApplication %s" %(usr_id2, grp_id2)) + + self.assert_(usr_id == usr_id1, "The correct UID is not passed by invoker") + self.assert_(grp_id == grp_id1, "The correct GID is not passed by invoker") + + self.assert_(usr_id == usr_id2, "The correct UID is not passed by invoker") + self.assert_(grp_id == grp_id2, "The correct GID is not passed by invoker") + + + def test_invoker_param_creds(self): + p = run_cmd_as_user('invoker --creds') + self.assert_(p.wait() == 0, "'invoker --creds' failed") + + def test_invoker_param_respawn_delay(self): + p = run_cmd_as_user('invoker --respawn 10 --type=q --no-wait fala_ft_hello') + + time.sleep(7) + + pid = get_pid('booster-q') + self.assert_(pid == None, "'booster-q' was respawned too soon") + + time.sleep(7) + + pid = get_pid('booster-q') + self.assert_(pid != None, "'booster-q' was not respawned in time") + + p = run_cmd_as_user('invoker --respawn 256 --type=q --no-wait fala_ft_hello') + self.assert_(p.wait() != 0, "invoker didn't die with too big respawn delay") + kill_process('fala_ft_hello') + + def test_invoker_bogus_apptype(self): + p = run_cmd_as_user('invoker --type=foobar fala_ft_hello') + self.assert_(p.wait() != 0, "invoker didn't die with bogus apptype") + + p = run_cmd_as_user('invoker fala_ft_hello') + self.assert_(p.wait() != 0, "invoker didn't die with empty apptype") + def test_invoker_signal_forward(self): """ Test that UNIX signals are forwarded from @@ -98,6 +395,14 @@ class InvokerTests(unittest.TestCase): os.system("rm /usr/bin/invoker_link") self.assert_(st != 0,"The application was launched") + def test_invoker_usage_printing(self): + """ + Test that applauncherd invoker --help usage printing ok + """ + + p = run_cmd_as_user('invoker --help') + self.assert_(p.wait() == 0, "'invoker --help' failed") + def test_app_link(self): """ Test that symlink of an application can be launched. @@ -190,6 +495,24 @@ class InvokerTests(unittest.TestCase): kill_process("fala_wl") self.assert_(pid != None ,"The application was not launched") + def test_oom_adj_minus_two(self): + """ + Test that oom.adj is -2 for launched application process when using + invokers -o param + """ + + p = run_app_as_user_with_invoker(PREFERED_APP, booster = 'm', + arg = '-o') + time.sleep(4) + + pid = get_pid(PREFERED_APP) + + st, op = commands.getstatusoutput('cat /proc/%s/oom_adj' % pid) + + self.assert_(op == '-2', "oom.adj of the launched process is not -1") + + kill_process(PREFERED_APP) + # main diff --git a/tests/harmattan/testscripts/utils.py b/tests/harmattan/testscripts/utils.py index 5ef5b0c..6a487e2 100644 --- a/tests/harmattan/testscripts/utils.py +++ b/tests/harmattan/testscripts/utils.py @@ -9,6 +9,14 @@ from os.path import basename DEV_NULL = file("/dev/null","w") DAEMONS_TO_BE_STOPPED = ['xsession/applifed', 'xsession/conndlgs'] +LAUNCHER_BINARY='/usr/bin/applauncherd' +DEV_NULL = file("/dev/null","w") +LAUNCHABLE_APPS = ['/usr/bin/fala_ft_hello','/usr/bin/fala_ft_hello1', '/usr/bin/fala_ft_hello2'] +LAUNCHABLE_APPS_QML = ['/usr/bin/fala_qml_helloworld','/usr/bin/fala_qml_helloworld1', '/usr/bin/fala_qml_helloworld2'] +PREFERED_APP = '/usr/bin/fala_ft_hello' +PREFERED_APP_QML = '/usr/bin/fala_qml_helloworld' +GET_COORDINATE_SCRIPT = '/usr/share/applauncherd-testscripts/get-coordinates.rb' +PIXELCHANHED_BINARY = '/usr/bin/fala_pixelchanged' # Function to stop desired daemons. This is also done in setup function # if stop_daemons is not called before. @@ -283,7 +291,7 @@ def get_file_descriptor(booster, type, app_name): #launch application using booster debug("launch %s using booster" % app_name) st = os.system('invoker --type=%s --no-wait /usr/bin/%s' % (type, app_name)) - time.sleep(2) + time.sleep(4) #get fd of booster after launching the application debug("get fd of booster after launching the application") @@ -305,7 +313,7 @@ def get_file_descriptor(booster, type, app_name): count = count + 1 except KeyError: print "some key in init is not in final" - time.sleep(2) + time.sleep(4) debug("The number of changed file descriptors %d" %count) kill_process(apppid=pid) return count