Ignore:
Timestamp:
11/06/07 14:24:25 (13 years ago)
Author:
pjkersha
Message:

ndg.security.server/ndg/security/server/MyProxy.py: added details for
Access Grid Toolkit Public License in respective of myproxy_logon used as a
basis for the code.

ndg.security.test/ndg/security/test/SessionCookie/SessionCookieTest.py:

  • fixed so that private key password is prompted for once only by keeping

it as a class var.

  • corrected call to create method.
File:
1 edited

Legend:

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

    r2558 r2573  
    1313""" 
    1414import unittest 
    15 import os, sys, getpass 
     15import os, sys, getpass, base64 
    1616  
    1717from ndg.security.common.SessionCookie import SessionCookie 
     
    2222class SessionCookieTestCase(unittest.TestCase): 
    2323     
     24    priKeyPwd = None 
     25         
    2426    def setUp(self): 
    2527        self.cookie = SessionCookie() 
     
    3032        self.cookie.x509CertFilePath = configParser.get('setUp',  
    3133                                                        'x509CertFilePath') 
    32         try: 
    33             priKeyPwd = configParser.get('setUp', 'priKeyPwd') 
    34         except NoOptionError: 
     34        if self.__class__.priKeyPwd is None: 
    3535            try: 
    36                 priKeyPwd = getpass.getpass(\ 
    37                             prompt="\nsetUp - private key password: ") 
    38             except KeyboardInterrupt: 
    39                 raise SystemExit 
     36                self.__class__.priKeyPwd = configParser.get('setUp',  
     37                                                            'priKeyPwd') 
     38            except NoOptionError: 
     39                try: 
     40                    self.__class__.priKeyPwd = getpass.getpass(\ 
     41                                prompt="\nsetUp - private key password: ") 
     42                    import pdb;pdb.set_trace() 
     43                except KeyboardInterrupt: 
     44                    raise SystemExit 
    4045         
    41         self.cookie.priKeyPwd = priKeyPwd 
     46        self.cookie.priKeyPwd = self.__class__.priKeyPwd 
    4247         
    4348        self.cookie.priKeyFilePath = configParser.get('setUp',  
    4449                                                      'priKeyFilePath') 
    4550       
    46         self.cookie.create() 
     51        self.cookie.create('O=NDG/OU=BADC/CN=test', 
     52                           base64.encodestring(os.urandom(32)), 
     53                           'http://localhost:5000/SessionManager') 
    4754         
    4855         
Note: See TracChangeset for help on using the changeset viewer.