Commit Graph
116 Commits
Author SHA1 Message Date
Tobias Waldekranz 257f1df1d5 test: case: user_scripts: Add test
Verify that:
- Scripts are executed when the service is enabled
- Scripts are not enabled when the service is disabled
2024-05-21 22:02:28 +02:00
Tobias Waldekranz 3f2ae3f3fc test: case: igmp_basic: Speed up positive reception tests
Use must{,_not}_receive instead of the general sniffer, so that we can
continue the test as soon as we see the transmission at the receiver,
rather than always waiting the full 5s.

While we're here:
- Show the port mappings in the top block-comment
- Define a few more steps to show the user what is going on
2024-05-20 16:21:06 +02:00
Tobias Waldekranz f94815cf46 test: case: static_multicast_filters: Speed up positive reception tests
Use must{,_not}_receive instead of the general sniffer, so that we can
continue the test as soon as we see the transmission at the receiver,
rather than always waiting the full 5s.

While we're here:
- Show the port mappings in the top block-comment
- Define a few more steps to show the user what is going on
- Avoid global variable references in set_static_multicast_filter()
2024-05-20 16:21:06 +02:00
Tobias Waldekranz 1dbe09b428 test: Spellchecking 2024-05-20 16:21:06 +02:00
Tobias Waldekranz e53f3362be test: case: routing_basic: Restructure to reuse existing namespace
Rather than setting up and tearing down two identical namespaces,
create it once and use it for the duration of the test.
2024-05-20 16:21:06 +02:00
Tobias Waldekranz c3945a996c test: case: static_routing: Restructure to reuse existing namespace
Rather than setting up and tearing down two identical namespaces,
create it once and use it for the duration of the test. (This is
probably a documentation issue with Infamy: there is no requirement
that test.steps are direct descendants of the test, but until this
point there was no example of this in the source base)

In the process of this, it was also discovered that no positive ping
test was done over v6, so that has been added.
2024-05-20 16:21:06 +02:00
Tobias Waldekranz 74b0679cf0 test: case: container_*: Use standard ping tests 2024-05-20 16:21:06 +02:00
Tobias Waldekranz dc6dffbff9 test: case: bridge_*: Use standard ping tests 2024-05-20 16:21:06 +02:00
Tobias Waldekranz 4c6dfdf600 test: Run negative ping tests in parallel
Rather than having to wait for each timeout sequentially, run each
test in parallel.
2024-05-20 16:21:06 +02:00
Tobias Waldekranz 177b65587b test: case: routing_basic: Remove bridge from figure
This a routed setup, no bridge is used.
2024-05-20 16:21:06 +02:00
Tobias Waldekranz fb2bd2c2b7 test: Whitespace cleanup 2024-05-20 16:21:06 +02:00
Tobias WaldekranzandJoachim Wiberg a2906acdf7 test: Optionally use deterministic topology mappings
Due to the salting being applied to Python's `hash()` (see [1]), the
hash of an object is not stable across different Python processes. As
a result, neither are the topology mappings generated by networkx.

The upside of this is randomness that we get better test coverage over
time, especially on physical devices where the underlying hardware
could differ between ports, for example.

On the other hand, it can be very frustrating to track down a bug when
locial nodes are suffled around between phyical nodes on each
invocation of a test case.

Therefore, use a random seed by default, but allow the user to specify
a fixed value if they so choose. We then add a meta test that logs the
seed being used for the current suite - which means we can simply
copy&paste that value to rerun the suite (or single test) with the
same topology mappings.

[1]: https://docs.python.org/3/reference/datamodel.html#object.__hash__
2024-05-03 14:44:54 +02:00
Tobias WaldekranzandJoachim Wiberg 753f3806a1 test: Improve efficiency of logical to physical topology matching
- Present the topologies to networkx as multigraphs, rather than
  expaning each port of the record shape as a separate node.

- Create a topology mapping by locating a subgraph monomorphism of the
  logical topology in the physical ditto.

