summaryrefslogtreecommitdiff
path: root/demoscript/IceGrid
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2007-08-24 14:41:39 +0800
committerMatthew Newhook <matthew@zeroc.com>2007-08-24 14:41:39 +0800
commit9ff48829c8669fbef8c7ca6a9b8bab99c77db2f9 (patch)
tree7fa0a0406be0386a8314b2e8c742f29bf127b70d /demoscript/IceGrid
parentMerge branch 'bug1319' (diff)
downloadice-9ff48829c8669fbef8c7ca6a9b8bab99c77db2f9.tar.bz2
ice-9ff48829c8669fbef8c7ca6a9b8bab99c77db2f9.tar.xz
ice-9ff48829c8669fbef8c7ca6a9b8bab99c77db2f9.zip
Squashed commit of the following:
commit d74cec9e6c77e70b33883f517b1bb6f97b2ffa5e Author: Matthew Newhook <matthew@zeroc.com> Date: Fri Aug 24 14:33:06 2007 +0800 updates. commit 643b31f979a00ea5397206ca59f20bb58c62660e Author: Matthew Newhook <matthew@zeroc.com> Date: Fri Aug 24 14:32:35 2007 +0800 added some .gitignore rules. commit 1510d38798976753b435f32308e79acd9fcd2722 Author: Matthew Newhook <matthew@zeroc.com> Date: Fri Aug 24 14:05:10 2007 +0800 removed bogus use of 127.0.0.1 commit 3c91e89b01af20a0dacfdbc1fbeca1c67c796656 Author: Matthew Newhook <matthew@zeroc.com> Date: Fri Aug 24 14:01:43 2007 +0800 Verify that cygwin python is used under Windows. commit ff160725c051eedb28a42d9dd69f0d8aa297e522 Author: Matthew Newhook <matthew@zeroc.com> Date: Fri Aug 24 13:55:03 2007 +0800 bump timeout for the node to terminate. killing the node leaves the servers running under cygwin commit ec3bddb58e861f906bf39aee1fa818c3e9a50000 Author: Matthew Newhook <matthew@zeroc.com> Date: Fri Aug 24 13:48:55 2007 +0800 added back accidently removed files. commit f9ea2f552d7f576ebfa878669925f4184a89257b Author: Matthew Newhook <matthew@zeroc.com> Date: Fri Aug 24 13:47:47 2007 +0800 http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=2427, http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=2422 commit 8a309ca0036dba7ecbd577edb2d737fa41174a5a Author: Matthew Newhook <matthew@zeroc.com> Date: Fri Aug 24 10:06:53 2007 +0800 added ruby support to the expect scripts. commit 34597c1ee6d80d6754c9e925bd376125dd104a5f Author: Matthew Newhook <matthew@zeroc.com> Date: Fri Aug 24 09:26:10 2007 +0800 added pexpect to git repository. commit 4bd2e1f2b52bcb9906b03ac216db686b8229b545 Author: Matthew Newhook <matthew@zeroc.com> Date: Thu Aug 23 18:49:51 2007 +0800 numerous UNIX expect script fixes. commit 25ab4a812f45a6e908d5d2d7ab03e557d79afa9f Author: Matthew Newhook <matthew@zeroc.com> Date: Thu Aug 23 16:47:08 2007 +0800 generate configuration files for IceGrid icebox/iceboxd commit 6bb57bf7ed21d7256963c228aaf0b20657367a47 Author: Matthew Newhook <matthew@zeroc.com> Date: Thu Aug 23 15:16:55 2007 +0800 added python & C# support to the expect scripts. commit 08f1a59971ad3a52a4357069554dcc309b2d062b Author: Matthew Newhook <matthew@zeroc.com> Date: Wed Aug 22 14:23:53 2007 +0800 java expect scripts complete. commit 3918f4ff3beea3005001bc55c5502c0825d8b7ea Author: Matthew Newhook <matthew@zeroc.com> Date: Wed Aug 22 13:30:31 2007 +0800 first set of expect changes.
Diffstat (limited to 'demoscript/IceGrid')
-rwxr-xr-xdemoscript/IceGrid/allocate.py24
-rwxr-xr-xdemoscript/IceGrid/sessionActivation.py14
-rwxr-xr-xdemoscript/IceGrid/simple.py42
3 files changed, 32 insertions, 48 deletions
diff --git a/demoscript/IceGrid/allocate.py b/demoscript/IceGrid/allocate.py
index 25e08e20819..134aee21181 100755
--- a/demoscript/IceGrid/allocate.py
+++ b/demoscript/IceGrid/allocate.py
@@ -8,7 +8,8 @@
#
# **********************************************************************
-import pexpect, sys, demoscript
+import sys, demoscript
+import demoscript.pexpect as pexpect
def run(clientCmd):
print "cleaning databases...",
@@ -58,8 +59,7 @@ def run(clientCmd):
node.expect('says Hello World!')
client2.expect(pexpect.TIMEOUT, timeout = 0)
client1.sendline('x')
- client1.expect(pexpect.EOF, timeout=1)
- assert client1.wait() == 0
+ client1.waitTestSuccess(timeout=1)
client2.expect('==>')
client2.sendline('t')
@@ -67,8 +67,7 @@ def run(clientCmd):
client2.sendline('s')
node.expect('detected termination of server')
client2.sendline('x')
- client2.expect(pexpect.EOF, timeout=1)
- assert client2.wait() == 0
+ client2.waitTestSuccess(timeout=1)
print "ok"
print "deploying multiple...",
@@ -109,8 +108,7 @@ def run(clientCmd):
client3.expect(pexpect.TIMEOUT, timeout = 0)
client1.sendline('x')
- client1.expect(pexpect.EOF, timeout=1)
- assert client1.wait() == 0
+ client1.waitTestSuccess(timeout=1)
client3.expect('==>')
client3.sendline('t')
@@ -121,20 +119,16 @@ def run(clientCmd):
client2.sendline('s')
node.expect('detected termination of server')
client2.sendline('x')
- client2.expect(pexpect.EOF, timeout=1)
- assert client2.wait() == 0
+ client2.waitTestSuccess(timeout=1)
client3.sendline('s')
node.expect('detected termination of server')
client3.sendline('x')
- client3.expect(pexpect.EOF, timeout=1)
- assert client3.wait() == 0
+ client3.waitTestSuccess(timeout=1)
print "ok"
admin.sendline('registry shutdown Master')
admin.sendline('exit')
- admin.expect(pexpect.EOF)
- assert admin.wait() == 0
- node.expect(pexpect.EOF)
- assert node.wait() == 0
+ admin.waitTestSuccess()
+ node.waitTestSuccess()
diff --git a/demoscript/IceGrid/sessionActivation.py b/demoscript/IceGrid/sessionActivation.py
index d0d2609162b..d634438470c 100755
--- a/demoscript/IceGrid/sessionActivation.py
+++ b/demoscript/IceGrid/sessionActivation.py
@@ -8,7 +8,7 @@
#
# **********************************************************************
-import pexpect, sys, demoscript
+import sys, demoscript
def run(clientCmd):
print "cleaning databases...",
@@ -49,8 +49,7 @@ def run(clientCmd):
client.sendline('t')
node.expect('says Hello World!')
client.sendline('x')
- client.expect(pexpect.EOF, timeout=1)
- assert client.wait() == 0
+ client.waitTestSuccess(timeout=1)
node.expect('detected termination of server')
client = demoscript.Util.spawn(clientCmd)
@@ -63,15 +62,12 @@ def run(clientCmd):
client.sendline('t')
node.expect('says Hello World!')
client.sendline('x')
- client.expect(pexpect.EOF, timeout=1)
- assert client.wait() == 0
+ client.waitTestSuccess(timeout=1)
node.expect('detected termination of server')
print "ok"
admin.sendline('registry shutdown Master')
admin.sendline('exit')
- admin.expect(pexpect.EOF)
- assert admin.wait() == 0
- node.expect(pexpect.EOF)
- assert node.wait() == 0
+ admin.waitTestSuccess()
+ node.waitTestSuccess()
diff --git a/demoscript/IceGrid/simple.py b/demoscript/IceGrid/simple.py
index c40b38385b7..400c1461988 100755
--- a/demoscript/IceGrid/simple.py
+++ b/demoscript/IceGrid/simple.py
@@ -8,9 +8,9 @@
#
# **********************************************************************
-import pexpect, sys, demoscript
+import sys, demoscript
-def run(clientStr):
+def run(clientStr, desc = 'application'):
print "cleaning databases...",
sys.stdout.flush()
demoscript.Util.cleanDbDir("db/node")
@@ -24,15 +24,16 @@ def run(clientStr):
print "starting icegridnode...",
sys.stdout.flush()
- node = demoscript.Util.spawn('icegridnode --Ice.Config=config.grid --Ice.PrintAdapterReady %s' % (args))
+ node = demoscript.Util.spawn('icegridnode --Ice.Config=config.grid --Ice.PrintAdapterReady %s' % (args),
+ language="C++")
node.expect('IceGrid.Registry.Internal ready\r{1,2}\nIceGrid.Registry.Server ready\r{1,2}\nIceGrid.Registry.Client ready\r{1,2}\nIceGrid.Node ready')
print "ok"
print "deploying application...",
sys.stdout.flush()
- admin = demoscript.Util.spawn('icegridadmin --Ice.Config=config.grid')
+ admin = demoscript.Util.spawn('icegridadmin --Ice.Config=config.grid', language="C++")
admin.expect('>>>')
- admin.sendline("application add \'application.xml\'")
+ admin.sendline("application add \'%s.xml\'" %(desc))
admin.expect('>>>')
print "ok"
@@ -48,13 +49,12 @@ def run(clientStr):
node.expect("detected termination of.*SimpleServer")
client.sendline('x')
- client.expect(pexpect.EOF, timeout=1)
- assert client.wait() == 0
+ client.waitTestSuccess(timeout=1)
print "ok"
print "deploying template...",
sys.stdout.flush()
- admin.sendline("application update \'application_with_template.xml\'")
+ admin.sendline("application update \'%s_with_template.xml\'" % (desc))
admin.expect('>>>')
print "ok"
@@ -70,20 +70,19 @@ def run(clientStr):
node.expect("detected termination of.*SimpleServer-[123]")
client.sendline('x')
- client.expect(pexpect.EOF, timeout=1)
- assert client.wait() == 0
+ client.waitTestSuccess(timeout=1)
print "ok"
print "deploying replicated version...",
sys.stdout.flush()
- admin.sendline("application update \'application_with_replication.xml\'")
+ admin.sendline("application update \'%s_with_replication.xml\'" %(desc))
admin.expect('>>> ')
print "ok"
print "testing client...",
sys.stdout.flush()
- client = demoscript.Util.spawn(clientStr + ' --Ice.Default.Host=127.0.0.1')
+ client = demoscript.Util.spawn(clientStr)
client.expect('==>')
client.sendline('t')
node.expect("SimpleServer-1 says Hello World!")
@@ -92,10 +91,9 @@ def run(clientStr):
client.sendline('s')
node.expect("detected termination of.*SimpleServer-1")
client.sendline('x')
- client.expect(pexpect.EOF, timeout=1)
- assert client.wait() == 0
+ client.waitTestSuccess(timeout=1)
- client = demoscript.Util.spawn(clientStr + ' --Ice.Default.Host=127.0.0.1')
+ client = demoscript.Util.spawn(clientStr)
client.expect('==>')
client.sendline('t')
node.expect("SimpleServer-2 says Hello World!")
@@ -104,10 +102,9 @@ def run(clientStr):
client.sendline('s')
node.expect("detected termination of.*SimpleServer-2")
client.sendline('x')
- client.expect(pexpect.EOF, timeout=1)
- assert client.wait() == 0
+ client.waitTestSuccess(timeout=1)
- client = demoscript.Util.spawn(clientStr + ' --Ice.Default.Host=127.0.0.1')
+ client = demoscript.Util.spawn(clientStr)
client.expect('==>')
client.sendline('t')
node.expect("SimpleServer-3 says Hello World!")
@@ -116,14 +113,11 @@ def run(clientStr):
client.sendline('s')
node.expect("detected termination of.*SimpleServer-3")
client.sendline('x')
- client.expect(pexpect.EOF, timeout=1)
- assert client.wait() == 0
+ client.waitTestSuccess(timeout=1)
print "ok"
admin.sendline('registry shutdown Master')
admin.sendline('exit')
- admin.expect(pexpect.EOF)
- assert admin.wait() == 0
- node.expect(pexpect.EOF)
- assert node.wait() == 0
+ admin.waitTestSuccess()
+ node.waitTestSuccess()