Changeset 5290


Ignore:
Timestamp:
14/05/09 16:42:36 (10 years ago)
Author:
pjkersha
Message:

Reworking unit tests

Location:
TI12-security/trunk/python
Files:
3 added
52 edited

Legend:

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

    r5280 r5290  
    125125                       [('Content-type', contentType), 
    126126                        ('Content-Length', str(len(response)))]) 
    127         return response 
     127        return [response] 
    128128         
    129129    @staticmethod 
  • TI12-security/trunk/python/ndg.security.server/ndg/security/server/wsgi/authn.py

    r5285 r5290  
    119119         
    120120        else: 
    121             # Retrieve OpenID response parameters and set a Forbidden response 
    122             # to trigger the PEP to check to see if the requested URI is a  
    123             # secured one 
    124              
    125             def set403Response(status, header, exc_info=None): 
    126                 return start_response(self.getStatusMessage(403), 
    127                                       header, 
    128                                       exc_info) 
    129                  
    130             return self._app(environ, set403Response)             
     121            # Set a Forbidden response to trigger the PEP to check to see if  
     122            # the requested URI is a secured one 
     123             
     124#            def set403Response(status, header, exc_info=None): 
     125#                return start_response(self.getStatusMessage(403), 
     126#                                      header, 
     127#                                      exc_info) 
     128#                 
     129#            return self._app(environ, set403Response)  
     130            return self._setErrorResponse(code=403)            
    131131    
    132132    def _setRedirectURI(self, uri): 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/__init__.py

    r4840 r5290  
    1 """NDG Security Unit test package 
     1"""NDG Security test package 
    22 
    33NERC Data Grid Project 
     
    99__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    1010__revision__ = '$Id$' 
    11  
    12 import unittest 
    13 import logging 
    14 logging.basicConfig() 
    15  
    16 import os 
    17 from os.path import expandvars as xpdVars 
    18 from os.path import join as jnPath 
    19  
    20  
    21 class BaseTestCase(unittest.TestCase): 
    22     '''Convenience base class from which other unit tests can extend.  Its 
    23     sets the generic data directory path''' 
    24     configDirEnvVarName = 'NDGSEC_UNITTEST_CONFIG_DIR' 
    25      
    26     def setUp(self): 
    27         if BaseTestCase.configDirEnvVarName not in os.environ: 
    28             os.environ[BaseTestCase.configDirEnvVarName] = \ 
    29                 os.path.join(os.path.abspath(os.path.dirname(__file__)), 
    30                              'config') 
    31  
    32 mkDataDirPath = lambda file:jnPath(os.environ[BaseTestCase.configDirEnvVarName], 
    33                                    file) 
    34  
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/config/README

    r4692 r5290  
    1 This folder contains data used for the unit tests. 
     1This folder contains data and services used for the unit and integration  
     2tests. 
     3 - attributeauthority/ - two attribute authority test services: 
     4     sitea/ 
     5     siteb/ 
    26 - pki/ - X.509 certificates and private keys used to secure services 
    37     ca/ - CA certificates 
     8 - sessionmanager/ - Session Manager test service 
    49      
    510P J Kershaw 19/12/08 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/config/attributeauthority/sitea/site-a.ini

    r4777 r5290  
    5050attributeAuthority.signingPriKeyFilePath: %(here)s/siteA-aa.key 
    5151attributeAuthority.signingCertFilePath: %(here)s/siteA-aa.crt 
    52 attributeAuthority.caCertFilePathList: $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     52attributeAuthority.caCertFilePathList: $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    5353 
    5454[server:main] 
     
    132132 
    133133# Provide a space separated list of file paths 
    134 caCertFilePathList=$NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    135 #caCertFilePathList=$NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt $NDGSEC_UNITTEST_CONFIG_DIR/ca/java-ca.crt 
     134caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     135#caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt $NDGSEC_TEST_CONFIG_DIR/ca/java-ca.crt 
    136136 
    137137 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/config/attributeauthority/sitea/siteAAttributeAuthority.cfg

    r4777 r5290  
    3535signingPriKeyFilePath: %(here)s/siteA-aa.key 
    3636signingCertFilePath: %(here)s/siteA-aa.crt 
    37 caCertFilePathList: $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     37caCertFilePathList: $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    3838 
    3939# Location of role mapping file 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/config/attributeauthority/sitea/siteAServerApp.py

    r4855 r5290  
    2020    return infoApp 
    2121 
    22 from ndg.security.test import BaseTestCase 
     22from ndg.security.test.unit import BaseTestCase 
    2323 
    2424# Initialize environment for unit tests 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/config/attributeauthority/siteb/site-b.ini

    r4777 r5290  
    5050attributeAuthority.signingPriKeyFilePath: %(here)s/siteB-aa.key 
    5151attributeAuthority.signingCertFilePath: %(here)s/siteB-aa.crt 
    52 attributeAuthority.caCertFilePathList: $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     52attributeAuthority.caCertFilePathList: $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    5353 
    5454[server:main] 
     
    128128 
    129129# Provide a space separated list of file paths 
    130 caCertFilePathList=$NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     130caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    131131 
    132132# Logging configuration 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/config/attributeauthority/siteb/siteBAttAuthority.cfg

    r4777 r5290  
    3131signingPriKeyFilePath: %(here)s/siteB-aa.key 
    3232signingCertFilePath: %(here)s/siteB-aa.crt 
    33 caCertFilePathList: $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     33caCertFilePathList: $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    3434 
    3535# Location of role mapping file 
     
    5353# The CA certificates of other NDG trusted sites should go here.  NB, multiple 
    5454# values should be delimited by a space 
    55 caCertFilePathList: $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt $NDGSEC_UNITTEST_CONFIG_DIR/ca/cacert.pem 
     55caCertFilePathList: $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt $NDGSEC_TEST_CONFIG_DIR/ca/cacert.pem 
    5656 
    5757# Signature of an outbound message 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/config/attributeauthority/siteb/siteBServerApp.py

    r4855 r5290  
    2020    return infoApp 
    2121 
    22 from ndg.security.test import BaseTestCase 
     22from ndg.security.test.unit import BaseTestCase 
    2323 
    2424# Initialize environment for unit tests 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/config/sessionmanager/session-manager.ini

    r4777 r5290  
    3232# Directory containing CA cert.s to verify SSL peer cert against - ignored if  
    3333# useSSL is blank  
    34 #sessionManager.sslCACertDir: $NDGSEC_UNITTEST_CONFIG_DIR/ca 
     34#sessionManager.sslCACertDir: $NDGSEC_TEST_CONFIG_DIR/ca 
    3535 
    3636# Credential Wallet Settings - global to all user sessions 
    3737# 
    3838# CA certificates for Attribute Certificate signature validation 
    39 sessionManager.credentialWallet.caCertFilePathList=$NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     39sessionManager.credentialWallet.caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    4040 
    4141# CA certificates for SSL connection peer cert. validation - required if 
    4242# connecting to an Attribute Authority over SSL 
    43 sessionManager.credentialWallet.sslCACertFilePathList=$NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     43sessionManager.credentialWallet.sslCACertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    4444 
    4545# Allow Get Attribute Certificate calls to try to get a mapped certificate 
     
    7070# The CA certificates of other NDG trusted sites should go here.  NB, multiple 
    7171# values should be delimited by a space 
    72 sessionManager.credentialWallet.wssecurity.caCertFilePathList: $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     72sessionManager.credentialWallet.wssecurity.caCertFilePathList: $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    7373 
    7474# Signature of an outbound message 
     
    105105# Specific settings for UserCertAuthN Session Manager authentication plugin 
    106106# This sets up PKI credentials for a single test account 
    107 sessionManager.authNService.userX509CertFilePath: $NDGSEC_UNITTEST_CONFIG_DIR/pki/user.crt 
    108 sessionManager.authNService.userPriKeyFilePath: $NDGSEC_UNITTEST_CONFIG_DIR/pki/user.key 
     107sessionManager.authNService.userX509CertFilePath: $NDGSEC_TEST_CONFIG_DIR/pki/user.crt 
     108sessionManager.authNService.userPriKeyFilePath: $NDGSEC_TEST_CONFIG_DIR/pki/user.key 
    109109sessionManager.authNService.userPriKeyPwd: testpassword 
    110110 
     
    195195 
    196196# Provide a space separated list of file paths 
    197 caCertFilePathList=$NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt  
    198 #caCertFilePathList=$NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt $NDGSEC_UNITTEST_CONFIG_DIR/ca/java-ca.crt 
     197caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt  
     198#caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt $NDGSEC_TEST_CONFIG_DIR/ca/java-ca.crt 
    199199 
    200200 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/config/sessionmanager/sessionManagerServerApp.py

    r4855 r5290  
    2020    return infoApp 
    2121 
    22 from ndg.security.test import BaseTestCase 
     22from ndg.security.test.unit import BaseTestCase 
    2323 
    2424# Initialize environment for unit tests 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/integration/combinedservices/serverapp.py

    r5181 r5290  
    168168 
    169169     
    170 from ndg.security.test import BaseTestCase 
     170from ndg.security.test.unit import BaseTestCase 
    171171 
    172172# Initialize environment for unit tests 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/integration/combinedservices/singlesignonservice/sso.cfg

    r4909 r5290  
    3535# must verify against at least one of these otherwise the connection is  
    3636# dropped. 
    37 sslCACertFilePathList: $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     37sslCACertFilePathList: $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    3838 
    3939# Web Services HTTP Proxy fine tuning  
     
    7777 
    7878# file path PEM encoded cert  
    79 signingCertFilePath=$NDGSEC_UNITTEST_CONFIG_DIR/pki/wsse-clnt.crt 
     79signingCertFilePath=$NDGSEC_TEST_CONFIG_DIR/pki/wsse-clnt.crt 
    8080 
    8181# file path to PEM encoded private key file 
    82 signingPriKeyFilePath=$NDGSEC_UNITTEST_CONFIG_DIR/pki/wsse-clnt.key 
     82signingPriKeyFilePath=$NDGSEC_TEST_CONFIG_DIR/pki/wsse-clnt.key 
    8383 
    8484# Password protecting private key.  Leave blank if there is no password. 
     
    9393# Provide a space separated list of file paths.  CA Certs should be included  
    9494# for all the sites this installation trusts 
    95 caCertFilePathList=$NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     95caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    9696 
    9797# Set the ValueType for the BinarySecurityToken added to the WSSE header for a 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/integration/combinedservices/test_combinedservices.cfg

    r4770 r5290  
    2222# For https only - List of CA certificates to enable this client to verify  
    2323# the server's SSL X.509 certificate 
    24 sslCACertFilePathList = $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     24sslCACertFilePathList = $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    2525 
    2626[test01Connect] 
     
    8383# Certificate associated with private key used to sign a message.  The sign  
    8484# method will add this to the BinarySecurityToken element of the WSSE header.   
    85 signingCertFilePath=$NDGSEC_UNITTEST_CONFIG_DIR/pki/test.crt 
     85signingCertFilePath=$NDGSEC_TEST_CONFIG_DIR/pki/test.crt 
    8686 
    8787# PEM encoded private key file 
    88 signingPriKeyFilePath=$NDGSEC_UNITTEST_CONFIG_DIR/pki/test.key 
     88signingPriKeyFilePath=$NDGSEC_TEST_CONFIG_DIR/pki/test.key 
    8989 
    9090# Set the ValueType for the BinarySecurityToken added to the WSSE header for a 
     
    109109 
    110110# Provide a space separated list of file paths 
    111 caCertFilePathList=$NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     111caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/integration/combinedservices/test_combinedservices.py

    r5063 r5290  
    3232    AttributeRequestDenied 
    3333 
    34 from ndg.security.test import BaseTestCase     
     34from ndg.security.test.unit import BaseTestCase     
    3535from ndg.security.common.X509 import X509CertParse, X509CertRead 
    3636from ndg.security.common.wssecurity.signaturehandler.dom import SignatureHandler as SigHdlr 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/__init__.py

    r5285 r5290  
     1"""NDG Security unit test package 
     2 
     3NERC Data Grid Project 
     4""" 
     5__author__ = "P J Kershaw" 
     6__date__ = "14/05/09" 
     7__copyright__ = "(C) 2009 Science and Technology Facilities Council" 
     8__license__ = "BSD - see LICENSE file in top-level directory" 
     9__contact__ = "Philip.Kershaw@stfc.ac.uk" 
     10__revision__ = '$Id: __init__.py 4840 2009-01-19 13:59:08Z pjkersha $' 
     11 
     12import unittest 
     13import logging 
     14logging.basicConfig() 
     15 
     16import os 
     17from os.path import expandvars, join, dirname, abspath 
     18 
     19 
     20class BaseTestCase(unittest.TestCase): 
     21    '''Convenience base class from which other unit tests can extend.  Its 
     22    sets the generic data directory path''' 
     23    configDirEnvVarName = 'NDGSEC_TEST_CONFIG_DIR' 
     24     
     25    def setUp(self): 
     26        if BaseTestCase.configDirEnvVarName not in os.environ: 
     27            os.environ[BaseTestCase.configDirEnvVarName] = \ 
     28                join(abspath(dirname(dirname(__file__))), 'config') 
     29 
     30mkDataDirPath = lambda file:join(os.environ[BaseTestCase.configDirEnvVarName], 
     31                                 file) 
     32 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/attCert/AttCertTest.py

    r4840 r5290  
    1919from ConfigParser import SafeConfigParser 
    2020from ndg.security.common.AttCert import AttCert 
    21 from ndg.security.test import BaseTestCase 
     21from ndg.security.test.unit import BaseTestCase 
    2222 
    2323xpdVars = os.path.expandvars 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/attCert/ac.xml

    r4739 r5290  
    99        <userId>/O=NDG/OU=BADC/CN=pjkershaw</userId> 
    1010        <validity> 
    11             <notBefore>2009 01 05 13 58 26</notBefore>  
    12             <notAfter>2009 01 05 21 58 26</notAfter>  
     11            <notBefore>2009 05 14 11 18 00</notBefore>  
     12            <notAfter>2009 05 14 19 18 00</notAfter>  
    1313        </validity> 
    1414        <attributes> 
     
    2727        <provenance>original</provenance>  
    2828    </acInfo> 
    29 <ds:Signature><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="ds"></ec:InclusiveNamespaces></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></ds:SignatureMethod><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></ds:Transform><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="xmlns"></ec:InclusiveNamespaces></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod><ds:DigestValue>5YtRRY+NdjH4yZo6ZuNC0eca6ZM=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>iHrz8Tu5mSW3K0gV8yiswTrDHZZVUVuGvUG/pPDCceEHXgmohhWKJZ43LNiVF9gSnSxoh+kIXyMK 
    30 FaIqqgtHG52fiVZFA8XqWc/ucBpGrQJpNQRruaLCJElEv01F0ltQ+f+d+KRP2Keg1EEJf30NNgLR 
    31 LIM4WV+8OyL2o1hOjDdeFfxZa/B2AvkRingybqIO100p7hkY2lyhJPwSR3GIbc57Lnw+e1Y6gKgp 
    32 tV+0eAKtvXp3NTlXv1pXNi7FalRyHGCOXYZymVGR52dPsbFjRrxwgf8CARcd4T7nO2RGwu9Ba/U1 
    33 wLQ1e/daMeIdz3ZHAX4eVVmTmb3J6KUswORGVA==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIICazCCAdSgAwIBAgICAQEwDQYJKoZIhvcNAQEEBQAwLzEMMAoGA1UEChMDTkRH 
     29<ds:Signature><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="ds"></ec:InclusiveNamespaces></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></ds:SignatureMethod><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></ds:Transform><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="xmlns"></ec:InclusiveNamespaces></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod><ds:DigestValue>sPx/VQ+W/6ImQpzpVyqNN4SRi94=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>lvYk1Pjb7lDkkkZBrF8PhlT5krZWReU1l6X1vjDUPPkthV2ASVwj3NHCLJIFwrp3PCD8TLUERbhN 
     307MBO/IhQ9AM2qHZDScc+QxJ1iCdXgIGiV5Bb98Gyex3ZxBE+Kj7HlD2NCwzLswKUTEHfdstMlWWI 
     31FuDlalmEJ2pyGdyi+DaA7b1g2rUxapJneqvH94SNQCaS7RqiThy5JyI/u43cMeZXgxCeGzDUZmWo 
     32UQb4jbLe+oQn7PhYV15jf3MwksLqfiLYO9iyjKZhfXQpn+mOW5dY3+00NTb5v6wup+f3l7uGNHkU 
     33U+AfrdIAp52UPM15kWd9aYjQQgdwDegzAz/mBA==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIICazCCAdSgAwIBAgICAQEwDQYJKoZIhvcNAQEEBQAwLzEMMAoGA1UEChMDTkRH 
    3434MQ0wCwYDVQQLEwRCQURDMRAwDgYDVQQDEwdUZXN0IENBMB4XDTA4MTIxNjE1MTE0 
    3535OFoXDTEzMTIxNTE1MTE0OFowLDEMMAoGA1UEChMDTkRHMQ0wCwYDVQQLEwRCQURD 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/attCert/attCertTest.cfg

    r4770 r5290  
    1010 
    1111[test9Sign] 
    12 signingCertFilePath: $NDGSEC_UNITTEST_CONFIG_DIR/pki/test.crt 
    13 signingPriKeyFilePath: $NDGSEC_UNITTEST_CONFIG_DIR/pki/test.key 
     12signingCertFilePath: $NDGSEC_TEST_CONFIG_DIR/pki/test.crt 
     13signingPriKeyFilePath: $NDGSEC_TEST_CONFIG_DIR/pki/test.key 
    1414filePath: $NDGSEC_ATTCERT_UNITTEST_DIR/ac-signed.xml 
    1515signingPriKeyPwd: 
     
    2222 
    2323[test12IsValid] 
    24 certFilePathList: $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     24certFilePathList: $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    2525 
    2626[test13IsValidStressTest] 
    2727# First cert is added to the signature, both certs are used in the  
    2828# verification 
    29 certFilepathlist: $NDGSEC_UNITTEST_CONFIG_DIR/pki/test.crt $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    30 signingPriKeyFilePath: $NDGSEC_UNITTEST_CONFIG_DIR/pki/test.key 
     29certFilepathlist: $NDGSEC_TEST_CONFIG_DIR/pki/test.crt $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     30signingPriKeyFilePath: $NDGSEC_TEST_CONFIG_DIR/pki/test.key 
    3131signingPriKeyPwd: 
    3232nruns: 10 
    3333 
    3434[test14IsValidSignature] 
    35 certFilePathList: $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     35certFilePathList: $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    3636filePath: $NDGSEC_ATTCERT_UNITTEST_DIR/ac.xml 
    3737 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/attributeauthority/test_attributeauthority.cfg

    r4770 r5290  
    99 
    1010[DEFAULT] 
    11 siteBPropFilePath=$NDGSEC_UNITTEST_CONFIG_DIR/attributeauthority/siteb/siteBAttAuthority.cfg 
     11siteBPropFilePath=$NDGSEC_TEST_CONFIG_DIR/attributeauthority/siteb/siteBAttAuthority.cfg 
    1212 
    1313[setUp] 
    1414# ! SiteBMapConfig.xml trusted site A aaURI setting must agree with this  
    1515# setting for test6GetMappedAttCert 
    16 propFilePath=$NDGSEC_UNITTEST_CONFIG_DIR/attributeauthority/sitea/siteAAttributeAuthority.cfg 
     16propFilePath=$NDGSEC_TEST_CONFIG_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_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     22sslCACertFilePathList = $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    2323 
    2424[test02GetTrustedHostInfo] 
    25 role = postgrad 
     25role = urn:siteA:security:authz:1.0:attr:postgrad 
    2626 
    2727[test03GetTrustedHostInfoWithNoMatchingRoleFound] 
     
    3030  
    3131[test05GetAttCert] 
    32 issuingClntCertFilePath = $NDGSEC_UNITTEST_CONFIG_DIR/pki/user.crt 
     32issuingClntCertFilePath = $NDGSEC_TEST_CONFIG_DIR/pki/user.crt 
    3333 
    3434# Setup for use by test08GetMappedAttCert test 
     
    4040 
    4141[test07GetMappedAttCert] 
    42 issuingClntCertFilePath = $NDGSEC_UNITTEST_CONFIG_DIR/pki/user.crt 
     42issuingClntCertFilePath = $NDGSEC_TEST_CONFIG_DIR/pki/user.crt 
    4343userAttCertFilePath = $NDGSEC_AA_UNITTEST_DIR/ac-clnt.xml 
    4444mappedAttCertFilePath = $NDGSEC_AA_UNITTEST_DIR/mapped-ac.xml 
    4545 
    4646[test08GetMappedAttCertStressTest] 
    47 issuingClntCertFilePath = $NDGSEC_UNITTEST_CONFIG_DIR/pki/user.crt 
     47issuingClntCertFilePath = $NDGSEC_TEST_CONFIG_DIR/pki/user.crt 
    4848userAttCertFilePathList = $NDGSEC_AA_UNITTEST_DIR/ac-clnt.xml 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/attributeauthority/test_attributeauthority.py

    r4840 r5290  
    2323mkPath = lambda file:jnPath(os.environ['NDGSEC_AA_UNITTEST_DIR'], file) 
    2424 
    25 from ndg.security.test import BaseTestCase 
     25from ndg.security.test.unit import BaseTestCase 
    2626 
    2727from ndg.security.common.utils.configfileparsers import \ 
     
    5656             
    5757        self.aa = AttributeAuthority( 
    58                                 propFilePath=self.cfg['setUp']['propFilePath'])             
     58                            propFilePath=self.cfg['setUp']['propFilePath'])             
    5959 
    6060    _mkSiteBAttributeAuthority = lambda self: AttributeAuthority(\ 
     
    8383        where the input role doesn't match any roles in the target AA's map  
    8484        config file""" 
    85         thisSection=self.cfg['test03GetTrustedHostInfoWithNoMatchingRoleFound'] 
     85        thisSection = self.cfg[ 
     86                            'test03GetTrustedHostInfoWithNoMatchingRoleFound'] 
    8687        try: 
    8788            trustedHostInfo = self.aa.getTrustedHostInfo(thisSection['role']) 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/attributeauthorityclient/README

    r4732 r5290  
    1010in this directory and run: 
    1111 
    12 $ python ../config/attributeauthority/sitea/siteAServerApp.py 
     12$ python ../../config/attributeauthority/sitea/siteAServerApp.py 
    1313 
    1414...and in a separate terminal: 
    1515 
    16 $ python ../config/attributeauthority/siteb/siteBServerApp.py 
     16$ python ../../config/attributeauthority/siteb/siteBServerApp.py 
    1717 
    1818Configuration for these services is held in the files  
    1919 
    20 ../config/attributeauthority/sitea/site-a.ini and 
    21 ../config/attributeauthority/siteb/site-b.ini  
     20../../config/attributeauthority/sitea/site-a.ini and 
     21../../config/attributeauthority/siteb/site-b.ini  
    2222 
    2323respectively. 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/attributeauthorityclient/attAuthorityClientTest.cfg

    r4855 r5290  
    1111# ! SiteBMapConfig.xml trusted site A aaURI setting must agree with this  
    1212# setting for test6GetMappedAttCert 
    13 #uri = http://localhost:5000/AttributeAuthority 
     13uri = http://localhost:5000/AttributeAuthority 
    1414 
    1515# With TCP Mon: 
     
    2323# same as peer hostname.  
    2424sslPeerCertCN =  
    25 sslCACertFilePathList = $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     25sslCACertFilePathList = $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    2626 
    2727[test02GetTrustedHostInfo] 
    28 role = postgrad 
     28role = urn:siteA:security:authz:1.0:attr:postgrad 
    2929 
    3030[test03GetTrustedHostInfoWithNoMatchingRoleFound] 
     
    5858# Certificate associated with private key used to sign a message.  The sign  
    5959# method will add this to the BinarySecurityToken element of the WSSE header.   
    60 signingCertFilePath=$NDGSEC_UNITTEST_CONFIG_DIR/pki/wsse-clnt.crt 
     60signingCertFilePath=$NDGSEC_TEST_CONFIG_DIR/pki/wsse-clnt.crt 
    6161 
    6262# PEM encoded private key file 
    63 signingPriKeyFilePath=$NDGSEC_UNITTEST_CONFIG_DIR/pki/wsse-clnt.key 
     63signingPriKeyFilePath=$NDGSEC_TEST_CONFIG_DIR/pki/wsse-clnt.key 
    6464 
    6565# Set the ValueType for the BinarySecurityToken added to the WSSE header for a 
     
    8484 
    8585# Provide a space separated list of file paths 
    86 caCertFilePathList=$NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     86caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    8787 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/attributeauthorityclient/test_attributeauthorityclient.py

    r4840 r5290  
    1616logging.basicConfig() 
    1717 
    18 from ndg.security.test import BaseTestCase 
     18from ndg.security.test.unit import BaseTestCase 
    1919 
    2020from ndg.security.common.attributeauthority import AttributeAuthorityClient, \ 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/credentialwallet/README

    r4734 r5290  
    77run: 
    88 
    9 $ python ../config/attributeauthority/sitea/siteAServerApp.py 
     9$ python ../../config/attributeauthority/sitea/siteAServerApp.py 
    1010 
    1111...and in a separate terminal: 
    1212 
    13 $ python ../config/attributeauthority/siteb/siteBServerApp.py 
     13$ python ../../config/attributeauthority/siteb/siteBServerApp.py 
    1414 
    1515Configuration for these services is held in the files  
    1616 
    17 ../config/attributeauthority/sitea/site-a.ini and 
    18 ../config/attributeauthority/siteb/site-b.ini  
     17../../config/attributeauthority/sitea/site-a.ini and 
     18../../config/attributeauthority/siteb/site-b.ini  
    1919 
    2020respectively. 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/credentialwallet/credWallet.cfg

    r4770 r5290  
    1616 
    1717# CA certificates for Attribute Certificate signature validation 
    18 caCertFilePathList=$NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     18caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    1919 
    2020# CA certificates for SSL connection peer cert. validation 
    21 sslCACertFilePathList=$NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     21sslCACertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    2222 
    2323# See attAuthority unit tests to get this service running 
     
    5151# method will add this to the BinarySecurityToken element of the WSSE header.   
    5252# binSecTokValType attribute must be set to 'X509' or 'X509v3' ValueType.   
    53 wssecurity.signingCertFilePath=$NDGSEC_UNITTEST_CONFIG_DIR/pki/wsse-clnt.crt 
     53wssecurity.signingCertFilePath=$NDGSEC_TEST_CONFIG_DIR/pki/wsse-clnt.crt 
    5454 
    5555# ... or provide file path to PEM encoded private key file 
    56 wssecurity.signingPriKeyFilePath=$NDGSEC_UNITTEST_CONFIG_DIR/pki/wsse-clnt.key 
     56wssecurity.signingPriKeyFilePath=$NDGSEC_TEST_CONFIG_DIR/pki/wsse-clnt.key 
    5757 
    5858# Password protecting private key.  Leave blank if there is no password. 
     
    8080 
    8181# Provide a space separated list of file paths 
    82 wssecurity.caCertFilePathList=$NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt  
     82wssecurity.caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt  
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/credentialwallet/credWalletTest.cfg

    r4770 r5290  
    1717# Test with tcpmon 
    1818#attributeAuthorityURI=http://localhost:5099/AttributeAuthority 
    19 userX509CertFilePath=$NDGSEC_UNITTEST_CONFIG_DIR/pki/test.crt 
    20 userPriKeyFilePath=$NDGSEC_UNITTEST_CONFIG_DIR/pki/test.key 
     19userX509CertFilePath=$NDGSEC_TEST_CONFIG_DIR/pki/test.crt 
     20userPriKeyFilePath=$NDGSEC_TEST_CONFIG_DIR/pki/test.key 
    2121 
    2222[test07GetAttCertFromLocalAAInstance] 
    23 attributeAuthorityPropFilePath=$NDGSEC_UNITTEST_CONFIG_DIR/attributeauthority/sitea/siteAAttributeAuthority.cfg 
     23attributeAuthorityPropFilePath=$NDGSEC_TEST_CONFIG_DIR/attributeauthority/sitea/siteAAttributeAuthority.cfg 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/credentialwallet/test_credentialwallet.py

    r4840 r5290  
    1515import traceback 
    1616 
    17 from ndg.security.test import BaseTestCase 
     17from ndg.security.test.unit import BaseTestCase 
    1818 
    1919from ndg.security.common.utils.configfileparsers import \ 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/sessionmanager/README

    r4479 r5290  
    66  
    771) Two test Attribute Authority services are required.  These can be run from  
    8 the Attribute Authority Client unit test directory.  It's path relative to this  
    9 directory is ../attributeauthorityclient/.  Run each service in a separate  
    10 window so that the output can be monitored: 
     8the config test directory.  It's path relative to this directory is  
     9../../config/.  Run each service in a separate window so that the output can  
     10be monitored: 
    1111 
    12 $ ../attributeauthorityclient/siteA/siteAServerApp.py 
    13 $ ../attributeauthorityclient/siteB/siteBServerApp.py 
     12$ python ../../config/attributeauthority/sitea/siteAServerApp.py 
     13 
     14...and in a separate terminal: 
     15 
     16$ python ../../config/attributeauthority/siteb/siteBServerApp.py 
     17 
     18Configuration for these services is held in the files  
     19 
     20../../config/attributeauthority/sitea/site-a.ini and 
     21../../config/attributeauthority/siteb/site-b.ini  
     22 
     23respectively. 
    1424 
    15252) Run the tests with the command: 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/sessionmanager/sessionMgr.cfg

    r4770 r5290  
    2525 
    2626# X.509 certificate for SSL connections - ignored if useSSL is blank - Nb. 
    27 sslCertFile: $NDGSEC_UNITTEST_CONFIG_DIR/sessionmanager/sm.crt 
     27sslCertFile: $NDGSEC_TEST_CONFIG_DIR/sessionmanager/sm.crt 
    2828 
    2929# Private key file for SSL  - ignored if useSSL is blank  
    30 sslKeyFile: $NDGSEC_UNITTEST_CONFIG_DIR/sessionmanager/sm.key 
     30sslKeyFile: $NDGSEC_TEST_CONFIG_DIR/sessionmanager/sm.key 
    3131 
    3232# Directory containing CA cert.s to verify SSL peer cert against - ignored if  
    3333# useSSL is blank  
    34 sslCACertDir: $NDGSEC_UNITTEST_CONFIG_DIR/ca 
     34sslCACertDir: $NDGSEC_TEST_CONFIG_DIR/ca 
    3535 
    3636# Credential Wallet Settings - global to all user sessions 
    3737# 
    3838# CA certificates for Attribute Certificate signature validation 
    39 credentialWallet.caCertFilePathList=$NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     39credentialWallet.caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    4040 
    4141# CA certificates for SSL connection peer cert. validation - required if 
    4242# connecting to an Attribute Authority over SSL 
    43 credentialWallet.sslCACertFilePathList=$NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     43credentialWallet.sslCACertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    4444 
    4545# Allow Get Attribute Certificate calls to try to get a mapped certificate 
     
    6565# The CA certificates of other NDG trusted sites should go here.  NB, multiple 
    6666# values should be delimited by a space 
    67 credentialWallet.wssecurity.caCertFilePathList: $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     67credentialWallet.wssecurity.caCertFilePathList: $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    6868 
    6969# Signature of an outbound message 
     
    7575 
    7676# PEM encoded cert 
    77 credentialWallet.wssecurity.signingCertFilePath: $NDGSEC_UNITTEST_CONFIG_DIR/sessionmanager/sm.crt 
     77credentialWallet.wssecurity.signingCertFilePath: $NDGSEC_TEST_CONFIG_DIR/sessionmanager/sm.crt 
    7878 
    7979# ... or provide file path to PEM encoded private key file 
    80 credentialWallet.wssecurity.signingPriKeyFilePath: $NDGSEC_UNITTEST_CONFIG_DIR/sessionmanager/sm.key 
     80credentialWallet.wssecurity.signingPriKeyFilePath: $NDGSEC_TEST_CONFIG_DIR/sessionmanager/sm.key 
    8181 
    8282# Set the ValueType for the BinarySecurityToken added to the WSSE header for a 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/sessionmanager/sessionMgrTest.cfg

    r4770 r5290  
    1313username = testuser 
    1414passphrase = testpassword 
    15 userX509CertFilePath = $NDGSEC_UNITTEST_CONFIG_DIR/pki/user.crt 
    16 userPriKeyFilePath = $NDGSEC_UNITTEST_CONFIG_DIR/pki/user.key 
     15userX509CertFilePath = $NDGSEC_TEST_CONFIG_DIR/pki/user.crt 
     16userPriKeyFilePath = $NDGSEC_TEST_CONFIG_DIR/pki/user.key 
    1717userPriKeyPwd = testpassword 
    1818 
     
    5454 
    5555[test12GetAttCertFromLocalAAInstance] 
    56 aaPropFilePath = $NDGSEC_UNITTEST_CONFIG_DIR/attributeauthority/sitea/siteAAttributeAuthority.cfg 
     56aaPropFilePath = $NDGSEC_TEST_CONFIG_DIR/attributeauthority/sitea/siteAAttributeAuthority.cfg 
    5757acOutputFilePath = $NDGSEC_SM_UNITTEST_DIR/test12-ac-out.xml 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/sessionmanager/test_sessionmanager.py

    r4840 r5290  
    2323mkPath = lambda file: jnPath(os.environ['NDGSEC_SM_UNITTEST_DIR'], file) 
    2424 
    25 from ndg.security.test import BaseTestCase 
     25from ndg.security.test.unit import BaseTestCase 
    2626 
    2727from ndg.security.common.utils.configfileparsers import \ 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/sessionmanagerclient/README

    r4737 r5290  
    33This is the most complicated unit test suite and requires a number of services 
    44to be running: 
    5  * Test Session Manager web service run from this directory 
    6  * Two test Attribute Authorities run from the Attribute Authority unit test 
    7  directory ../attributeauthority 
     5 * Test Session Manager web service and 
     6 * Two test Attribute Authorities  
     7  
     8These are run from the config test directory ../../config 
    89  
    910It is worthwhile trying out the Attribute Authority  
     
    2021terminal: 
    2122 
    22 $ python ../config/sessionmanager/sessionManagerServerApp.py 
     23$ python ../../config/sessionmanager/sessionManagerServerApp.py 
    2324 
    24252) Two test Attribute Authority services are required.  These can be run from  
     
    2728window so that the output can be monitored: 
    2829 
    29 $ python ../config/attributeauthority/sitea/siteAServerApp.py 
     30$ python ../../config/attributeauthority/sitea/siteAServerApp.py 
    3031 
    3132...and in a separate terminal: 
    3233 
    33 $ python ../config/attributeauthority/siteb/siteBServerApp.py 
     34$ python ../../config/attributeauthority/siteb/siteBServerApp.py 
    3435 
    3536Configuration for these services is held in the files  
    3637 
    37 ../config/sessionmanager/session-manager.ini 
    38 ../config/attributeauthority/sitea/site-a.ini 
    39 ../config/attributeauthority/siteb/site-b.ini  
     38../../config/sessionmanager/session-manager.ini 
     39../../config/attributeauthority/sitea/site-a.ini 
     40../../config/attributeauthority/siteb/site-b.ini  
    4041 
    4142respectively. 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/sessionmanagerclient/sessionMgrClientTest.cfg

    r4855 r5290  
    1919# For https only - List of CA certificates to enable this client to verify  
    2020# the server's SSL X.509 certificate 
    21 sslCACertFilePathList = $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     21sslCACertFilePathList = $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    2222 
    2323[test01Connect]  
     
    8989 
    9090# Provide a space separated list of file paths 
    91 caCertFilePathList=$NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     91caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/sessionmanagerclient/test_sessionmanagerclient.py

    r5063 r5290  
    2727mkPath = lambda file: jnPath(os.environ['NDGSEC_SMCLNT_UNITTEST_DIR'], file) 
    2828 
    29 from ndg.security.test import BaseTestCase 
     29from ndg.security.test.unit import BaseTestCase 
    3030 
    3131from ndg.security.common.sessionmanager import SessionManagerClient, \ 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/sslclientauthnmiddleware/sslclientauthnapp.py

    r4738 r5290  
    1919    return application 
    2020 
    21 from ndg.security.test import BaseTestCase 
     21from ndg.security.test.unit import BaseTestCase 
    2222 
    2323# Initialize environment for unit tests 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/sslclientauthnmiddleware/test.ini

    r4863 r5290  
    2828errorResponseCode: 401 
    2929pathMatchList: /secure1 /secure2 
    30 caCertFilePathList: $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     30caCertFilePathList: $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    3131 
    3232# Logging configuration 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/sslclientauthnmiddleware/test_sslclientauthn.py

    r4840 r5290  
    2222                             file) 
    2323 
    24 from ndg.security.test import BaseTestCase 
     24from ndg.security.test.unit import BaseTestCase 
    2525from ndg.security.common.utils.configfileparsers import \ 
    2626                                                    CaseSensitiveConfigParser 
     
    5454        thisSection = 'test01CheckAccessSecuredURLSucceeds' 
    5555         
    56         clntCertFilePath = xpdVars(os.path.join('$NDGSEC_UNITTEST_CONFIG_DIR', 
     56        clntCertFilePath = xpdVars(os.path.join('$NDGSEC_TEST_CONFIG_DIR', 
    5757                                                'pki',  
    5858                                                'test.crt')) 
    59         clntPriKeyFilePath=xpdVars(os.path.join('$NDGSEC_UNITTEST_CONFIG_DIR', 
     59        clntPriKeyFilePath=xpdVars(os.path.join('$NDGSEC_TEST_CONFIG_DIR', 
    6060                                                'pki',  
    6161                                                'test.key')) 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/wsgi/authn/test.ini

    r5037 r5290  
    1212 
    1313[pipeline:main] 
    14 pipeline = AuthNRedirectFilter 
    15            TestApp 
     14pipeline = AuthNRedirectFilter TestApp 
    1615 
    1716[app:TestApp] 
    18 paste.app_factory = ndg.security.test.wsgi.authn.test_authn:TestAuthNMiddleware 
     17paste.app_factory = ndg.security.test.unit.wsgi.authn.test_authn:TestAuthNMiddleware 
    1918 
    2019[filter:AuthNRedirectFilter] 
    21 paste.filter_app_factory = ndg.security.server.wsgi.authn:AuthNRedirectHandlerMiddleware 
     20paste.filter_app_factory = ndg.security.server.wsgi.authn:AuthenticationRedirectMiddleware 
    2221prefix = authN. 
    23 #authN.redirectURI = /redirect2here 
    24 authN.redirectURI = http://localhost:5800/verify 
     22authN.redirectURI = /redirect2here 
     23#authN.redirectURI = http://localhost:5800/verify 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/wsgi/authn/test_authn.py

    r5037 r5290  
    22"""Unit tests for WSGI Authentication redirect handler 
    33 
    4 NERC Data Grid Project 
     4NERC DataGrid Project 
    55""" 
    66__author__ = "P J Kershaw" 
     
    4343        elif environ['PATH_INFO'] == '/test_401WithLoggedIn': 
    4444            status = "401 Unauthorized" 
    45             environ['REMOTE_USER'] = 'testuser'             
    4645             
    4746        elif environ['PATH_INFO'] == '/test_200WithNotLoggedIn': 
     
    7372    def test01Catch401WithNotLoggedIn(self): 
    7473        response = self.app.get('/test_401WithNotLoggedIn') 
     74        self.assert_(response.status == 302) 
     75         
    7576        try: 
    7677            redirectResponse = response.follow() 
     
    8081 
    8182    def test02Skip200WithLoggedIn(self): 
    82         response = self.app.get('/test_200WithLoggedIn') 
    83         self.assert_(TestAuthNMiddleware.response in response) 
     83        response = self.app.get('/test_200WithLoggedIn', 
     84                                extra_environ={'REMOTE_USER': 'testuser'}, 
     85                                status=403) 
     86        self.assert_(response.status == 403) 
    8487 
    8588    def test03Catch401WithLoggedIn(self): 
     
    9396    def test04Catch200WithNotLoggedIn(self): 
    9497        response = self.app.get('/test_200WithNotLoggedIn') 
    95         self.assert_(TestAuthNMiddleware.response in response) 
     98        self.assert_(response.status == 302) 
     99         
     100        try: 
     101            redirectResponse = response.follow() 
     102        except paste.fixture.AppError, e: 
     103            self.failIf('404 Not found' not in str(e),  
     104                        "Expecting 404 Not found") 
    96105     
    97106 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/wssecurity/dom/client/echoClientTest.cfg

    r5054 r5290  
    99[setUp] 
    1010uri = http://localhost:7500/Echo 
    11 signingPriKeyFilePath = $NDGSEC_UNITTEST_CONFIG_DIR/pki/wsse-clnt.key 
     11signingPriKeyFilePath = $NDGSEC_TEST_CONFIG_DIR/pki/wsse-clnt.key 
    1212signingPriKeyPwd =  
    13 signingCertFilePath = $NDGSEC_UNITTEST_CONFIG_DIR/pki/wsse-clnt.crt 
     13signingCertFilePath = $NDGSEC_TEST_CONFIG_DIR/pki/wsse-clnt.crt 
    1414 
    1515# - NB, the two CA certificates are for the python and the java clients, respectively 
    16 caCertFilePathList = $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt $NDGSEC_WSSECLNT_UNITTEST_DIR/cacert.pem 
     16caCertFilePathList = $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt $NDGSEC_WSSECLNT_UNITTEST_DIR/cacert.pem 
    1717 
    1818[test1Echo] 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/wssecurity/dom/client/test_echoclient.py

    r5063 r5290  
    2626from EchoService_services import EchoServiceLocator 
    2727 
    28 from ndg.security.test import BaseTestCase 
     28from ndg.security.test.unit import BaseTestCase 
    2929from ndg.security.common.wssecurity.signaturehandler.dom import SignatureHandler 
    3030 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/wssecurity/dom/server/echoServer.py

    r5063 r5290  
    2727 
    2828 
    29 from ndg.security.test import BaseTestCase 
     29from ndg.security.test.unit import BaseTestCase 
    3030 
    3131# Initialize environment for unit tests 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/wssecurity/dom/server/wssecurity.cfg

    r5054 r5290  
    2828 
    2929# ... or provide file path PEM encode cert here 
    30 signingCertFilePath=$NDGSEC_UNITTEST_CONFIG_DIR/pki/wsse-server.crt 
    31 #signingCertFilePath=$NDGSEC_UNITTEST_CONFIG_DIR/pki/java-ca-server.crt 
     30signingCertFilePath=$NDGSEC_TEST_CONFIG_DIR/pki/wsse-server.crt 
     31#signingCertFilePath=$NDGSEC_TEST_CONFIG_DIR/pki/java-ca-server.crt 
    3232 
    3333# Pass a list of certificates ',' separated PEM encoded certs constituting a  
     
    4141 
    4242# ... or provide file path to PEM encoded private key file 
    43 signingPriKeyFilePath=$NDGSEC_UNITTEST_CONFIG_DIR/pki/wsse-server.key 
    44 #signingPriKeyFilePath=$NDGSEC_UNITTEST_CONFIG_DIR/pki/java-ca-server.key 
     43signingPriKeyFilePath=$NDGSEC_TEST_CONFIG_DIR/pki/wsse-server.key 
     44#signingPriKeyFilePath=$NDGSEC_TEST_CONFIG_DIR/pki/java-ca-server.key 
    4545 
    4646# Password protecting private key.  Leave blank if there is no password. 
     
    9595# Provide a space separated list of file paths 
    9696# - NB, the two CA certificates are for the python and the java clients, respectively 
    97 caCertFilePathList=$NDGSEC_UNITTEST_CONFIG_DIR/ca/java-ca.crt $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     97caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/java-ca.crt $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/wssecurity/foursuite/client/echoClientTest.cfg

    r5053 r5290  
    99[setUp] 
    1010uri = http://localhost:7500/Echo 
    11 signingPriKeyFilePath = $NDGSEC_UNITTEST_CONFIG_DIR/pki/wsse-clnt.key 
     11signingPriKeyFilePath = $NDGSEC_TEST_CONFIG_DIR/pki/wsse-clnt.key 
    1212signingPriKeyPwd =  
    13 signingCertFilePath = $NDGSEC_UNITTEST_CONFIG_DIR/pki/wsse-clnt.crt 
     13signingCertFilePath = $NDGSEC_TEST_CONFIG_DIR/pki/wsse-clnt.crt 
    1414 
    1515# - NB, the two CA certificates are for the python and the java clients, respectively 
    16 caCertFilePathList = $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt $NDGSEC_WSSECLNT_UNITTEST_DIR/cacert.pem 
     16caCertFilePathList = $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt $NDGSEC_WSSECLNT_UNITTEST_DIR/cacert.pem 
    1717 
    1818[test1Echo] 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/wssecurity/foursuite/client/test_echoclient.py

    r5063 r5290  
    2727from EchoService_services import EchoServiceLocator 
    2828 
    29 from ndg.security.test import BaseTestCase 
     29from ndg.security.test.unit import BaseTestCase 
    3030from ndg.security.common.wssecurity.signaturehandler.foursuite import SignatureHandler 
    3131from ndg.security.common.wssecurity.utils import DomletteReader, \ 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/wssecurity/foursuite/server/echoServer.py

    r5063 r5290  
    2828 
    2929 
    30 from ndg.security.test import BaseTestCase 
     30from ndg.security.test.unit import BaseTestCase 
    3131 
    3232# Initialize environment for unit tests 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/x509/test_x509.py

    r4840 r5290  
    2525 
    2626from ConfigParser import SafeConfigParser 
    27 from ndg.security.test import BaseTestCase 
     27from ndg.security.test.unit import BaseTestCase 
    2828from ndg.security.common.X509 import X509CertRead, X509CertParse, X500DN, \ 
    2929    X509Stack, X509StackEmptyError, SelfSignedCert, X509CertIssuerNotFound 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/x509/x509Test.cfg

    r4770 r5290  
    1010 
    1111[test1X509CertRead] 
    12 certfile: $NDGSEC_UNITTEST_CONFIG_DIR/pki/user.crt 
     12certfile: $NDGSEC_TEST_CONFIG_DIR/pki/user.crt 
    1313 
    1414[test8X509StackVerifyCertChain] 
    15 certfile: $NDGSEC_UNITTEST_CONFIG_DIR/pki/user.crt 
     15certfile: $NDGSEC_TEST_CONFIG_DIR/pki/user.crt 
    1616proxycertfile: $NDGSEC_X509_UNITTEST_DIR/proxy.crt 
    17 cacertfile: $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     17cacertfile: $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    1818 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/xmlsec/etree/etree.cfg

    r4770 r5290  
    1212 
    1313[test2SignWithInclC14N] 
    14 signingCertFilePath: $NDGSEC_UNITTEST_CONFIG_DIR/pki/test.crt 
    15 signingPriKeyFilePath: $NDGSEC_UNITTEST_CONFIG_DIR/pki/test.key 
     14signingCertFilePath: $NDGSEC_TEST_CONFIG_DIR/pki/test.crt 
     15signingPriKeyFilePath: $NDGSEC_TEST_CONFIG_DIR/pki/test.key 
    1616filePath: $NDGSEC_XMLSEC_ETREE_UNITTEST_DIR/test-incl-c14n-signed.xml 
    1717signingPriKeyPwd: 
    1818 
    1919[test3SignWithExclC14N] 
    20 signingCertFilePath: $NDGSEC_UNITTEST_CONFIG_DIR/pki/test.crt 
    21 signingPriKeyFilePath: $NDGSEC_UNITTEST_CONFIG_DIR/pki/test.key 
     20signingCertFilePath: $NDGSEC_TEST_CONFIG_DIR/pki/test.crt 
     21signingPriKeyFilePath: $NDGSEC_TEST_CONFIG_DIR/pki/test.key 
    2222filePath: $NDGSEC_XMLSEC_ETREE_UNITTEST_DIR/test-excl-c14n-signed.xml 
    2323signingPriKeyPwd: 
     
    3030 
    3131[test6VerifyInclC14nDoc] 
    32 certFilePathList: $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     32certFilePathList: $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    3333filePath: $NDGSEC_XMLSEC_ETREE_UNITTEST_DIR/test-incl-c14n-signed.xml 
    3434 
    3535[test7VerifyExclC14nDoc] 
    36 certFilePathList: $NDGSEC_UNITTEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     36certFilePathList: $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
    3737filePath: $NDGSEC_XMLSEC_ETREE_UNITTEST_DIR/test-excl-c14n-signed.xml 
    3838 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/xmlsec/etree/test_etree.py

    r4840 r5290  
    2525 
    2626from ConfigParser import SafeConfigParser 
    27 from ndg.security.test import BaseTestCase 
     27from ndg.security.test.unit import BaseTestCase 
    2828from ndg.security.common.xmlsec.etree import XMLSecDoc 
    2929 
Note: See TracChangeset for help on using the changeset viewer.