This cuts down the time of finding a mapping by several orders of
magnitude. Example:

Before:

time python3 test/infamy/topology.py \
     	     test/virt/quad/topology.dot.in \
	     test/infamy/topologies/ring-4-duts.dot >/dev/null

real    13m1,213s
user    13m0,112s
sys     0m0,732s

After:

time python3 test/infamy/topology.py \
     	     test/virt/quad/topology.dot.in \
	     test/infamy/topologies/ring-4-duts.dot >/dev/null

real    0m0,153s
user    0m0,128s
sys     0m0,024s
2024-05-03 14:44:54 +02:00
Joachim WibergandTobias Waldekranz 053d9c2131 test: reenable infix-services test with a link toggle
Since we do not yet have lldpTxFast, or similar, to enable on LLDP, we
tickle both services to resend their HELLO frames on link down/up event
instead.

 + Reduces turnaround times drastically
 + Restore regression test for mDNS, which we lost recently

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-30 15:51:17 +02:00
Joachim WibergandTobias Waldekranz db628ee3f3 test: revert back to tcpdump output format when reading pcap
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-30 15:51:17 +02:00
Joachim Wiberg c3900ec710 confd: allow VLAN interfaces as bridge ports
Fixes #406

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-25 09:20:32 +02:00
Mattias Walström 8c9c432847 Add a new packet python-statd
Actually a part of statd, but had to make
a separarate package to get it to work.

Statd helper-scripts are now pre-compiled instead of doing it
in runtime.

Fixes #379
2024-04-16 12:47:16 +02:00
Joachim Wiberg e18ddcf0c8 test: disable web server for container tests
The container tests utilize the bundled curios-httpd, which clashes with
the new web services provided by nginx.  So we need to disable it while
testing all the containers.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 493be97769 Drop legacy Classic builds
The Classic builds served for a while as an introduction to classic
embedded systems, with a user managed read-writable /etc.  Today we
decided to firmly take the plunge into the future with NETCONF and
focus on our core platforms aarch64 and x86_64 (for Qemu).

The reasons are several: reduce overhead, simplify build and release
work, as well as manual testing, since Classic builds do not have any
automated regression testing.

The Classic builds may be resurrected later in a dedicated project.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg bb498043e4 test: bump version of bundled sample container image
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Mattias WalströmandJoachim Wiberg cc8221a22a Refactor cli-pretty for show bridge mdb 2024-04-09 20:22:26 +02:00
Mattias WalströmandJoachim Wiberg c72bc34df1 test: Add test for static multicast filters 2024-04-05 15:34:21 +02:00
Mattias WalströmandJoachim Wiberg f9e9822b52 Implement MDB and IGMP status in operational 2024-04-05 15:34:21 +02:00
Mattias Walström 81745a1625 Add configuration of static multicast entries
Both L2 and L3 is supported.

With VLAN-filtering:
admin@infix-00-00-00:/config/interface/br0/> set bridge vlans  vlan 1  multicast-filter 224.1.3.4 ports e0

Without VLAN-filtering:
admin@infix-00-00-00:/config/interface/br0/> set bridge multicast-filter 224.1.2.3 ports e0
2024-04-04 17:27:11 +02:00
Joachim Wiberg 814d5f6a4d test: update "show interfaces" template, bridge now has ethernet mac
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Mattias Walström d9ffff2b5a cli-pretty: Refactor to not take model as argument
Instead focus on the task to do 'show hardware', 'show interfaces' and more,
this to make it more logical.
2024-03-18 16:32:18 +01:00
Mattias Walström 89bcf7346f test: igmp_basic: Speed up test and some renaming
Rename to more distinct names for netns and hostports
2024-03-07 12:45:55 +01:00
Mattias Walström f91d36b8d1 test: igmp_vlan: Speed up test significantly
Remove a lot of extra sleeps.
2024-03-07 12:45:55 +01:00
Mattias Walström 400ae6ce1c test: Add new test igmp_vlan and add igmp tests to suite 2024-03-07 12:45:55 +01:00
Mattias Walström 43d67044d0 test: igmp_basic: speed up test, remove unnecessary long timeout
And cleanup ASCII picture
2024-03-07 12:45:55 +01:00
Mattias Walström c21f37c241 test: add new test igmp_basic
Simple test that tests (without VLAN):
* Multicast flooding works
* Join works as expected
2024-03-07 12:45:55 +01:00
Mattias WalströmandJoachim Wiberg c6626b6520 test: Increase timeouts for OSPF tests
This since when running the test in the cloud with github
supplied runner, everthing sometimes gets really slow.
2024-02-29 09:46:08 +01:00
Mattias WalströmandJoachim Wiberg 2bf6ec7d1a test: ipv4_autoconf: Fix racecondition on slow test-PCs
Refactor test, remove fragile solution with tcpdump started AFTER
the linklocal was activated, this opened for a race condition since
it was listening for a message sent once.

