From 915b9830dcff5d17f52e8f52f17efd581245e99f Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Sun, 20 May 2012 23:04:41 -0400 Subject: [PATCH] greylisting: reset transaction for immunity tests --- t/plugin_tests/greylisting | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/t/plugin_tests/greylisting b/t/plugin_tests/greylisting index 34effe0..f780393 100644 --- a/t/plugin_tests/greylisting +++ b/t/plugin_tests/greylisting @@ -54,8 +54,11 @@ sub test_hook_data { sub test_is_immune { my $self = shift; + $self->_reset_transaction(); + $self->qp->connection->relay_client(1); ok( $self->is_immune(), 'relayclient'); + $self->qp->connection->relay_client(0); ok( ! $self->is_immune(), "nope -" ); @@ -178,4 +181,14 @@ sub test_greylist_p0f_uptime { ok( ! $self->p0f_match(), 'p0f uptime miss'); } +sub _reset_transaction { + my $self = shift; + + $self->qp->connection->relay_client(0); + $self->qp->transaction->notes('whitelistsender',0); + $self->qp->connection->notes('whitelisthost',0); + $self->qp->transaction->notes('tls_enabled',0); + $self->{_args}{p0f} = undef; + $self->{_args}{geoip} = undef; +};