source: TI12-security/trunk/python/ndg.security.test/ndg/security/test/attAuthority/siteBServer.py @ 3189

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.test/ndg/security/test/attAuthority/siteBServer.py@3189
Revision 3189, 1.8 KB checked in by pjkersha, 13 years ago (diff)

Improvements to Attribute Authority SOAP client unit tests. Tests now include test PKI files

security/python/ndg.security.test/ndg/security/test/attAuthority/AttAuthorityClient.py,
security/python/ndg.security.test/ndg/security/test/attAuthority/attAuthorityClient.cfg:

  • improved comments and added NDGSEC_AACLNT_UNITTEST_DIR env to enable running of tests from any dir
  • simplified WSSE settings for use of proxy cert / non-proxy cert.

security/python/ndg.security.test/ndg/security/test/attAuthority/siteAServer.py,
security/python/ndg.security.test/ndg/security/test/attAuthority/siteBServer.py:
replace equivalent .sh shell scripts with python equivalents based on a hack of twistd source code.

security/python/ndg.security.test/ndg/security/test/attAuthority/siteAServer.sh,
security/python/ndg.security.test/ndg/security/test/attAuthority/siteBServer.sh:
removed and replaced with above python versions.

  • Property svn:executable set to *
Line 
1#!/usr/bin/env python
2"""Site 'B' Attribute Authority server start-up script for unit test - replaces
3former bash script
4
5NERC Data Grid Project
6"""
7__author__ = "P J Kershaw"
8__date__ = "07/01/08"
9__copyright__ = "(C) 2007 STFC & NERC"
10__license__ = \
11"""This software may be distributed under the terms of the Q Public
12License, version 1.0 or later."""
13__contact__ = "P.J.Kershaw@rl.ac.uk"
14__revision__ = '$Id:$'
15import sys, os, string
16if string.find(os.path.abspath(sys.argv[0]), os.sep+'Twisted') != -1:
17    sys.path.insert(0, os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), os.pardir, os.pardir)))
18if hasattr(os, "getuid") and os.getuid() != 0:
19    sys.path.insert(0, os.path.abspath(os.getcwd()))
20### end of preamble
21
22from twisted.python.runtime import platformType
23if platformType == "win32":
24    from twisted.scripts._twistw import run
25else:
26    from twisted.scripts.twistd import run
27
28from tempfile import mkstemp
29
30if 'NDGSEC_AACLNT_UNITTEST_DIR' not in os.environ:
31    os.environ['NDGSEC_AACLNT_UNITTEST_DIR'] = \
32                        os.path.abspath(os.path.dirname(__file__))
33   
34if 'NDGSEC_AA_PROPFILEPATH' not in os.environ:
35    os.environ['NDGSEC_AA_PROPFILEPATH'] = \
36                        os.path.join(os.environ['NDGSEC_AACLNT_UNITTEST_DIR'],
37                                     "siteBAttAuthorityProperties.xml")
38   
39if 'NDGSEC_DIR' in os.environ:
40    tacFilePath=os.path.join(os.environ['NDGSEC_DIR'],
41                             "conf",
42                             "attAuthority.tac")
43else:
44    import pkg_resources
45    eggConfigDir=pkg_resources.resource_filename('ndg.security.server','conf')
46    os.environ['NDGSEC_DIR'] = os.path.dirname(eggConfigDir)
47    tacFilePath = os.path.join(eggConfigDir, "attAuthority.tac")
48
49sys.argv += ["--pidfile=twistd-%d.pid" % os.getpid(), "-noy", tacFilePath]
50run()
Note: See TracBrowser for help on using the repository browser.