Now wait for the linklocal address instead.
2024-02-28 18:25:43 +01:00
Mattias Walström d1b9f1fb45 Add new test start_from_startup.py to just see that the device can boot from startup config
Useful to run in a loop.
2024-02-28 13:18:51 +01:00
Mattias Walström e77772e8c5 test: usb: Refactor to use a common function to wait boot 2024-02-28 13:18:51 +01:00
Richard AlpeandMattias Walström 27a4278cce statd: add good-octets counters
This patch adds out-good-octets and in-good-octets as augment in
the infix-ethernet-interface yang model. These counters represents
OctetsTransmittedOK and OctetsReceivedOK from ethtool.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-28 11:21:53 +01:00
Joachim Wiberg b0b1a79aa5 statd: refactor to autotools, same as confd
Fix issue #299

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-27 08:14:41 +01:00
Joachim Wiberg 00c2c0c608 test/case: new test, container connected using physical interface
Verifies that a regular/physical port/interface can be handed over to a
container.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 4856705803 test/case: new test, plain bridge + veth connection for container
Vanilla bridge and veth pair managed entirely by Infix.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg a38f5902c8 test/case: new test, verify connectivity behind docker0 masquerade
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg ec4c1b1d70 test/case: new test, basic container test
- New helper class for container testing
 - New helper class to urllib, Furl

Due to extremely weak Python-fu in the undersigned, this patch changes
the __init__.py file to add new helper classes for container tests.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Mattias Walström 4869b73b14 test: usb: test startup with no hardware configuration
In this case the USB ports shall be locked.
2024-02-23 14:01:23 +01:00
Mattias Walström 15b32cfcc2 infamy: Add a simple USB test 2024-02-23 14:01:23 +01:00
Richard AlpeandTobias Waldekranz 1827b65182 test: update cli-output to reflect new bridge output
Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-20 21:43:48 +01:00
Richard AlpeandTobias Waldekranz 0937921cbc test: add br1 to sysrepo emulator
Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-20 21:43:48 +01:00
Richard AlpeandTobias Waldekranz 6ad80c80ab test: make e2 into br1 bridge port in system output
Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-20 21:43:48 +01:00
Richard AlpeandTobias Waldekranz 4150f45cc4 test: add system output for vlan filtering bridge
Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-20 21:43:48 +01:00
Richard AlpeandJoachim Wiberg d73d5440c5 test: remove hardcoded interface type
This can now a days be inferred and isn't needed. Also, the interface
type in virtual testing is now etherlike not ethernet.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-05 18:01:30 +01:00
Richard AlpeandJoachim Wiberg 795f2615cb test: update cli output test to reflect etherlike changes
* Remove bogus ethernet statistics for br0
* Change parentbus for e0 and e1 to make them ethernet devices (not
  virtio -> etherlike).

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-05 18:01:30 +01:00
Mattias WalströmandTobias Waldekranz 051658d36a Add test to se that it is possible to get all operational data
Unlikley to fail though.
2024-01-27 23:56:31 +01:00