diff --git a/debian/applauncherd-testscripts.install b/debian/applauncherd-testscripts.install index 3d9da9d..c182b15 100644 --- a/debian/applauncherd-testscripts.install +++ b/debian/applauncherd-testscripts.install @@ -3,3 +3,5 @@ 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 diff --git a/tests/TestScripts/CMakeLists.txt b/tests/TestScripts/CMakeLists.txt index dd22bbf..672672d 100644 --- a/tests/TestScripts/CMakeLists.txt +++ b/tests/TestScripts/CMakeLists.txt @@ -7,4 +7,6 @@ install(FILES install(PROGRAMS ts_prestartapp.rb tc_theming.rb + fala_sf.py + fala_sf.sh DESTINATION /usr/share/applauncherd-testscripts) diff --git a/tests/TestScripts/fala_sf.py b/tests/TestScripts/fala_sf.py new file mode 100755 index 0000000..3057028 --- /dev/null +++ b/tests/TestScripts/fala_sf.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/fala_sf.sh &") + +time.sleep(2) +st, op = commands.getstatusoutput("pgrep fala_ft_hello") + +#Killing application with a signal 11 (Segmentation Fault) +commands.getoutput("kill -11 %s" %op) +time.sleep(2) + diff --git a/tests/TestScripts/fala_sf.sh b/tests/TestScripts/fala_sf.sh new file mode 100755 index 0000000..07fef1a --- /dev/null +++ b/tests/TestScripts/fala_sf.sh @@ -0,0 +1,3 @@ +#!/bin/sh +invoker --type=m --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 6fcefb3..5d61933 100644 --- a/tests/TestScripts/test-func-launcher.py +++ b/tests/TestScripts/test-func-launcher.py @@ -704,6 +704,15 @@ class launcher_tests (unittest.TestCase): self.assert_(grp_id == grp_id2, "The correct GID is not passed by invoker") + def test_019_signal_forwarding(self): + """ + To test that invoker is killed by the same signal as the application + """ + + st, op = commands.getstatusoutput("/usr/share/applauncherd-testscripts/fala_sf.py") + print ("The Invoker killed by : %s" %op) + + self.assert_(op == 'Segmentation fault (core dumped)', "The invoker was not killed by the same signal") # main if __name__ == '__main__': # When run with testrunner, for some reason the PATH doesn't include diff --git a/tests/bug-tests/tests.xml b/tests/bug-tests/tests.xml index e369789..2d8b750 100644 --- a/tests/bug-tests/tests.xml +++ b/tests/bug-tests/tests.xml @@ -73,6 +73,9 @@ source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_018_invoker_gid_uid + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_019_signal_forwarding + true