source: TI12-security/trunk/python/Tests/LogTest.py @ 1236

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

Tests/LogClientTest?.py: LogServer? WS client unit tests

Tests/LogTest?.py: Log unit tests

ndgSetup.sh: added optional environment variable setting for security WS ports: NDG_CA_PORT_NUM,
NDG_LOG_PORT_NUM, and NDG_GK_PORT_NUM

share/ndg-sm, share/ndg-log, share/ndg-gk and share/ndg-ca: SysV init scripts for the Session Manager, NDG Log,
Gatekeeper and Simple CA WSs.

conf/gatekeeperProperties.xml: include basic settings

NDG/LogIO.py: interface for Log WS messages - not checked in previously (!)

bin/AttAuthorityServer.py, bin/LogServer.py, bin/SessionMgrServer.py, bin/GatekeeperServer.py and
bin/SimpleCAServer.py: all working with ability to fork a new process for the respective server. Debug code
allows error messages to be reported to a temp file if required - set logForkErr flag in the code to True.

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
14
15from NDG.Log import *
16
17class LogTestCase(unittest.TestCase):
18
19    def setUp(self):
20        self.log = Log(logFilePath="./ndg.log", console=True)
21
22    def test(self):
23       
24        # Now, we can log to the root logger, or any other logger. First the root...
25        try:
26            self.log.info('Jackdaws love my big sphinx of quartz.')
27       
28            self.log.debug('Quick zephyrs blow, vexing daft Jim.')
29            self.log.info('How quickly daft jumping zebras vex.')
30            self.log.warning('Jail zesty vixen who grabbed pay from quack.')
31            self.log.error('The five boxing wizards jump quickly.')
32           
33        except Exception, e:
34            self.fail(str(e))
35           
36           
37#_____________________________________________________________________________       
38class LogTestSuite(unittest.TestSuite):
39   
40    def __init__(self):
41        map = map(LogTestCase,
42                  (
43                    "test",
44                  ))
45        unittest.TestSuite.__init__(self, map)
46           
47                                                   
48if __name__ == "__main__":
49    unittest.main()
Note: See TracBrowser for help on using the repository browser.