Changeset 3115 for TI12-security
- Timestamp:
- 06/12/07 09:46:37 (13 years ago)
- Location:
- TI12-security/trunk/python/ndg.security.test/ndg/security/test/wsSecurity/client
- Files:
-
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/python/ndg.security.test/ndg/security/test/wsSecurity/client/echoClientTest.py
r3114 r3115 9 9 import wsSecurity 10 10 11 import unittest 12 import os 13 import sys 14 import getpass 15 import traceback 16 17 from ConfigParser import SafeConfigParser 18 from ndg.security.common import wsSecurity 19 20 class WSSecurityClientTestCase(unittest.TestCase): 21 22 def setUp(self): 23 24 configParser = SafeConfigParser() 25 configParser.read("./myProxyClientTest.cfg") 26 27 self.cfg = {} 28 for section in configParser.sections(): 29 self.cfg[section] = dict(configParser.items(section)) 30 31 self.clnt = WSSecurityClient(\ 32 propFilePath=self.cfg['setUp']['propfilepath']) 33 34 35 def test1Echo(self): 36 '''test1Echo: test signed message and signed response from server''' 37 38 passphrase = self.cfg['test1Echo'].get('passphrase') 39 if passphrase is None: 40 passphrase = getpass.getpass(\ 41 prompt="\ntest1Echo cred. pass-phrase: ") 42 43 ownerPassphrase = self.cfg['test1Echo'].get('ownerpassphrase') 44 if ownerPassphrase is None: 45 ownerPassphrase = getpass.getpass(\ 46 prompt="\ntest1Echo cred. owner pass-phrase: ") 47 48 try: 49 self.clnt.store(self.cfg['test1Echo']['username'], 50 passphrase, 51 self.cfg['test1Echo']['certfile'], 52 self.cfg['test1Echo']['keyfile'], 53 ownerCertFile=self.cfg['test1Echo']['ownercertfile'], 54 ownerKeyFile=self.cfg['test1Echo']['ownerkeyfile'], 55 ownerPassphrase=ownerPassphrase, 56 force=False) 57 print "Store creds for user %s" % \ 58 self.cfg['test1Echo']['username'] 59 except: 60 self.fail(traceback.print_exc()) 61 62 #_____________________________________________________________________________ 63 class WSSecurityClientTestSuite(unittest.TestSuite): 64 def __init__(self): 65 map = map(WSSecurityClientTestCase, 66 ( 67 "test1Echo", 68 )) 69 unittest.TestSuite.__init__(self, map) 70 71 if __name__ == "__main__": 72 unittest.main() 11 73 # Lambda used by WS-Security handler to check which operation has been 12 74 # invoked
Note: See TracChangeset
for help on using the changeset viewer.