def test_reregister_named_process(self, quite=0): if not quite: self.progress_message("\ntest_reregister_named_process:") process.register_named_process('test', os.getpid()) try: process.register_named_process('test', os.getpid()) except process.EProcessRunning: return raise 'Did not detect self already running.'
def test_reregister_named_process(self, quite=0): if not quite: self.progress_message("\ntest_reregister_named_process:") process.register_named_process("test", os.getpid()) try: process.register_named_process("test", os.getpid()) except process.EProcessRunning: return raise "Did not detect self already running."
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_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
def test_register_named_process(self, quite=0): if not quite: self.progress_message("\ntest_register_named_process:") process.register_named_process('test', os.getpid()) return
def test_register_named_process(self, quite=0): if not quite: self.progress_message("\ntest_register_named_process:") process.register_named_process("test", os.getpid()) return