def test_status_from_nosuch_name(self, quite=0): if not quite: self.progress_message("\ntest_status_from_nosuch_name:") status = process.status_from_name('test') if status.name != 'test': raise 'Did not set the name correctly.' if status.pid != None: raise 'Found nonexistant named process id.' if status.state != process.StatusEnum.DOESNOTEXIST: raise 'Found nonexistant named process state.' return
def test_status_from_name(self, quite=0): if not quite: self.progress_message("\ntest_status_from_name:") process.register_named_process('test', os.getpid()) status = process.status_from_name('test') if status.name != 'test': raise 'Did not set the name correctly.' if status.pid != os.getpid(): raise 'Self does not have my process id.' if status.state != process.StatusEnum.EXISTS: raise 'Self does not EXIST, using status_from_name.' return
def test_status_from_nosuch_name(self, quite=0): if not quite: self.progress_message("\ntest_status_from_nosuch_name:") status = process.status_from_name("test") if status.name != "test": raise "Did not set the name correctly." if status.pid != None: raise "Found nonexistant named process id." if status.state != process.StatusEnum.DOESNOTEXIST: raise "Found nonexistant named process state." return
def do_status(self): status = process.status_from_name("broadway").state if status == "EXISTS": status = "OK" elif status == "DOESNOTEXIST": status = "Application not running" else: status = "Offline: " + status return status
def do_status(self): status = process.status_from_name('broadway').state if status == 'EXISTS': status = 'OK' elif status == 'DOESNOTEXIST': status = 'Application not running' else: status = 'Offline: ' + status return status
def test_status_from_name(self, quite=0): if not quite: self.progress_message("\ntest_status_from_name:") process.register_named_process("test", os.getpid()) status = process.status_from_name("test") if status.name != "test": raise "Did not set the name correctly." if status.pid != os.getpid(): raise "Self does not have my process id." if status.state != process.StatusEnum.EXISTS: raise "Self does not EXIST, using status_from_name." return
def test_terminate_named_process(self, quite=0): if not quite: self.progress_message("\ntest_terminate_named_process:") child = popen2.Popen4('bash -c "while true; do sleep 1; done"') process.register_named_process('child', child.pid) status = process.status_from_name('child') if status.name != 'child': raise 'Did not set the name correctly.' if status.pid != child.pid: raise 'Child does not have the correct pid.' if status.state != process.StatusEnum.EXISTS: raise 'Child does not EXIST.' exit_status = process.terminate_named_process('child') return
def test_terminate_named_process(self, quite=0): if not quite: self.progress_message("\ntest_terminate_named_process:") child = popen2.Popen4('bash -c "while true; do sleep 1; done"') process.register_named_process("child", child.pid) status = process.status_from_name("child") if status.name != "child": raise "Did not set the name correctly." if status.pid != child.pid: raise "Child does not have the correct pid." if status.state != process.StatusEnum.EXISTS: raise "Child does not EXIST." exit_status = process.terminate_named_process("child") return