[Rt-commit] rtir branch, rtir-ipv6-regex, created. 4.0.0-2-g6add7644

Craig Kaiser craig at bestpractical.com
Wed Mar 7 12:35:17 EST 2018


The branch, rtir-ipv6-regex has been created
        at  6add7644f58a5d21c112df312c0c9f7d6f6e67a1 (commit)

- Log -----------------------------------------------------------------
commit 6add7644f58a5d21c112df312c0c9f7d6f6e67a1
Author: craig Kaiser <craig at bestpractical.com>
Date:   Wed Mar 7 12:15:23 2018 -0500

    Test ticket content with invalid ipv6 value
    
    When a ticket is created with content that contains a substring of a
    valid ipv6 id, it can register as a false positive for the ip.

diff --git a/t/custom-fields/ipv6.t b/t/custom-fields/ipv6.t
index afd3b4c1..68a18bd0 100644
--- a/t/custom-fields/ipv6.t
+++ b/t/custom-fields/ipv6.t
@@ -576,5 +576,29 @@ diag "merge ticket with the same IP";
     is( $has[0], '::ac10:1', "has value" );
 }
 
+diag "create a ticket via web with invalid IPv6 address" if $ENV{'TEST_VERBOSE'};
+{
+    my $content = 'Scan::Address_Scan';
+
+    my $incident_id;
+    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
+        diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
+
+        my $id = $agent->create_rtir_ticket_ok(
+            $queue,
+            {
+                Subject => "test invalid IPv6 in message",
+                ($queue eq 'Countermeasures'? (Incident => $incident_id): ()),
+                Content => "$content",
+            },
+        );
+        $incident_id = $id if $queue eq 'Incidents';
+
+        my $ticket = RT::Ticket->new( $RT::SystemUser );
+        $ticket->Load( $id );
+        ok( $ticket->id, 'loaded ticket' );
+        is( $ticket->FirstCustomFieldValue('IP'), undef, 'correct value' );
+    }
+}
 undef $agent;
 done_testing();

-----------------------------------------------------------------------


More information about the rt-commit mailing list