aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpcarrier <pcarrier@ef72aa8b-4018-0410-8976-d6e080ef94d8>2010-11-27 22:13:19 +0000
committerpcarrier <pcarrier@ef72aa8b-4018-0410-8976-d6e080ef94d8>2010-11-27 22:13:19 +0000
commitfa049d0ad37a060ccf2c95c227f27535b37cb0fc (patch)
tree769f3b900204150e5b03b55352d267eb79b4aae4
parent8c017df273cb955c67cf99e91ac7c9022b9ea76f (diff)
downloadsos-fa049d0ad37a060ccf2c95c227f27535b37cb0fc.tar.gz
[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
-rw-r--r--tests/worker.py21
1 files changed, 21 insertions, 0 deletions
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__':