diff options
author | Pascal Mathis <mail@pascalmathis.com> | 2018-06-13 19:34:17 +0200 |
---|---|---|
committer | Pascal Mathis <mail@pascalmathis.com> | 2018-06-14 18:55:32 +0200 |
commit | a14810f43f6a7970468eb2568385ca75c4708e4d (patch) | |
tree | a9e4c0c1ed41f16437a1c2c0403f1740c1196111 /tests | |
parent | bgpd: Implement group-overrides for peer timers (diff) | |
download | frr-a14810f43f6a7970468eb2568385ca75c4708e4d.tar.xz frr-a14810f43f6a7970468eb2568385ca75c4708e4d.zip |
bgpd: Implement group-overrides for peer attrs
This commit introduces BGP peer-group overrides for the last set of
peer-level attrs which did not offer that feature yet. The following
attributes have been implemented: description, local-as, password and
update-source.
Each attribute, with the exception of description because it does not
offer any inheritance between peer-groups and peers, is now also setting
a peer-flag instead of just modifying the internal data structures. This
made it possible to also re-use the same implementation for attribute
overrides as already done for peer flags, AF flags and AF attrs.
The `no neighbor <neigh> description` command has been slightly changed
to support negation for no parameters, one parameter or * parameters
(LINE...). This was needed for the test suite to pass and is a small
change without any bigger impact on the CLI.
Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bgpd/test_peer_attr.c | 40 | ||||
-rw-r--r-- | tests/bgpd/test_peer_attr.py | 10 |
2 files changed, 50 insertions, 0 deletions
diff --git a/tests/bgpd/test_peer_attr.c b/tests/bgpd/test_peer_attr.c index 5e09bf61a..362919cf3 100644 --- a/tests/bgpd/test_peer_attr.c +++ b/tests/bgpd/test_peer_attr.c @@ -211,6 +211,12 @@ static struct test_peer_attr test_peer_attrs[] = { .o.use_iface_peer = true, }, { + .cmd = "description", + .peer_cmd = "description FRR Peer", + .group_cmd = "description FRR Group", + .type = PEER_AT_GLOBAL_CUSTOM, + }, + { .cmd = "disable-connected-check", .u.flag = PEER_FLAG_DISABLE_CONNECTED_CHECK, .type = PEER_AT_GLOBAL_FLAG, @@ -226,6 +232,22 @@ static struct test_peer_attr test_peer_attrs[] = { .type = PEER_AT_GLOBAL_FLAG, }, { + .cmd = "local-as", + .peer_cmd = "local-as 1", + .group_cmd = "local-as 2", + .type = PEER_AT_GLOBAL_CUSTOM, + }, + { + .cmd = "local-as 1 no-prepend", + .u.flag = PEER_FLAG_LOCAL_AS_NO_PREPEND, + .type = PEER_AT_GLOBAL_FLAG, + }, + { + .cmd = "local-as 1 no-prepend replace-as", + .u.flag = PEER_FLAG_LOCAL_AS_REPLACE_AS, + .type = PEER_AT_GLOBAL_FLAG, + }, + { .cmd = "override-capability", .u.flag = PEER_FLAG_OVERRIDE_CAPABILITY, .type = PEER_AT_GLOBAL_FLAG, @@ -236,6 +258,12 @@ static struct test_peer_attr test_peer_attrs[] = { .type = PEER_AT_GLOBAL_FLAG, }, { + .cmd = "password", + .peer_cmd = "password FRR-Peer", + .group_cmd = "password FRR-Group", + .type = PEER_AT_GLOBAL_CUSTOM, + }, + { .cmd = "shutdown", .u.flag = PEER_FLAG_SHUTDOWN, .type = PEER_AT_GLOBAL_FLAG, @@ -259,6 +287,18 @@ static struct test_peer_attr test_peer_attrs[] = { .u.flag = PEER_FLAG_TIMER_CONNECT, .type = PEER_AT_GLOBAL_FLAG, }, + { + .cmd = "update-source", + .peer_cmd = "update-source 255.255.255.1", + .group_cmd = "update-source 255.255.255.2", + .type = PEER_AT_GLOBAL_CUSTOM, + }, + { + .cmd = "update-source", + .peer_cmd = "update-source IFACE-PEER", + .group_cmd = "update-source IFACE-GROUP", + .type = PEER_AT_GLOBAL_CUSTOM, + }, /* Address Family Attributes */ { diff --git a/tests/bgpd/test_peer_attr.py b/tests/bgpd/test_peer_attr.py index bd377ca3a..7a4dd2b04 100644 --- a/tests/bgpd/test_peer_attr.py +++ b/tests/bgpd/test_peer_attr.py @@ -6,16 +6,26 @@ class TestFlag(frrtest.TestMultiOut): # List of tests can be generated by executing: # $> ./test_peer_attr 2>&1 | sed -n 's/\\/\\\\/g; s/\S\+ \[test\] \(.\+\)/TestFlag.okfail(\x27\1\x27)/pg' # +TestFlag.okfail('peer\\advertisement-interval') TestFlag.okfail('peer\\capability dynamic') TestFlag.okfail('peer\\capability extended-nexthop') TestFlag.okfail('peer\\capability extended-nexthop') +TestFlag.okfail('peer\\description') TestFlag.okfail('peer\\disable-connected-check') TestFlag.okfail('peer\\dont-capability-negotiate') TestFlag.okfail('peer\\enforce-first-as') +TestFlag.okfail('peer\\local-as') +TestFlag.okfail('peer\\local-as 1 no-prepend') +TestFlag.okfail('peer\\local-as 1 no-prepend replace-as') TestFlag.okfail('peer\\override-capability') TestFlag.okfail('peer\\passive') +TestFlag.okfail('peer\\password') TestFlag.okfail('peer\\shutdown') TestFlag.okfail('peer\\strict-capability-match') +TestFlag.okfail('peer\\timers') +TestFlag.okfail('peer\\timers connect') +TestFlag.okfail('peer\\update-source') +TestFlag.okfail('peer\\update-source') TestFlag.okfail('peer\\ipv4-unicast\\addpath-tx-all-paths') TestFlag.okfail('peer\\ipv4-multicast\\addpath-tx-all-paths') TestFlag.okfail('peer\\ipv6-unicast\\addpath-tx-all-paths') |