From 019af9c3e17d41057a4afb4c6f4f7360b1d19f0c Mon Sep 17 00:00:00 2001 From: Nimika Keshri Date: Thu, 14 Jul 2011 16:47:29 +0300 Subject: [PATCH] Changes: Test for relative path search added RevBy: TrustMe --- tests/harmattan/red-tests/tests.xml | 3 +++ .../testscripts/signal-forward/fala_inv_sf.py | 8 ++------ tests/harmattan/testscripts/test-invoker.py | 12 +++++++++++- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/tests/harmattan/red-tests/tests.xml b/tests/harmattan/red-tests/tests.xml index 7fbaffc..9fdf5f6 100644 --- a/tests/harmattan/red-tests/tests.xml +++ b/tests/harmattan/red-tests/tests.xml @@ -174,6 +174,9 @@ source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_invoker_wait_term + + source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-invoker.py test_relative_path_search + true true diff --git a/tests/harmattan/testscripts/signal-forward/fala_inv_sf.py b/tests/harmattan/testscripts/signal-forward/fala_inv_sf.py index 3bb3a79..d6b1bdd 100755 --- a/tests/harmattan/testscripts/signal-forward/fala_inv_sf.py +++ b/tests/harmattan/testscripts/signal-forward/fala_inv_sf.py @@ -7,12 +7,8 @@ import commands os.system("/usr/share/applauncherd-testscripts/signal-forward/fala_sf_m.sh &") time.sleep(2) -st, op = commands.getstatusoutput("ps ax | grep fala_ft_hello") -if op.split("\n")[1].find("invoker") != -1: - op = op.split("\n")[1].split(" ")[0] -else: - print("The Application was not launched by invoker") - exit +st, op = commands.getstatusoutput("ps ax | grep fala_ft_hello | grep invoker") +op = op.split("\n")[0].split(" ")[0] #Killing application with a signal 11 (Segmentation Fault) commands.getoutput("kill -11 %s" %op) diff --git a/tests/harmattan/testscripts/test-invoker.py b/tests/harmattan/testscripts/test-invoker.py index 421e535..ef0f982 100644 --- a/tests/harmattan/testscripts/test-invoker.py +++ b/tests/harmattan/testscripts/test-invoker.py @@ -128,7 +128,7 @@ class InvokerTests(unittest.TestCase): kill_process("fala_wl") self.assert_(pid != None ,"The application was not launched") - def test_app_directory_file(self): + def test_app_directory(self): """ Test that invoker is unable to launch a application which is a directory """ @@ -179,6 +179,16 @@ class InvokerTests(unittest.TestCase): debug("terminating fala_wait ...") self.assert_(success, "invoker terminated before delay elapsed") + + def test_relative_path_search(self): + """ + Test that invoker searches the application through relative path + """ + os.system("(cd /usr;export PATH=bin;/usr/bin/invoker --type=m fala_wl&)") + pid = get_pid("fala_wl") + kill_process("fala_wl") + self.assert_(pid != None ,"The application was not launched") + # main