Changeset 3192


Ignore:
Timestamp:
09/01/08 14:50:08 (12 years ago)
Author:
pjkersha
Message:

Working version of Session Manager unit tests with certs included in SVN issued from test CA.

security/python/ndg.security.test/ndg/security/test/attAuthority/README: added note about test config file.

security/python/ndg.security.test/ndg/security/test/attAuthority/siteAAttAuthorityProperties.xml,
security/python/ndg.security.test/ndg/security/test/attAuthority/siteBAttAuthorityProperties.xml:
added note about MyProxy? CA certificate inclusion for WSSE signature handler to trust requests authenticated by certs from MyProxy? CA. This is needed for running these services with Session Manager and Session Manager Cleint unit tests

security/python/ndg.security.test/ndg/security/test/ca/README: added note that this unit test is currently defunct.

security/python/ndg.security.test/ndg/security/test/gatekeeper/README,
security/python/ndg.security.test/ndg/security/test/Log: added

security/python/ndg.security.test/ndg/security/test/myProxy/README: added note about ensuring test creds are removed from the repository.

security/python/ndg.security.test/ndg/security/test/sessionCookie/README: note that this test is defunct. Pylons code can perform the same function

security/python/ndg.security.test/ndg/security/test/sessionCookie/SessionCookieTest.py,
security/python/ndg.security.test/ndg/security/test/sessionCookie/sessionCookieTest.cfg:
altered so that files are ref'd by env vars so that tests can be run from any dir

security/python/ndg.security.test/ndg/security/test/README: added

security/python/ndg.security.test/ndg/security/test/sessionMgr/sessionMgrProperties.xml,
security/python/ndg.security.test/ndg/security/test/sessionMgr/sessionMgrTest.cfg,
security/python/ndg.security.test/ndg/security/test/sessionMgr/test.py:

  • altered so that files are ref'd by env vars so that tests can be run from any dir
  • test1Connect PKI output is dumped to user.creds file.
