Merge remote branch 'origin/master'

pull/1/head
Alexey Shilov 15 years ago
commit 592e92440c

8
debian/changelog vendored

@ -1,12 +1,8 @@
applauncherd (0.15.2) unstable; urgency=low
applauncherd (0.15.1) unstable; urgency=low
* Changes: Launcher library exports only main()
* Changes: Install /usr/bin/applauncherd.launcher to /usr/lib/libapplauncherd.so
due to dh_strip problems and because it's not -pie.
-- Jussi Lind <jussi.lind@nokia.com> Mon, 22 Nov 2010 15:32:17 +0200
applauncherd (0.15.1) stable; urgency=low
* Changes: Added the "startup time from application grid" test
* Implemented: SWP#DUI-4282

@ -3,6 +3,9 @@ include(${QT_USE_FILE})
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/common)
# Hide all symbols except the ones explicitly exported in the code (like main())
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
# Set sources
set(SRC appdata.cpp booster.cpp boosterfactory.cpp monitorbooster.cpp connection.cpp daemon.cpp mbooster.cpp logger.cpp main.cpp qtbooster.cpp wrtbooster.cpp)
set(MOC_HDRS monitorbooster.h mbooster.h)

@ -26,6 +26,8 @@
#include <fcntl.h>
#include <sys/file.h>
#include <QtCore/QtGlobal>
//! Signal handler to reap zombie processes
void reapZombies(int)
{
@ -47,7 +49,7 @@ void exitLauncher(int)
}
//! Main function
int main(int argc, char * argv[])
Q_DECL_EXPORT int main(int argc, char * argv[])
{
// Open the log

@ -78,6 +78,8 @@ class launcher_tests (unittest.TestCase):
def tearDown(self):
#teardown here
print "Executing TearDown"
if get_pid('applauncherd') == None:
os.system('initctl start xsession/applauncherd')
#Testcases
def test_001_launcher_exist(self):
@ -530,7 +532,85 @@ class launcher_tests (unittest.TestCase):
p = run_app_as_user('invoker --type=m --no-wait spam_cake.launch')
self.assert_(p.wait() != 0, "Found spam_cake.launch for some reason")
kill_process('spam_cake')
def test_booster_killed_or_restarted(self):
"""
Test that boosters are killed if applauncherd is stopped
and restarted if applauncherd is killed
"""
#get the pids of boosters and make sure they are running
qpid = get_pid('booster-q')
print "Pid of booster-q before killing :%s" %qpid
self.assert_(qpid != None, "No booster process running")
mpid = get_pid('booster-m')
print "Pid of booster-m before killing :%s" %mpid
self.assert_(mpid != None, "No booster process running")
wpid = get_pid('booster-w')
print "Pid of booster-w before killing :%s" %mpid
self.assert_(wpid != None, "No booster process running")
#stop applauncherd
os.system("initctl stop xsession/applauncherd")
#wait for the boosters to be killed
time.sleep(2)
#check that the none of the booster is running
qpid_new = get_pid('booster-q')
print "Pid of booster-q after killing :%s" %qpid_new
self.assert_(qpid_new == None, "booster-q still running")
mpid_new = get_pid('booster-m')
print "Pid of booster-m after killing :%s" %mpid_new
self.assert_(mpid_new == None, "booster-m still running")
wpid_new = get_pid('booster-w')
print "Pid of booster-w after killing :%s" %wpid_new
self.assert_(wpid_new == None, "booster-w still running")
#Now start the applauncherd
os.system("initctl start xsession/applauncherd")
#wait for the boosters to be restarted
time.sleep(6)
#get the pids of boosters and make sure they are running
qpid = get_pid('booster-q')
print "Pid of booster-q before killing :%s" %qpid
self.assert_(qpid != None, "No booster process running")
mpid = get_pid('booster-m')
print "Pid of booster-m before killing :%s" %mpid
self.assert_(mpid != None, "No booster process running")
wpid = get_pid('booster-w')
print "Pid of booster-w before killing :%s" %mpid
self.assert_(wpid != None, "No booster process running")
#Now kill applauncherd
kill_process('applauncherd')
#wait for the boosters to be restarted
time.sleep(6)
#check that the new boosters are started
qpid_new = get_pid('booster-q')
print "Pid of booster-q after killing :%s" %qpid_new
self.assert_(qpid_new != None, "No booster process running")
self.assert_(qpid_new != qpid, "booster process was not killed")
mpid_new = get_pid('booster-m')
print "Pid of booster-m after killing :%s" %mpid_new
self.assert_(mpid_new != None, "No booster process running")
self.assert_(mpid_new != mpid, "booster process was not killed")
wpid_new = get_pid('booster-w')
print "Pid of booster-w after killing :%s" %wpid_new
self.assert_(wpid_new != None, "No booster process running")
self.assert_(wpid_new != wpid, "booster process was not killed")
# main

@ -112,6 +112,11 @@
<case name="kill-boosters" type="Functional" description="Test that booster is restarted if it is killed" 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_016_restart_booster</step>
</case>
<case name="kill-applaunched-restart-booster" type="Functional" description="Test that booster is restarted if applauncherd is killed" 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_booster_killed_or_restarted</step>
</case>
<environments>
<scratchbox>true</scratchbox>
<hardware>true</hardware>

@ -78,6 +78,8 @@ class launcher_tests (unittest.TestCase):
def tearDown(self):
#teardown here
print "Executing TearDown"
if get_pid('applauncherd') == None:
os.system('initctl start xsession/applauncherd')
#Testcases
def test_001_launcher_exist(self):
@ -530,7 +532,85 @@ class launcher_tests (unittest.TestCase):
p = run_app_as_user('invoker --type=m --no-wait spam_cake.launch')
self.assert_(p.wait() != 0, "Found spam_cake.launch for some reason")
kill_process('spam_cake')
def test_booster_killed_or_restarted(self):
"""
Test that boosters are killed if applauncherd is stopped
and restarted if applauncherd is killed
"""
#get the pids of boosters and make sure they are running
qpid = get_pid('booster-q')
print "Pid of booster-q before killing :%s" %qpid
self.assert_(qpid != None, "No booster process running")
mpid = get_pid('booster-m')
print "Pid of booster-m before killing :%s" %mpid
self.assert_(mpid != None, "No booster process running")
wpid = get_pid('booster-w')
print "Pid of booster-w before killing :%s" %mpid
self.assert_(wpid != None, "No booster process running")
#stop applauncherd
os.system("initctl stop xsession/applauncherd")
#wait for the boosters to be killed
time.sleep(2)
#check that the none of the booster is running
qpid_new = get_pid('booster-q')
print "Pid of booster-q after killing :%s" %qpid_new
self.assert_(qpid_new == None, "booster-q still running")
mpid_new = get_pid('booster-m')
print "Pid of booster-m after killing :%s" %mpid_new
self.assert_(mpid_new == None, "booster-m still running")
wpid_new = get_pid('booster-w')
print "Pid of booster-w after killing :%s" %wpid_new
self.assert_(wpid_new == None, "booster-w still running")
#Now start the applauncherd
os.system("initctl start xsession/applauncherd")
#wait for the boosters to be restarted
time.sleep(6)
#get the pids of boosters and make sure they are running
qpid = get_pid('booster-q')
print "Pid of booster-q before killing :%s" %qpid
self.assert_(qpid != None, "No booster process running")
mpid = get_pid('booster-m')
print "Pid of booster-m before killing :%s" %mpid
self.assert_(mpid != None, "No booster process running")
wpid = get_pid('booster-w')
print "Pid of booster-w before killing :%s" %mpid
self.assert_(wpid != None, "No booster process running")
#Now kill applauncherd
kill_process('applauncherd')
#wait for the boosters to be restarted
time.sleep(6)
#check that the new boosters are started
qpid_new = get_pid('booster-q')
print "Pid of booster-q after killing :%s" %qpid_new
self.assert_(qpid_new != None, "No booster process running")
self.assert_(qpid_new != qpid, "booster process was not killed")
mpid_new = get_pid('booster-m')
print "Pid of booster-m after killing :%s" %mpid_new
self.assert_(mpid_new != None, "No booster process running")
self.assert_(mpid_new != mpid, "booster process was not killed")
wpid_new = get_pid('booster-w')
print "Pid of booster-w after killing :%s" %wpid_new
self.assert_(wpid_new != None, "No booster process running")
self.assert_(wpid_new != wpid, "booster process was not killed")
# main

Loading…
Cancel
Save