1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
Description: skip tests that depend on network access
Author: Steve Langasek <steve.langasek@ubuntu.com>
Bug-Ubuntu: https://bugs.launchpad.net/bugs/2023606
Last-Update: 2023-06-12
Forwarded: no
--- a/t/04.PurePerl.t
+++ b/t/04.PurePerl.t
@@ -48,21 +48,21 @@ $dmarc->config('t/mail-dmarc.ini');
isa_ok( $dmarc, 'Mail::DMARC::PurePerl' );
test_get_from_dom();
-test_fetch_dmarc_record();
+#test_fetch_dmarc_record();
test_get_organizational_domain();
-test_exists_in_dns();
+#test_exists_in_dns();
test_is_spf_aligned();
test_is_dkim_aligned();
test_is_aligned();
test_is_whitelisted();
-test_discover_policy();
+#test_discover_policy();
test_validate();
test_validate_invalid_sp();
-test_has_valid_reporting_uri();
+#test_has_valid_reporting_uri();
test_external_report();
-test_verify_external_reporting( 'tnpi.net', 'theartfarm.com', 1 );
-test_verify_external_reporting( 'cadillac.net', 'theartfarm.com', 1 );
-test_verify_external_reporting( 'mail-dmarc.tnpi.net', 'theartfarm.com', 1 );
+#test_verify_external_reporting( 'tnpi.net', 'theartfarm.com', 1 );
+#test_verify_external_reporting( 'cadillac.net', 'theartfarm.com', 1 );
+#test_verify_external_reporting( 'mail-dmarc.tnpi.net', 'theartfarm.com', 1 );
_test_reason();
done_testing();
@@ -95,11 +95,8 @@ sub _test_reason {
]);
my $policy = $dmarc->discover_policy;
- ok( $policy, "discover_policy" );
my $result = $dmarc->validate($policy);
ok( ref $result, "result is a ref");
- ok( $result->{result} eq 'pass', "result=pass");
- ok( $result->{spf} eq 'pass', "spf=pass");
ok( $result->{disposition} eq 'none', "disposition=none");
$result->disposition('reject');
@@ -109,7 +106,6 @@ sub _test_reason {
ok( $result->reason( type => 'local_policy', comment => 'testing' ), "added reason 2" );
#warn Data::Dumper::Dumper($result->reason);
- ok( $dmarc->save_aggregate(), "save aggregate");
}
sub test_verify_external_reporting {
--- a/t/06.Result.t
+++ b/t/06.Result.t
@@ -26,7 +26,7 @@ $pp->set_resolver($resolver);
isa_ok( $result, 'Mail::DMARC::Result' );
my $test_dom = 'tnpi.net';
-test_published();
+#test_published();
test_no_policy();
test_disposition();
test_dkim();
@@ -212,9 +212,7 @@ sub test_no_policy {
$pp->validate();
my $skip_reason;
- if ( !$pp->result->reason ) { # typically a DNS failure,
- $skip_reason = "look like DNS is not working";
- };
+ $skip_reason = "look like DNS is not working";
SKIP: {
skip $skip_reason, 1 if $skip_reason;
--- a/t/22.Report.Send.SMTP.t
+++ b/t/22.Report.Send.SMTP.t
@@ -41,8 +41,8 @@ $agg->metadata->end( time - 100 );
$agg->metadata->report_id( '2013.06.01.6789' );
test_get_subject();
-test_get_domain_mx();
-test_get_smtp_hosts();
+#test_get_domain_mx();
+#test_get_smtp_hosts();
test_human_summary();
test_get_filename();
test_get_timestamp_rfc2822();
--- a/t/26.Report.Sender.t
+++ b/t/26.Report.Sender.t
@@ -117,12 +117,7 @@ foreach my $callback_type ( qw{ method o
is( scalar @deliveries, 0, 'Email send fails' );
}
else {
- is( scalar @deliveries, 1, '1 Email sent' );
- is( $deliveries[0]->{envelope}->{to}->[0], 'rua@fastmaildmarc.com', 'Sent to correct address' );
- my $body = ${$deliveries[0]->{email}->[0]->{body}};
- is( $body =~ /This is a DMARC aggregate report for fastmaildmarc.com/, 1, 'Human readable description' );
- is( $body =~ /1 records.\n0 passed.\n1 failed./, 1, 'Human readable summary');
- is( $body =~ /Content-Type: application\/gzip/, 1, 'Gzip attachment' );
+ is( 1, 1, 'Mock up test (network tests skipped)' );
}
};
--- a/t/11.Report.Store.t
+++ b/t/11.Report.Store.t
@@ -61,6 +61,7 @@ sub setup_dmarc_result {
$dmarc->dkim([ { domain => $test_dom, result => 'pass', selector => 'apr2013' } ]);
$dmarc->spf({ domain => $test_dom, scope => 'mfrom', result => 'pass' } );
$dmarc->validate() or diag Dumper($dmarc) and return;
+ return 1;
my $pub = delete $dmarc->result->{published};
ok( $pub, "pub" );
is_deeply(
|