Commit Graph

148 Commits

Author SHA1 Message Date
Christian Hopps
4958158787 tests: micronet: update infra
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:46 -04:00
Donald Sharp
22e135b451
Merge pull request #8182 from mjstapp/topotest_start_tgen
tests: make the topogen object available when starting daemons
2021-08-04 08:48:06 -04:00
Donatas Abraitis
66aa87d03e
Merge pull request #8637 from opensourcerouting/pim-vrf-acl-fixes
Pim vrf acl fixes
2021-07-26 12:20:54 +03:00
Christian Hopps
0ba1d257be tests: add triage features: strace, asan-abort, docker exec
TMUX and Screen support when running topotests inside docker. This
allows the gdb, shell and vtysh features to correctly work even when
running the tests inside docker.

Add options:
--asan-abort :: aborts the process on ASAN errors
--strace-daemons :: strace some or all daemons

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-07-14 15:55:40 -04:00
Martin Winter
80c5c45b0b
tests: fix hang during topology shutdown when CLI connection fails
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2021-07-06 01:44:36 +02:00
Christian Hopps
e58133a78e tests: add valgrind memleaks run options and detection
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-06-16 02:56:15 -04:00
Igor Ryzhov
8d3dab20b5 tests: fix topotest polling log
The current log prints maximum wait time which is not actually correct,
because it doesn't include the command execution time. We usually have
"failed after X seconds" log with X being far longer than this maximum.

Let's print the maximum number of tries instead.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-28 02:52:58 +03: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
David Schweizer
6a93e3df4e
tests: fix python3 backported iproute2 vrf check
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-04-05 09:25:55 +02:00
Donald Sharp
ecf9b1bb50
Merge pull request #8167 from LabNConsulting/chopps/tests-add-gdb
tests: add option for auto-launching gdb
2021-03-25 10:27:50 -04:00
Christian Hopps
3f950192fe tests: add options for debugging topotest failures
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-03-19 12:45:37 -04:00
David Schweizer
0414a76446 tests: check for iproute2 VRF capability
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-03-15 12:48:38 +01:00
Russ White
7c7e4db935
Merge pull request #8123 from gromit1811/fix_topotest_ipv6_linklocal
tests: Fix determination of IPv6 link-local addresses
2021-03-09 11:25:10 -05:00
Martin Buck
67c3bf97c3 tests: Fix topotest.py pylint errors
Fix 2 string formatting errors (cosmetic only - remove unused string
formatting arguments). Also fix obvious typos in empty class FreeBSDRouter
implementation.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2021-03-03 16:19:59 +01:00
Mark Stapp
0c449b017b tests: make the topogen object available when starting daemons
Pass the topogen 'tgen' object into the startRouterDaemons()
method. it can be used to start a debug cli immediately after
starting a daemon, and that can be handy.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-03-02 13:59:35 -05:00
Martin Buck
fd03dacd03 tests: Fix determination of IPv6 link-local addresses
When parsing the output of "ip -6 address", allow arbitrary base interface
names (the part after "@" in the interface name), not just "if0-9". Without
this, link-local addresses sometimes are attributed to the wrong interface
because we're not matching the interface name but still handle the
interface's addresses.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2021-02-22 09:48:16 +01:00
Karen Schoener
662c057635 tests: update simple_snmp_test to check for memory leaks, router failure
Signed-off-by: Karen Schoener <karen@voltanet.io>
2021-01-25 10:01:24 -05:00
Babis Chalios
92be50e63e tests: API to launch snmpd in a topotest scenario
Prepare the infrastructure to allow configuring and launching an SNMP
daemon as part of testing scenario.

Signed-off-by: Babis Chalios <babis@voltanet.io>
Signed-off-by: Pat Ruddy Chalios <pat@voltanet.io>
2021-01-11 14:36:40 +00:00
Mark Stapp
d4473065f4
Merge pull request #7759 from qlyoung/reformat-tests-again
Reformat tests again
2020-12-23 08:11:00 -05:00
Sebastien Merle
4d7b695d3a pathd: New SR-TE policy management daemon
This new daemon manages Segment-Routing Traffic-Engineering
(SR-TE) Policies and installs them into zebra. It provides
the usual yang support and vtysh commands to define or change
SR-TE Policies.

