Changeset 5358


Ignore:
Timestamp:
05/06/09 13:07:28 (10 years ago)
Author:
pjkersha
Message:
  • ndg.security.test.unit.wssecurity.dom: WS-Security signature handler: added a unit test case for a client not setting a timestamp in the input message and the server configured to catch it and raise an exception (using timestampMustBeSet config param)
Location:
TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/wssecurity/dom
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/wssecurity/dom/client/test_echoclient.py

    r5290 r5358  
    2727 
    2828from ndg.security.test.unit import BaseTestCase 
    29 from ndg.security.common.wssecurity.signaturehandler.dom import SignatureHandler 
     29from ndg.security.common.wssecurity.signaturehandler.dom import \ 
     30    SignatureHandler 
     31from ndg.security.common.wssecurity.signaturehandler import NoSignatureFound 
    3032 
    3133class EchoClientTestCase(BaseTestCase): 
     
    7072         
    7173 
    72     def test1Echo(self): 
     74    def test01Echo(self): 
    7375        '''test1Echo: test signed message and signed response from server''' 
    7476             
     
    7880        except: 
    7981            self.fail(traceback.print_exc()) 
    80       
    81 #_____________________________________________________________________________        
    82 class EchoClientTestSuite(unittest.TestSuite): 
    83     def __init__(self): 
    84         map = map(EchoClientTestCase, 
    85                   ( 
    86                     "test1Echo", 
    87                   )) 
    88         unittest.TestSuite.__init__(self, map) 
     82         
     83 
     84    def test02ServerRaiseMissingTimestampError(self): 
     85        # Get server to catch that no timestamp was provided 
     86         
     87        self.clnt.binding.sig_handler.addTimestamp = False 
     88        try: 
     89            resp = self.clnt.Echo("Hello again from client") 
     90             
     91        except NoSignatureFound: 
     92            print "PASSED - server rejected client message with no timestamp" 
     93        else: 
     94            self.fail("Expecting error from server because client didn't set " 
     95                      "a timestamp element") 
    8996                                         
    9097if __name__ == "__main__": 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/unit/wssecurity/dom/server/wssecurity.cfg

    r5290 r5358  
    9696# - NB, the two CA certificates are for the python and the java clients, respectively 
    9797caCertFilePathList=$NDGSEC_TEST_CONFIG_DIR/ca/java-ca.crt $NDGSEC_TEST_CONFIG_DIR/ca/ndg-test-ca.crt 
     98 
     99# Force an exception if a client message doesn't contain a timestamp 
     100timestampMustBeSet=True 
Note: See TracChangeset for help on using the changeset viewer.