tcl-websh-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ron...@apache.org
Subject svn commit: r784041 - in /tcl/websh/trunk/src: ChangeLog tests/logtosyslog.test
Date Fri, 12 Jun 2009 09:08:46 GMT
Author: ronnie
Date: Fri Jun 12 09:08:46 2009
New Revision: 784041

URL: http://svn.apache.org/viewvc?rev=784041&view=rev
Log:
- add constraint to only run test when syslog is found and readable

Modified:
    tcl/websh/trunk/src/ChangeLog
    tcl/websh/trunk/src/tests/logtosyslog.test

Modified: tcl/websh/trunk/src/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/ChangeLog?rev=784041&r1=784040&r2=784041&view=diff
==============================================================================
--- tcl/websh/trunk/src/ChangeLog (original)
+++ tcl/websh/trunk/src/ChangeLog Fri Jun 12 09:08:46 2009
@@ -1,3 +1,8 @@
+2009-06-12 Brunner Ronnie <ronnie.brunner@netcetera.ch>
+	* src/tests/logtosyslog.test:
+	- add constraint to only run test when syslog is 
+	  found and readable
+
 2009-05-22 Brunner Ronnie <ronnie.brunner@netcetera.ch>
 	* src/generic/url.c:
 	- properly detect host and port in request params

Modified: tcl/websh/trunk/src/tests/logtosyslog.test
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/tests/logtosyslog.test?rev=784041&r1=784040&r2=784041&view=diff
==============================================================================
--- tcl/websh/trunk/src/tests/logtosyslog.test (original)
+++ tcl/websh/trunk/src/tests/logtosyslog.test Fri Jun 12 09:08:46 2009
@@ -48,7 +48,23 @@
     set res [web::logdest add info2.-debug syslog 0]
 } {logdest0}
 
-test logToSyslog-1.2 {websh3_toSyslog: test log} {unixOnly} {
+
+global srclist
+set srclist [list /var/adm/messages /var/log/messages /var/log/syslog /var/log/system.log]
+
+proc sysLogIsReadable {} {
+    global srclist
+    foreach file $srclist {
+	if {[file readable $file]} {
+	    return 1
+	}
+    }
+    return 0
+}
+
+testConstraint sysLogUnreadableOrNotFound [sysLogIsReadable]
+
+test logToSyslog-1.2 {websh3_toSyslog: test log} {unixOnly sysLogUnreadableOrNotFound} {
     set res "Failed"
 
     set curTim [clock seconds]
@@ -62,12 +78,11 @@
 
     web::log info.info {toSyslog}
 
-    set srclst [list /var/adm/messages /var/log/messages /var/log/syslog /var/log/system.log]
-
     ## give syslog a little time to feed the message to the file
     after 1000
 
-    foreach tmp $srclst {
+    global srclist
+    foreach tmp $srclist {
         if {[scanFileForPattern $tmp $format]} {
 	    set res "Ok"
             break



---------------------------------------------------------------------
To unsubscribe, e-mail: websh-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-cvs-help@tcl.apache.org


Mime
View raw message