]> git.puffer.fish Git - mirror/frr.git/commit
tests: Add tests for overriding BGP peer attrs
authorPascal Mathis <mail@pascalmathis.com>
Sun, 27 May 2018 15:52:19 +0000 (17:52 +0200)
committerPascal Mathis <mail@pascalmathis.com>
Tue, 19 Jun 2018 16:16:24 +0000 (18:16 +0200)
commita413cdf162675260b5ce060e8ea14d1c4c201910
tree314ed39b80e87a295ec20087a69e721caeeb9acc
parentb6b5969332054c932eeb9ff8aaaa0f9580778a62
tests: Add tests for overriding BGP peer attrs

This commit introduces unit tests for BGP peer attributes and checks all
three involved components, which are:

- CLI Configuration Input: The appropriate commands to configure the
attribute on either a peer or peer-group are being executed the same way
an end user would do it.

- CLI Configuration Output: The output of 'show running-config' is being
checked for presence/absence of expected configuration strings.

- Internal Data Structures: The internal data structures for maintaining
flag/filter states (value + override + invert) are being checked after
each operation to ensure the override has been implemented properly.

All attributes to be tested must be defined within the 'peer_attrs'
structure, which contains all peer attributes as of today and checks
them with both IPv4 Unicast and IPv6 Unicast. More address families are
supposed to be introduced at a later point in time.

Each attribute is being checked in its own 'clean' BGP environment, so
everything gets reset after each attribute to avoid any weird edge
cases. The 'correct' BGP startup and shutdown routine was taken from
'bgp_main.c' to ensure that we are not leaking any memory or acting
different than the real 'bgpd' would do.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
(cherry picked from commit 9d4f56237a22ff8f9f21912f1632e0279f4d7ec8)
tests/.gitignore
tests/Makefile.am
tests/bgpd/test_peer_attr.c [new file with mode: 0644]
tests/bgpd/test_peer_attr.py [new file with mode: 0644]