summaryrefslogtreecommitdiff
path: root/demoscript
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2009-03-24 11:45:18 +0100
committerBenoit Foucher <benoit@zeroc.com>2009-03-24 11:45:18 +0100
commit06a08ecf28e205277336a97a6173db7ccbed1adc (patch)
treea369a5044a63f8cdba9e7c0a461e24ae344486b4 /demoscript
parentMerge branch 'R3_3_branch' (diff)
parentBug 3924: slice2py missing from VC60 installer (diff)
downloadice-06a08ecf28e205277336a97a6173db7ccbed1adc.tar.bz2
ice-06a08ecf28e205277336a97a6173db7ccbed1adc.tar.xz
ice-06a08ecf28e205277336a97a6173db7ccbed1adc.zip
Merge commit 'origin/R3_3_branch'
Conflicts: CHANGES cpp/demo/Freeze/backup/.depend cpp/demo/Freeze/bench/.depend cpp/demo/Freeze/casino/.depend cpp/demo/Freeze/customEvictor/.depend cpp/demo/Freeze/library/.depend cpp/demo/Freeze/phonebook/.depend cpp/demo/Freeze/transform/.depend cpp/demo/Glacier2/callback/.depend cpp/demo/Glacier2/chat/.depend cpp/demo/Ice/async/.depend cpp/demo/Ice/bidir/.depend cpp/demo/Ice/callback/.depend cpp/demo/Ice/converter/.depend cpp/demo/Ice/hello/.depend cpp/demo/Ice/invoke/.depend cpp/demo/Ice/latency/.depend cpp/demo/Ice/minimal/.depend cpp/demo/Ice/multicast/.depend cpp/demo/Ice/nested/.depend cpp/demo/Ice/nrvo/.depend cpp/demo/Ice/session/.depend cpp/demo/Ice/throughput/.depend cpp/demo/Ice/value/.depend cpp/demo/IceBox/hello/.depend cpp/demo/IceGrid/allocate/.depend cpp/demo/IceGrid/icebox/.depend cpp/demo/IceGrid/replication/.depend cpp/demo/IceGrid/sessionActivation/.depend cpp/demo/IceGrid/simple/.depend cpp/demo/IceStorm/clock/.depend cpp/demo/IceStorm/counter/.depend cpp/demo/IceStorm/replicated/.depend cpp/demo/IceStorm/replicated2/.depend cpp/demo/book/freeze_filesystem/.depend cpp/demo/book/lifecycle/.depend cpp/demo/book/printer/.depend cpp/demo/book/simple_filesystem/.depend cpp/src/Freeze/.depend cpp/src/FreezeScript/.depend cpp/src/Ice/.depend cpp/src/Ice/UdpTransceiver.cpp cpp/src/Ice/UdpTransceiver.h cpp/src/IceBox/.depend cpp/src/IceGrid/.depend cpp/src/IceGridLib/.depend cpp/src/IcePatch2/.depend cpp/src/IceStorm/.depend cpp/src/slice2freeze/.depend cpp/test/Freeze/complex/.depend cpp/test/Freeze/dbmap/.depend cpp/test/Freeze/evictor/.depend cpp/test/Freeze/oldevictor/.depend cpp/test/FreezeScript/dbmap/.depend cpp/test/FreezeScript/evictor/.depend cpp/test/Glacier2/attack/.depend cpp/test/Glacier2/dynamicFiltering/.depend cpp/test/Glacier2/router/.depend cpp/test/Glacier2/sessionControl/.depend cpp/test/Glacier2/ssl/.depend cpp/test/Glacier2/staticFiltering/.depend cpp/test/Ice/adapterDeactivation/.depend cpp/test/Ice/background/.depend cpp/test/Ice/binding/.depend cpp/test/Ice/checksum/.depend cpp/test/Ice/checksum/server/.depend cpp/test/Ice/custom/.depend cpp/test/Ice/exceptions/.depend cpp/test/Ice/facets/.depend cpp/test/Ice/faultTolerance/.depend cpp/test/Ice/gc/.depend cpp/test/Ice/hold/.depend cpp/test/Ice/inheritance/.depend cpp/test/Ice/interceptor/.depend cpp/test/Ice/location/.depend cpp/test/Ice/objects/.depend cpp/test/Ice/operations/.depend cpp/test/Ice/proxy/.depend cpp/test/Ice/retry/.depend cpp/test/Ice/servantLocator/.depend cpp/test/Ice/slicing/exceptions/.depend cpp/test/Ice/slicing/objects/.depend cpp/test/Ice/stream/.depend cpp/test/Ice/stringConverter/.depend cpp/test/Ice/timeout/.depend cpp/test/Ice/udp/.depend cpp/test/IceBox/configuration/.depend cpp/test/IceGrid/activation/.depend cpp/test/IceGrid/allocation/.depend cpp/test/IceGrid/deployer/.depend cpp/test/IceGrid/distribution/.depend cpp/test/IceGrid/replicaGroup/.depend cpp/test/IceGrid/replication/.depend cpp/test/IceGrid/session/.depend cpp/test/IceGrid/simple/.depend cpp/test/IceGrid/update/.depend cpp/test/IceSSL/configuration/.depend cpp/test/IceStorm/federation/.depend cpp/test/IceStorm/federation2/.depend cpp/test/IceStorm/rep1/.depend cpp/test/IceStorm/repgrid/.depend cpp/test/IceStorm/repstress/.depend cpp/test/IceStorm/single/.depend cpp/test/IceStorm/stress/.depend cpp/test/Slice/keyword/.depend cs/src/Ice/Instance.cs cs/src/IceSSL/ConnectorI.cs java/demo/book/simple_filesystem/Filesystem/DirectoryI.java java/demo/book/simple_filesystem/Filesystem/FileI.java java/src/IceInternal/TcpConnector.java java/src/IceSSL/ConnectorI.java py/modules/IcePy/.depend rb/src/IceRuby/.depend
Diffstat (limited to 'demoscript')
-rwxr-xr-xdemoscript/Freeze/transform.py1
-rwxr-xr-xdemoscript/Glacier2/callback.py3
-rw-r--r--demoscript/Ice/hello.py2
-rw-r--r--demoscript/Ice/protobuf.py30
-rw-r--r--demoscript/Ice/serialize.py40
-rw-r--r--demoscript/Util.py21
-rwxr-xr-xdemoscript/book/freeze_filesystem.py7
7 files changed, 90 insertions, 14 deletions
diff --git a/demoscript/Freeze/transform.py b/demoscript/Freeze/transform.py
index e37fd57b0c9..55136aaef3b 100755
--- a/demoscript/Freeze/transform.py
+++ b/demoscript/Freeze/transform.py
@@ -55,6 +55,7 @@ def run(createCmd, recreateCmd, readCmd, readnewCmd):
readnew.expect('All contacts \(default order\)')
readnew.expect('All contacts \(ordered by phone number\)')
readnew.expect('DbEnv \"dbnew\": Secondary index corrupt: not consistent with primary')
+ readnew.waitTestSuccess(1)
print "ok"
print "recreating database...",
diff --git a/demoscript/Glacier2/callback.py b/demoscript/Glacier2/callback.py
index 550306dc7ca..f0058a813ba 100755
--- a/demoscript/Glacier2/callback.py
+++ b/demoscript/Glacier2/callback.py
@@ -54,9 +54,9 @@ def run(client, server, sessionserver, glacier2):
sys.stdout.flush()
client.sendline('v')
client.sendline('t')
+ glacier2.expect('_fwd/t, _ovrd/some_value')
server.expect('initiating callback to')
client.expect('received callback')
- glacier2.expect('_fwd/t, _ovrd/some_value')
print "ok"
print "testing fake category...",
@@ -65,7 +65,6 @@ def run(client, server, sessionserver, glacier2):
client.sendline('F')
client.sendline('t')
server.expect('initiating callback to.*fake.*ObjectNotExistException')
- glacier2.expect('_fwd/t, _ovrd/some_value')
try:
client.expect('received callback', timeout=1)
except Expect.TIMEOUT:
diff --git a/demoscript/Ice/hello.py b/demoscript/Ice/hello.py
index a003b0c9598..a5a1624b9d3 100644
--- a/demoscript/Ice/hello.py
+++ b/demoscript/Ice/hello.py
@@ -59,7 +59,7 @@ def runtests(client, server, secure):
client.sendline('P')
client.expect('server delay is now set to 2500ms')
client.sendline('t')
- client.expect('.*TimeoutException.*', timeout=5)
+ client.expect('.*TimeoutException.*', timeout=10)
server.expect('Hello World!')
server.expect('Hello World!') # second because op is idempotent
client.sendline('P')
diff --git a/demoscript/Ice/protobuf.py b/demoscript/Ice/protobuf.py
new file mode 100644
index 00000000000..23ad94fc48d
--- /dev/null
+++ b/demoscript/Ice/protobuf.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2009 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 sys
+from demoscript import *
+from scripts import Expect
+
+def run(client, server):
+ print "testing...",
+ sys.stdout.flush()
+ client.sendline('t')
+ server.expect('Hello World from id: 1')
+ server.expect('name: "Fred Jones"')
+ server.expect('email: "fred@jones.com"')
+ print "ok"
+
+ print "shutting down...",
+ client.sendline('s')
+ server.waitTestSuccess()
+
+ client.sendline('x')
+ client.waitTestSuccess()
+ print "ok"
diff --git a/demoscript/Ice/serialize.py b/demoscript/Ice/serialize.py
new file mode 100644
index 00000000000..77a3ca03d29
--- /dev/null
+++ b/demoscript/Ice/serialize.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2009 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 sys
+from demoscript import *
+from scripts import Expect
+
+def runtests(client, server, secure):
+ print "testing greeting...",
+ sys.stdout.flush()
+ client.sendline('g')
+ server.expect('Hello there!')
+ client.sendline('g')
+ server.expect('Hello there!')
+ print "ok"
+
+ print "testing null greeting...",
+ sys.stdout.flush()
+ client.sendline('t')
+ client.sendline('g')
+ server.expect('Received null greeting')
+ client.sendline('g')
+ server.expect('Received null greeting')
+ print "ok"
+
+def run(client, server):
+ runtests(client, server, False)
+
+ client.sendline('s')
+ server.waitTestSuccess()
+
+ client.sendline('x')
+ client.waitTestSuccess()
diff --git a/demoscript/Util.py b/demoscript/Util.py
index bc5418248b7..d0352171e7d 100644
--- a/demoscript/Util.py
+++ b/demoscript/Util.py
@@ -33,6 +33,7 @@ from scripts import Expect
keepGoing = False
iceHome = None
x64 = False
+java2 = False
preferIPv4 = False
demoErrors = []
@@ -82,7 +83,10 @@ def configurePaths():
#
if iceHome == "/usr":
javaDir = os.path.join("/", "usr", "share", "java")
- addenv("CLASSPATH", os.path.join(javaDir, "Ice.jar"))
+ if java2:
+ addenv("CLASSPATH", os.path.join(javaDir, "Ice-java2.jar"))
+ else:
+ addenv("CLASSPATH", os.path.join(javaDir, "Ice.jar"))
addenv("CLASSPATH", "classes")
return # That's it, we're done!
@@ -306,13 +310,14 @@ def runDemos(start, args, demos, num = 0, script = False, root = False):
demoErrors.append(message)
-def run(demos, root = False):
+def run(demos, protobufDemos = [], root = False):
def usage():
print """usage: %s
--start=index Start running the demos at the given demo."
--loop Run the demos in a loop."
--filter=<regex> Run all the demos that match the given regex."
--rfilter=<regex> Run all the demos that do not match the given regex."
+ --protobuf Run the protobuf demos."
--debug Display debugging information on each demos."
--trace=<output> Run the demos with tracing enabled."
--host=host Set --Ice.Default.Host=<host>."
@@ -332,7 +337,7 @@ def run(demos, root = False):
try:
opts, args = getopt.getopt(sys.argv[1:], "lr:R:", [
"filter=", "rfilter=", "start=", "loop", "fast", "trace=", "debug", "host=", "mode=",
- "continue", "ice-home=", "x64", "preferIPv4", "env", "noenv", "script"])
+ "continue", "ice-home=", "x64", "java2", "preferIPv4", "env", "noenv", "script", "protobuf"])
except getopt.GetoptError:
usage()
@@ -376,6 +381,8 @@ def run(demos, root = False):
start = int(a)
elif o in '--script':
script = True
+ elif o in '--protobuf':
+ demos = demos + protobufDemos
for demoFilter, removeFilter in filters:
if removeFilter:
@@ -522,7 +529,7 @@ def processCmdLine():
print "usage: " + sys.argv[0] + " --x64 --preferIPv4 --env --noenv --fast --trace=output --debug --host host --mode=[debug|release] --ice-home=<dir>"
sys.exit(2)
try:
- opts, args = getopt.getopt(sys.argv[1:], "", ["env", "noenv", "x64", "preferIPv4", "fast", "trace=", "debug", "host=", "mode=", "ice-home="])
+ opts, args = getopt.getopt(sys.argv[1:], "", ["env", "noenv", "x64", "java2", "preferIPv4", "fast", "trace=", "debug", "host=", "mode=", "ice-home="])
except getopt.GetoptError:
usage()
@@ -531,6 +538,7 @@ def processCmdLine():
global tracefile
global buildmode
global x64
+ global java2
global preferIPv4
global debug
global host
@@ -540,6 +548,7 @@ def processCmdLine():
trace = False
buildmode = None
x64 = False
+ java2 = False
tracefile = None
env = False
noenv = False
@@ -562,13 +571,15 @@ def processCmdLine():
fast = True
if o == "--x64":
x64 = True
+ if o == "--java2":
+ java2 = True
if o == "--preferIPv4":
preferIPv4 = True
if o == "--ice-home":
iceHome = a
if o == "--mode":
buildmode = a
- if buildmode != 'debug' and mode != 'release':
+ if buildmode != 'debug' and buildmode != 'release':
usage()
if host != "":
diff --git a/demoscript/book/freeze_filesystem.py b/demoscript/book/freeze_filesystem.py
index 55f0f1d8764..bf9ea01f3de 100755
--- a/demoscript/book/freeze_filesystem.py
+++ b/demoscript/book/freeze_filesystem.py
@@ -14,17 +14,12 @@ def run(client, server):
print "testing...",
sys.stdout.flush()
client.expect('Created Coleridge/Kubla_Khan')
- server.expect('added')
client.expect('Contents of filesystem:')
- server.expect('added')
- server.expect('added')
- server.expect('locate')
- server.expect('locate')
client.expect('Down to a sunless sea')
- server.expect('locate')
client.expectall(['Destroying Coleridge', 'Destroying README'])
server.expect('removed object')
server.expect('removed object')
+ server.expect('removed object')
client.waitTestSuccess()
print "ok"