Changes: boot-mode test for booster-d added

RevBy: Olli Leppanen
pull/1/head
Nimika Keshri 14 years ago
parent 92a4b37206
commit ca06b06fc8

@ -56,6 +56,7 @@
<set name="TC_Bootmode" description="functional tests for boot mode" 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_change_to_normal_mode" type="Functional" description="To test change from boot mode to normal mode" timeout="360" level="System" insignificant="false">
@ -74,6 +75,9 @@
<case name="applauncherd__test_SIGUSR1" type="Functional" description="Test for SIGUSR1" 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-boot-mode.py test_SIGUSR1 </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>

@ -59,8 +59,6 @@ class BootModeTests(unittest.TestCase):
if get_pid('applauncherd') != None:
stop_applauncherd()
if get_pid('applifed') != None:
os.system("initctl stop xsession/applifed")
self.start_applauncherd_in_boot_mode()
@ -73,12 +71,6 @@ class BootModeTests(unittest.TestCase):
if get_pid('fala_multi-instance') != None:
kill_process('fala_multi-instance')
if get_pid('applauncherd') != None:
kill_process('applauncherd')
if get_pid('applifed') == None:
os.system("initctl start xsession/applifed")
wait_for_app('camera-ui')
start_applauncherd()
def start_applauncherd_in_boot_mode(self):
remove_applauncherd_runtime_files()
@ -126,10 +118,10 @@ class BootModeTests(unittest.TestCase):
self.assert_(pids[0] != pids2[0], "pid of booster-m didn't change")
self.assert_(pids[1] != pids2[1], "pid of booster-m didn't change")
def launch_apps(self, n = 6):
def launch_apps(self, n = 6, btype = 'm'):
# check that launching works and the apps are there
for i in range(n):
run_cmd_as_user('/usr/bin/invoker -n -r 2 --type=m fala_multi-instance %d' % i)
run_cmd_as_user('/usr/bin/invoker -n -r 2 --type=%s fala_multi-instance %d' % (btype, i))
time.sleep(4)
# give the applications time to really start
@ -156,33 +148,43 @@ class BootModeTests(unittest.TestCase):
# launch apps in boot mode
res_boot = self.launch_apps(6)
debug("Res at boot : %s" %res_boot)
res_boot_d = self.launch_apps(6, 'd')
debug("Res at boot for booster-m: %s" %res_boot)
debug("Res at boot for booster-d : %s" %res_boot_d)
# switch to normal mode and give boosters some time to start
kill_process('applauncherd', signum=10)
wait_for_app('booster-m')
wait_for_app('booster-q')
wait_for_app('booster-d')
# launch apps in normal mode
res_norm = self.launch_apps(6)
debug("Res at normal : %s" %res_norm)
res_norm_d = self.launch_apps(6, 'd')
debug("Res at normal for booster-m: %s" %res_norm)
debug("Res at normal for booster-d : %s" %res_norm_d)
# and finally, terminate applauncherd
kill_process('applauncherd', signum=15)
wait_for_app('booster-m')
wait_for_app('booster-q')
# assert that the boot mode results are correct
self.assert_(res_boot[0] == 6 and res_boot[1] == 6,
"%d apps, %d windows. Expected %d apps, %d windows (boot mode)" % (res_boot[0],
"With booster-m %d apps, %d windows. Expected %d apps, %d windows (boot mode)" % (res_boot[0],
res_boot[1],
6, 6))
self.assert_(res_boot_d[0] == 6 and res_boot_d[1] == 6,
"With booster-d %d apps, %d windows. Expected %d apps, %d windows (boot mode)" % (res_boot_d[0],
res_boot_d[1],
6, 6))
# assert that the normal mode results are correct
self.assert_(res_norm[0] == 6 and res_norm[1] == 12,
"%d apps, %d windows. Expected %d apps, %d windows (normal mode)" % (res_norm[0],
"With booster-m %d apps, %d windows. Expected %d apps, %d windows (normal mode)" % (res_norm[0],
res_norm[1],
6, 12))
self.assert_(res_norm_d[0] == 6 and res_norm_d[1] == 6,
"With booster-d %d apps, %d windows. Expected %d apps, %d windows (normal mode)" % (res_norm_d[0],
res_norm_d[1],
6, 6))
def test_SIGUSR2(self):
"""
@ -249,10 +251,6 @@ if __name__ == '__main__':
mysuite = unittest.TestSuite(map(BootModeTests, tests))
result = unittest.TextTestRunner(verbosity=2).run(mysuite)
# kill applauncherd if it's left running and restart it
kill_process('applauncherd')
restart_applauncherd()
if not result.wasSuccessful():
sys.exit(1)

@ -8,7 +8,7 @@ from subprocess import Popen
from os.path import basename
DEV_NULL = file("/dev/null","w")
DAEMONS_TO_BE_STOPPED = ['xsession/applifed', 'xsession/conndlgs']
DAEMONS_TO_BE_STOPPED = ['xsession/applifed']
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']
@ -32,7 +32,9 @@ def start_daemons():
for daemon in DAEMONS_TO_BE_STOPPED:
os.system('initctl start %s'%(daemon))
wait_for_single_applauncherd()
get_booster_pid()
#Wait for the camera-ui to be up and running so that no more boosters are used
wait_for_app('camera-ui')
def daemons_running():
st, op = commands.getstatusoutput('pgrep %s'%DAEMONS_TO_BE_STOPPED[0].split("/")[1])

Loading…
Cancel
Save