Changes: Signal-forwarding tests added

RevBy: TrustMe
pull/1/head
Nimika Keshri 15 years ago
parent b240224f6e
commit dd68e8af23

@ -3,3 +3,5 @@ usr/share/applauncherd-testscripts/ts_prestartapp.rb
usr/share/applauncherd-testscripts/check_pipes.py usr/share/applauncherd-testscripts/check_pipes.py
usr/share/applauncherd-testscripts/test-perf-mbooster.py usr/share/applauncherd-testscripts/test-perf-mbooster.py
usr/share/applauncherd-testscripts/tc_theming.rb usr/share/applauncherd-testscripts/tc_theming.rb
usr/share/applauncherd-testscripts/fala_sf.sh
usr/share/applauncherd-testscripts/fala_sf.py

@ -7,4 +7,6 @@ install(FILES
install(PROGRAMS install(PROGRAMS
ts_prestartapp.rb ts_prestartapp.rb
tc_theming.rb tc_theming.rb
fala_sf.py
fala_sf.sh
DESTINATION /usr/share/applauncherd-testscripts) DESTINATION /usr/share/applauncherd-testscripts)

@ -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)

@ -0,0 +1,3 @@
#!/bin/sh
invoker --type=m --wait-term /usr/bin/fala_ft_hello.launch

@ -704,6 +704,15 @@ class launcher_tests (unittest.TestCase):
self.assert_(grp_id == grp_id2, "The correct GID is not passed by invoker") 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 # main
if __name__ == '__main__': if __name__ == '__main__':
# When run with testrunner, for some reason the PATH doesn't include # When run with testrunner, for some reason the PATH doesn't include

@ -73,6 +73,9 @@
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_018_invoker_gid_uid</step> <step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_018_invoker_gid_uid</step>
</case> </case>
<case name="signal-forwarding" type="Functional" description="To Test that invoker is killed by the same signal as the application" timeout="120" level="System" insignificant="true">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_019_signal_forwarding</step>
</case>
<environments> <environments>
<scratchbox>true</scratchbox> <scratchbox>true</scratchbox>

Loading…
Cancel
Save