SF.net SVN: nagiosplug:[2237] nagiosplug/trunk/plugins/tests/check_snmp.t

[email protected]
Newsgroups gmane.network.nagios.plugins.cvs
Message-ID <[email protected]>
Revision: 2237
          http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=2237&view=rev
Author:   dermoth
Date:     2009-09-05 07:27:09 +0000 (Sat, 05 Sep 2009)

Log Message:
-----------
Add a test that succeeds on check_snmp v1.4.13. Newer versions skip additional
lines so this new test fails on the current head.

Note: check_snmp v1.4.13 with multi-line strings return somewhat v3 output;
      it's not exactly what the specs say but it doesn't appears to break them
      either. The fix could eventually supports both v2 and v3 output formats.

From: Thomas Guyot-Sionnest <[email protected]>

Modified Paths:
--------------
    nagiosplug/trunk/plugins/tests/check_snmp.t

Modified: nagiosplug/trunk/plugins/tests/check_snmp.t
===================================================================
--- nagiosplug/trunk/plugins/tests/check_snmp.t	2009-08-05 07:15:15 UTC (rev 2236)
+++ nagiosplug/trunk/plugins/tests/check_snmp.t	2009-09-05 07:27:09 UTC (rev 2237)
@@ -41,7 +41,7 @@
 	}
 }
 
-my $tests = 2;
+my $tests = 3;
 if (-x "./check_snmp") {
 	plan tests => $tests;
 } else {
@@ -53,4 +53,11 @@
 $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.0");
 cmp_ok( $res->return_code, '==', 0, "Exit OK when querying a multi-line string" );
 like($res->output, '/^SNMP OK - /', "String contains SNMP OK");
+like($res->output, '/'.quotemeta('SNMP OK - "Cisco Internetwork Operating System SoftwareIOS (tm) Catalyst 4000 L3 Switch Software (cat4000-I9K91S-M), Version
+12.2(20)EWA, RELEASE SOFTWARE (fc1)
+Technical Support: http://www.cisco.com/techsupport
+Copyright (c) 1986-2004 by cisco Systems, Inc.
+"').'/m', "String contains all lines");
 
+print $res->output;
+


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.