]> git.proxmox.com Git - mirror_frr.git/commit - tests/.gitignore
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>
Mon, 28 May 2018 17:20:46 +0000 (19:20 +0200)
commit9d4f56237a22ff8f9f21912f1632e0279f4d7ec8
treeb3ddb289dc737f1870dea57757d9d33b93baae01
parent27c05d4d43d14464b15582c700a511156c4ea2af
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>
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]