From 8796c9efbab74a9d27203cbe5ea806655c7fb52d Mon Sep 17 00:00:00 2001 From: pcarrier Date: Sun, 28 Nov 2010 00:36:25 +0000 Subject: [tests] worker: added SIGUSR1 tests git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@1050 ef72aa8b-4018-0410-8976-d6e080ef94d8 --- tests/worker.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/worker.py b/tests/worker.py index 4111318b..25ff5aab 100644 --- a/tests/worker.py +++ b/tests/worker.py @@ -67,7 +67,6 @@ class WorkerTests(unittest.TestCase): self.sig(SIGINT) self.expect(self.prompt(0)) - def test_basic_noop(self): self.sendlines(['noop']) self.expect(self.prompt(1)) @@ -88,6 +87,34 @@ class WorkerTests(unittest.TestCase): self.expect('0\r\n'+self.prompt(1)) self.test_exit() + def test_basic_sigusr1(self): + self.sig(SIGUSR1) + self.expect('ALIVE\r\n') + self.test_exit() + + def test_sigusr1_when_entering_command(self): + self.worker.send('pin') + self.sig(SIGUSR1) + self.expect('pinALIVE\r\n') + self.sendlines(['g']) + self.expect('ALIVE\r\n' + self.prompt(1)) + self.test_exit() + + def test_sigusr1_on_readparms(self): + self.worker.send('exec\nech') + self.sig(SIGUSR1) + self.worker.send('o lol\n') + self.expect('exec\r\nechALIVE\r\no lol\r\n'+ + self.__exec_echo_lol_output__ + self.prompt(1)) + self.test_exit() + + def test_exec_continues_after_sigusr1(self): + self.worker.send('exec\nsleep 0.1; exec echo lol\n') + self.sig(SIGUSR1) + self.expect('exec\r\nsleep 0.1; exec echo lol\r\nALIVE\r\n'+ + self.__exec_echo_lol_output__ + self.prompt(1)) + self.test_exit() + def test_increasing_counter(self): for req_counter in range(1, 5): self.sendlines(['noop']) -- cgit