[Rt-commit] r5985 - in rtir/branches/2.1-EXPERIMENTAL: .
ruz at bestpractical.com
ruz at bestpractical.com
Mon Sep 18 20:13:06 EDT 2006
Author: ruz
Date: Mon Sep 18 20:13:05 2006
New Revision: 5985
Modified:
rtir/branches/2.1-EXPERIMENTAL/ (props changed)
rtir/branches/2.1-EXPERIMENTAL/t/013-custom-field-ip.t
Log:
r1580 at cubic-pc: cubic | 2006-09-19 03:50:01 +0400
* tests for searches by IP
Modified: rtir/branches/2.1-EXPERIMENTAL/t/013-custom-field-ip.t
==============================================================================
--- rtir/branches/2.1-EXPERIMENTAL/t/013-custom-field-ip.t (original)
+++ rtir/branches/2.1-EXPERIMENTAL/t/013-custom-field-ip.t Mon Sep 18 20:13:05 2006
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More tests => 134;
+use Test::More tests => 138;
require "t/rtir-test.pl";
@@ -128,3 +128,26 @@
ok( $has{ "172.16.$i.2" }, "has value" ) or diag "but has values ". join ", ", keys %has;
}
}
+
+diag "search tickets by IP" if $ENV{'TEST_VERBOSE'};
+{
+ my $tickets = RT::Tickets->new( $rtir_user );
+ $tickets->FromSQL("CF.{_RTIR_IP} = '172.16.1.1'");
+ ok( $tickets->Count, "found tickets" );
+}
+
+diag "search tickets by IP range" if $ENV{'TEST_VERBOSE'};
+{
+ my $tickets = RT::Tickets->new( $rtir_user );
+ $tickets->FromSQL("CF.{_RTIR_IP} = '172.16.2.0-172.16.2.255'");
+ ok( $tickets->Count, "found tickets" );
+}
+
+diag "search tickets within CIDR block" if $ENV{'TEST_VERBOSE'};
+{
+ my $tickets = RT::Tickets->new( $rtir_user );
+ $tickets->FromSQL("CF.{_RTIR_IP} = '172.16.2/24'");
+ ok( $tickets->Count, "found tickets" );
+ $tickets->FromSQL("CF.{_RTIR_IP} = '172.16/16'");
+ ok( $tickets->Count, "found tickets" );
+}
More information about the Rt-commit
mailing list