summaryrefslogtreecommitdiff
path: root/demoscript/Ice/throughput.py
diff options
context:
space:
mode:
Diffstat (limited to 'demoscript/Ice/throughput.py')
-rwxr-xr-xdemoscript/Ice/throughput.py61
1 files changed, 61 insertions, 0 deletions
diff --git a/demoscript/Ice/throughput.py b/demoscript/Ice/throughput.py
new file mode 100755
index 00000000000..a9c3c968c08
--- /dev/null
+++ b/demoscript/Ice/throughput.py
@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+import pexpect, sys, demoscript
+
+def runseries(client):
+ client.expect('==> ', timeout=240)
+ client.sendline('t')
+ client.expect('t')
+
+ client.expect('==> ', timeout=240)
+ print "twoway: %s " % (client.before)
+
+ client.sendline('o')
+
+ client.expect('o')
+ client.expect('==> ', timeout=240)
+ print "oneway: %s " % (client.before)
+
+ client.sendline('r')
+ client.expect('r')
+
+ client.expect('==> ', timeout=240)
+ print "receive: %s" % (client.before)
+ client.sendline('e')
+ client.expect('e')
+
+ client.expect('==> ', timeout=240)
+ print "echo: %s" % (client.before)
+
+def run(client, server):
+ print "testing bytes"
+ runseries(client)
+
+ if not demoscript.Util.fast:
+ print "testing strings"
+ client.sendline('2')
+ runseries(client)
+
+ print "testing structs with string... "
+ client.sendline('3')
+ runseries(client)
+
+ print "testing structs with two ints and double... "
+ client.sendline('4')
+ runseries(client)
+
+ client.sendline('s')
+ server.expect(pexpect.EOF)
+ assert server.wait() == 0
+
+ client.sendline('x')
+ client.expect(pexpect.EOF)
+ assert client.wait() == 0