]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: add flowspec test with BGP MP_REACH/UNREACH
authorPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 6 Mar 2018 13:25:48 +0000 (14:25 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 30 Mar 2018 12:01:06 +0000 (14:01 +0200)
This commit checks that the reception of MP_REACH and MP_UNREACH
flowspec is handled correctly.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
tests/bgpd/test_mp_attr.c

index fff16524735c3a8531e6657165ea5fff7fcb2891..34c35cfcc5872d543bc760331d74d5cb99f0848d 100644 (file)
@@ -809,7 +809,26 @@ static struct test_segment {
                37,
                SHOULD_ERR,
        },
-
+       {
+               .name = "IPv4",
+               .desc = "IPV4 MP Reach, flowspec, 1 NLRI",
+               .data = {
+                       /* AFI / SAFI */ 0x0,
+                       AFI_IP,
+                       IANA_SAFI_FLOWSPEC,
+                       0x00, /* no NH */
+                       0x00,
+                       0x06, /* FS Length */
+                       0x01, /* FS dest prefix ID */
+                       0x1e, /* IP */
+                       0x1e,
+                       0x28,
+                       0x28,
+                       0x0
+               },
+               .len = 12,
+               .parses = SHOULD_PARSE,
+       },
        {NULL, NULL, {0}, 0, 0}};
 
 /* MP_UNREACH_NLRI tests */
@@ -906,6 +925,24 @@ static struct test_segment mp_unreach_segments[] = {
                (3 + (1 + 3 + 8 + 2) + (1 + 3 + 8 + 3)),
                SHOULD_PARSE,
        },
+       {
+               .name = "IPv4",
+               .desc = "IPV4 MP Unreach, flowspec, 1 NLRI",
+               .data = {
+                       /* AFI / SAFI */ 0x0,
+                       AFI_IP,
+                       IANA_SAFI_FLOWSPEC,
+                       0x06, /* FS Length */
+                       0x01, /* FS dest prefix ID */
+                       0x1e, /* IP */
+                       0x1e,
+                       0x28,
+                       0x28,
+                       0x0
+               },
+               .len = 10,
+               .parses = SHOULD_PARSE,
+       },
        {NULL, NULL, {0}, 0, 0}};
 
 /* nlri_parse indicates 0 on successful parse, and -1 otherwise.
@@ -1002,9 +1039,11 @@ int main(void)
        conf_bgp_debug_neighbor_events = -1UL;
        conf_bgp_debug_packet = -1UL;
        conf_bgp_debug_as4 = -1UL;
+       conf_bgp_debug_flowspec = -1UL;
        term_bgp_debug_neighbor_events = -1UL;
        term_bgp_debug_packet = -1UL;
        term_bgp_debug_as4 = -1UL;
+       term_bgp_debug_flowspec = -1UL;
 
        qobj_init();
        cmd_init(0);