Changes: New test added to test that boosters are restarted if they are killed

RevBy: TrustMe
pull/1/head
Nimika Keshri 15 years ago
parent a03eb26083
commit e85397078d

@ -105,8 +105,6 @@ class launcher_tests (unittest.TestCase):
stdout=DEV_NULL, stderr=DEV_NULL)
return p
#get_pid = lambda appname: commands.getstatusoutput("pgrep %s" % appname)[-1]
def get_pid(self, appname):
temp = basename(appname)[:14]
st, op = commands.getstatusoutput("pgrep %s" % temp)
@ -602,6 +600,38 @@ class launcher_tests (unittest.TestCase):
count = self.get_file_descriptor("booster-q","qt")
self.assert_(count != 0, "None of the file descriptors were changed")
def test_016_restart_booster(self):
"""
Test that booster is restarted if it is killed
"""
#get the pids of boosters and make sure they are running
qpid = self.get_pid('booster-q')
print "Pid of booster-q before killing :%s" %qpid
self.assert_(qpid != None, "No booster process running")
mpid = self.get_pid('booster-m')
print "Pid of booster-m before killing :%s" %mpid
self.assert_(mpid != None, "No booster process running")
#Kill the booster processes
self.kill_process(apppid=qpid)
self.kill_process(apppid=mpid)
#wait for the boosters to be restarted
time.sleep(6)
#check that the new boosters are started
qpid_new = self.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 = self.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")
# main
if __name__ == '__main__':
# When run with testrunner, for some reason the PATH doesn't include

@ -71,7 +71,7 @@
</environments>
</set>
<set name="file-descriptor" description="Launcher functional tests" feature="Closing File Descriptors" requirement="300168">
<set name="Booster-tests" description="Launcher functional tests" feature="Closing File Descriptors" requirement="300168">
<pre_steps>
<step>/usr/bin/waitloadavg.rb -l 1.0 -p 1.0 -t 120</step>
</pre_steps>
@ -84,6 +84,9 @@
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_015_fd_booster_q</step>
</case>
<case name="kill-boosters" type="Functional" description="Test that booster is restarted if it is killed" timeout="120" level="System" insignificant="false">
<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>
<environments>
<scratchbox>true</scratchbox>
<hardware>true</hardware>

Loading…
Cancel
Save