diff --git a/tests/TestScripts/test-func-launcher.py b/tests/TestScripts/test-func-launcher.py
index 5144284..4dee19e 100644
--- a/tests/TestScripts/test-func-launcher.py
+++ b/tests/TestScripts/test-func-launcher.py
@@ -47,6 +47,8 @@ DEV_NULL = file("/dev/null","w")
LAUNCHABLE_APPS = ['/usr/bin/fala_ft_hello','/usr/bin/fala_ft_hello1', '/usr/bin/fala_ft_hello2']
PREFERED_APP = '/usr/bin/fala_ft_hello'
+using_scratchbox = False
+
def debug(*msg):
"""
Debug function
@@ -417,6 +419,43 @@ class launcher_tests (unittest.TestCase):
self.kill_process(None, app_pid2)
self.assert_(False, "%s was not killed" % app_path)
+ def test_011(self):
+ # stop/kill applauncherd if it's running
+ if using_scratchbox:
+ commands.getstatusoutput("pkill applauncherd")
+ else:
+ commands.getstatusoutput("initctl stop xsession/applauncherd")
+
+ files = ['/tmp/applauncherd.lock', '/tmp/qtlnchr', '/tmp/mlnchr']
+
+ for f in files:
+ os.remove(f)
+
+ # start applauncherd daemonized
+ subprocess.Popen(["applauncherd.bin", "--daemon"],
+ shell=False,
+ stdout=DEV_NULL, stderr=DEV_NULL)
+
+ time.sleep(2)
+
+ # count should be 2 (pgrep -f returns the shell in which it is run ...)
+ st, op = commands.getstatusoutput('pgrep -f "applauncherd.bin --daemon"')
+ count = len(op.split("\n"))
+
+ commands.getstatusoutput('pkill -f "applauncherd.bin --daemon"')
+
+ for f in files:
+ os.remove(f)
+
+ # start applauncherd again
+ if using_scratchbox:
+ subprocess.Popen("applauncherd",
+ shell=False,
+ stdout=DEV_NULL, stderr=DEV_NULL)
+ else:
+ commands.getstatusoutput("initctl start xsession/applauncherd")
+
+ self.assert_(count == 2, "applauncherd was not daemonized")
# main
if __name__ == '__main__':
@@ -424,6 +463,7 @@ if __name__ == '__main__':
# the tools/bin directory
if os.getenv('_SBOX_DIR') != None:
os.environ['PATH'] = os.getenv('PATH') + ":" + os.getenv('_SBOX_DIR') + '/tools/bin'
+ using_scratchbox = True
check_prerequisites()
start_launcher_daemon()
diff --git a/tests/functests/tests.xml b/tests/functests/tests.xml
index 6093259..41523e6 100644
--- a/tests/functests/tests.xml
+++ b/tests/functests/tests.xml
@@ -31,6 +31,10 @@
source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_005_one_instance
+
+ source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_011
+
+
true
true