diff -r 3190e55f104b -r 32c8d3292079 t/00-basic.t --- a/t/00-basic.t Thu Jun 16 19:52:58 2016 +0200 +++ b/t/00-basic.t Mon Jun 20 12:26:04 2016 +0200 @@ -4,7 +4,8 @@ use Test::Exception; use_ok 'Nagios::Check::DNS::check_tlsa_record' or BAIL_OUT; -can_ok 'Nagios::Check::DNS::check_tlsa_record', qw(get_tlsa_from_dns) or BAIL_OUT; +can_ok 'Nagios::Check::DNS::check_tlsa_record', qw(get_tlsa_from_dns) + or BAIL_OUT; # The above package doesn't use the Exporter currently, for shortcut # reasons we import the relevant subs into *this* module @@ -12,17 +13,23 @@ # API conformance subtest 'API' => sub { - dies_ok { get_tlsa_from_dns('example.org') } 'API: get_tlsa_from_dns() missing port'; + dies_ok { get_tlsa_from_dns('example.org') } + 'API: get_tlsa_from_dns() missing port'; }; # get and compare the TLSA records via get_tlsa_from_dns with `dig …` subtest 'Data' => sub { - foreach (['ssl.schlittermann.de' => 443], - ['mx1.mailbox.org' => 25], - ['ssl.kugelbus.de' => 443]) { + foreach ( + ['ssl.schlittermann.de' => 443], + ['mx1.mailbox.org' => 25], + ['ssl.kugelbus.de' => 443] + ) + { my ($domain, $port) = @$_; - my (@tlsa) = map { /^_$port._tcp.\S+\s+\d+\s+IN\s+TLSA\s+(.*\n)/i } `dig tlsa _$port._tcp.$domain`; - #is get_tlsa_from_dns($domain, $port), $tlsa[0] => "TLSA for $domain:$port"; + my (@tlsa) = map { /^_$port._tcp.\S+\s+\d+\s+IN\s+TLSA\s+(.*\n)/i } + `dig tlsa _$port._tcp.$domain`; + + #is get_tlsa_from_dns($domain, $port), $tlsa[0] => "TLSA for $domain:$port"; my @check = get_tlsa_from_dns($domain, $port); is $check[0], $tlsa[0] => "TLSA for $domain:$port"; }