source: TI12-security/trunk/python/ndg.security.test/ndg/security/test/Log/LogTest.py @ 2900

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.test/ndg/security/test/Log/LogTest.py@2900
Revision 2900, 1.5 KB checked in by pjkersha, 13 years ago (diff)

ndg.security.server/setup.py: added *.conf for conf/ openssl.conf file

ndg.security.server/ndg/security/server/AttAuthority/init.py:

  • Use RotatingFileHandler? from logging package to enable store of ACs issued to be limited. Properties file attCertFileLogCnt sets maximum number of files created before rotation.
  • newAttCertFilePath() is replaced by rotating file handler functionality
  • added logging with some debug messages - more needed to complete

ndg.security.server/ndg/security/server/conf/attCert/init.py

  • renamed to ndg.security.test/ndg/security/test/AttAuthority/attCertLog/init.py

ndg.security.server/ndg/security/server/conf/userRoles.py: userIsRegistered should return bool

ndg.security.server/ndg/security/server/conf/attAuthorityProperties.xml,
ndg.security.test/ndg/security/test/AttAuthority/siteAAttAuthorityProperties.xml,
ndg.security.test/ndg/security/test/AttAuthority/siteBAttAuthorityProperties.xml:

  • filled in default values for most attributes to ease installation config tasks
  • attCertFilePfx and attCertFileSfx replaced with attCertFileName and attCertFileLog attributes for new AC logging.

ndg.security.client/ndg/security/client/ndgSessionClient.py: removed debug calls. This module may now be surplus because of Pylons framework and plans for Java and PHP clients.

ndg.security.test/ndg/security/test/AttAuthority/siteAUserRoles.py: added coapec for testing

ndg.security.test/ndg/security/test/AttAuthority/siteAMapConfig.xml: fix formatting

ndg.security.test/ndg/security/test/AttAuthority/attAuthorityClientTest.cfg: altered settings for tests

ndg.security.test/ndg/security/test/Log/LogTest.py: exptd with log config. Eventually change to be harness for SOAP log interface

Makefile: use default python + added force target.

  • Property svn:executable set to *
Line 
1#!/usr/bin/env python
2"""NDG Logging class test harness
3
4NERC Data Grid Project
5
6P J Kershaw 12/05/06
7
8Copyright (C) 2006 CCLRC & NERC
9
10This software may be distributed under the terms of the Q Public License,
11version 1.0 or later.
12"""
13import unittest
14import os
15import logging
16#logging.basicConfig(level=logging.DEBUG,
17#                    format='%(asctime)s %(levelname)-8s %(message)s',
18#                    datefmt='%a, %d %b %Y %H:%M:%S',
19#                    filename='./ndg.log',
20#                    filemode='w')
21from logging.config import fileConfig
22fileConfig('log.cfg')
23log = logging.getLogger(__name__)
24
25class LogTestCase(unittest.TestCase):
26
27    def setUp(self):
28        pass
29   
30    def __output(self):
31        print log
32        log.info('Jackdaws love my big sphinx of quartz.')
33   
34        log.debug('Quick zephyrs blow, vexing daft Jim.')
35        log.info('How quickly daft jumping zebras vex.')
36        log.warning('Jail zesty vixen who grabbed pay from quack.')
37        log.error('The five boxing wizards jump quickly.')
38
39
40    def test1(self):
41        self.__output()
42         
43           
44#_____________________________________________________________________________       
45class LogTestSuite(unittest.TestSuite):
46   
47    def __init__(self):
48        map = map(LogTestCase,
49                  (
50                    "test",
51                  ))
52        unittest.TestSuite.__init__(self, map)
53           
54                                                   
55if __name__ == "__main__":
56    unittest.main()
Note: See TracBrowser for help on using the repository browser.