Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (20 sloc) 0.576 kb
#!perl -w
use strict;
use warnings;
use Qpsmtpd::Constants;
sub register_tests {
my $self = shift;
eval 'use Geo::IP';
if ( $@ ) {
warn "could not load Geo::IP\n";
$self->log(LOGERROR, "could not load Geo::IP");
return;
};
$self->register_test('test_geoip_lookup', 2);
};
sub test_geoip_lookup {
my $self = shift;
$self->qp->connection->remote_ip('24.24.24.24');
cmp_ok( $self->connect_handler(), '==', DECLINED, "exit code");
cmp_ok( $self->qp->connection->notes('geoip_country'), 'eq', 'US', "note");
};
Jump to Line
Something went wrong with that request. Please try again.