qpsmtpd/t/plugin_tests/dnsbl
Matt Sergeant 069c5a6835 Apparently diag() doesn't do what I thought it did!
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@315 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-08 21:53:29 +00:00

26 lines
633 B
Plaintext

sub register_tests {
my $self = shift;
$self->register_test("test_local", 1);
$self->register_test("test_returnval", 1);
}
sub test_local {
my $self = shift;
my $connection = $self->qp->connection;
$connection->remote_ip('127.0.0.2'); # standard dnsbl test value
$self->connect_handler($self->qp->transaction);
ok($self->qp->connection->notes('dnsbl_sockets'));
}
sub test_returnval {
my $self = shift;
my ($ret, $note) = $self->rcpt_handler($self->qp->transaction, 'rcpt@example.com');
is($ret, DENY, "Check we got a DENY");
print("# dnsbl result: $note\n");
}