diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-03-06 14:25:48 +0100 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2018-03-30 14:01:06 +0200 |
commit | 3bc593a8f79375247f80eca0be2904197ae949f3 (patch) | |
tree | 47289f33de80103eec37d30ae9e6b0b892e0b4f2 /tests/bgpd/test_mp_attr.c | |
parent | bgpd: introduce [no] debug bgp flowspec (diff) | |
download | frr-3bc593a8f79375247f80eca0be2904197ae949f3.tar.xz frr-3bc593a8f79375247f80eca0be2904197ae949f3.zip |
tests: add flowspec test with BGP MP_REACH/UNREACH
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>
Diffstat (limited to 'tests/bgpd/test_mp_attr.c')
-rw-r--r-- | tests/bgpd/test_mp_attr.c | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/tests/bgpd/test_mp_attr.c b/tests/bgpd/test_mp_attr.c index fff165247..34c35cfcc 100644 --- a/tests/bgpd/test_mp_attr.c +++ b/tests/bgpd/test_mp_attr.c @@ -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); |