source: TI12-security/trunk/python/ndg.security.test/ndg/security/test/attributeauthorityclient/wsgi/siteBServerApp.py @ 4404

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.test/ndg/security/test/attributeauthorityclient/wsgi/siteBServerApp.py@4404
Revision 4404, 1.7 KB checked in by pjkersha, 12 years ago (diff)

Updated contact e-mail address

  • Property svn:executable set to *
Line 
1#!/usr/bin/env python
2"""NDG Security Attribute Authority test harness for unit test site 'A'
3
4NERC Data Grid Project
5
6This software may be distributed under the terms of the Q Public License,
7version 1.0 or later.
8"""
9__author__ = "P J Kershaw"
10__date__ = "24/09/08"
11__copyright__ = "(C) 2008 STFC & NERC"
12__contact__ = "Philip.Kershaw@stfc.ac.uk"
13__revision__ = "$Id$"
14import os
15
16def infoApp(environ, start_response):
17    start_response('200 OK', [('Content-type', 'text/plain')])
18    return "NDG Security Attribute Authority Unit Tests: Site B Server"
19
20def app_factory(global_config, **local_conf):
21    return infoApp
22
23
24# Initialize environment for unit tests
25if 'NDGSEC_AACLNT_UNITTEST_DIR' not in os.environ:
26    os.environ['NDGSEC_AACLNT_UNITTEST_DIR'] = \
27                    os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
28   
29if 'NDGSEC_AA_PROPFILEPATH' not in os.environ:
30    os.environ['NDGSEC_AA_PROPFILEPATH'] = \
31                        os.path.join(os.environ['NDGSEC_AACLNT_UNITTEST_DIR'],
32                                     "siteBAttAuthorityProperties.xml")
33
34# To start the Site B Attribute Authority run
35# $ paster serve site-b.ini or run this file as a script
36# $ ./siteBServerApp.py [port #]
37if __name__ == '__main__':
38    import sys
39    import logging
40    logging.basicConfig(level=logging.DEBUG)
41
42    if len(sys.argv) > 1:
43        port = int(sys.argv[1])
44    else:
45        port = 5100
46       
47    cfgFilePath = os.path.join(os.path.dirname(os.path.abspath(__file__)),
48                               'site-b.ini')
49       
50    from paste.httpserver import serve
51    from paste.deploy import loadapp
52
53    app = loadapp('config:%s' % cfgFilePath)
54    serve(app, host='0.0.0.0', port=port)
Note: See TracBrowser for help on using the repository browser.