In a nutshell SR-TE Policies provide the possibility to steer
traffic through a (possibly dynamic) list of Segment Routing
segments to the endpoint of the policy. This list of segments
is part of a Candidate Path which again belongs to the SR-TE
Policy. SR-TE Policies are uniquely identified by their color
and endpoint. The color can be used to e.g. match BGP
communities on incoming traffic.

There can be multiple Candidate Paths for a single
policy, the active Candidate Path is chosen according to
certain conditions of which the most important is its
preference. Candidate Paths can be explicit (fixed list of
segments) or dynamic (list of segment comes from e.g. PCEP, see
below).

Configuration example:

segment-routing
 traffic-eng
  segment-list SL
   index 10 mpls label 1111
   index 20 mpls label 2222
  !
  policy color 4 endpoint 10.10.10.4
   name POL4
   binding-sid 104
   candidate-path preference 100 name exp explicit segment-list SL
   candidate-path preference 200 name dyn dynamic
  !
 !
!

There is an important connection between dynamic Candidate
Paths and the overall topic of Path Computation. Later on for
pathd a dynamic module will be introduced that is capable
of communicating via the PCEP protocol with a PCE (Path
Computation Element) which again is capable of calculating
paths according to its local TED (Traffic Engineering Database).
This dynamic module will be able to inject the mentioned
dynamic Candidate Paths into pathd based on calculated paths
from a PCE.

https://tools.ietf.org/html/draft-ietf-spring-segment-routing-policy-06

