Update of /cvsroot/naviserver/naviserver/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14198/tests
Modified Files:
ns_log.test
Log Message:
* nsd/log.c:
* tests/ns_log.test: Add new sub-command: ns_logctl severity.
With this you can query and set the status of any of the log
levels at runtime. For example, you could log into the control
port -- ns_logctl severity debug on -- to track down a problem.
Index: ns_log.test
===================================================================
RCS file: /cvsroot/naviserver/naviserver/tests/ns_log.test,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ns_log.test 4 Aug 2005 05:29:41 -0000 1.1
--- ns_log.test 17 Oct 2005 11:43:58 -0000 1.2
***************
*** 27,35 ****
test ns_log-2.2 {basic syntax} -body {
ns_logctl ?
! } -returnCodes error -result {bad option "?": must be hold, count, get, peek, flush, release, or truncate}
ns_logctl hold
ns_logctl trunc
test ns_log-3.1 {severity} -body {
--- 27,37 ----
test ns_log-2.2 {basic syntax} -body {
ns_logctl ?
! } -returnCodes error -result {bad option "?": must be hold, count, get, peek, flush, release, truncate, or severity}
ns_logctl hold
ns_logctl trunc
+ ns_logctl severity debug on
+ ns_logctl severity dev on
test ns_log-3.1 {severity} -body {
***************
*** 58,67 ****
} -match glob -result "* Bug: test\n"
! test ns_log-3.6 {severity} -constraints knownBug -body {
ns_log debug test
ns_logctl get
} -match glob -result "* Debug: test\n"
! test ns_log-3.7 {severity} -constraints knownBug -body {
ns_log dev test
ns_logctl get
--- 60,69 ----
} -match glob -result "* Bug: test\n"
! test ns_log-3.6 {severity} -body {
ns_log debug test
ns_logctl get
} -match glob -result "* Debug: test\n"
! test ns_log-3.7 {severity} -body {
ns_log dev test
ns_logctl get
***************
*** 143,148 ****
--- 145,175 ----
+ test ns_log-6.1 {configuration} -body {
+ ns_logctl severity
+ } -returnCodes error -result {wrong # args: should be "ns_logctl severity severity-level ?bool?"}
+
+ test ns_log-6.2 {configuration} -body {
+ ns_logctl severity ?
+ } -returnCodes error -result {bad severity "?": must be notice, Notice, warning, Warning, error, Error, fatal, Fatal, bug, Bug, debug, Debug, dev, or Dev}
+
+ test ns_log-6.3 {configuration} -body {
+ ns_logctl severity debug
+ } -result 1
+
+ test ns_log-6.4 {configuration} -body {
+ ns_logctl severity debug 0
+ } -result 0
+
+ test ns_log-6.5 {configuration} -body {
+ ns_logctl severity debug
+ } -result 0
+
+
+
ns_logctl trunc
ns_logctl release
+ ns_logctl severity debug off
+ ns_logctl severity dev off
+
cleanupTests
|