ICE 3.4.2
[php5-ice-freebsdport.git] / java / test / Glacier2 / sessionHelper / run.py
blob14f5444fa0af5713a9e57158320b59025ea89c91
1 #!/usr/bin/env python
2 # **********************************************************************
4 # Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
6 # This copy of Ice is licensed to you under the terms described in the
7 # ICE_LICENSE file included in this distribution.
9 # **********************************************************************
11 import os, sys
13 path = [ ".", "..", "../..", "../../..", "../../../.." ]
14 head = os.path.dirname(sys.argv[0])
15 if len(head) > 0:
16 path = [os.path.join(head, p) for p in path]
17 path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
18 if len(path) == 0:
19 raise "can't find toplevel directory!"
20 sys.path.append(os.path.join(path[0]))
21 from scripts import *
23 router = os.path.join(TestUtil.getCppBinDir(), "glacier2router")
25 args = ' --Ice.Warn.Dispatch=0' + \
26 ' --Ice.Warn.Connections=0' + \
27 ' --Glacier2.SessionTimeout="30"' + \
28 ' --Glacier2.Client.Endpoints="default -p 12347"' + \
29 ' --Glacier2.Server.Endpoints="tcp -h 127.0.0.1"' \
30 ' --Ice.Admin.Endpoints="tcp -h 127.0.0.1 -p 12348"' + \
31 ' --Ice.Admin.InstanceName=Glacier2' + \
32 ' --Glacier2.CryptPasswords="' + os.path.join(os.getcwd(), "passwords") + '"'
34 print "starting router...",
35 routerConfig = TestUtil.DriverConfig("server")
36 routerConfig.lang = "cpp"
37 starterProc = TestUtil.startServer(router, args, count=2, config=routerConfig)
38 print "ok"
42 TestUtil.clientServerTest(additionalClientOptions=" --shutdown")
44 starterProc.waitTestSuccess()