Commit Graph

51 Commits

Author SHA1 Message Date
Donald Sharp
33303f08bf
Merge pull request #12713 from opensourcerouting/fix/json_naming_deprecation
*: Drop deprecated incorrect JSON fields with wrong naming
2023-02-01 15:39:18 -05:00
Donatas Abraitis
f932966b02 tests: Use JSON camelCase naming for tests
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-31 20:49:44 +02:00
Martin Winter
82db2cd11f
tests: Fix wrong tgen.stop_topology() calls which got skipped
Calls were missing the () and caused the stop_topology() to be skipped

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2023-01-31 16:10:04 +01:00
Kuldeep Kashyap
991a971fe9 tests: Cleaning up daemon param used in start_topology()
Earlier daemon parameter was passed to
start_topology(), which is not needed now,
as new code is implemented to start
feature specific daemons.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-12-13 22:45:34 -08:00
Kuldeep Kashyap
dc4c450fc2 tests: Topotests daemon start as per feature test
Currently topotests starts all daemons by default,
made changes to f/w so only needed daemons can
be started, daemons which are needed to tests
particular test suite.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-12-13 20:25:41 -08:00
Lou Berger
675ba67d89 topotests: test_ospf_p2mp.py - check for full adjacencies and basic DB info
Signed-off-by: Lou Berger <lberger@labn.net>
2022-10-25 15:31:40 +00:00
nguggarigoud
d5bd355430 tests: Removing invalid step from ospf tests.
1. Removed the step from hello test case with hello
timer of 65535. This test works in some platforms
and does not work in others, affecting stability.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2022-06-21 02:21:35 -07:00
Donald Sharp
d60a3f0e71 tests: Fix spelling of daemons
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-01 16:26:38 -04:00
rgirada
1478f0ad11 ospfd: topotest cases for LSID change algo
Description:
	Topotest cases for LSID change (RFC 2328 appendex-E)
	algorithm.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2022-01-22 04:10:20 -08:00
Donald Sharp
235f1ccd9b tests: test_ospf_lan.py is looking for a certain order enforce it
OSPF when converging will choose a DR / Backup DR based upon
who has already come up.  Irrelevant of priority.  As such if
under system load OSPF comes up first and elects a DR that under
normal circumstances not be the elected one due to priority
OSPF does not go back through and re-elect to keep the system
stable in this case.  Tests are experiencing this:

unet> r0 show ip ospf neigh

Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
100.1.1.1        99 Full/Backup     4m14s              3.780s 10.0.1.2        r0-s1-eth0:10.0.1.1                  0     0     0
100.1.1.2         0 Full/DROther    4m14s              3.848s 10.0.1.3        r0-s1-eth0:10.0.1.1                  0     0     0
100.1.1.3         0 Full/DROther    4m14s              3.912s 10.0.1.4        r0-s1-eth0:10.0.1.1                  0     0     0

unet> r1 show ip ospf neigh

Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
100.1.1.0        98 Full/DR         4m15s              3.011s 10.0.1.1        r1-s1-eth1:10.0.1.2                  0     0     0
100.1.1.2         0 Full/DROther    4m19s              3.124s 10.0.1.3        r1-s1-eth1:10.0.1.2                  0     0     0
100.1.1.3         0 Full/DROther    4m19s              3.188s 10.0.1.4        r1-s1-eth1:10.0.1.2                  0     0     0

unet> r2 show ip ospf neigh

Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
100.1.1.0        98 Full/DR         4m27s              3.483s 10.0.1.1        r2-s1-eth0:10.0.1.3                  0     0     0
100.1.1.1        99 Full/Backup     4m32s              3.527s 10.0.1.2        r2-s1-eth0:10.0.1.3                  0     0     0
100.1.1.3         0 2-Way/DROther   4m32s              3.660s 10.0.1.4        r2-s1-eth0:10.0.1.3                  0     0     0

unet> r3 show ip ospf neigh

Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
100.1.1.0        98 Full/DR         4m55s              3.786s 10.0.1.1        r3-s1-eth1:10.0.1.4                  0     0     0
100.1.1.1        99 Full/Backup     4m55s              3.829s 10.0.1.2        r3-s1-eth1:10.0.1.4                  0     0     0
100.1.1.2         0 2-Way/DROther   4m54s              3.897s 10.0.1.3        r3-s1-eth1:10.0.1.4                  0     0     0