Location:
TI12-security/trunk/python/ndg.security.test/ndg/security/test
Files:
6 added
12 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/attAuthority/README

    r3189 r3192  
    22===================================================== 
    33The test client connects to two different test Attribute Authorities 
    4 corresponding to the fictitious Service Providers Site "A" and Site "B".  These 
    5 services must be started before running the unit tests.  Start a terminal in 
    6 this directory and run 
    7  
     4corresponding to the fictitious Service Providers Site "A" and Site "B".  Each 
     5has it's own respective properties file.  These services must be started before 
     6running the unit tests.  Start a terminal in this directory and run: 
    87 
    98$ python ./siteAServer.py 
     
    1615certificates: test7GetMappedAttCert and test8GetMappedAttCertStressTest 
    1716 
     17Settings for the client to these services are configured with  
     18attAuthorityClientTest.cfg.  The default values should work as set. 
     19 
    1820Run the unit tests script AttAuthorityClientTest.py from another terminal: 
    1921 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/attAuthority/siteAAttAuthorityProperties.xml

    r3189 r3192  
    1919    <caCertFileList> 
    2020        <caCertFile>$NDGSEC_AACLNT_UNITTEST_DIR/ca/ndg-test-ca.crt</caCertFile> 
     21        <!--  
     22        To also trust certificates issued from your MyProxy CA, replace  
     23        "abcdef01.0" with the unique name for your CA certificate and uncomment 
     24        the following line: 
     25        <caCertFile>/etc/grid-security/certificates/abcdef01.0</caCertFile> 
     26        --> 
    2127    </caCertFileList> 
    2228    <!--  
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/attAuthority/siteBAttAuthorityProperties.xml

    r3189 r3192  
    1515    <caCertFileList> 
    1616        <caCertFile>$NDGSEC_AACLNT_UNITTEST_DIR/ca/ndg-test-ca.crt</caCertFile> 
     17        <!--  
     18        To also trust certificates issued from your MyProxy CA, replace  
     19        "abcdef01.0" with the unique name for your CA certificate and uncomment 
     20        the following line: 
     21        <caCertFile>/etc/grid-security/certificates/abcdef01.0</caCertFile> 
     22        --> 
    1723    </caCertFileList> 
    1824    <keyFile>$NDGSEC_AACLNT_UNITTEST_DIR/siteB-aa.key</keyFile> 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/ca/README

    r2139 r3192  
    11Unit tests for Certificate Authority Web Service Client 
    2 _________________________________________________ 
     2======================================================= 
     304/01/08: this unit test is defunct.  CA requests for new users are handled 
     4directly by MyProxy. 
    35 
    46Before running the tests start the Certificate Authority web service: 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/myProxy/README

    r3176 r3192  
    2323$ python ./MyProxyClientTest.py MyProxyClientTestCase.test1Store 
    2424 
    25 Note that some tests are dependent on the output of previous tests.  See 
    26 myProxyClientTest.cfg configuration file to change test parameters. 
     25 * Note that some tests are dependent on the output of previous tests.   
     26 * test1Store adds a new credential to the repository.  Running all the tests 
     27   together as in 3) will ensure the credential is removed afterwards.  To 
     28   check the existence of the credential after the test run test3Info: 
     29    
     30   $ python ./MyProxyClientTest.py MyProxyClientTestCase.test3Info 
     31    
     32   or use MyProxy client commands on the MyProxy host: myproxy-info, 
     33   myproxy-destroy.  If these fail, the content of /var/myproxy on the  
     34   target host can be checked to see if testuser credentials still exist. 
     35 * See myProxyClientTest.cfg configuration file to change test parameters. 
     36 * See the installation guide for MyProxy trouble shooting information. 
    2737 
    28 See the installation guide for MyProxy trouble shooting information. 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/myProxy/proxy.crt

    r3176 r3192  
    22MIICijCCAXKgAwIBAgICAPkwDQYJKoZIhvcNAQEEBQAwQjEMMAoGA1UEChMDTkRH 
    33MQ0wCwYDVQQLEwRCQURDMRAwDgYDVQQLEwdHYWJyaWVsMREwDwYDVQQDEwh0ZXN0 
    4 dXNlcjAeFw0wODAxMDQxNTI1MDZaFw0wODAxMDUwMzMwMDZaMFIxDDAKBgNVBAoT 
     4dXNlcjAeFw0wODAxMDQxNTMwNTdaFw0wODAxMDUwMzM1NTdaMFIxDDAKBgNVBAoT 
    55A05ERzENMAsGA1UECxMEQkFEQzEQMA4GA1UECxMHR2FicmllbDERMA8GA1UEAxMI 
    66dGVzdHVzZXIxDjAMBgNVBAMTBXByb3h5MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB 
    7 iQKBgQC9LuG8yFNOYcsYLJwy1GhaqxmDQusRJW0r5T9yaCzmpJADLxHYVxjCGtnZ 
    8 DYAR/9YuBql3rkI2oRRxxfxL5L1LYaHaK9+xrMmpxwBsJcwgQryA3xfrzY37kNbu 
    9 tGcIBmyf2O4CiZFSVY4PIHXGZERupZBAr/rHxb3zhEx47yR9HwIDAQABMA0GCSqG 
    10 SIb3DQEBBAUAA4IBAQCb5Q5ipzCpQMDCJjtRGWjc6G9gPxdAni5NRfWm3oRX5uMc 
    11 wig0bd6OPP6Qv3Z1DgA8Q5m3yg41QZm5WGCNbSeCYpAhyqzk8vwI6uRD0GzMmls9 
    12 jd5Q8PgidfEgXi14v9IQ4dPJ1laiFCUljh2+hPhDcoyYDCINWC0iuCycpObvcDkO 
    13 gfKt+k2iCOrgxKXv7Khck0A+g37S9QV0mGtxzSn2xNQs7wWO6XermOP1fqqfalFS 
    14 +KbAdl3EPvdKLpXFwJueezUxoUe+hpkdZKl8dNbc2ahMLwLfpJVCiPb5gJN1ssPN 
    15 aVnphcQMcPk+WA5mlJ3SydseOylrD1cgOkgjcp7c 
     7iQKBgQCuAnhHngHz2WZyncnTv18d9ToIc430TlLSyFp3WQ1lZeSt2DtHr32MOkjN 
     8urcTJ6OjLo31lykg4RKkyMiLTiEXpN92nsFNIBcDG0b/yIFN3uGW0c4MOc+vpCk/ 
     9eSwuZTzCjDzYwjZuy8wxRaU3olSVp+3RbKAfBv7wyb4MnGIwGQIDAQABMA0GCSqG 
     10SIb3DQEBBAUAA4IBAQBo8ts3GPAsD4jkrbsKESXoXo5wVcKKs4Tu+KkW12cBHQTj 
     11Qzvfa6mwDDS9YOh4S+sxeEwuO5JTBt5RYoVboG8Mpy07Ur0Bmj0E+QiLJNCUWAY3 
     121xzDA2tw/lpG1BvKAMuHk+A9hulVYyGJkgpcQWNJyGiGoU5+K7wA4I4YmtrgylnW 
     13xIle3fZQSr/JRTxFHduJoGCLuE0dyIEtIhRVROQP+xpkQrxjEja+U6C5rqipgOsD 
     14x0RKDE/SrbNCd/DGcOB1Cmn7PfWhzSDErH3Rgc1a8L2Wnx6ymdfmBJP3f9QH8T9R 
     157mVVpN95DT9YCouBapFhX7nsa4QKUVQn4hCnc7l4 
    1616-----END CERTIFICATE----- 
    1717-----BEGIN CERTIFICATE----- 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/myProxy/proxy.key

    r3176 r3192  
    11-----BEGIN RSA PRIVATE KEY----- 
    2 MIICXAIBAAKBgQC9LuG8yFNOYcsYLJwy1GhaqxmDQusRJW0r5T9yaCzmpJADLxHY 
    3 VxjCGtnZDYAR/9YuBql3rkI2oRRxxfxL5L1LYaHaK9+xrMmpxwBsJcwgQryA3xfr 
    4 zY37kNbutGcIBmyf2O4CiZFSVY4PIHXGZERupZBAr/rHxb3zhEx47yR9HwIDAQAB 
    5 AoGAOIeMvnthoTdJl6Sk2+9qa0VbL0TMtufnEknDRq1oVVbxDXKAM5P6+u1JETme 
    6 fkJjPoeRFgkFEgvZ7xFJDWiBQ0ODNNdjf9nV7Zr9lZp8QjwZbx3BwNFKsGfMb+X+ 
    7 zu27H3oO6M4BHEBv9MJbAZVqf2nZLDzo74TWtmM+1EWoFEkCQQD6OcU1I5QA9guy 
    8 +obBLh7/T+LkJeA5eWP5/X7qnCYOMNojw5GQhXathii3ozwSrVvteWTOTv4zvi2q 
    9 ZOO/xncbAkEAwYx/Vy4DlkkzDeBeu02cwb+wv/1shiNyUCD8nQJ+jxBlEqs1NMn+ 
    10 v8E9ggQteMsuvf2Mnxpw5u20IBafx9CeTQJAR0uIjhB6DiAMy00ocghjGpm3awwD 
    11 rDyTKNp6e/xLt4Vh0gjaA9STMPPlzBT9e9DbPXl2KHZHZZTNTBx869pvewJAEi1q 
    12 zDpDFfs780KuQvMQFNY2+GEJrzNnCgV/FBPm5PLKO02fCp0p8sJoT2yrBJw4gJlu 
    13 eobWMaoDb7wQN4jtRQJBANVfcPz3oQxqkcL0rFZib8ewBaaylZv4s3Lrm5xqODzw 
    14 GLMu09EKnGMmawvX78Jio4caItLyX5b9OkkM4F4fsvY= 
     2MIICXQIBAAKBgQCuAnhHngHz2WZyncnTv18d9ToIc430TlLSyFp3WQ1lZeSt2DtH 
     3r32MOkjNurcTJ6OjLo31lykg4RKkyMiLTiEXpN92nsFNIBcDG0b/yIFN3uGW0c4M 
     4Oc+vpCk/eSwuZTzCjDzYwjZuy8wxRaU3olSVp+3RbKAfBv7wyb4MnGIwGQIDAQAB 
     5AoGALstLPTcon0LfYgM8u0zDb3L64Dry+bf2XeizK1UvXQ1Bqd50UprG0Gb8HRcR 
     6FH2ca82hL2IvFUBxmw7Dn3KrQxbJFH5IpFaX3U456E85FUHJvvwepdp4P+9HF7BF 
     7dZlkyuvJc1lLoWUEvKYyohZAr9s9VB6iot2aNvJs+Yhv9+ECQQDfQ8rPuZRjmoG/ 
     8RXCA3dHCBeCHqcJgKGtsX8aM6N7wZmG3bt88VUEuioq1zFARdGbREQt3CYEjiwWk 
     9sWiqnDKPAkEAx4XkpGyqdEMLFxucZQSu+AkjFrJ+tROI5uwd08j6La9jB98RxRwr 
     103J2LcYc1S1hAGMqnknvAZeCe2MMGaGWm1wJBAKGzze5JMMo7G4HW3zbWcZee/hID 
     11x74xSCyD6aAhAWcIH/nlGVXvQXhd6zzkr5EUx2rgd3dNsPR3Oi0gOPhojM0CQEbi 
     129xzDzruHpkULdkEdrNxKwsCpogLLcfQ5J0+7M8dPbKu7QSD6pUq4XnZzRygBrqQg 
     13O/D7LpwDdewlPf2RP/kCQQCyQtZvpLbgxs858EWtsjcRpaADzJUqkY8lHOvLGMQs 
     14puF45jpBP2qY8AL+4ZDpIsfXxOMcwzkBu3TMzYNvhv5E 
    1515-----END RSA PRIVATE KEY----- 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/sessionCookie/SessionCookieTest.py

    r2909 r3192  
    1717import os, sys, getpass, base64 
    1818  
    19 from ndg.security.common.SessionCookie import SessionCookie 
     19from ndg.security.common.sessionCookie import SessionCookie 
    2020from datetime import datetime, timedelta 
    2121from ConfigParser import SafeConfigParser, NoOptionError 
    2222 
     23xpdVars = os.path.expandvars 
     24jnPath = os.path.join 
     25mkPath=lambda file:jnPath(os.environ['NDGSEC_SESSIONCOOKIE_UNITTEST_DIR'],file) 
     26 
    2327 
    2428class SessionCookieTestCase(unittest.TestCase): 
    25      
     29    raise NotImplementedError(\ 
     30    "SessionCookie class not used in current implementation of NDG Security") 
    2631    priKeyPwd = None 
    2732         
    2833    def setUp(self): 
     34        if 'NDGSEC_INT_DEBUG' in os.environ: 
     35            import pdb 
     36            pdb.set_trace() 
     37         
     38        if 'NDGSEC_SESSIONCOOKIE_UNITTEST_DIR' not in os.environ: 
     39            os.environ['NDGSEC_SESSIONCOOKIE_UNITTEST_DIR'] = \ 
     40                os.path.abspath(os.path.dirname(__file__)) 
     41 
    2942        self.cookie = SessionCookie() 
    3043         
    3144        configParser = SafeConfigParser() 
    32         configParser.read("./sessionCookieTest.cfg") 
     45        configFilePath=jnPath(os.environ['NDGSEC_SESSIONCOOKIE_UNITTEST_DIR'], 
     46                              'sessionCookieTest.cfg') 
     47        configParser.read(configFilePath) 
    3348         
    34         self.cookie.x509CertFilePath = configParser.get('setUp',  
    35                                                         'x509CertFilePath') 
     49        self.cookie.x509CertFilePath = xpdVars(configParser.get('setUp',  
     50                                                        'x509CertFilePath')) 
    3651        if self.__class__.priKeyPwd is None: 
    3752            try: 
     
    4560                    raise SystemExit 
    4661         
    47         self.priKeyFilePath = configParser.get('setUp', 'priKeyFilePath') 
     62        self.priKeyFilePath=xpdVars(configParser.get('setUp','priKeyFilePath')) 
    4863         
    49         self.cookie.x509CertFilePath = configParser.get('setUp',  
    50                                                         'x509CertFilePath') 
     64        self.cookie.x509CertFilePath = xpdVars(configParser.get('setUp',  
     65                                                        'x509CertFilePath')) 
    5166       
    5267        self.cookie.create('O=NDG/OU=BADC/CN=test', 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/sessionCookie/sessionCookieTest.cfg

    r2556 r3192  
    1010# X.509 certificate for encrypting cookie morsel 
    1111# returned responses 
    12 x509CertFilePath = cert.pem 
     12x509CertFilePath = $NDGSEC_SESSIONCOOKIE_UNITTEST_DIR/test.crt 
    1313 
    1414# Private key file used to decrypt cookie morsel 
    15 priKeyFilePath = key.pem 
     15priKeyFilePath = $NDGSEC_SESSIONCOOKIE_UNITTEST_DIR/test.key 
    1616 
    1717# Password protecting client private key - comment out to force 
    1818# prompt from stdin or leave equal empty string if no password is 
    1919# required 
    20 #priKeyPwd =  
     20priKeyPwd =  
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/sessionMgr/sessionMgrProperties.xml

    r3145 r3192  
    2020    --> 
    2121    <caCertFileList> 
    22         <caCertFile>$NDGSEC_SM_UNITTEST_DIR/ca/cacert.pem</caCertFile> 
    2322        <caCertFile>$NDGSEC_SM_UNITTEST_DIR/ca/ndg-test-ca.crt</caCertFile> 
    2423    </caCertFileList> 
     
    4948                Useful if hostname and certificate CN don't match correctly.  Globus  
    5049                host DN is set to "host/<fqdn>".  Delete this element and set from  
    51                 MYPROXY_SERVER_DN environment variable if prefered 
    52                 <serverDN></serverDN> 
     50                MYPROXY_SERVER_DN environment variable if preferred 
     51                <serverDN>/O=NDG/OU=BADC/OU=Gabriel/CN=localhost</serverDN> 
    5352                --> 
    5453                <!-- 
    55                 Set "host/" prefix to host cert CN as is default with globus 
     54                Set "host/" prefix to host cert CN as is default with globus otherwise 
     55                client SSL peer cert check fails 
    5656                --> 
     57                <serverCNprefix>host/</serverCNprefix>   
    5758                <!-- 
    5859                This directory path is used to locate the OpenSSL configuration file 
     
    7677                        --> 
    7778                <proxyCertLifetime>43200</proxyCertLifetime> <!-- in seconds --> 
    78                 <caCertFile>$NDGSEC_SM_UNITTEST_DIR/cacert.pem</caCertFile> 
     79                <caCertFile>$NDGSEC_SM_UNITTEST_DIR/ndg-test-ca.crt</caCertFile> 
    7980        </myProxyProp> 
    8081        <simpleCACltProp> 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/sessionMgr/sessionMgrTest.cfg

    r3145 r3192  
    1010# $Id:$ 
    1111[setUp] 
    12 propFilePath = ./sessionMgrProperties.xml 
    13 NDGSEC_SM_UNITTEST_DIR = $PWD 
     12propFilePath = $NDGSEC_SM_UNITTEST_DIR/sessionMgrProperties.xml 
    1413 
    15 [test1Connect]          
    16 username = raphaelTest 
    17 #username = gabriel 
     14[test1Connect] 
     15# Alter username according to the MyProxy credentials you wish to test.  If 
     16# passphrase is commented out you will be prompted for it on the command line. 
     17# Note also setting for test3ConnectNoCreateServerSess test below.   
     18username = testuser 
    1819#passphrase = testpassword 
    1920 
     
    2122 
    2223[test3ConnectNoCreateServerSess]          
    23 username = gabriel 
     24username = testuser 
    2425#passphrase = testpassword 
    2526 
    2627[test6GetAttCertWithSessID] 
    2728aaURI = http://localhost:5000/AttributeAuthority 
    28 acOutFilePath = ac-out.xml 
     29acOutFilePath = $NDGSEC_SM_UNITTEST_DIR/ac-out.xml 
    2930 
    3031[test6aGetAttCertRefusedWithSessID] 
     
    3738aaURI = http://localhost:5100/AttributeAuthority 
    3839# Use output from test6GetAttCertWithSessID! 
    39 extACFilePath = ac-out.xml 
     40extACFilePath = $NDGSEC_SM_UNITTEST_DIR/ac-out.xml 
    4041 
    4142[test7GetAttCertWithUserCert] 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/sessionMgr/test.py

    r3139 r3192  
    1818import os, sys, getpass, re 
    1919from ConfigParser import SafeConfigParser 
     20import traceback 
    2021 
    2122from ndg.security.common.X509 import X509CertParse 
    2223from ndg.security.server.SessionMgr import * 
     24from ndg.security.server.MyProxy import MyProxyClient 
     25 
     26from os.path import expandvars as xpdVars 
     27from os.path import join as jnPath 
     28mkPath = lambda file: jnPath(os.environ['NDGSEC_SM_UNITTEST_DIR'], file) 
    2329 
    2430 
     
    3036    test1Passphrase = None 
    3137    test3Passphrase = None 
    32  
     38     
    3339    def setUp(self): 
    3440         
    35         self.cfg = SafeConfigParser() 
    36         self.cfg.read("./sessionMgrTest.cfg") 
    37          
    38         os.environ['NDGSEC_SM_UNITTEST_DIR'] = \ 
    39             os.path.expandvars(self.cfg.get('setUp',  
    40                                             'NDGSEC_SM_UNITTEST_DIR')) 
    41              
    42         # Initialise the Session Manager client connection 
    43         # Omit traceFile keyword to leave out SOAP debug info 
    44         self.sm = SessionMgr(propFilePath=self.cfg.get('setUp',  
    45                                                        'propFilePath')) 
    4641        if 'NDGSEC_INT_DEBUG' in os.environ: 
    4742            import pdb 
    4843            pdb.set_trace() 
     44         
     45        if 'NDGSEC_SM_UNITTEST_DIR' not in os.environ: 
     46            os.environ['NDGSEC_SM_UNITTEST_DIR'] = \ 
     47                os.path.abspath(os.path.dirname(__file__)) 
     48         
     49        self.cfg = SafeConfigParser() 
     50        configFilePath = jnPath(os.environ['NDGSEC_SM_UNITTEST_DIR'], 
     51                                "sessionMgrTest.cfg") 
     52        self.cfg.read(configFilePath) 
     53                     
     54        # Initialise the Session Manager client connection 
     55        # Omit traceFile keyword to leave out SOAP debug info 
     56        propFilePath = xpdVars(self.cfg.get('setUp', 'propFilePath')) 
     57        self.sm = SessionMgr(propFilePath=propFilePath) 
     58         
    4959                                   
    5060    def test1Connect(self): 
     
    5262         
    5363        print "\n\t" + self.test1Connect.__doc__ 
     64         
     65        username = self.cfg.get('test1Connect', 'username') 
    5466         
    5567        if SessionMgrTestCase.test1Passphrase is None and \ 
     
    6072        if not SessionMgrTestCase.test1Passphrase: 
    6173            SessionMgrTestCase.test1Passphrase = getpass.getpass(\ 
    62                                prompt="\ntest1Connect pass-phrase for user: ") 
     74                prompt="\ntest1Connect pass-phrase for user %s: " % username) 
    6375 
    6476        userCert, self.userPriKey, self.issuingCert, self.sessID = \ 
    65             self.sm.connect(username=self.cfg.get('test1Connect', 'username'),  
     77            self.sm.connect(username=username,  
    6678                            passphrase=SessionMgrTestCase.test1Passphrase) 
    6779        self.userCert = X509CertParse(userCert) 
    6880         
    6981        print "User '%s' connected to Session Manager:\n%s" % \ 
    70             (self.cfg.get('test1Connect', 'username'), self.sessID) 
     82                                                        (username, self.sessID) 
     83        creds = self.issuingCert or '' + userCert + self.userPriKey 
     84        open(mkPath("user.creds"), "w").write(creds) 
     85     
    7186             
    7287    def test2GetSessionStatus(self): 
     
    89104        print "\n\t" + self.test3ConnectNoCreateServerSess.__doc__ 
    90105         
     106        username = self.cfg.get('test3ConnectNoCreateServerSess', 'username') 
     107 
    91108        if SessionMgrTestCase.test3Passphrase is None and \ 
    92109           self.cfg.has_option('test3ConnectNoCreateServerSess',  
     
    97114        if not SessionMgrTestCase.test3Passphrase: 
    98115            SessionMgrTestCase.test3Passphrase = getpass.getpass(\ 
    99             prompt="\ntest3ConnectNoCreateServerSess pass-phrase for user: ") 
    100  
    101         username = self.cfg.get('test3ConnectNoCreateServerSess', 'username') 
     116        prompt="\ntest3ConnectNoCreateServerSess pass-phrase for user %s: " % \ 
     117            username) 
     118 
    102119        self.userCert, self.userPriKey, self.issuingCert, sessID = \ 
    103120            self.sm.connect(username=username,  
     
    108125        assert not sessID, "Expecting a null session ID!" 
    109126           
    110         print "User '%s' connected to Session Manager:\n%s" % \ 
    111                 (self.cfg.get('test3ConnectNoCreateServerSess', 'username'),  
    112                  self.userCert) 
     127        print "User '%s' retrieved creds. from Session Manager:\n%s" % \ 
     128                                                    (username, self.userCert) 
    113129             
    114130 
     
    152168        print "Attribute Certificate:\n%s" % attCert  
    153169        attCert.filePath = \ 
    154             self.cfg.get('test6GetAttCertWithSessID', 'acoutfilepath')  
     170            xpdVars(self.cfg.get('test6GetAttCertWithSessID', 'acoutfilepath'))  
    155171        attCert.write() 
    156172         
     
    213229        # Use output from test6GetAttCertWithSessID! 
    214230        extACFilePath = \ 
    215     self.cfg.get('test6cGetAttCertWithExtAttCertListWithSessID', 'extacfilepath')    
     231        xpdVars(self.cfg.get('test6cGetAttCertWithExtAttCertListWithSessID',  
     232                             'extacfilepath'))    
    216233        extAttCert = open(extACFilePath).read() 
    217234         
    218         attCert, errMsg, extAttCertList = self.sm.getAttCert(sessID=self.sessID,  
    219                                        aaURI=aaURI, 
    220                                        extAttCertList=[extAttCert]) 
     235        attCert, errMsg, extAttCertList = self.sm.getAttCert( 
     236                                                   sessID=self.sessID,  
     237                                                   aaURI=aaURI, 
     238                                                   extAttCertList=[extAttCert]) 
    221239        if errMsg: 
    222240            self.fail(errMsg) 
     
    247265     
    248266    def __init__(self): 
    249         map = map(SessionMgrTestCase, 
    250                   ( 
    251                     "test1Connect", 
    252                     "test2GetSessionStatus", 
    253                     "test3ConnectNoCreateServerSess", 
    254                     "test4DisconnectWithSessID", 
    255                     "test5DisconnectWithUserCert", 
    256                     "test6GetAttCertWithSessID", 
    257                     "test6bGetMappedAttCertWithSessID", 
    258                     "test6cGetAttCertWithExtAttCertListWithSessID", 
    259                     "test7GetAttCertWithUserCert", 
    260                   )) 
    261         unittest.TestSuite.__init__(self, map) 
     267        print "SessionMgrTestSuite ..." 
     268        smTestCaseMap = map(SessionMgrTestCase, 
     269                          ( 
     270                            "test1Connect", 
     271                            "test2GetSessionStatus", 
     272                            "test3ConnectNoCreateServerSess", 
     273                            "test4DisconnectWithSessID", 
     274                            "test5DisconnectWithUserCert", 
     275                            "test6GetAttCertWithSessID", 
     276                            "test6bGetMappedAttCertWithSessID", 
     277                            "test6cGetAttCertWithExtAttCertListWithSessID", 
     278                            "test7GetAttCertWithUserCert", 
     279                          )) 
     280        unittest.TestSuite.__init__(self, smTestCaseMap) 
    262281             
    263282                                                     
    264283if __name__ == "__main__": 
     284#    suite = SessionMgrTestSuite() 
     285#    unittest.TextTestRunner(verbosity=2).run(suite) 
    265286    unittest.main()         
Note: See TracChangeset for help on using the changeset viewer.