summaryrefslogtreecommitdiff
path: root/py/demo
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2007-08-15 13:59:55 -0230
committerDwayne Boone <dwayne@zeroc.com>2007-08-15 13:59:55 -0230
commit1d265d0027c43825a0dd9567589758713a27452c (patch)
tree207e11aba123ed504311ba5b988b79d151852704 /py/demo
parentAdded missing file (diff)
downloadice-1d265d0027c43825a0dd9567589758713a27452c.tar.bz2
ice-1d265d0027c43825a0dd9567589758713a27452c.tar.xz
ice-1d265d0027c43825a0dd9567589758713a27452c.zip
Added expect scripts
Diffstat (limited to 'py/demo')
-rwxr-xr-xpy/demo/Glacier2/callback/expect.py39
-rw-r--r--py/demo/Ice/async/Client.py2
-rwxr-xr-xpy/demo/Ice/async/expect.py33
-rwxr-xr-xpy/demo/Ice/bidir/expect.py31
-rwxr-xr-xpy/demo/Ice/callback/expect.py33
-rwxr-xr-xpy/demo/Ice/hello/expect.py33
-rwxr-xr-xpy/demo/Ice/latency/expect.py36
-rwxr-xr-xpy/demo/Ice/minimal/expect.py35
-rwxr-xr-xpy/demo/Ice/session/expect.py31
-rwxr-xr-xpy/demo/Ice/throughput/expect.py32
-rwxr-xr-xpy/demo/Ice/value/expect.py32
-rwxr-xr-xpy/demo/IceGrid/simple/expect.py28
-rwxr-xr-xpy/demo/IceStorm/clock/expect.py28
13 files changed, 392 insertions, 1 deletions
diff --git a/py/demo/Glacier2/callback/expect.py b/py/demo/Glacier2/callback/expect.py
new file mode 100755
index 00000000000..285057f29cb
--- /dev/null
+++ b/py/demo/Glacier2/callback/expect.py
@@ -0,0 +1,39 @@
+#!/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, os
+
+try:
+ import demoscript
+except ImportError:
+ for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
+ toplevel = os.path.normpath(toplevel)
+ if os.path.exists(os.path.join(toplevel, "demoscript")):
+ break
+ else:
+ raise "can't find toplevel directory!"
+ sys.path.append(os.path.join(toplevel))
+ import demoscript
+
+import demoscript.Util
+import demoscript.Glacier2.callback
+
+server = demoscript.Util.spawn('python Server.py --Ice.PrintAdapterReady')
+server.expect('.* ready')
+sessionserver = demoscript.Util.spawn('python SessionServer.py --Ice.PrintAdapterReady')
+sessionserver.expect('.* ready')
+
+glacier2 = demoscript.Util.spawn('glacier2router --Ice.Config=config.glacier2 --Ice.PrintAdapterReady --Glacier2.SessionTimeout=5')
+glacier2.expect('Glacier2.Client ready')
+glacier2.expect('Glacier2.Server ready')
+
+client = demoscript.Util.spawn('python Client.py')
+
+demoscript.Glacier2.callback.run(client, server, sessionserver, glacier2)
diff --git a/py/demo/Ice/async/Client.py b/py/demo/Ice/async/Client.py
index 2c371dafc62..0c3f1e2782e 100644
--- a/py/demo/Ice/async/Client.py
+++ b/py/demo/Ice/async/Client.py
@@ -19,7 +19,7 @@ class AMI_Hello_sayHelloI:
def ice_exception(self, ex):
if isinstance(ex, Demo.RequestCanceledException):
- print "Request canceled"
+ print "Demo.RequestCanceledException"
else:
print "sayHello AMI call failed:"
print ex
diff --git a/py/demo/Ice/async/expect.py b/py/demo/Ice/async/expect.py
new file mode 100755
index 00000000000..ce0a966abc1
--- /dev/null
+++ b/py/demo/Ice/async/expect.py
@@ -0,0 +1,33 @@
+#!/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, os
+
+try:
+ import demoscript
+except ImportError:
+ for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
+ toplevel = os.path.normpath(toplevel)
+ if os.path.exists(os.path.join(toplevel, "demoscript")):
+ break
+ else:
+ raise "can't find toplevel directory!"
+ sys.path.append(os.path.join(toplevel))
+ import demoscript
+
+import demoscript.Util
+import demoscript.Ice.async
+
+server = demoscript.Util.spawn('python Server.py --Ice.PrintAdapterReady')
+server.expect('.* ready')
+client = demoscript.Util.spawn('python Client.py')
+client.expect('.*==>')
+
+demoscript.Ice.async.run(client, server)
diff --git a/py/demo/Ice/bidir/expect.py b/py/demo/Ice/bidir/expect.py
new file mode 100755
index 00000000000..f6c334e7b48
--- /dev/null
+++ b/py/demo/Ice/bidir/expect.py
@@ -0,0 +1,31 @@
+#!/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, os
+
+try:
+ import demoscript
+except ImportError:
+ for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
+ toplevel = os.path.normpath(toplevel)
+ if os.path.exists(os.path.join(toplevel, "demoscript")):
+ break
+ else:
+ raise "can't find toplevel directory!"
+ sys.path.append(os.path.join(toplevel))
+ import demoscript
+
+import demoscript.Util
+import demoscript.Ice.bidir
+
+server = demoscript.Util.spawn('python Server.py --Ice.PrintAdapterReady')
+server.expect('.* ready')
+
+demoscript.Ice.bidir.run('python Client.py', server)
diff --git a/py/demo/Ice/callback/expect.py b/py/demo/Ice/callback/expect.py
new file mode 100755
index 00000000000..6007be0875a
--- /dev/null
+++ b/py/demo/Ice/callback/expect.py
@@ -0,0 +1,33 @@
+#!/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, os
+
+try:
+ import demoscript
+except ImportError:
+ for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
+ toplevel = os.path.normpath(toplevel)
+ if os.path.exists(os.path.join(toplevel, "demoscript")):
+ break
+ else:
+ raise "can't find toplevel directory!"
+ sys.path.append(os.path.join(toplevel))
+ import demoscript
+
+import demoscript.Util
+import demoscript.Ice.callback
+
+server = demoscript.Util.spawn('python Server.py --Ice.PrintAdapterReady')
+server.expect('.* ready')
+client = demoscript.Util.spawn('python Client.py')
+client.expect('.*==>')
+
+demoscript.Ice.callback.run(client, server)
diff --git a/py/demo/Ice/hello/expect.py b/py/demo/Ice/hello/expect.py
new file mode 100755
index 00000000000..1a4f44aa191
--- /dev/null
+++ b/py/demo/Ice/hello/expect.py
@@ -0,0 +1,33 @@
+#!/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, os
+
+try:
+ import demoscript
+except ImportError:
+ for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
+ toplevel = os.path.normpath(toplevel)
+ if os.path.exists(os.path.join(toplevel, "demoscript")):
+ break
+ else:
+ raise "can't find toplevel directory!"
+ sys.path.append(os.path.join(toplevel))
+ import demoscript
+
+import demoscript.Util
+import demoscript.Ice.hello
+
+server = demoscript.Util.spawn('python Server.py --Ice.PrintAdapterReady')
+server.expect('.* ready')
+client = demoscript.Util.spawn('python Client.py')
+client.expect('.*==>')
+
+demoscript.Ice.hello.run(client, server)
diff --git a/py/demo/Ice/latency/expect.py b/py/demo/Ice/latency/expect.py
new file mode 100755
index 00000000000..7061ffb74cd
--- /dev/null
+++ b/py/demo/Ice/latency/expect.py
@@ -0,0 +1,36 @@
+#!/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, os
+
+try:
+ import demoscript
+except ImportError:
+ for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
+ toplevel = os.path.normpath(toplevel)
+ if os.path.exists(os.path.join(toplevel, "demoscript")):
+ break
+ else:
+ raise "can't find toplevel directory!"
+ sys.path.append(os.path.join(toplevel))
+ import demoscript
+
+import demoscript.Util
+
+server = demoscript.Util.spawn('python Server.py --Ice.PrintAdapterReady')
+server.expect('.* ready')
+
+print "testing ping... ",
+sys.stdout.flush()
+client = demoscript.Util.spawn('python Client.py')
+client.expect(pexpect.EOF, timeout=100)
+print "ok"
+
+print client.before
diff --git a/py/demo/Ice/minimal/expect.py b/py/demo/Ice/minimal/expect.py
new file mode 100755
index 00000000000..dbb25da3afa
--- /dev/null
+++ b/py/demo/Ice/minimal/expect.py
@@ -0,0 +1,35 @@
+#!/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, os
+
+try:
+ import demoscript
+except ImportError:
+ for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
+ toplevel = os.path.normpath(toplevel)
+ if os.path.exists(os.path.join(toplevel, "demoscript")):
+ break
+ else:
+ raise "can't find toplevel directory!"
+ sys.path.append(os.path.join(toplevel))
+ import demoscript
+
+import demoscript.Util
+
+server = demoscript.Util.spawn('python Server.py --Ice.PrintAdapterReady')
+server.expect('.* ready')
+
+print "testing...",
+sys.stdout.flush()
+client = demoscript.Util.spawn('python Client.py')
+client.expect(pexpect.EOF)
+server.expect('Hello World!')
+print "ok"
diff --git a/py/demo/Ice/session/expect.py b/py/demo/Ice/session/expect.py
new file mode 100755
index 00000000000..4ba4f2fab34
--- /dev/null
+++ b/py/demo/Ice/session/expect.py
@@ -0,0 +1,31 @@
+#!/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, os
+
+try:
+ import demoscript
+except ImportError:
+ for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
+ toplevel = os.path.normpath(toplevel)
+ if os.path.exists(os.path.join(toplevel, "demoscript")):
+ break
+ else:
+ raise "can't find toplevel directory!"
+ sys.path.append(os.path.join(toplevel))
+ import demoscript
+
+import demoscript.Util
+import demoscript.Ice.session
+
+server = demoscript.Util.spawn('python Server.py --Ice.PrintAdapterReady')
+server.expect('.* ready')
+
+demoscript.Ice.session.run('python Client.py', server)
diff --git a/py/demo/Ice/throughput/expect.py b/py/demo/Ice/throughput/expect.py
new file mode 100755
index 00000000000..c0876f71727
--- /dev/null
+++ b/py/demo/Ice/throughput/expect.py
@@ -0,0 +1,32 @@
+#!/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, os
+
+try:
+ import demoscript
+except ImportError:
+ for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
+ toplevel = os.path.normpath(toplevel)
+ if os.path.exists(os.path.join(toplevel, "demoscript")):
+ break
+ else:
+ raise "can't find toplevel directory!"
+ sys.path.append(os.path.join(toplevel))
+ import demoscript
+
+import demoscript.Util
+import demoscript.Ice.throughput
+
+server = demoscript.Util.spawn('python Server.py --Ice.PrintAdapterReady')
+server.expect('.* ready')
+client = demoscript.Util.spawn('python Client.py')
+
+demoscript.Ice.throughput.run(client, server)
diff --git a/py/demo/Ice/value/expect.py b/py/demo/Ice/value/expect.py
new file mode 100755
index 00000000000..6620a8b41d4
--- /dev/null
+++ b/py/demo/Ice/value/expect.py
@@ -0,0 +1,32 @@
+#!/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, os
+
+try:
+ import demoscript
+except ImportError:
+ for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
+ toplevel = os.path.normpath(toplevel)
+ if os.path.exists(os.path.join(toplevel, "demoscript")):
+ break
+ else:
+ raise "can't find toplevel directory!"
+ sys.path.append(os.path.join(toplevel))
+ import demoscript
+
+import demoscript.Util
+import demoscript.Ice.value
+
+server = demoscript.Util.spawn('python Server.py --Ice.PrintAdapterReady')
+server.expect('.* ready')
+client = demoscript.Util.spawn('python Client.py')
+
+demoscript.Ice.value.run(client, server)
diff --git a/py/demo/IceGrid/simple/expect.py b/py/demo/IceGrid/simple/expect.py
new file mode 100755
index 00000000000..7894164e7c2
--- /dev/null
+++ b/py/demo/IceGrid/simple/expect.py
@@ -0,0 +1,28 @@
+#!/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, os
+
+try:
+ import demoscript
+except ImportError:
+ for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
+ toplevel = os.path.normpath(toplevel)
+ if os.path.exists(os.path.join(toplevel, "demoscript")):
+ break
+ else:
+ raise "can't find toplevel directory!"
+ sys.path.append(os.path.join(toplevel))
+ import demoscript
+
+import demoscript.Util
+import demoscript.IceGrid.simple
+
+demoscript.IceGrid.simple.run('python Client.py')
diff --git a/py/demo/IceStorm/clock/expect.py b/py/demo/IceStorm/clock/expect.py
new file mode 100755
index 00000000000..5e7f91c4f6f
--- /dev/null
+++ b/py/demo/IceStorm/clock/expect.py
@@ -0,0 +1,28 @@
+#!/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, os
+
+try:
+ import demoscript
+except ImportError:
+ for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
+ toplevel = os.path.normpath(toplevel)
+ if os.path.exists(os.path.join(toplevel, "demoscript")):
+ break
+ else:
+ raise "can't find toplevel directory!"
+ sys.path.append(os.path.join(toplevel))
+ import demoscript
+
+import demoscript.Util
+import demoscript.IceStorm.clock
+
+demoscript.IceStorm.clock.run('python Subscriber.py', 'python Publisher.py')