Ignore:
Timestamp:
01/12/08 15:39:41 (12 years ago)
Author:
pjkersha
Message:

ndg.security.server.wsgi.utils.sessionmanagerclient.WSGISessionManagerClient: completed this class and tested in combinedservices unit tests. This class enables WSGI apps to access another Session Manager WSGI app running in the same stack or else make a callout to a remote SOAP service.

Location:
TI12-security/trunk/python/ndg.security.test/ndg/security/test/combinedservices
Files:
4 edited
1 moved

Legend:

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

    r4513 r4520  
    1919from ndg.security.server.wsgi.utils.sessionmanagerclient import \ 
    2020    WSGISessionManagerClient 
    21      
     21 
     22 
     23class HTTPBasicAuthentication(object): 
     24    '''Enable Authkit based HTTP Basic Authentication for test methods''' 
     25    def __init__(self): 
     26        self._userIn = UserIn([]) 
     27         
     28    def __call__(self, environ, username, password): 
     29        """validation function""" 
     30        try: 
     31            client = WSGISessionManagerClient(environ=environ) 
     32            res = client.connect(username, passphrase=password) 
     33 
     34            if username not in self._userIn.users: 
     35                self._userIn.users += [username] 
     36             
     37            # Keep a reference to the session ID for test purposes 
     38            environ[client.environKey+'.user'] = res[-1] 
     39                 
     40        except Exception, e: 
     41            return False 
     42        else: 
     43            return True 
     44 
    2245class InfoApp(object): 
    2346    method = { 
    2447        "/": 'default', 
    25         "/test_connect": "test_connect" 
     48        "/test_connect": "test_connect", 
     49        "/test_getSessionStatus": "test_getSessionStatus", 
     50        "/test_disconnect": "test_disconnect", 
     51        "/test_getAttCert": "test_getAttCert" 
    2652    } 
     53    httpBasicAuthentication = HTTPBasicAuthentication() 
    2754     
    2855    def __call__(self, environ, start_response): 
     
    4067        return "NDG Security Combined Services Unit Tests" 
    4168 
     69    @authorize(httpBasicAuthentication._userIn) 
    4270    def test_connect(self, environ, start_response): 
    43          
    4471        start_response('200 OK', [('Content-type', 'text/plain')]) 
    4572        return "test_connect succeeded" 
     73         
     74    @authorize(httpBasicAuthentication._userIn) 
     75    def test_getSessionStatus(self, environ, start_response): 
     76        client = WSGISessionManagerClient(environ=environ) 
     77        stat=client.getSessionStatus(sessID=environ[client.environKey+'.user']) 
     78        start_response('200 OK', [('Content-type', 'text/xml')]) 
     79        return "test_getSessionStatus succeeded. Response = %s" % stat 
    4680 
    47     def test_getAttributeCertificate(self, environ, start_response): 
     81    @authorize(httpBasicAuthentication._userIn) 
     82    def test_disconnect(self, environ, start_response): 
    4883        client = WSGISessionManagerClient(environ=environ) 
    49         attCert = client.getAttCert() 
     84        client.disconnect(sessID=environ[client.environKey+'.user']) 
     85         
     86        # Re-initialise user authentication 
     87        InfoApp.httpBasicAuthentication._userIn.users = [] 
     88        start_response('200 OK', [('Content-type', 'text/plain')]) 
     89        return "test_disconnect succeeded." 
     90 
     91    @authorize(httpBasicAuthentication._userIn) 
     92    def test_getAttCert(self, environ, start_response): 
     93        client = WSGISessionManagerClient(environ=environ) 
     94        attCert = client.getAttCert(sessID=environ[client.environKey+'.user']) 
    5095        start_response('200 OK', [('Content-type', 'text/xml')]) 
    51         return attCert 
    52  
    53 def valid(environ, username, password): 
    54     """validation function""" 
    55     try: 
    56         client = WSGISessionManagerClient(environ=environ) 
    57         res = client.connect(username, passphrase=password) 
    58     except Exception, e: 
    59         return False 
    60     else: 
    61         return True 
     96        return str(attCert) 
    6297         
    6398def app_factory(global_config, **local_conf): 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/combinedservices/services.ini

    r4513 r4520  
    2222wsseCfgFileSection = WS-Security 
    2323 
     24#______________________________________________________________________________ 
    2425# Attribute Authority settings 
    2526# 'name' setting MUST agree with map config file 'thisHost' name attribute 
     
    5859attributeAuthority.caCertFilePathList: $NDGSEC_COMBINED_SRVS_UNITTEST_DIR/ca/ndg-test-ca.crt 
    5960 
    60  
     61#______________________________________________________________________________ 
    6162# Session Manager specific settings - commented out settings will take their 
    6263# default settings.  To override the defaults uncomment and set as required. 
     
    100101# values should be delimited by a space 
    101102sessionManager.credentialWallet.wssecurity.caCertFilePathList: $NDGSEC_COMBINED_SRVS_UNITTEST_DIR/ca/ndg-test-ca.crt 
     103 
    102104# Signature of an outbound message 
    103105# 
     
    132134# Authentication service properties  
    133135sessionManager.authNService.moduleFilePath:  
    134 sessionManager.authNService.moduleName: ndg.security.test.combinedservices.sessionmanager.usercertauthn 
    135 sessionManager.authNService.className: UserCertAuthN 
     136sessionManager.authNService.moduleName: ndg.security.test.combinedservices.sessionmanager.userx509certauthn 
     137sessionManager.authNService.className: UserX509CertAuthN 
    136138 
    137139# Specific settings for UserCertAuthN Session Manager authentication plugin 
     
    165167enableWSDLQuery = True 
    166168charset = utf-8 
    167 filterID = attributeAuthorityFilter 
     169filterID = ndg.security.server.wsgi.attributeAuthorityFilter 
    168170 
    169171[filter:SessionManagerFilter] 
     
    178180enableWSDLQuery = True 
    179181charset = utf-8 
    180 filterID = ndg.security.server.sessionmanager.SessionManager 
     182filterID = ndg.security.server.wsgi.sessionManagerFilter 
    181183 
    182184[filter:wsseSignatureVerificationFilter] 
     
    198200setup_method=basic 
    199201basic_realm=Test Realm 
    200 basic_authenticate_function=ndg.security.test.combinedservices.serverapp:valid 
     202basic_authenticate_function=ndg.security.test.combinedservices.serverapp:InfoApp.httpBasicAuthentication 
    201203 
    202204 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/combinedservices/test_combinedservices.cfg

    r4513 r4520  
    4141passphrase = testpassword 
    4242 
     43[test10WSGILocalInstanceGetSessionStatus] 
     44url = http://localhost:8000/test_getSessionStatus 
     45username = testuser 
     46passphrase = testpassword 
     47 
     48[test11WSGILocalInstanceDisconnect] 
     49url = http://localhost:8000/test_disconnect 
     50username = testuser 
     51passphrase = testpassword 
     52 
     53[test12WSGILocalInstanceGetAttCert] 
     54url = http://localhost:8000/test_getAttCert 
     55username = testuser 
     56passphrase = testpassword 
     57 
    4358[wsse] 
    4459# WS-Security settings for unit test AA clients 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/combinedservices/test_combinedservices.py

    r4513 r4520  
    114114         
    115115 
    116     def test01Connect(self): 
    117         """test01Connect: Connect as if acting as a browser client -  
    118         a session ID is returned""" 
    119          
    120         username = self.cfg['test01Connect']['username'] 
    121          
    122         if CombinedServicesTestCase.test01Passphrase is None: 
    123             CombinedServicesTestCase.test01Passphrase = \ 
    124                                     self.cfg['test01Connect'].get('passphrase') 
    125          
    126         if not CombinedServicesTestCase.test01Passphrase: 
    127             CombinedServicesTestCase.test01Passphrase = getpass.getpass(\ 
    128                 prompt="\ntest01Connect pass-phrase for user %s: " % username) 
    129  
    130         self.userX509Cert, self.userPriKey, self.issuingCert, self.sessID = \ 
    131             self.clnt.connect(self.cfg['test01Connect']['username'],  
    132                     passphrase=CombinedServicesTestCase.test01Passphrase) 
    133  
    134         print("User '%s' connected to Session Manager:\n%s" % (username,  
    135                                                                self.sessID)) 
    136              
    137              
    138     def test02GetSessionStatus(self): 
    139         """test02GetSessionStatus: check a session is alive""" 
    140         print "\n\t" + self.test02GetSessionStatus.__doc__ 
    141          
    142         self.test01Connect() 
    143         assert self.clnt.getSessionStatus(sessID=self.sessID),"Session is dead" 
    144                  
    145         print("User connected to Session Manager with sessID=%s" % self.sessID) 
    146  
    147         assert not self.clnt.getSessionStatus(sessID='abc'), \ 
    148                                                 "sessID=abc shouldn't exist!" 
    149              
    150         print "CORRECT: sessID=abc doesn't exist" 
    151  
    152  
    153     def test03ConnectNoCreateServerSess(self): 
    154         """test03ConnectNoCreateServerSess: Connect without creating a session -  
    155         sessID should be None.  This only indicates that the username/password 
    156         are correct.  To be of practical use the AuthNService plugin at 
    157         the Session Manager needs to return X.509 credentials e.g. 
    158         with MyProxy plugin.""" 
    159  
    160         username = self.cfg['test03ConnectNoCreateServerSess']['username'] 
    161          
    162         if CombinedServicesTestCase.test03Passphrase is None: 
    163             CombinedServicesTestCase.test03Passphrase = \ 
    164                 self.cfg['test03ConnectNoCreateServerSess'].get('passphrase') 
    165                  
    166         if not CombinedServicesTestCase.test03Passphrase: 
    167             prompt="\ntest03ConnectNoCreateServerSess pass-phrase for user %s: " 
    168             CombinedServicesTestCase.test03Passphrase = getpass.getpass(\ 
    169                                                     prompt=prompt % username) 
    170              
    171         userX509Cert, userPriKey,issuingCert, sessID = \ 
    172             self.clnt.connect(username,  
    173                       passphrase=CombinedServicesTestCase.test03Passphrase, 
    174                       createServerSess=False) 
    175          
    176         # Expect null session ID 
    177         assert(not sessID) 
    178            
    179         print("Successfully authenticated") 
    180              
    181  
    182     def test04DisconnectWithSessID(self): 
    183         """test04DisconnectWithSessID: disconnect as if acting as a browser  
    184         client  
    185         """ 
    186          
    187         print "\n\t" + self.test04DisconnectWithSessID.__doc__ 
    188         self.test01Connect() 
    189          
    190         self.clnt.disconnect(sessID=self.sessID) 
    191          
    192         print("User disconnected from Session Manager:\n%s" % self.sessID) 
    193              
    194  
    195     def test05DisconnectWithUserX509Cert(self): 
    196         """test05DisconnectWithUserX509Cert: Disconnect as a command line client  
    197         """ 
    198          
    199         print "\n\t" + self.test05DisconnectWithUserX509Cert.__doc__ 
    200         self.test01Connect() 
    201          
    202         # Use user cert / private key just obtained from connect call for 
    203         # signature generation 
    204         if self.issuingCert: 
    205             self.clnt.signatureHandler.reqBinSecTokValType = 'X509PKIPathv1' 
    206             self.clnt.signatureHandler.signingPriKey = self.userPriKey         
    207             self.clnt.signatureHandler.signingCertChain = (self.issuingCert, 
    208                                                            self.userX509Cert) 
    209             self.clnt.signatureHandler.signingCert = None 
    210         else: 
    211             self.clnt.signatureHandler.reqBinSecTokValType = 'X509v3' 
    212             self.clnt.signatureHandler.signingPriKeyPwd = \ 
    213                 CombinedServicesTestCase.test01Passphrase 
    214             self.clnt.signatureHandler.signingPriKey = self.userPriKey         
    215             self.clnt.signatureHandler.signingCertChain = () 
    216             self.clnt.signatureHandler.signingCert = self.userX509Cert 
    217              
    218         # user X.509 cert in signature determines ID of session to delete 
    219         self.clnt.disconnect() 
    220         print("User disconnected from Session Manager:\n%s"%self.userX509Cert) 
    221  
    222  
    223     def test06GetAttCertWithSessID(self): 
    224         """test06GetAttCertWithSessID: make an attribute request using 
    225         a session ID as authentication credential""" 
    226  
    227         print "\n\t" + self.test06GetAttCertWithSessID.__doc__ 
    228         thisSection = self.cfg['test06GetAttCertWithSessID']       
    229         self.test01Connect() 
    230          
    231         attCert = self.clnt.getAttCert(sessID=self.sessID,  
    232                                        attAuthorityURI=thisSection['aaURI']) 
    233          
    234         print "Attribute Certificate:\n%s" % attCert  
    235         attCert.filePath = xpdVars(thisSection['acOutFilePath'])  
    236         attCert.write()  
    237  
    238  
    239     def test07GetAttCertWithUserX509Cert(self): 
    240         """test07GetAttCertWithUserX509Cert: make an attribute request using 
    241         a user cert as authentication credential""" 
    242         print "\n\t" + self.test07GetAttCertWithUserX509Cert.__doc__ 
    243         self.test01Connect() 
    244  
    245         if self.issuingCert: 
    246             self.clnt.signatureHandler.reqBinSecTokValType = 'X509PKIPathv1' 
    247             self.clnt.signatureHandler.signingPriKeyPwd = \ 
    248                                 CombinedServicesTestCase.test01Passphrase 
    249             self.clnt.signatureHandler.signingPriKey = self.userPriKey         
    250             self.clnt.signatureHandler.signingCertChain = (self.issuingCert, 
    251                                                            self.userX509Cert) 
    252             self.clnt.signatureHandler.signingCert = None 
    253         else: 
    254             self.clnt.signatureHandler.reqBinSecTokValType = 'X509v3' 
    255             self.clnt.signatureHandler.signingPriKeyPwd = \ 
    256                                 CombinedServicesTestCase.test01Passphrase 
    257             self.clnt.signatureHandler.signingPriKey = self.userPriKey         
    258             self.clnt.signatureHandler.signingCertChain = () 
    259             self.clnt.signatureHandler.signingCert = self.userX509Cert 
    260          
    261         # Request an attribute certificate from an Attribute Authority  
    262         # using the userX509Cert returned from connect() 
    263          
    264         aaURI = self.cfg['test07GetAttCertWithUserX509Cert']['aaURI'] 
    265         attCert = self.clnt.getAttCert(attAuthorityURI=aaURI) 
    266            
    267         print("Attribute Certificate:\n%s" % attCert)   
    268  
    269  
    270     def test08GetAttCertFromLocalAttributeAuthority(self): 
    271         """test08GetAttCertFromLocalAttributeAuthority: query the Attribute 
    272         Authority running in the same server instance as the Session Manager""" 
    273  
    274         print "\n\t" + self.test08GetAttCertFromLocalAttributeAuthority.__doc__ 
    275         self.test01Connect() 
    276          
    277         attCert = self.clnt.getAttCert(sessID=self.sessID) 
    278          
    279         print "Attribute Certificate:\n%s" % attCert  
     116#    def test01Connect(self): 
     117#        """test01Connect: Connect as if acting as a browser client -  
     118#        a session ID is returned""" 
     119#         
     120#        username = self.cfg['test01Connect']['username'] 
     121#         
     122#        if CombinedServicesTestCase.test01Passphrase is None: 
     123#            CombinedServicesTestCase.test01Passphrase = \ 
     124#                                    self.cfg['test01Connect'].get('passphrase') 
     125#         
     126#        if not CombinedServicesTestCase.test01Passphrase: 
     127#            CombinedServicesTestCase.test01Passphrase = getpass.getpass(\ 
     128#                prompt="\ntest01Connect pass-phrase for user %s: " % username) 
     129# 
     130#        self.userX509Cert, self.userPriKey, self.issuingCert, self.sessID = \ 
     131#            self.clnt.connect(self.cfg['test01Connect']['username'],  
     132#                    passphrase=CombinedServicesTestCase.test01Passphrase) 
     133# 
     134#        print("User '%s' connected to Session Manager:\n%s" % (username,  
     135#                                                               self.sessID)) 
     136#             
     137#             
     138#    def test02GetSessionStatus(self): 
     139#        """test02GetSessionStatus: check a session is alive""" 
     140#        print "\n\t" + self.test02GetSessionStatus.__doc__ 
     141#         
     142#        self.test01Connect() 
     143#        assert self.clnt.getSessionStatus(sessID=self.sessID),"Session is dead" 
     144#                 
     145#        print("User connected to Session Manager with sessID=%s" % self.sessID) 
     146# 
     147#        assert not self.clnt.getSessionStatus(sessID='abc'), \ 
     148#                                                "sessID=abc shouldn't exist!" 
     149#             
     150#        print "CORRECT: sessID=abc doesn't exist" 
     151# 
     152# 
     153#    def test03ConnectNoCreateServerSess(self): 
     154#        """test03ConnectNoCreateServerSess: Connect without creating a session -  
     155#        sessID should be None.  This only indicates that the username/password 
     156#        are correct.  To be of practical use the AuthNService plugin at 
     157#        the Session Manager needs to return X.509 credentials e.g. 
     158#        with MyProxy plugin.""" 
     159# 
     160#        username = self.cfg['test03ConnectNoCreateServerSess']['username'] 
     161#         
     162#        if CombinedServicesTestCase.test03Passphrase is None: 
     163#            CombinedServicesTestCase.test03Passphrase = \ 
     164#                self.cfg['test03ConnectNoCreateServerSess'].get('passphrase') 
     165#                 
     166#        if not CombinedServicesTestCase.test03Passphrase: 
     167#            prompt="\ntest03ConnectNoCreateServerSess pass-phrase for user %s: " 
     168#            CombinedServicesTestCase.test03Passphrase = getpass.getpass(\ 
     169#                                                    prompt=prompt % username) 
     170#             
     171#        userX509Cert, userPriKey,issuingCert, sessID = \ 
     172#            self.clnt.connect(username,  
     173#                      passphrase=CombinedServicesTestCase.test03Passphrase, 
     174#                      createServerSess=False) 
     175#         
     176#        # Expect null session ID 
     177#        assert(not sessID) 
     178#           
     179#        print("Successfully authenticated") 
     180#             
     181# 
     182#    def test04DisconnectWithSessID(self): 
     183#        """test04DisconnectWithSessID: disconnect as if acting as a browser  
     184#        client  
     185#        """ 
     186#         
     187#        print "\n\t" + self.test04DisconnectWithSessID.__doc__ 
     188#        self.test01Connect() 
     189#         
     190#        self.clnt.disconnect(sessID=self.sessID) 
     191#         
     192#        print("User disconnected from Session Manager:\n%s" % self.sessID) 
     193#             
     194# 
     195#    def test05DisconnectWithUserX509Cert(self): 
     196#        """test05DisconnectWithUserX509Cert: Disconnect as a command line client  
     197#        """ 
     198#         
     199#        print "\n\t" + self.test05DisconnectWithUserX509Cert.__doc__ 
     200#        self.test01Connect() 
     201#         
     202#        # Use user cert / private key just obtained from connect call for 
     203#        # signature generation 
     204#        if self.issuingCert: 
     205#            self.clnt.signatureHandler.reqBinSecTokValType = 'X509PKIPathv1' 
     206#            self.clnt.signatureHandler.signingPriKey = self.userPriKey         
     207#            self.clnt.signatureHandler.signingCertChain = (self.issuingCert, 
     208#                                                           self.userX509Cert) 
     209#            self.clnt.signatureHandler.signingCert = None 
     210#        else: 
     211#            self.clnt.signatureHandler.reqBinSecTokValType = 'X509v3' 
     212#            self.clnt.signatureHandler.signingPriKeyPwd = \ 
     213#                CombinedServicesTestCase.test01Passphrase 
     214#            self.clnt.signatureHandler.signingPriKey = self.userPriKey         
     215#            self.clnt.signatureHandler.signingCertChain = () 
     216#            self.clnt.signatureHandler.signingCert = self.userX509Cert 
     217#             
     218#        # user X.509 cert in signature determines ID of session to delete 
     219#        self.clnt.disconnect() 
     220#        print("User disconnected from Session Manager:\n%s"%self.userX509Cert) 
     221# 
     222# 
     223#    def test06GetAttCertWithSessID(self): 
     224#        """test06GetAttCertWithSessID: make an attribute request using 
     225#        a session ID as authentication credential""" 
     226# 
     227#        print "\n\t" + self.test06GetAttCertWithSessID.__doc__ 
     228#        thisSection = self.cfg['test06GetAttCertWithSessID']       
     229#        self.test01Connect() 
     230#         
     231#        attCert = self.clnt.getAttCert(sessID=self.sessID,  
     232#                                       attAuthorityURI=thisSection['aaURI']) 
     233#         
     234#        print "Attribute Certificate:\n%s" % attCert  
     235#        attCert.filePath = xpdVars(thisSection['acOutFilePath'])  
     236#        attCert.write()  
     237# 
     238# 
     239#    def test07GetAttCertWithUserX509Cert(self): 
     240#        """test07GetAttCertWithUserX509Cert: make an attribute request using 
     241#        a user cert as authentication credential""" 
     242#        print "\n\t" + self.test07GetAttCertWithUserX509Cert.__doc__ 
     243#        self.test01Connect() 
     244# 
     245#        if self.issuingCert: 
     246#            self.clnt.signatureHandler.reqBinSecTokValType = 'X509PKIPathv1' 
     247#            self.clnt.signatureHandler.signingPriKeyPwd = \ 
     248#                                CombinedServicesTestCase.test01Passphrase 
     249#            self.clnt.signatureHandler.signingPriKey = self.userPriKey         
     250#            self.clnt.signatureHandler.signingCertChain = (self.issuingCert, 
     251#                                                           self.userX509Cert) 
     252#            self.clnt.signatureHandler.signingCert = None 
     253#        else: 
     254#            self.clnt.signatureHandler.reqBinSecTokValType = 'X509v3' 
     255#            self.clnt.signatureHandler.signingPriKeyPwd = \ 
     256#                                CombinedServicesTestCase.test01Passphrase 
     257#            self.clnt.signatureHandler.signingPriKey = self.userPriKey         
     258#            self.clnt.signatureHandler.signingCertChain = () 
     259#            self.clnt.signatureHandler.signingCert = self.userX509Cert 
     260#         
     261#        # Request an attribute certificate from an Attribute Authority  
     262#        # using the userX509Cert returned from connect() 
     263#         
     264#        aaURI = self.cfg['test07GetAttCertWithUserX509Cert']['aaURI'] 
     265#        attCert = self.clnt.getAttCert(attAuthorityURI=aaURI) 
     266#           
     267#        print("Attribute Certificate:\n%s" % attCert)   
     268# 
     269# 
     270#    def test08GetAttCertFromLocalAttributeAuthority(self): 
     271#        """test08GetAttCertFromLocalAttributeAuthority: query the Attribute 
     272#        Authority running in the same server instance as the Session Manager""" 
     273# 
     274#        print "\n\t" + self.test08GetAttCertFromLocalAttributeAuthority.__doc__ 
     275#        self.test01Connect() 
     276#         
     277#        attCert = self.clnt.getAttCert(sessID=self.sessID) 
     278#         
     279#        print "Attribute Certificate:\n%s" % attCert  
    280280 
    281281 
     
    286286        # Make a client connection to the WSGI app - authenticate with WSGI 
    287287        # basic auth 
    288         thisSection = 'test09WSGILocalInstanceConnect' 
    289         url = self.cfg[thisSection]['url'] 
    290         username = self.cfg[thisSection]['username'] 
    291         password = self.cfg[thisSection]['passphrase'] 
     288        thisSection = self.cfg['test09WSGILocalInstanceConnect'] 
     289        url = thisSection['url'] 
     290        username = thisSection['username'] 
     291        password = thisSection['passphrase'] 
    292292        print("WSGI app connecting to local Session Manager instance: %s" % 
    293293              self._httpBasicAuthReq(url, username, password)) 
    294          
    295          
     294 
     295 
     296    def test10WSGILocalInstanceGetSessionStatus(self): 
     297        """test10WSGILocalInstanceGetSessionStatus: test a WSGI app calling a  
     298        Session Manager WSGI local instance""" 
     299         
     300        # Make a client connection to the WSGI app - authenticate with WSGI 
     301        # basic auth 
     302        thisSection = self.cfg['test10WSGILocalInstanceGetSessionStatus'] 
     303        url = thisSection['url'] 
     304        username = thisSection['username'] 
     305        password = thisSection['passphrase'] 
     306        print("WSGI app connecting to local Session Manager instance: %s" % 
     307              self._httpBasicAuthReq(url, username, password)) 
     308 
     309 
     310    def test11WSGILocalInstanceDisconnect(self): 
     311        """test11WSGILocalInstanceDisconnect: test a WSGI app calling a  
     312        Session Manager WSGI local instance""" 
     313         
     314        # Make a client connection to the WSGI app - authenticate with WSGI 
     315        # basic auth 
     316        thisSection = self.cfg['test11WSGILocalInstanceDisconnect'] 
     317        url = thisSection['url'] 
     318        username = thisSection['username'] 
     319        password = thisSection['passphrase'] 
     320        print("WSGI app connecting to local Session Manager instance: %s" % 
     321              self._httpBasicAuthReq(url, username, password))      
     322 
     323 
     324    def test12WSGILocalInstanceGetAttCert(self): 
     325        """test12WSGILocalInstanceGetAttCert: test a WSGI app calling a  
     326        Session Manager WSGI local instance""" 
     327         
     328        # Make a client connection to the WSGI app - authenticate with WSGI 
     329        # basic auth 
     330        thisSection = self.cfg['test12WSGILocalInstanceGetAttCert'] 
     331        url = thisSection['url'] 
     332        username = thisSection['username'] 
     333        password = thisSection['passphrase'] 
     334        print("WSGI app connecting to local Session Manager instance: %s" % 
     335              self._httpBasicAuthReq(url, username, password))        
     336        
    296337class CombinedServicesTestSuite(unittest.TestSuite): 
    297338     
     
    308349                    "test08GetAttCertFromLocalAttributeAuthority", 
    309350                    "test09WSGILocalInstanceConnect", 
     351                    "test10WSGILocalInstanceGetSessionStatus", 
     352                    "test11WSGILocalInstanceDisconnect" 
    310353                  )) 
    311354        unittest.TestSuite.__init__(self, map) 
Note: See TracChangeset for help on using the changeset viewer.