Modify the test to do a clear to enforce the order we are specifically looking for.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-12-11 12:05:36 -05:00
Donald Sharp
4b2e09df96 tests: Do not pick an ip address that overlaps with ourselves
The ospf_basic_functionality/test_ospf_lan.py creates
a ethernet segment and attaches 4 routers to it and
assigns ip addresses in a /24.  As one of the tests
it picks a new address for r0 which coincides with
a ip address on r3.  Then the test immediatly
checks for other data.  The problem is of course
that if a test is `slow` enough hello's will
start to be ignored from r3 to r0 and the
neighbor relationships will come down.  Choose
an ip address that doesn't cause this issue.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-24 07:05:19 -05:00
Donald Sharp
6862166ed5 tests: Fix ospf_asbr_summary_topo1.py
This script is failing occassionally in our upstream topotests.
Where it was changing route-maps and attempting to see if
summarization was working correctly.  The problem was that
the code appeared to be attempting to add route-maps to
redistribution in ospf then modifying the route-maps behavior
to affect summarization as well as the metric type of that
summarization.

The problem is of course that ospf does not appear to modify
the summary routes metric-type when the components
of that summary change it's metric-type.  So the test
is testing nothing.  In addition the test had messed
up the usage of the route-map generation code and all
the generated config was in different sequence numbers
but route-map processing would never get to those
new sequence numbers because of how route-maps are processed.

Let's just remove this part of the test instead of trying
to unwind it into anything meaningfull

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-15 11:43:44 -04:00
Christian Hopps
a53c08bc13 tests: cleanup: rerun changed files through black
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
4953ca977f tests: cleanup - remove unused imports
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
e82b531df9 tests: remove legacy Topo class (fixes many pylint errors)
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:46 -04:00
Christian Hopps
d7d21c3a19 tests: fix pylint test errors
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:46 -04:00
Christian Hopps
8db751b853 tests: micronet: adapt tests
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:46 -04:00
Christian Hopps
0779f17742
tests: fix ospf ASBR summary test
Previously the check did nothing as the input_dict parameter was wrong.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-27 14:46:20 -04:00
Russ White
d147c287db
Merge pull request #8729 from gpnaveen/ospf_route_maps
tests: ospf routemap basic test cases 2.
2021-08-24 09:13:57 -04:00
Christian Hopps
e83c0fb125 tests: use correct key for deleting entry.
OSPF mixes uses of "delete" and "del_action" depending on which library
function is called. It's a bug-prone mess that needs fixing; however, for
now we fix the one obvious incorrect use in this test.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-23 21:42:20 -04:00
nguggarigoud
d43837e6be tests: ospf routemap basic test cases 2.
Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-08-23 17:34:33 -07:00
Christian Hopps
6a95bfc8b0 tests: uniq vrf names when using netns
- In order to run tests in parallel the netns-based vrfs need to
have unique names primarily bc they are all tracked/looked-up in
`/run/netns` which is not network namespace nesting friendly

- use ip(8) exclusively rather than a mix of `ip` and `ifconfig`
and `vconfig`, reducing required pkg count by a couple.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-21 06:13:52 -04:00
Donald Sharp
6ff492b194 tests: Add pytest.mark.ospfd on tests missing this mark
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-28 09:36:30 -04:00
Christian Hopps
ed776e38f6
tests: apply KISS to retry fixture
This python fixture was way too complex for what is needed.

Eliminate gratuitous options/over-engineering:

- Change from non-deterministic `wait` and `attempts` to a single
`retry_timeout` value. This is both more deterministic, as well as
what the user should actually be thinking about.

- Use a fixed 2 second pause between executing the wrapped function
rather than a bunch of arbitrary choices of 2, 3 and 4 seconds
spread all over the test code.

- Get rid of the multiple variables for determining what "Positive" and
"Negative" results are. Instead just implement what all the user code
already wants, i.e., boolean False or a str (errormsg) means
"Negative" result otherwise it's a "Positive" result.

