Changeset 4716 for TI12-security


Ignore:
Timestamp:
24/12/08 11:54:17 (11 years ago)
Author:
pjkersha
Message:

renamed data -> config

Location:
TI12-security/trunk/python/ndg.security.test
Files:
1 deleted
8 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/__init__.py

    r4680 r4716  
    44""" 
    55__author__ = "P J Kershaw" 
    6 __date__ = "15/03/07" 
     6__date__ = "24/12/08" 
    77__copyright__ = "(C) 2007 STFC" 
    88__license__ = \ 
     
    1111__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    1212__revision__ = '$Id$' 
     13 
     14import unittest 
     15import logging 
     16logging.basicConfig() 
     17 
     18import os 
     19from os.path import expandvars as xpdVars 
     20from os.path import join as jnPath 
     21 
     22 
     23class BaseTestCase(unittest.TestCase): 
     24    '''Convenience base class from which other unit tests can extend.  Its 
     25    sets the generic data directory path''' 
     26    dataDirEnvVarName = 'NDGSEC_UNITTEST_DATA_DIR' 
     27     
     28    def setUp(self): 
     29        if BaseTestCase.dataDirEnvVarName not in os.environ: 
     30            os.environ[BaseTestCase.dataDirEnvVarName] = \ 
     31                os.path.join(os.path.abspath(os.path.dirname(__file__)), 
     32                             'config') 
     33 
     34mkDataDirPath = lambda file:jnPath(os.environ[BaseTestCase.dataDirEnvVarName], 
     35                                   file) 
     36 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/attributeauthority/siteA/siteAMapConfig.xml

    r4713 r4716  
    22<AAmap> 
    33    <thisHost name="Site A"> 
    4                 <siteName>The A Centre for Research</siteName> 
     4                <siteName>A Centre for Research</siteName> 
    55        <aaURI>http://localhost:5000/AttributeAuthority</aaURI> 
    66        <loginURI>https://localhost/login</loginURI> 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/attributeauthority/test_attributeauthority.cfg

    r4680 r4716  
    1414# ! SiteBMapConfig.xml trusted site A aaURI setting must agree with this  
    1515# setting for test6GetMappedAttCert 
    16 propFilePath=$NDGSEC_AA_UNITTEST_DIR/siteA/siteAAttAuthority.cfg 
     16propFilePath=$NDGSEC_UNITTEST_DATA_DIR/attributeauthority/siteA/siteAAttributeAuthority.cfg 
    1717 
    1818# For https connections only.  !Omit ssl* settings if using http! 
     
    2020# same as peer hostname.  
    2121sslPeerCertCN = AttributeAuthority 
    22 sslCACertFilePathList = $NDGSEC_AA_UNITTEST_DIR/ca/ndg-test-ca.crt 
     22sslCACertFilePathList = $NDGSEC_UNITTEST_DATA_DIR/ca/ndg-test-ca.crt 
    2323 
    2424[test02GetTrustedHostInfo] 
     
    4646[test08GetMappedAttCertStressTest] 
    4747userAttCertFilePathList = $NDGSEC_AA_UNITTEST_DIR/ac-clnt.xml 
    48  
    49 [wsse] 
    50 # WS-Security settings for unit test AA clients 
    51 # 
    52 # OUTBOUND MESSAGE CONFIG 
    53  
    54 # Signature of an outbound message 
    55  
    56 # Certificate associated with private key used to sign a message.  The sign  
    57 # method will add this to the BinarySecurityToken element of the WSSE header.   
    58 signingCertFilePath=$NDGSEC_AA_UNITTEST_DIR/test.crt 
    59  
    60 # PEM encoded private key file 
    61 signingPriKeyFilePath=$NDGSEC_AA_UNITTEST_DIR/test.key 
    62  
    63 # Set the ValueType for the BinarySecurityToken added to the WSSE header for a 
    64 # signed message.  See __setReqBinSecTokValType method and binSecTokValType  
    65 # class variable for options - it may be one of X509, X509v3, X509PKIPathv1 or  
    66 # give full namespace to alternative - see  
    67 # ZSI.wstools.Namespaces.OASIS.X509TOKEN 
    68 # 
    69 # binSecTokValType determines whether signingCert or signingCertChain  
    70 # attributes will be used. 
    71 reqBinSecTokValType=X509v3 
    72  
    73 # Add a timestamp element to an outbound message 
    74 addTimestamp=True 
    75  
    76 # For WSSE 1.1 - service returns signature confirmation containing signature  
    77 # value sent by client 
    78 applySignatureConfirmation=False 
    79  
    80 # 
    81 # INBOUND MESSAGE CONFIG 
    82  
    83 # Provide a space separated list of file paths 
    84 caCertFilePathList=$NDGSEC_AA_UNITTEST_DIR/ca/ndg-test-ca.crt 
    85  
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/attributeauthority/test_attributeauthority.py

    r4680 r4716  
    2525mkPath = lambda file:jnPath(os.environ['NDGSEC_AA_UNITTEST_DIR'], file) 
    2626 
     27from ndg.security.test import BaseTestCase 
     28 
    2729from ndg.security.common.utils.configfileparsers import \ 
    2830    CaseSensitiveConfigParser 
     
    3335 
    3436 
    35 class AttributeAuthorityTestCase(unittest.TestCase): 
     37class AttributeAuthorityTestCase(BaseTestCase): 
    3638    clntPriKeyPwd = None 
    3739 
    3840    def setUp(self): 
    39  
     41        super(AttributeAuthorityTestCase, self).setUp() 
     42         
    4043        if 'NDGSEC_INT_DEBUG' in os.environ: 
    4144            import pdb 
     
    100103            for k, v in hostInfo.items(): 
    101104                self.assert_(k, "hostInfo value key unset") 
    102                 self.assert_(v, "%s value not set" % k) 
    103105                    
    104106        print("Trusted Host Info:\n %s" % trustedHostInfo) 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/attributeauthorityclient/test_attributeauthorityclient.py

    r4713 r4716  
    1818logging.basicConfig() 
    1919 
     20from ndg.security.test import BaseTestCase 
     21 
    2022from ndg.security.common.attributeauthority import AttributeAuthorityClient, \ 
    2123    NoMatchingRoleInTrustedHosts 
     
    3032 
    3133 
    32 class AttributeAuthorityClientTestCase(unittest.TestCase): 
     34class AttributeAuthorityClientTestCase(BaseTestCase): 
    3335    clntPriKeyPwd = None 
    3436    pemPat = "-----BEGIN CERTIFICATE-----[^\-]*-----END CERTIFICATE-----" 
     
    5355 
    5456    def setUp(self): 
    55  
     57        super(AttributeAuthorityClientTestCase, self).setUp() 
     58         
    5659        if 'NDGSEC_INT_DEBUG' in os.environ: 
    5760            import pdb 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/combinedservices/singleSignOnService/sso.cfg

    r4692 r4716  
    4949ignoreHttpProxyEnv: True 
    5050 
    51  
    5251# Flag to enable OpenID login 
    5352enableOpenID: True 
     53 
     54# Service addresses - connect to a remote service or provide a key to WSGI  
     55# environ for a service running locally.  See services.ini to get the key 
     56# names from the filterID options set 
     57#sessionMgrURI: http://localhost:8000/SessionManager 
     58sessionManagerEnvironKey = filter:SessionManagerFilter 
     59 
     60# If the Attribute Authority URI is commented out the service will try to  
     61# connect to an Attribute Authority instance in the local WSG stack 
     62#attributeAuthorityURI: http://localhost:8000/AttributeAuthority 
     63attributeAuthorityEnvironKey = filter:AttributeAuthorityFilter 
     64 
    5465 
    5566[WS-Security] 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/combinedservices/siteAAttributeAuthority/siteAMapConfig.xml

    r4587 r4716  
    22<AAmap> 
    33    <thisHost name="Site A"> 
     4                <siteName>A Centre for Research</siteName> 
    45        <aaURI>http://localhost:8000/AttributeAuthority</aaURI> 
    56        <loginURI>https://localhost/sso/login</loginURI> 
     
    2122    </trusted> 
    2223    <trusted name="Site D"> 
     24                <siteName>The D Research Laboratory</siteName> 
    2325        <aaURI>http://aa.sited.blah</aaURI> 
    2426        <loginURI>https://www.sited.blah/login</loginURI> 
  • TI12-security/trunk/python/ndg.security.test/setup.py

    r4680 r4716  
    2020 
    2121_pkgData = { 
    22     'ndg.security.test.attAuthority': ['*.xml',  
     22    'ndg.security.test.attributeauthority': [ 
     23        '*.xml',  
     24        '*.cfg',  
     25        'user.crt', 
     26        'user.key' 
     27    ], 
     28    'ndg.security.test.attributeauthority.siteA': [ 
     29        'siteA-aa.crt', 
     30        'siteA-aa.key', 
     31        '*.cfg', 
     32        '*.xml' 
     33    ], 
     34    'ndg.security.test.attributeauthority.siteB': [ 
     35        'siteB-aa.crt', 
     36        'siteB-aa.key', 
     37        '*.cfg', 
     38        '*.xml' 
     39    ], 
     40    'ndg.security.test.attributeuthority.ca': ['*.crt'], 
     41    'ndg.security.test.attributeauthorityclient': [ 
     42                                        '*.xml',  
    2343                                       '*.cfg',  
    2444                                       'test.crt', 
    2545                                       'test.key', 
    26                                        'siteA-aa.crt', 
    27                                        'siteA-aa.key', 
    28                                        'siteB-aa.crt', 
    29                                        'siteB-aa.key', 
    3046                                       'README'], 
    31     'ndg.security.test.attAuthority.ca': ['*.crt'], 
     47    'ndg.security.test.attributeuthorityclient.ca': ['*.crt'], 
     48    'ndg.security.test.attributeauthorityclient.siteA': [ 
     49        'siteA-aa.crt', 
     50        'siteA-aa.key', 
     51        '*.cfg', 
     52        '*.xml' 
     53    ], 
     54    'ndg.security.test.attributeauthorityclient.siteB': [ 
     55        'siteB-aa.crt', 
     56        'siteB-aa.key', 
     57        '*.cfg', 
     58        '*.xml' 
     59    ], 
    3260    'ndg.security.test.attCert': ['*.xml', 
    3361                                  '*.cfg', 
Note: See TracChangeset for help on using the changeset viewer.