diff --git a/debian/changelog b/debian/changelog index ae3c357..c808f0e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 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 diff --git a/src/launcherlib/CMakeLists.txt b/src/launcherlib/CMakeLists.txt index ea5f03c..73e981a 100644 --- a/src/launcherlib/CMakeLists.txt +++ b/src/launcherlib/CMakeLists.txt @@ -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) diff --git a/src/launcherlib/main.cpp b/src/launcherlib/main.cpp index 91a2064..bd1dbe8 100644 --- a/src/launcherlib/main.cpp +++ b/src/launcherlib/main.cpp @@ -26,6 +26,8 @@ #include #include +#include + //! 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 diff --git a/tests/Harmattan/TestScripts/test-func-launcher.py b/tests/Harmattan/TestScripts/test-func-launcher.py index a1a76c5..88dc4bc 100644 --- a/tests/Harmattan/TestScripts/test-func-launcher.py +++ b/tests/Harmattan/TestScripts/test-func-launcher.py @@ -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 diff --git a/tests/Harmattan/bug-tests/tests.xml b/tests/Harmattan/bug-tests/tests.xml index aa96086..6df9fb3 100644 --- a/tests/Harmattan/bug-tests/tests.xml +++ b/tests/Harmattan/bug-tests/tests.xml @@ -112,6 +112,11 @@ source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_016_restart_booster + + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_booster_killed_or_restarted + + true true diff --git a/tests/Meego/TestScripts/test-func-launcher.py b/tests/Meego/TestScripts/test-func-launcher.py index bc207e4..e6ef8da 100644 --- a/tests/Meego/TestScripts/test-func-launcher.py +++ b/tests/Meego/TestScripts/test-func-launcher.py @@ -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