source: TI12-security/trunk/python/ndg.security.test/ndg/security/test/attAuthority/siteAServer.py @ 4140

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.test/ndg/security/test/attAuthority/siteAServer.py@4140
Revision 4140, 2.1 KB checked in by cbyrom, 12 years ago (diff)

Fix property keywords in test cases - since these don't use the Case Sensitive parse
the names need to be lowercased.

  • Property svn:executable set to *
Line 
1#!/usr/bin/env python
2"""Site 'A' 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.twistd import run
25    #from twisted.scripts._twistw import run
26else:
27    from twisted.scripts.twistd import run
28
29from tempfile import mkstemp
30
31if 'NDGSEC_AACLNT_UNITTEST_DIR' not in os.environ:
32    os.environ['NDGSEC_AACLNT_UNITTEST_DIR'] = \
33                        os.path.abspath(os.path.dirname(__file__))
34   
35if 'NDGSEC_AA_PROPFILEPATH' not in os.environ:
36    os.environ['NDGSEC_AA_PROPFILEPATH'] = \
37                        os.path.join(os.environ['NDGSEC_AACLNT_UNITTEST_DIR'],
38#                                     "siteAAttAuthority.cfg")
39                                     "siteAAttAuthorityProperties.xml")
40   
41if 'NDGSEC_DIR' in os.environ:
42    tacFilePath=os.path.join(os.environ['NDGSEC_DIR'],
43                             "conf",
44                             "attAuthority.tac")
45else:
46    import pkg_resources
47    eggConfigDir=pkg_resources.resource_filename('ndg.security.server','conf')
48    os.environ['NDGSEC_DIR'] = os.path.dirname(eggConfigDir)
49    tacFilePath = os.path.join(eggConfigDir, "attAuthority.tac")
50
51# NB, pid not required on windows - this just causes an error to be thrown
52if platformType != "win32":
53    sys.argv += ["--pidfile=twistd-%d.pid" % os.getpid()]
54sys.argv += ["-noy", tacFilePath]   
55print "Running: %s" %sys.argv
56run()
Note: See TracBrowser for help on using the repository browser.