From 4ad56e41173d8ffe9922ce88332b85b809f3ce87 Mon Sep 17 00:00:00 2001 From: Jared Johnson Date: Thu, 11 Dec 2014 16:50:06 -0600 Subject: [PATCH] Add tests for check_genre() --- t/plugin_tests/ident/p0f | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/t/plugin_tests/ident/p0f b/t/plugin_tests/ident/p0f index 42039aa..1f7cb97 100644 --- a/t/plugin_tests/ident/p0f +++ b/t/plugin_tests/ident/p0f @@ -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 {