From fa049d0ad37a060ccf2c95c227f27535b37cb0fc Mon Sep 17 00:00:00 2001 From: pcarrier Date: Sat, 27 Nov 2010 22:13:19 +0000 Subject: [tests] worker: new tests, some slow - empty_glob - increasing_counter - queue_commands Those last two are significantly slower. Actually performance is almost disturbing! git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@1043 ef72aa8b-4018-0410-8976-d6e080ef94d8 --- tests/worker.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/worker.py b/tests/worker.py index 1cccfab3..45a39db9 100644 --- a/tests/worker.py +++ b/tests/worker.py @@ -77,6 +77,27 @@ class PexpectTest(unittest.TestCase): self.expect('2\r\n(/bin\r\n/sbin|/sbin\r\n/bin)\r\n#1#\r\n') self.test_exit() + def test_empty_glob(self): + self.sendlines(['glob', '/?kyzh?']) + self.expect('0\r\n#1#\r\n') + self.test_exit() + + def test_increasing_counter(self): + for req_counter in range(1, 5): + self.sendlines(['noop']) + self.expect('#%i#\r\n' % req_counter) + for req_counter in range(5, 10): + self.sendlines(['ping']) + self.expect('ALIVE\r\n#%i#\r\n' % req_counter) + self.test_exit() + + def test_queuecommands(self): + self.worker.send('ping\n'*5) + self.worker.send('exec\necho lol\n'*5) + for req_counter in range(1,6): + self.lose_expect('ALIVE\r\n#%i#\r\n' % req_counter) + for req_counter in range(6,11): + self.lose_expect('0\r\n4\r\nlol\r\n\r\n0\r\n\r\n#%i#\r\n' % req_counter) self.test_exit() if __name__ == '__main__': -- cgit