From 01fa09807824d3a56cb71bdbc57a9472b7f7aaa1 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 20 Apr 2019 06:57:43 +0100 Subject: [PATCH] support debug via env vars (same as netdisco) --- xt/lib/My/Test/Class.pm | 2 ++ xt/lib/Test/SNMP/Info.pm | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/xt/lib/My/Test/Class.pm b/xt/lib/My/Test/Class.pm index 4758a550..8a46d11c 100644 --- a/xt/lib/My/Test/Class.pm +++ b/xt/lib/My/Test/Class.pm @@ -73,6 +73,8 @@ sub setup : Tests(setup) { 'Community' => 'public', 'Version' => 2, 'Session' => $sess, + 'Debug' => ($ENV{INFO_TRACE} || 0), + 'DebugSNMP' => ($ENV{SNMP_TRACE} || 0), ); } diff --git a/xt/lib/Test/SNMP/Info.pm b/xt/lib/Test/SNMP/Info.pm index c90ea846..b6464a28 100644 --- a/xt/lib/Test/SNMP/Info.pm +++ b/xt/lib/Test/SNMP/Info.pm @@ -935,7 +935,7 @@ sub init : Tests(3) { my $netsnmp_ver = $SNMP::VERSION; local $SNMP::VERSION = '5.0.1'; - warnings_like { $test->{info}->init() } + warnings_exist { $test->{info}->init() } [{carped => qr/Net-SNMP\s5.0.1\sseems\sto\sbe\srather\sbuggy/x}], 'Use of bad Net-SNMP gives warning'; @@ -956,6 +956,8 @@ sub args : Tests(2) { 'Community' => 'public', 'Version' => 2, 'Session' => $sess, + 'Debug' => ($ENV{INFO_TRACE} || 0), + 'DebugSNMP' => ($ENV{SNMP_TRACE} || 0), }; can_ok($test->{info}, 'args');