From 7ee5acc25e47a0d1c8d27acb8ce4e80ad48087b6 Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Fri, 23 Nov 2012 10:23:51 +0000 Subject: Added minimal_dns_lookups configuration directive to allow alert-group DNS lookups to occur when needed. --- test/tc_mauve_source_list.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/tc_mauve_source_list.rb b/test/tc_mauve_source_list.rb index 5b1aa70..6241a2f 100644 --- a/test/tc_mauve_source_list.rb +++ b/test/tc_mauve_source_list.rb @@ -1,10 +1,9 @@ $:.unshift "../lib/" require 'th_mauve' -require 'mauve/source_list' require 'th_mauve_resolv' +require 'mauve/source_list' require 'webmock' -require 'pp' class TcMauveSourceList < Mauve::UnitTest @@ -90,6 +89,18 @@ class TcMauveSourceList < Mauve::UnitTest assert( sl.includes?("www2.example.com"), "www2.example.com not found in #{sl.list}" ) end + def test_ip_crossmatch_fail_when_minimal_dns_is_available + Configuration.current.minimal_dns_lookups = true + + sl = SourceList.new("test") + assert_nothing_raised { sl += "test-1.example.com" } + assert( !sl.includes?("www.example.com"), "www.example.com not found in #{sl.list}" ) + + sl = SourceList.new("test") + assert_nothing_raised { sl += "2001::/3" } + assert( !sl.includes?("www2.example.com"), "www2.example.com not found in #{sl.list}" ) + end + def test_remote_source_list stub_request(:get, "http://localhost/network/monitor_ip/by_tag/Managed"). to_return(:status => 200, :body => %w(1.2.3.4 1.2.3.5).join("\n")) -- cgit v1.2.1