Fix test failures due to hook renames
Fix redefined warnings due to hook renames


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@507 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Matt Sergeant 2005-07-14 13:31:07 +00:00
parent 51f1f32928
commit 2ca6e9d192
3 changed files with 5 additions and 7 deletions

View File

@ -238,7 +238,7 @@ sub _load_plugins {
my $package = "Qpsmtpd::Plugin::$plugin_name"; my $package = "Qpsmtpd::Plugin::$plugin_name";
# don't reload plugins if they are already loaded # don't reload plugins if they are already loaded
unless ( defined &{"${package}::register"} ) { unless ( defined &{"${package}::plugin_name"} ) {
Qpsmtpd::Plugin->compile($plugin_name, Qpsmtpd::Plugin->compile($plugin_name,
$package, "$dir/$plugin", $self->{_test_mode}); $package, "$dir/$plugin", $self->{_test_mode});
$self->log(LOGDEBUG, "Loading $plugin_line") $self->log(LOGDEBUG, "Loading $plugin_line")
@ -320,9 +320,7 @@ sub run_hook {
} }
else { else {
$self->varlog(LOGINFO, $hook, $code->{name}); $self->varlog(LOGINFO, $hook, $code->{name});
print STDERR "plugin $hook $code->{name} 1\n";
eval { (@r) = $code->{code}->($self, $self->transaction, @args); }; eval { (@r) = $code->{code}->($self, $self->transaction, @args); };
print STDERR "plugin $hook $code->{name} 2\n";
$@ and $self->log(LOGCRIT, "FATAL PLUGIN ERROR: ", $@) and return; $@ and $self->log(LOGCRIT, "FATAL PLUGIN ERROR: ", $@) and return;

View File

@ -102,8 +102,8 @@ sub isa_plugin {
$cleanParent =~ s/\W/_/g; $cleanParent =~ s/\W/_/g;
my $newPackage = $currentPackage."::_isa_$cleanParent"; my $newPackage = $currentPackage."::_isa_$cleanParent";
# don't reload plugins if they are already loaded
return if defined &{"${newPackage}::register"}; return if defined &{"${newPackage}::plugin_name"};
$self->compile($self->plugin_name . "_isa_$cleanParent", $self->compile($self->plugin_name . "_isa_$cleanParent",
$newPackage, $newPackage,

View File

@ -11,7 +11,7 @@ sub test_local {
my $connection = $self->qp->connection; my $connection = $self->qp->connection;
$connection->remote_ip('127.0.0.2'); # standard dnsbl test value $connection->remote_ip('127.0.0.2'); # standard dnsbl test value
$self->connect_handler($self->qp->transaction); $self->hook_connect($self->qp->transaction);
ok($self->qp->connection->notes('dnsbl_sockets')); ok($self->qp->connection->notes('dnsbl_sockets'));
} }
@ -20,7 +20,7 @@ sub test_returnval {
my $self = shift; my $self = shift;
my $address = Qpsmtpd::Address->parse('<rcpt@example.com>'); my $address = Qpsmtpd::Address->parse('<rcpt@example.com>');
my ($ret, $note) = $self->rcpt_handler($self->qp->transaction, my ($ret, $note) = $self->hook_rcpt($self->qp->transaction,
$address); $address);
is($ret, DENY, "Check we got a DENY"); is($ret, DENY, "Check we got a DENY");
print("# dnsbl result: $note\n"); print("# dnsbl result: $note\n");