test hostname before failing the test.

Test machine might have qmail installed with another hostname configured.
This commit is contained in:
Matt Simerson 2012-05-11 01:50:10 -04:00 committed by Robert
parent be28372dca
commit e206763428

View File

@ -82,8 +82,14 @@ sub test_get_rcpt_host {
"get_rcpt_host, +" ); "get_rcpt_host, +" );
$address = Qpsmtpd::Address->parse('<postmaster>'); $address = Qpsmtpd::Address->parse('<postmaster>');
cmp_ok( $self->get_rcpt_host( $address ), 'eq', 'some.host.example.org', my $local_hostname = $self->get_rcpt_host( $address );
"get_rcpt_host, special postmaster +" ); if ( $local_hostname eq 'some.host.example.org' ) {
cmp_ok( $self->get_rcpt_host( $address ), 'eq', 'some.host.example.org',
"get_rcpt_host, special postmaster +" );
}
else {
ok( 1, "get_rcpt_host, special postmaster + ($local_hostname)" );
}
# I think this is a bug. Qpsmtpd::Address fails to parse <abuse> # I think this is a bug. Qpsmtpd::Address fails to parse <abuse>
$address = Qpsmtpd::Address->parse('<abuse>'); $address = Qpsmtpd::Address->parse('<abuse>');