Add tests for check_genre()

This commit is contained in:
Jared Johnson 2014-12-11 16:50:06 -06:00
parent dad4fb1d29
commit 4ad56e4117

View File

@ -102,9 +102,20 @@ sub test_rcpt_handler {
$msg = 'undef' if ! defined $msg;
is( return_code($r) . "/$msg", "DECLINED/undef",
'rcpt_handler returns DECLINED on no p0f genre match' );
delete $self->{os_block};
}
sub test_check_genre {
my ( $self ) = @_;
$self->{os_block_re} = [qr/windows/i];
ok( $self->check_genre, 'check_genre() returns true on OS match' );
$self->{os_block_re} = [qr/windoze/i];
ok( ! $self->check_genre, 'check_genre() returns false for no OS match' );
delete $self->{os_block_re};
}
sub test_exclude_connection {