summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2014-10-30 06:42:00 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2014-10-30 07:06:01 +0100
commitc68f6d9dbb9f910d3ee82e099655fff7c12ef856 (patch)
treeb21eac804634d638e25e83beffc2cb45715759da /tests
parent59135bde25441cd39cea0389467eb206fc9030c9 (diff)
downloadquagga-c68f6d9dbb9f910d3ee82e099655fff7c12ef856.tar.bz2
quagga-c68f6d9dbb9f910d3ee82e099655fff7c12ef856.tar.xz
tests: fix tests for 055086f (well-known attr check)
Fix tests/aspathtest.c by including an ORIGIN attribute in the testcases. After 055086f "bgpd: well-known attr check only run for v4/uni, which could cause a crash," we're now checking for it and tests are failing due to that. Note that test #11 ("4b AS4_PATH w/o AS_PATH") is no longer accepted as OK since the function now checks for the existence of an AS_PATH attr. Fixes: 055086f ("bgpd: well-known attr check only run for v4/uni"...) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/aspath_test.c76
1 files changed, 48 insertions, 28 deletions
diff --git a/tests/aspath_test.c b/tests/aspath_test.c
index 0e57c535..71a31022 100644
--- a/tests/aspath_test.c
+++ b/tests/aspath_test.c
@@ -453,6 +453,13 @@ static struct test_segment {
}, { NULL, NULL, {0}, 0, { NULL, 0, 0 } }
};
+#define COMMON_ATTRS \
+ BGP_ATTR_FLAG_TRANS, \
+ BGP_ATTR_ORIGIN, \
+ 1, \
+ BGP_ORIGIN_EGP
+#define COMMON_ATTR_SIZE 4
+
/* */
static struct aspath_tests {
const char *desc;
@@ -474,11 +481,12 @@ static struct aspath_tests {
"8466 3 52737 4096",
AS2_DATA, 0,
0,
- { BGP_ATTR_FLAG_TRANS,
- BGP_ATTR_AS_PATH,
+ { COMMON_ATTRS,
+ BGP_ATTR_FLAG_TRANS,
+ BGP_ATTR_AS_PATH,
10,
},
- 3,
+ COMMON_ATTR_SIZE + 3,
},
/* 1 */
{
@@ -487,11 +495,12 @@ static struct aspath_tests {
"8466 3 52737 4096",
AS2_DATA, -1,
0,
- { BGP_ATTR_FLAG_TRANS,
+ { COMMON_ATTRS,
+ BGP_ATTR_FLAG_TRANS,
BGP_ATTR_AS_PATH,
8,
},
- 3,
+ COMMON_ATTR_SIZE + 3,
},
/* 2 */
{
@@ -500,11 +509,12 @@ static struct aspath_tests {
"8466 3 52737 4096",
AS2_DATA, -1,
0,
- { BGP_ATTR_FLAG_TRANS,
+ { COMMON_ATTRS,
+ BGP_ATTR_FLAG_TRANS,
BGP_ATTR_AS_PATH,
12,
},
- 3,
+ COMMON_ATTR_SIZE + 3,
},
/* 3 */
{
@@ -513,11 +523,12 @@ static struct aspath_tests {
"8466 3 52737 4096",
AS2_DATA, -1,
0,
- { BGP_ATTR_FLAG_TRANS|BGP_ATTR_FLAG_OPTIONAL,
+ { COMMON_ATTRS,
+ BGP_ATTR_FLAG_TRANS|BGP_ATTR_FLAG_OPTIONAL,
BGP_ATTR_AS_PATH,
10,
},
- 3,
+ COMMON_ATTR_SIZE + 3,
},
/* 4 */
{
@@ -526,11 +537,12 @@ static struct aspath_tests {
"8466 3 52737 4096",
AS2_DATA, -1,
0,
- { BGP_ATTR_FLAG_TRANS|BGP_ATTR_FLAG_OPTIONAL,
+ { COMMON_ATTRS,
+ BGP_ATTR_FLAG_TRANS|BGP_ATTR_FLAG_OPTIONAL,
BGP_ATTR_AS4_PATH,
10,
},
- 3,
+ COMMON_ATTR_SIZE + 3,
},
/* 5 */
{
@@ -539,11 +551,12 @@ static struct aspath_tests {
"8466 3 52737 4096",
AS4_DATA, -1,
PEER_CAP_AS4_RCV,
- { BGP_ATTR_FLAG_TRANS|BGP_ATTR_FLAG_OPTIONAL,
+ { COMMON_ATTRS,
+ BGP_ATTR_FLAG_TRANS|BGP_ATTR_FLAG_OPTIONAL,
BGP_ATTR_AS4_PATH,
10,
},
- 3,
+ COMMON_ATTR_SIZE + 3,
},
/* 6 */
{
@@ -552,11 +565,12 @@ static struct aspath_tests {
"8466 3 52737 4096",
AS4_DATA, 0,
PEER_CAP_AS4_RCV|PEER_CAP_AS4_ADV,
- { BGP_ATTR_FLAG_TRANS,
+ { COMMON_ATTRS,
+ BGP_ATTR_FLAG_TRANS,
BGP_ATTR_AS_PATH,
18,
},
- 3,
+ COMMON_ATTR_SIZE + 3,
},
/* 7 */
{
@@ -565,11 +579,12 @@ static struct aspath_tests {
"8466 3 52737 4096",
AS4_DATA, -1,
PEER_CAP_AS4_RCV|PEER_CAP_AS4_ADV,
- { BGP_ATTR_FLAG_TRANS,
+ { COMMON_ATTRS,
+ BGP_ATTR_FLAG_TRANS,
BGP_ATTR_AS_PATH,
16,
},
- 3,
+ COMMON_ATTR_SIZE + 3,
},
/* 8 */
{
@@ -578,11 +593,12 @@ static struct aspath_tests {
"8466 3 52737 4096",
AS4_DATA, -1,
PEER_CAP_AS4_RCV|PEER_CAP_AS4_ADV,
- { BGP_ATTR_FLAG_TRANS,
+ { COMMON_ATTRS,
+ BGP_ATTR_FLAG_TRANS,
BGP_ATTR_AS_PATH,
20,
},
- 3,
+ COMMON_ATTR_SIZE + 3,
},
/* 9 */
{
@@ -591,11 +607,12 @@ static struct aspath_tests {
"8466 3 52737 4096",
AS4_DATA, -1,
PEER_CAP_AS4_RCV|PEER_CAP_AS4_ADV,
- { BGP_ATTR_FLAG_TRANS,
+ { COMMON_ATTRS,
+ BGP_ATTR_FLAG_TRANS,
BGP_ATTR_AS_PATH,
22,
},
- 3,
+ COMMON_ATTR_SIZE + 3,
},
/* 10 */
{
@@ -604,24 +621,26 @@ static struct aspath_tests {
"8466 3 52737 4096",
AS4_DATA, -1,
PEER_CAP_AS4_RCV|PEER_CAP_AS4_ADV,
- { BGP_ATTR_FLAG_TRANS|BGP_ATTR_FLAG_OPTIONAL,
+ { COMMON_ATTRS,
+ BGP_ATTR_FLAG_TRANS|BGP_ATTR_FLAG_OPTIONAL,
BGP_ATTR_AS_PATH,
18,
},
- 3,
+ COMMON_ATTR_SIZE + 3,
},
/* 11 */
{
"4b AS4_PATH w/o AS_PATH",
&test_segments[6],
NULL,
- AS4_DATA, 0,
+ AS4_DATA, -1,
PEER_CAP_AS4_ADV,
- { BGP_ATTR_FLAG_TRANS|BGP_ATTR_FLAG_OPTIONAL,
+ { COMMON_ATTRS,
+ BGP_ATTR_FLAG_TRANS|BGP_ATTR_FLAG_OPTIONAL,
BGP_ATTR_AS4_PATH,
14,
},
- 3,
+ COMMON_ATTR_SIZE + 3,
},
/* 12 */
{
@@ -630,11 +649,12 @@ static struct aspath_tests {
"8466 3 52737 4096 (123 456 789)",
AS4_DATA, 0,
PEER_CAP_AS4_ADV,
- { BGP_ATTR_FLAG_TRANS|BGP_ATTR_FLAG_OPTIONAL,
+ { COMMON_ATTRS,
+ BGP_ATTR_FLAG_TRANS|BGP_ATTR_FLAG_OPTIONAL,
BGP_ATTR_AS4_PATH,
14,
},
- 3,
+ COMMON_ATTR_SIZE + 3,
&test_segments[0],
},
{ NULL, NULL, NULL, 0, 0, 0, { 0 }, 0 },