From 77de29cbffa9ee2180f805c6283a8186b75a7082 Mon Sep 17 00:00:00 2001 From: Nimika Keshri Date: Wed, 15 Sep 2010 13:15:59 +0300 Subject: [PATCH] Changes: Signal forwarding tests added for q-booster and w-booster RevBy: TrustMe --- debian/applauncherd-testscripts.install | 3 +-- tests/TestScripts/CMakeLists.txt | 4 ++-- .../TestScripts/signal-forward/CMakeLists.txt | 3 +++ .../fala_sf_m.py} | 2 +- .../fala_sf_m.sh} | 0 .../TestScripts/signal-forward/fala_sf_qt.py | 15 +++++++++++++ .../TestScripts/signal-forward/fala_sf_qt.sh | 3 +++ .../TestScripts/signal-forward/fala_sf_wrt.py | 15 +++++++++++++ .../TestScripts/signal-forward/fala_sf_wrt.sh | 3 +++ tests/TestScripts/test-func-launcher.py | 21 +++++++++++++++++-- 10 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 tests/TestScripts/signal-forward/CMakeLists.txt rename tests/TestScripts/{fala_sf.py => signal-forward/fala_sf_m.py} (78%) rename tests/TestScripts/{fala_sf.sh => signal-forward/fala_sf_m.sh} (100%) create mode 100755 tests/TestScripts/signal-forward/fala_sf_qt.py create mode 100755 tests/TestScripts/signal-forward/fala_sf_qt.sh create mode 100755 tests/TestScripts/signal-forward/fala_sf_wrt.py create mode 100755 tests/TestScripts/signal-forward/fala_sf_wrt.sh diff --git a/debian/applauncherd-testscripts.install b/debian/applauncherd-testscripts.install index 2677cf3..b4a7413 100644 --- a/debian/applauncherd-testscripts.install +++ b/debian/applauncherd-testscripts.install @@ -3,8 +3,7 @@ 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/fala_sf.sh -usr/share/applauncherd-testscripts/fala_sf.py usr/share/applauncherd-testscripts/test-perf.rb usr/share/applauncherd-testscripts/utils.py usr/share/applauncherd-testscripts/test-security.py +usr/share/applauncherd-testscripts/signal-forward/* diff --git a/tests/TestScripts/CMakeLists.txt b/tests/TestScripts/CMakeLists.txt index 78114f7..64c7598 100644 --- a/tests/TestScripts/CMakeLists.txt +++ b/tests/TestScripts/CMakeLists.txt @@ -9,7 +9,7 @@ install(FILES install(PROGRAMS ts_prestartapp.rb tc_theming.rb - fala_sf.py - fala_sf.sh test-perf.rb DESTINATION /usr/share/applauncherd-testscripts) + +add_subdirectory (signal-forward) diff --git a/tests/TestScripts/signal-forward/CMakeLists.txt b/tests/TestScripts/signal-forward/CMakeLists.txt new file mode 100644 index 0000000..3a7427c --- /dev/null +++ b/tests/TestScripts/signal-forward/CMakeLists.txt @@ -0,0 +1,3 @@ +install(PROGRAMS fala_sf_m.sh fala_sf_wrt.sh fala_sf_qt.sh DESTINATION /usr/share/applauncherd-testscripts/signal-forward) +install(PROGRAMS fala_sf_m.py fala_sf_wrt.py fala_sf_qt.py DESTINATION /usr/share/applauncherd-testscripts/signal-forward) + diff --git a/tests/TestScripts/fala_sf.py b/tests/TestScripts/signal-forward/fala_sf_m.py similarity index 78% rename from tests/TestScripts/fala_sf.py rename to tests/TestScripts/signal-forward/fala_sf_m.py index 3057028..3bbd20b 100755 --- a/tests/TestScripts/fala_sf.py +++ b/tests/TestScripts/signal-forward/fala_sf_m.py @@ -4,7 +4,7 @@ import time import commands #Launching application from the script -os.system("/usr/share/applauncherd-testscripts/fala_sf.sh &") +os.system("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_m.sh &") time.sleep(2) st, op = commands.getstatusoutput("pgrep fala_ft_hello") diff --git a/tests/TestScripts/fala_sf.sh b/tests/TestScripts/signal-forward/fala_sf_m.sh similarity index 100% rename from tests/TestScripts/fala_sf.sh rename to tests/TestScripts/signal-forward/fala_sf_m.sh diff --git a/tests/TestScripts/signal-forward/fala_sf_qt.py b/tests/TestScripts/signal-forward/fala_sf_qt.py new file mode 100755 index 0000000..bde5367 --- /dev/null +++ b/tests/TestScripts/signal-forward/fala_sf_qt.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +import os +import time +import commands + +#Launching application from the script +os.system("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_qt.sh &") + +time.sleep(3) +st, op = commands.getstatusoutput("pgrep fala_ft_hello") + +#Killing application with a signal 11 (Segmentation Fault) +commands.getoutput("kill -6 %s" %op) +time.sleep(2) + diff --git a/tests/TestScripts/signal-forward/fala_sf_qt.sh b/tests/TestScripts/signal-forward/fala_sf_qt.sh new file mode 100755 index 0000000..de5eb94 --- /dev/null +++ b/tests/TestScripts/signal-forward/fala_sf_qt.sh @@ -0,0 +1,3 @@ +#!/bin/sh +su user -c 'invoker --type=qt --wait-term /usr/bin/fala_ft_hello.launch' + diff --git a/tests/TestScripts/signal-forward/fala_sf_wrt.py b/tests/TestScripts/signal-forward/fala_sf_wrt.py new file mode 100755 index 0000000..5654317 --- /dev/null +++ b/tests/TestScripts/signal-forward/fala_sf_wrt.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +import os +import time +import commands + +#Launching application from the script +os.system("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_wrt.sh &") + +time.sleep(2) +st, op = commands.getstatusoutput("pgrep fala_ft_hello") + +#Killing application with a signal 11 (Segmentation Fault) +commands.getoutput("kill -10 %s" %op) +time.sleep(2) + diff --git a/tests/TestScripts/signal-forward/fala_sf_wrt.sh b/tests/TestScripts/signal-forward/fala_sf_wrt.sh new file mode 100755 index 0000000..18eac00 --- /dev/null +++ b/tests/TestScripts/signal-forward/fala_sf_wrt.sh @@ -0,0 +1,3 @@ +#!/bin/sh +invoker --type=wrt --wait-term /usr/bin/fala_ft_hello.launch + diff --git a/tests/TestScripts/test-func-launcher.py b/tests/TestScripts/test-func-launcher.py index f2d5d52..9958824 100644 --- a/tests/TestScripts/test-func-launcher.py +++ b/tests/TestScripts/test-func-launcher.py @@ -460,11 +460,28 @@ class launcher_tests (unittest.TestCase): """ To test that invoker is killed by the same signal as the application """ + #Test for m-booster + st, op = commands.getstatusoutput("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_m.py") + print ("The Invoker killed by : %s" %op) + + self.assert_(op == 'Segmentation fault (core dumped)', "The invoker(m-booster) was not killed by the same signal") + time.sleep(2) + + #This case is launching the application in user mode + #Test for q-booster + st, op = commands.getstatusoutput("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_qt.py") + print ("The Invoker killed by : %s" %op.split('\n')[3]) + + self.assert_(op.split('\n')[3] == 'Aborted (core dumped)', "The invoker(q-booster) was not killed by the same signal") + time.sleep(2) - st, op = commands.getstatusoutput("/usr/share/applauncherd-testscripts/fala_sf.py") + #Test for w-booster + st, op = commands.getstatusoutput("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_wrt.py") print ("The Invoker killed by : %s" %op) - self.assert_(op == 'Segmentation fault (core dumped)', "The invoker was not killed by the same signal") + self.assert_(op == 'User defined signal 1', "The invoker(w-booster) was not killed by the same signal") + time.sleep(2) + def test_020_launch_wo_applauncherd(self): """