Changes: Added stopping all daemons which are started with invoker before functional tests

RevBy: Juha Lintula
pull/1/head
Olli Leppanen 15 years ago
parent 0b577c619b
commit 0c6af71ceb

3
debian/changelog vendored

@ -1,7 +1,8 @@
applauncherd (0.27.0) unstable; urgency=low
* Changes: Fixed misbehaving pixelchanged application
* Implemented: SWP#DUI-5199
* Changes: Added stopping all daemons which are using invoker before functional tests
* Implemented: SWP#DUI-5199, SWP#DUI-5180, SWP#DUI-5162
* Fixes: NB#244103 - Device hangs on closing application in connecting view while configuring MFE account
* Fixes: NB#243857 - Mismatched new[] - delete in applauncherd
* Fixes: NB#238937 - minor splash-screen bugs

@ -8,6 +8,7 @@
<set name="TC_Launcher" description="Launcher functional tests" feature="AF Basic Launcher daemon support" requirement="300168">
<pre_steps>
<step>/usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120</step>
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_daemons</step>
</pre_steps>
<case name="applauncherd__test_launcher_exist" type="Functional" description="To test if the launcher exists and is executable or not" timeout="360" level="System" insignificant="false">
@ -37,7 +38,9 @@
<case name="applauncherd__test_launch_multiple_apps_cont" type="Functional" description="Test that launcher can launch multiple applications continously" timeout="360" level="System" insignificant="false">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launch_multiple_apps_cont</step>
</case>
<post_steps>
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_daemons</step>
</post_steps>
<environments>
<scratchbox>true</scratchbox>
<hardware>true</hardware>
@ -47,6 +50,9 @@
<set name="TC_Invoker" description="Tests for invoker" feature="AF Basic Launcher daemon support" requirement="300168">
<pre_steps>
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_daemons</step>
</pre_steps>
<case name="applauncherd__test_signal_forwarding" type="Functional" description="To Test that invoker is killed by the same signal as the application" timeout="360" 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_signal_forwarding</step>
@ -77,6 +83,10 @@
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launch_wo_applauncherd</step>
</case>
<post_steps>
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_daemons</step>
</post_steps>
<environments>
<scratchbox>true</scratchbox>
<hardware>true</hardware>
@ -87,6 +97,7 @@
<set name="TC_Booster" description="Functional tests for applauncherd boosters" feature="AF Basic Launcher daemon support" requirement="300168">
<pre_steps>
<step>/usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120</step>
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_daemons</step>
</pre_steps>
<case name="applauncherd__test_booster_pid_change" type="Functional" description="Test that application pid changes to the booster 'x' when application is launched using booster 'x' " timeout="360" level="System" insignificant="false">
@ -114,6 +125,9 @@
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 /usr/share/applauncherd-testscripts/tc_theming.rb name test_theme_change_booster_restart</step>
</case-->
<post_steps>
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_daemons</step>
</post_steps>
<environments>
<scratchbox>true</scratchbox>
@ -229,6 +243,7 @@
<set name="TC_Qml_Booster" description="functional tests for qml boosters" feature="AF Basic Launcher daemon support" requirement="300168">
<pre_steps>
<step>/usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120</step>
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_daemons</step>
</pre_steps>
@ -255,6 +270,11 @@
<case name="applauncherd__test_fd_booster_d" type="Functional" description="File descriptor test for booster-d" timeout="360" level="System" insignificant="false">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_fd_booster_d</step>
</case>
<post_steps>
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_daemons</step>
</post_steps>
<environments>
<scratchbox>true</scratchbox>
<hardware>true</hardware>
@ -265,6 +285,7 @@
<set name="TC_e_Booster" description="functional tests for qml boosters" feature="AF Basic Launcher daemon support" requirement="300168">
<pre_steps>
<step>/usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120</step>
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py stop_daemons</step>
</pre_steps>
<case name="applauncherd__test_zombie_state_e" type="Functional" description="To test that no Zombie process exist after the application is killed" timeout="360" level="System" insignificant="false">
@ -291,6 +312,10 @@
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_fd_booster_e</step>
</case>
<post_steps>
<step>source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py start_daemons</step>
</post_steps>
<environments>
<scratchbox>true</scratchbox>
<hardware>true</hardware>

@ -51,6 +51,7 @@ LAUNCHABLE_APPS = ['/usr/bin/fala_ft_hello','/usr/bin/fala_ft_hello1', '/usr/bin
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'
DAEMONS_TO_BE_STOPPED = ['xsession/applifed', 'xsession/conndlgs']
using_scratchbox = False
@ -72,9 +73,38 @@ def check_prerequisites():
for app in LAUNCHABLE_APPS:
assert len(basename(app)) <= 15, "For app: %s , base name !<= 14" %app
# Function to stop desired daemons. This is also done in setup function
# if stop_daemons is not called before.
def stop_daemons():
for daemon in DAEMONS_TO_BE_STOPPED:
os.system('initctl stop %s'%(daemon))
# Function to start desired daemons. This is also done in teardown function
# if start_daemons is not called before.
def start_daemons():
for daemon in DAEMONS_TO_BE_STOPPED:
os.system('initctl start %s'%(daemon))
class daemon_handling (unittest.TestCase):
def stop_daemons(self):
stop_daemons()
def start_daemons(self):
start_daemons()
class launcher_tests (unittest.TestCase):
def setUp(self):
os.system('initctl stop xsession/applifed')
# Check if first of the desired daemons is running, and if so, start those all
st, op = commands.getstatusoutput('pgrep %s'%DAEMONS_TO_BE_STOPPED[0].split("/")[1])
if st == 0:
stop_daemons()
self.START_DAEMONS_AT_TEARDOWN = True
else:
self.START_DAEMONS_AT_TEARDOWN = False
if get_pid('applauncherd') == None:
os.system('initctl start xsession/applauncherd')
time.sleep(5)
@ -87,14 +117,16 @@ class launcher_tests (unittest.TestCase):
def tearDown(self):
#teardown here
debug("Executing TearDown")
os.system('initctl start xsession/applifed')
if get_pid('applauncherd') == None:
os.system('initctl start xsession/applauncherd')
time.sleep(5)
debug ("START_DAEMONS_AT_TEARDOWN: %s"%self.START_DAEMONS_AT_TEARDOWN)
if self.START_DAEMONS_AT_TEARDOWN:
start_daemons()
get_pid('booster-m')
get_pid('booster-q')
get_pid('booster-d')
#Testcases
def test_launcher_exist(self):
"""
@ -927,7 +959,10 @@ if __name__ == '__main__':
check_prerequisites()
start_launcher_daemon()
tests = sys.argv[1:]
mysuite = unittest.TestSuite(map(launcher_tests, tests))
try:
mysuite = unittest.TestSuite(map(launcher_tests, tests))
except:
mysuite = unittest.TestSuite(map(daemon_handling, tests))
result = unittest.TextTestRunner(verbosity=2).run(mysuite)
if not result.wasSuccessful():
sys.exit(1)

Loading…
Cancel
Save