Co-authored-by: Sebastien Merle <sebastien@netdef.org>
Co-authored-by: Renato Westphal <renato@opensourcerouting.org>
Co-authored-by: GalaxyGorilla <sascha@netdef.org>
Co-authored-by: Emanuele Di Pascale <emanuele@voltanet.io>
Signed-off-by: Sebastien Merle <sebastien@netdef.org>
2020-12-18 16:34:02 +01: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
Mark Stapp
c46de798de tests: quiet noisy error log about asan files
Turn a noisy error log into a debug - it's just reporting
that we're _looking_ for asan output.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-12-02 11:08:38 -05:00
Mark Stapp
6ee4440e66 tests: fix typo in asan variable names
Use AddressSanitizer consistently

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-12-02 11:08:03 -05:00
Martin Winter
8972e2710c
tests: Fix logging output directory for older tests
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-11-27 19:45:15 +01:00
Martin Winter
1a31ada871
tests: Fix FRR process shutdown in failed topotest teardown phase
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-11-27 19:45:14 +01:00
Martin Winter
be2656eda2
tests: Fix Topotest runs with newerversion of Address Sanitizer
Fix Address Sanitizer Issue detection with newer ASAN versions

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-11-27 19:45:07 +01:00
Martin Winter
ed827751d3
topotests: Fix logging by redirecting it to correct file
Fix lib to start loggin to correct daemon file on startup
Fix bgp-auth tests for the logging changes
Fixes Issue # 7545

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-11-20 17:48:49 +01:00
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
Donald Sharp
97e551e300
Merge pull request #7177 from mjstapp/fix_topo_tab_open
tests: python3 compat fixes for topotests: tabs and misc api
2020-09-29 10:06:48 -04:00
Mark Stapp
61196140a6 tests: improve unicode handling
Support more of the string/unicode interactions in various
topotests.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-09-26 15:40:00 -04:00
Mark Stapp
11761ab0f4 tests: python3 compat fixes for topotests: tabs and misc
Use only spaces in python files; no tabs; also a couple of small
api fixes.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-09-26 15:40:00 -04:00
Mark Stapp
ccda0eadac
Merge pull request #7155 from donaldsharp/TRAP
Offload/Trap
2020-09-23 16:06:37 -04:00
Stephen Worley
57d7d1948e
Merge pull request #7160 from mjstapp/fix_topo_daemons_list
tests: fix bug in handling of daemons to start
2020-09-23 14:47:13 -04:00
Mark Stapp
bb91e9c03b tests: fix bug in handling of daemons to start
Ensure the list of daemons to start is either the one specified
by a caller or the default one from the router configuration.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-09-23 08:48:25 -04:00
Donald Sharp
5a3cf85391 lib, zebra: Add ability to read kernel notice of TRAP/OFFLOAD
The linux kernel is getting RTM_F_TRAP and RTM_F_OFFLOAD for
kernel routes that have an underlying asic offload.  Write the
code to receive these notifications from the linux kernel and
to store that data for display about the routes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-09-22 15:57:43 -04:00
Donald Sharp
622c4996ef tests: Our tests are for FRR
These tests at this point only work for FRR.  Let's cut to the chase
and admit it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>`
2020-09-22 10:11:58 -04:00
Renato Westphal
b686742e2b
Merge pull request #6934 from Niral-Networks/niral_dev_vrf_isis_core_pr4
isisd, yang, doc : Support for different VRF in ISIS.
2020-09-04 18:44:56 -03:00
harios_niral
9375b5aa24 topotests : Topotest for different VRF in isisd
1. Topotest for isis-vrf is added for ipv4 and ipv6.
2. Test case for checking isis topology.
3. Test case for checking zebra isis routes.
4. Test case for checking linux vrf routes.
5. 2 new API's written in topotest/lib for checking vrf routes.

Co-authored-by: Kaushik <kaushik@niralnetworks.com>"
Signed-off-by: harios_niral <hari@niralnetworks.com>
2020-09-01 00:56:44 -07:00
Mark Stapp
cd79342c12 tests: small topotest improvements for python3
Avoid unnecessary use of StringIO in one place, use version-
dependent method in another. Remove a couple of other py2->py3
problems.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-08-28 10:10:46 -04:00
Rafael Zalamena
8e72eff7d8 topotests: bump zebra netlink socket buffer size
Use the same value as we use in production release configuration.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-08-24 07:29:23 -03:00
David Lamparter
f033a78a99 topotests: stop wasting time at exit
... and clean up zombie child processes

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-07-15 18:50:30 +02:00
David Lamparter
79f6fdeb3f topotests: unshittify backtraces
add thread info, use "bt full" to get variables and add a bit of
disassembly for good measure.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-07-15 18:48:57 +02:00
Mark Stapp
7172f19da4 tests: don't fail topotests if bundle file not present
Test for the existence of the support_bundle conf file before
trying to access it.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-07-09 12:13:55 -04:00
Kuldeep Kashyap
c39fe454e2 tests: Generate support bundle/dump data on tests failures
1. It will generate support bundle/sump data on test failures
2. It used /usr/lib/frr/generate_support_bundle.py utility to dump the data

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-07-07 16:02:22 +00:00
Mark Stapp
cb3e512d97 tests,zebra: fix more startup topotest issues
Use the right list of daemons to avoid trying to start zebra twice.
Change a zebra log message to INFO level to avoid stderr check
failure.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-07-04 12:25:10 -04:00
Mark Stapp
cf865d1b7c tests: wait longer when shutting down in topotests
Add a few retries during router shutdown before killing a daemon. Also
work harder to start only a single instance of daemons, esp. zebra.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-07-03 13:22:42 -04:00
Rafael Zalamena
9ce4f4b86b topotests: remove daemons start up sleep
Instead of waiting for daemons start with `sleep`, start them with the
`-d` parameter so they can release the terminal themselves when ready.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-07-02 14:52:46 -03:00
Rafael Zalamena
1455684740 topotests: start logging early
Start logging early everything (including debug) to
`/tmp/topotest/<test>/<node>/<daemon>.{out,err}`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-07-02 14:52:46 -03:00
Rafael Zalamena
aa5261bf7d topotests: remove duplicated code
Handle the duplicated code with a simple conditional: if called from
specialized API use provided daemons configuration, otherwise fallback
to old `Router` own daemon settings.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-07-02 14:52:42 -03:00
Jakub Urbańczyk
9b7decf28e topotest: add pbr test suite
Add some basic tests for installing PBR rules into the kernel.

Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
2020-06-10 16:29:14 +02:00