- As part of the above the inversion logic is much more comprehensible
in the fixture code (and more correct to boot).

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-06-25 05:33:04 +00:00
nguggarigoud
e6a472a05a tests: Adding ospfv2 summarisation test cases.
Total cases 6.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-06-23 13:57:12 -07:00
Olivier Dugeon
da721863c3
Merge pull request #7096 from gpnaveen/ospf_asbr_summarisation
tests : Adding 2 ospf asbr summary testcases.
2021-06-08 17:20:33 +02:00
nguggarigoud
bcce695415 tests : Adding 2 ospf asbr summary testcases.
Test suite execution time is ~1 minutes.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-05-17 19:52:54 -07:00
nguggarigoud
8694dd78db tests: adding ospf basic 2 testcases.
Test cases included are 1 ospf cost, 1 ospf mtu.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-05-17 19:23:15 -07:00
Donald Sharp
0b25370e95 tests: More black fixups
Just another round of fixups found by running black on the code

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-09 08:35:05 -04:00
Kuldeep Kashyap
5cbb02ebde tests: Improve error/assert message logging
1. Improved error meesage logging.
2. No functionality changes only put some meaningfull error messages.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-03-06 00:51:43 -08:00
Donald Sharp
5980ad0ae0 tests: Run black against tests again to clean up formatting
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-01 09:18:49 -05:00
Donald Sharp
efb62eeddf tests: Add pytest.mark.staticd to topotests
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-02-04 18:35:42 -05:00
Donald Sharp
3dedee4fe1 tests: Add pytest.mark.ospfd to tests
Add pytest marking for ospfd.  This commit also has some other test markings
because I do not want to have to go through the same test multiple times.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-02-04 18:28:36 -05:00
Martin Winter
82b844d8d3
Merge pull request #7765 from gpnaveen/ospf_chaos_test
tests : Adding 3 ospf chaos testcases.
2021-01-21 23:59:29 +01:00
nguggarigoud
a3276d2c76 tests: Adding 3 ospf chaos testcases.
This script involves Restart ospfd,
restart frr with ospf enabled,
staticd with redistribution inside ospf is enabled

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-01-21 04:55:58 +05:30
Donald Sharp
f2aee6967c
Merge pull request #7837 from ckishimo/tests_ospf
tests: fix redistribute key in ospf tests
2021-01-13 13:31:32 -05:00
ckishimo
88b7d3e726 tests: move redistribute function into lib
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-12 11:18:22 +01:00
ckishimo
65980a0224 tests: remove old def for redistribution in ospf
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-12 11:18:22 +01:00
ckishimo
c6b59ef48c tests: use new def for redistribution in ospf
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-12 11:18:22 +01:00
ckishimo
881fa68f05 tests: add new def for redistribution in ospf
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-12 11:18:22 +01:00
nguggarigoud
dc5298d741 tests: Adding ospf p2mp basic test.
This test verifies basic p2mp test

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-01-12 09:28:50 +05:30
Mark Stapp
d4473065f4
Merge pull request #7759 from qlyoung/reformat-tests-again
Reformat tests again
2020-12-23 08:11:00 -05:00
whitespace
9fa6ec1473 tests: please follow the style guide
thanks

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-17 15:32:55 -05:00
Donald Sharp
9fd80543fe tests: unicode to frr_unicode
Let's standardize on the internal to frr unicode function.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-17 13:19:52 -05:00
nguggarigoud
816fdbbf53 tests : Adding 3 base ospf testcases.
Test suite execution time is 90 Secs.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2020-11-25 05:34:06 +05:30
whitespace
701a01920e *: reformat python files
We are now using black.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-10-07 17:22:26 -04:00
nguggarigoud
dd2da503cd tests: Optimising a step for not true case.
1. Optimising a step for not true case.
2. Fixing a timing issue in route calculation script.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2020-09-18 15:13:46 +05:30
nguggarigoud
b29a56b3ae tests: removing initial wait time in ospf.py
1. Removed initial_wait in ospf library.
2. Removed one test case which was random
   failure, will add back after traiging.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-09-18 15:13:46 +05:30
nguggarigoud
035267a374 tests: Adding daemon check for ospfd in common_config.py
start ospfd only when ospf config is used.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2020-09-18 15:13:46 +05:30
naveen
a81774ec7d tests: ospf basic functionality topojson testcases.
1. Removed static sleeps.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-09-18 15:13:46 +05:30