ICE 3.4.2
[php5-ice-freebsdport.git] / cpp / test / IceGrid / session / run.py
blob2f9e95a01d4361aed564cd4673c091e4783f20f3
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 if not TestUtil.isWin32() and os.getuid() == 0:
24 print
25 print "*** can't run test as root ***"
26 print
27 sys.exit(0)
29 name = os.path.join("IceGrid", "session")
31 node1Dir = os.path.join(os.getcwd(), "db", "node-1")
32 if not os.path.exists(node1Dir):
33 os.mkdir(node1Dir)
34 else:
35 IceGridAdmin.cleanDbDir(node1Dir)
37 print "starting admin permissions verifier...",
38 verifierProc = TestUtil.startServer(os.path.join(os.getcwd(), "verifier"), config=TestUtil.DriverConfig("server"))
39 print "ok"
41 IceGridAdmin.registryOptions += \
42 r' --IceGrid.Registry.DynamicRegistration' + \
43 r' --IceGrid.Registry.SessionFilters' + \
44 r' --IceGrid.Registry.AdminSessionFilters' + \
45 r' --IceGrid.Registry.PermissionsVerifier="ClientPermissionsVerifier"' + \
46 r' --IceGrid.Registry.AdminPermissionsVerifier="AdminPermissionsVerifier:tcp -p 12002"'+ \
47 r' --IceGrid.Registry.SSLPermissionsVerifier="SSLPermissionsVerifier"'
49 IceGridAdmin.iceGridTest("application.xml",
50 '--IceBinDir="%s" --TestDir="%s"' % (TestUtil.getCppBinDir(), os.getcwd()),
51 'properties-override=\'%s\'' % IceGridAdmin.iceGridNodePropertiesOverride())
53 verifierProc.waitTestSuccess()