Changes: Failing tests modified

RevBy: Antti Kervinen
Descrition: Stress test now waits for the queue of applications to be 0
            Search path test now uses delay
pull/1/head
Nimika Keshri 15 years ago
parent 77bc33943c
commit 2682546821

@ -495,35 +495,22 @@ class launcher_tests (unittest.TestCase):
# invoker searches PATH for the executable # invoker searches PATH for the executable
p = run_app_as_user('invoker --type=m --no-wait fala_ft_hello.launch') p = run_app_as_user('invoker --type=m --no-wait fala_ft_hello.launch')
self.assert_(p.wait() == 0, "Couldn't launch fala_ft_hello.launch") self.assert_(p.wait() == 0, "Couldn't launch fala_ft_hello.launch")
time.sleep(2)
kill_process('fala_ft_hello') kill_process('fala_ft_hello')
# launch with relative path # launch with relative path
cwd = os.getcwd()
os.chdir('/usr/share')
p = run_app_as_user('invoker --type=m --no-wait ' + p = run_app_as_user('cd /usr/share/; invoker --type=m --no-wait ' +
"../bin/fala_ft_hello.launch") "../bin/fala_ft_hello.launch")
self.assert_(p.wait() == 0, "Couldnt launch fala_ft_hello.launch" + self.assert_(p.wait() == 0, "Couldnt launch fala_ft_hello.launch" +
" with relative path") " with relative path")
time.sleep(2)
kill_process('fala_ft_hello') kill_process('fala_ft_hello')
# find a relative path from PATH and launch from there
oldpath = os.environ['PATH']
os.environ['PATH'] = '../bin:' + os.environ['PATH']
p = run_app_as_user('invoker --type=m --no-wait ' +
"fala_ft_hello.launch")
self.assert_(p.wait() == 0, "Couldnt launch fala_ft_hello.launch" +
" with relative path (2)")
kill_process('fala_ft_hello')
# restore CWD and PATH
os.chdir(cwd)
os.environ['PATH'] = oldpath
# and finally, try to launch something that doesn't exist # and finally, try to launch something that doesn't exist
p = run_app_as_user('invoker --type=m --no-wait spam_cake.launch') 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") self.assert_(p.wait() != 127, "Found spam_cake.launch for some reason")
time.sleep(2)
kill_process('spam_cake') kill_process('spam_cake')
def test_booster_killed_or_restarted(self): def test_booster_killed_or_restarted(self):
@ -681,6 +668,7 @@ class launcher_tests (unittest.TestCase):
""" """
Stress test for boosted applications to check only one instance is running. Stress test for boosted applications to check only one instance is running.
""" """
count = 0
p = run_app_as_user('invoker --type=m --no-wait fala_ft_hello.launch') p = run_app_as_user('invoker --type=m --no-wait fala_ft_hello.launch')
pid = get_pid('fala_ft_hello') pid = get_pid('fala_ft_hello')
for i in xrange(10): for i in xrange(10):
@ -688,7 +676,14 @@ class launcher_tests (unittest.TestCase):
app_pid = get_pid('fala_ft_hello') app_pid = get_pid('fala_ft_hello')
self.assert_(app_pid != None, "Application is not running") self.assert_(app_pid != None, "Application is not running")
self.assert_(pid == app_pid, "Same instance of application not running") self.assert_(pid == app_pid, "Same instance of application not running")
time.sleep(5) st, op = commands.getstatusoutput('ps ax | grep invoker | grep fala_ft_hello.launch | grep -v -- -sh | wc -l')
count = int(op)
while count != 0:
debug("The value of queue is %d" %count)
time.sleep(3)
debug("Sleeping for 3 secs")
st, op = commands.getstatusoutput('ps ax | grep invoker | grep fala_ft_hello.launch | grep -v -- -sh | wc -l')
count = int(op)
kill_process('fala_ft_hello') kill_process('fala_ft_hello')
def test_launched_app_name(self): def test_launched_app_name(self):

Loading…
Cancel
Save