diff options
author | pcarrier <pcarrier@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2010-11-28 00:36:25 +0000 |
---|---|---|
committer | pcarrier <pcarrier@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2010-11-28 00:36:25 +0000 |
commit | 8796c9efbab74a9d27203cbe5ea806655c7fb52d (patch) | |
tree | 56eed2f74b728eb80c420eec6cd65cbb7035cc56 /tests/worker.py | |
parent | 4c0ba99062bc72bffeaaac5325cc2ab9f0a4595e (diff) | |
download | sos-8796c9efbab74a9d27203cbe5ea806655c7fb52d.tar.gz |
[tests] worker: added SIGUSR1 tests
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@1050 ef72aa8b-4018-0410-8976-d6e080ef94d8
Diffstat (limited to 'tests/worker.py')
-rw-r--r-- | tests/worker.py | 29 |
1 files changed, 28 insertions, 1 deletions
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']) |