summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2020-06-01Merge pull request #6442 from wesleycoakley/pbrd-showjsonRuss White
pbrd: Optional JSON output for all `show pbr` directives
2020-05-29tests: Add a basic test for pbrDonald Sharp
Just add a basic test for pbr. This code does not actually test installation in the kernel at this point in time. What we do do is make sure pbr is in a sane state after some very basic configuration. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-05-29tests: Setup very basic pbr tests for our topology testsDonald Sharp
Just a simple setup for pbr to prove it starts. Once the json code for pbr gets in we can add more. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-05-28Merge pull request #6416 from Orange-OpenSource/masterRenato Westphal
ospfd: Solve crash after removing and adding conf.
2020-05-27Merge pull request #6447 from opensourcerouting/rename-bgp-vrf-leakDonald Sharp
topotest: refactory BGP VRF leak basic test
2020-05-26ospfd: Solve crash after removing and adding conf.Olivier Dugeon
Issue number #6291 describes how OSPFd crashes after being deleted and then added again with configuration when segment routing is used. The problem occurs in ospf_ri.c because the OspfRI structures retains the reference to the old area pointer which is mofified when ospfd is reactivated by configuration. When segment routing is activated, the LSA Router Information is sent with reference to the old area pointer, instead the new one, which causes the crash. The same problem is also present in ospf_ext.c with OspfEXT structure and Extended Link/Prefix structure. This commit introduces Extended Link/Prefix and Router Information LSAs flusing when OSPFd is stopped when configuration is removed and adds the correct initialization to the area pointer in OspfRI and Extended Link/Prefix structure when OSPFd is re-enabled with the configuration. Area pointer has been removed from the OspfEXT structure as it is never used with this commit. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-05-24topotest: refactory BGP VRF leak basic testRafael Zalamena
Changes: - Renamed file so we don't get confused when it fails. - Use `json_cmp` instead of direct key access. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-05-23tests: Turn on nhrpd and babeld as part of all-protocol-startupDonald Sharp
Turn on a few more daemons to run during this test. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-05-22tests: Fix JSON diff for nested listsGalaxyGorilla
The involved piece of code is supposed to find a 'closest' match for two JSON structures using another JSON diff. However, it can happen that during that new diff the JSON structures are altered (elements from a list are deleted when 'found'). This is in general ok when the deleted element is part of the JSON structure which 'matches', but when it later turns out that some other element of the structure doesn't fit, then the whole structure should be recovered. This is now realized by using a deepcopy for the besaid new JSON diff such that the original is only altered (e.g. deleted) when the diff is clean. Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2020-05-21Merge pull request #6293 from GalaxyGorilla/json_diffDonald Sharp
tests: introduce a proper JSON diff for topotests
2020-05-21Merge pull request #6398 from kuldeepkash/bgp_multi_vrfDonald Sharp
tests: Add bgp-multi-vrf test suites
2020-05-20Merge pull request #6425 from opensourcerouting/nb-state-cbs-fixesDonald Sharp
northbound state callbacks fixes
2020-05-20tests: Enhance bgp-ecmp-topo2 script as per latest framework changesKuldeep Kashyap
1. Few tests are enhanced as per latest framework changes. Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-05-20tests: Add bgp-multi-vrf-topo2 testsuiteKuldeep Kashyap
1. Adding 4 testcases to this testsuite to verify BGP multi-vrf functionality 2. Adding supporting JSON file to create topology and base config 3. Execution time is ~3 mins Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-05-20tests: Add bgp-multi-vrf-topo1 testsuiteKuldeep Kashyap
1. Adding 22 testcases to this testsuite to verify BGP multi-vrf functionality 2. Adding supporting JSON file to create topology and base config 3. Execution time is ~7 mins. Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-05-20tests: Framework support for BGP Multi-VRF automationKuldeep Kashyap
1. Added/Enhanced APIs to created bgp multi-vrf config and to verify config/functionality Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-05-19Merge pull request #6339 from opensourcerouting/ds-const-reduxMark Stapp
redux lists/datastructure const
2020-05-15isisd, yang: move IS-IS interface state data to the appropriate placeRenato Westphal
Now that the "frr-interface" list has a "state" container, move the IS-IS interface state nodes underneath it using a new augmentation. Also, update the IS-IS SR topotest to account for this change. Make use of symlinks where possible to avoid having multiple files with the same content. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-05-15Merge pull request #6404 from FRRouting/dev_isis_srDonald Sharp
isisd: IS-IS Segment Routing support
2020-05-13Merge pull request #6220 from kuldeepkash/bgp_graceful_restartMartin Winter
tests: Add bgp-graceful-restart test suites
2020-05-06tests: remove unused ref files from ldp topotestMark Stapp
Remove a couple of a couple of mis-named reference output files from the ldp-topo1 suite. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-05-04lib: add const iteration & find to typesafe listsDavid Lamparter
Based on work originally by Mark Stapp <mjs@voltanet.io>. Make it possible to iterate the typesafe lists in a const context, as well as find items from them. Signed-off-by: Mark Stapp <mjs@voltanet.io> [above signoff was for the original version before modification] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-05-04tests: Adding test suite bgp_gr_functionality_topo2Kuldeep Kashyap
1. Test suite has 17 test cases to verify BGP-graceful-restart functionality 2. Execution time is ~20 Mins Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-05-04tests: Adding test suite bgp_gr_functionality_topo1Kuldeep Kashyap
1. Test suite has 25 test cases to verify BGP-graceful-restart functionality 2. Execution time is ~21 Mins Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-05-04tests: Add library support for BGP-Graceful-Restart automationKuldeep Kashyap
1. Adding APIs to common_config.py to support BGP-Graceful-Restart automation 2. Adding APIs to create BGP-GR config to bgp.py 3. Adding verification API for BGP-GR functionality Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-05-04tests: Enhance topotests scripts to kill/start specific DaemonsKuldeep Kashyap
1. Added APIs to topogen.py and topotest.py to kill/start specific Daemons, ex - bgpd, staticd Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-04-30tests: add topotest for IS-IS SRRenato Westphal
This commit introduces a comprehensive test for IS-IS Segment Routing. It features the following network topology: +---------+ | | | RT1 | | 1.1.1.1 | | | +---------+ |eth-sw1 | | | +---------+ | +---------+ | | | | | | RT2 |eth-sw1 | eth-sw1| RT3 | | 2.2.2.2 +----------+----------+ 3.3.3.3 | | | 10.0.1.0/24 | | +---------+ +---------+ eth-rt4-1| |eth-rt4-2 eth-rt5-1| |eth-rt5-2 | | | | 10.0.2.0/24| |10.0.3.0/24 10.0.4.0/24| |10.0.5.0/24 | | | | eth-rt2-1| |eth-rt2-2 eth-rt3-1| |eth-rt3-2 +---------+ +---------+ | | | | | RT4 | 10.0.6.0/24 | RT5 | | 4.4.4.4 +---------------------+ 5.5.5.5 | | |eth-rt5 eth-rt4| | +---------+ +---------+ eth-rt6| |eth-rt6 | | 10.0.7.0/24| |10.0.8.0/24 | +---------+ | | | | | | | RT6 | | +----------+ 6.6.6.6 +-----------+ eth-rt4| |eth-rt5 +---------+ Each router has both an IPv4 and an IPv6 loopback address, each of which has a corresponding Prefix-SID configured. Basic SR functionality is tested. First, the topotest ensures that all expected Prefix-SIDs and Adj-SIDs are flooded and installed correctly in all routers of the network. Later, network failures are simulated and configuration changes are performed in several different routers. The topotest then checks if IS-IS has converged as expected in the network according to the network failures and configuration changes that happened. The topotest comprises 11 different steps, each with four individual tests (for a total of 44 tests). A summary of what each step does is provided below: --- STEP 1: -Initial network convergence --- Step 2: Action(s): -Disable IS-IS on the eth-rt5 interface on rt4 Expected changes: -rt4 should uninstall the Adj-SIDs pointing to rt5 -rt5 should uninstall the Adj-SIDs pointing to rt4 -rt2 should reinstall rt5's Prefix-SIDs (2 nexthops deleted) -rt3 should reinstall rt4's Prefix-SIDs (2 nexthops deleted) -rt4 should reinstall rt3's Prefix-SIDs (1 nexthop deleted) -rt4 should reinstall rt5's Prefix-SIDs (1 nexthop changed) -rt5 should reinstall rt2's Prefix-SIDs (1 nexthop deleted) -rt5 should reinstall rt4's Prefix-SIDs (1 nexthop changed) --- Step 3: Action(s): -Shut down the eth-rt4 interface on rt6 -Shut down the eth-rt5 interface on rt6 Expected changes: -All routers should uninstall rt6's Prefix-SIDs -rt4 and rt5 should uninstall the Adj-SIDs pointing to rt6 -rt4 should reconverge rt5's Prefix-SIDs through rt2 using ECMP -rt5 should reconverge rt4's Prefix-SIDs through rt3 using ECMP -rt6 should uninstall all its IS-IS routes, Prefix-SIDs and Adj-SIDs --- Step 4: Action(s): -Bring up the eth-rt4 interface on rt6 -Bring up the eth-rt5 interface on rt6 -Change rt6's SRGB Expected changes: -All routers should install rt6's Prefix-SIDs -rt4 and rt5 should install Adj-SIDs for rt6 -rt4 should reconverge rt5's Prefix-SIDs through rt6 using the new SRGB -rt5 should reconverge rt4's Prefix-SIDs through rt6 using the new SRGB -rt6 should reinstall all IS-IS routes and Prefix-SIDs from the network, and Adj-SIDs for rt4 and rt5 --- Step 5: Action(s): -Disable SR on rt6 Expected changes: -All routers should uninstall rt6's Prefix-SIDs -rt4 should uninstall rt5's Prefix-SIDs since the nexthop router hasn't SR enabled anymore -rt5 should uninstall rt4's Prefix-SIDs since the nexthop router hasn't SR enabled anymore -rt6 should uninstall all Prefix-SIDs from the network, and the Adj-SIDs for rt4 and rt5 --- Step 6: Action(s): -Enable SR on rt6 Expected changes: -All routers should install rt6's Prefix-SIDs -rt4 should install rt5's Prefix-SIDs through rt6 -rt5 should install rt4's Prefix-SIDs through rt6 -rt6 should install all Prefix-SIDs from the network, and Adj-SIDs for rt4 and rt5 --- Step 7: Action(s): -Delete rt1's Prefix-SIDs Expected changes: -All routers should uninstall rt1's Prefix-SIDs --- Step 8: Action(s): -Re-add rt1's Prefix-SIDs Expected changes: -All routers should install rt1's Prefix-SIDs --- Step 9: Action(s): -Change rt1's Prefix-SIDs to use the no-php option -Change rt6's Prefix-SIDs to stop using the explicit-null option Expected changes: -rt2 and rt3 should reinstall rt1's Prefix-SIDs accordingly -rt4 and rt5 should reinstall rt6's Prefix-SIDs accordingly --- Step 10: Action(s): -Remove the IPv4 address from rt4's eth-rt2-1 interface Expected changes: -rt2 should uninstall the IPv4 Adj-SIDs attached to the eth-rt4-1 interface -rt2 should reinstall all IPv4 Prefix-SIDs whose nexthop router is rt4 (ECMP shouldn't be used anymore) -rt4 should reinstall all IPv4 Prefix-SIDs whose nexthop router is rt2 (ECMP shouldn't be used anymore) --- Step 11: Action(s): -Restore the original network setup Expected changes: -All routes, Prefix-SIDs and Adj-SIDs should be the same as they were after the initial network convergence (step 1) Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-30tests: introduce a proper JSON diff for topotestsGalaxyGorilla
Diff'ing JSON objects is a crucial operation in the topotests for comparing e.g. vtysh output (formatted as JSON) with a file which covers the expectation of the tests. The current diff functionality is 'self-written' and intended to test a JSON object d2 on being a subset of another JSON object d1. For mismatches a diff is generated based on a normalized textual representation of the JSON objects. This approach has several disadvantages: * the human provided JSON text might not be normalized, hence a diff with line numbers might be worthless since it provides close to zero orientation what the problem is * the diff contains changes like commatas which are meaningless * the diff might contain a lot of changes about meaningless content which is present in d1 but not in d2 * there is no proper functionality to test for 'equality' of d1 and d2 * it is not possible to test for order, e.g. JSON arrays are just tested with respect to being a subset of another array * it is not possible to check if a key exists without also checking the value of that particular key This commit attempts to solve these issues. An error report is generated which includes the "JSON Path" to the problematic JSON elements and also hints on what the actual problem is (e.g. missing key, mismatch in dict values etc.). A special parameter 'exact' was introduced such that equality can be tested. Also there was a convention that absence of keys can be tested using the key in question with value 'None'. This convention is still honored such that full backwards compatiiblity is in place. Further order can be tested using the new tag '__ordered__' in lists (as first element). Example: d1 = [1, 2, 3] d2 = ['__ordered__', 1, 3, 2] Tesing d1 and d2 this way will now result in an error. Key existence can now be tested using an asterisk '*'. Example: d1 = [1, 2, 3] d2 = [1, '*', 3] d1 = {'a': 1, 'b': 2} d2 = {'a': '*'} Both cases will result now in a clean diff for d1 and d2. Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2020-04-28bgpd,tests: Modify import-check to require underlying prefixes to existDonald Sharp
Modify the import-check command to require the underlying prefix to exist in the rib. General consensus is that this is the correct behavior. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-28Merge pull request #6295 from ton31337/feature/show_bgp_afi_safi_sntpfxLou Berger
bgpd: Show PfxSnt for `show bgp <afi> <safi>` command
2020-04-28tests: fix size confusionDavid Lamparter
The question here isn't "why does it break on PowerPC?", but rather "why doesn't it break on x86_64 or ARM?" Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27build: make clippy Makefile rules nicerDavid Lamparter
These are easy to get subtly wrong, and doing so can cause nondeterministic failures when racing in parallel builds. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-24tests: Adopt some tests to PfxSnt counterDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-24Merge pull request #6279 from opensourcerouting/nb-cb-argsDonald Sharp
*: change the signature of the northbound callbacks to be more flexible
2020-04-24Revert "tests: Adopt some tests to PfxSnt counter"Donatas Abraitis
This reverts commit 6e0f90413ef43a154d84ff62bd04eb49366683a0.
2020-04-23Merge pull request #6277 from ton31337/feature/show_bgp_afi_safi_sndpfxSri Mohana Singamsetty
bgpd: Show PfxSnt for `show bgp <afi> <safi>` command
2020-04-23Merge pull request #6262 from qlyoung/remove-sprintfDavid Lamparter
2020-04-23*: change the signature of the northbound callbacks to be more flexibleRenato Westphal
Having a fixed set of parameters for each northbound callback isn't a good idea since it makes it difficult to add new parameters whenever that becomes necessary, as several hundreds or thousands of existing callbacks need to be updated accordingly. To remediate this issue, this commit changes the signature of all northbound callbacks to have a single parameter: a pointer to a 'nb_cb_x_args' structure (where x is different for each type of callback). These structures encapsulate all real parameters (both input and output) the callbacks need to have access to. And adding a new parameter to a given callback is as simple as adding a new field to the corresponding 'nb_cb_x_args' structure, without needing to update any instance of that callback in any daemon. This commit includes a .cocci semantic patch that can be used to update old code to the new format automatically. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-23tests: Adopt some tests to PfxSnt counterDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-20*: sprintf -> snprintfQuentin Young
Replace sprintf with snprintf where straightforward to do so. - sprintf's into local scope buffers of known size are replaced with the equivalent snprintf call - snprintf's into local scope buffers of known size that use the buffer size expression now use sizeof(buffer) - sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp buffer followed by strlcat Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20Merge pull request #6251 from opensourcerouting/cs-ignoreDonald Sharp
*: make coverity scan ignore random() calls
2020-04-20Merge pull request #6245 from sworleys/NHG-More-TopoMark Stapp
tests: add connected/recursive/duplicte/route-map NHG tests
2020-04-18Merge pull request #6164 from ↵Donald Sharp
ton31337/feature/rfc8212_enabled_traditional_profile bgpd: Enable rfc8212 by default except datacenter profile
2020-04-17*: replace all random() callsRafael Zalamena
Replace all `random()` calls with a function called `frr_weak_random()` and make it clear that it is only supposed to be used for weak random applications. Use the annotation described by the Coverity Scan documentation to ignore `random()` call warnings. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-04-16Merge pull request #6135 from opensourcerouting/cli-node-cleanupDonald Sharp
*: clean up the mess that is CLI command nodes
2020-04-16tests: add connected/recursive/duplicte/route-map NHG testsStephen Worley
Add some more NHG topotests using connected, recursive, duplicate and higher ecmp nexthops as well as route maps. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-04-16Merge pull request #5451 from opensourcerouting/rcu-logSantosh P K
logging subsystem rewrite
2020-04-16Merge pull request #6238 from donaldsharp/test_evpn_vxlan_cleanupDonatas Abraitis
tests: Cleanup bgp config for evpn vxlan topotest
2020-04-16tests: Cleanup bgp config for evpn vxlan topotestDonald Sharp
The bgp configuration for the vxlan topotest mixed and matched some configuration that does not belong for an IBGP setup. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-16*: move CLI node names to cmd_node->nameDavid Lamparter
And again for the name. Why on earth would we centralize this, just so people can forget to update it? Signed-off-by: David Lamparter <equinox@diac24.net>