summaryrefslogtreecommitdiff
path: root/tests/common
AgeCommit message (Collapse)Author
7 daystests: give the veth pair fixed MAC addressesDenys Fedoryshchenko
The tests create the veth pair with 'ip link add ... type veth peer name ...' and let the kernel pick random hardware addresses, then start accel-pppd right away. On distributions where systemd-udevd rewrites the address of a freshly created veth (MACAddressPolicy in its .link rules, seen on Ubuntu 22.04) this is a race: accel-pppd reads the address of the interface it serves once, at startup, and when udev wins it advertises an address the interface no longer has. Discovery still completes - the client copies the advertised address into its kernel PPPoE session as the peer address - but from then on the two ends disagree about it, no PPP frame is exchanged in either direction, and the session dies on LCP timeouts. Every PPPoE session test can fail this way; test_pppoe_ccp_ipcp_race failed 8 times out of 12 runs in one qemu Ubuntu-22.04 job. Create the pair with fixed, locally administered addresses derived from the name the pair already gets, so udev has nothing to change. The same job passes 12 out of 12 with this. This only removes the trigger in the tests. accel-pppd not following the address of the interface it serves is tracked in #363 and needs a fix of its own.
2026-08-08tests: cover the removal of stale ipoe session interfacesDenys Fedoryshchenko
Three tests around the interfaces the ipoe module creates per session: - kill accel-pppd with SIGKILL while a dhcp session is up, start it again and check that the interfaces left behind by the killed instance are gone, - remove a session interface with 'ip link del', - check that 'ip link add ... type ipoe' is refused, since a device made through rtnetlink would have none of the private state that IPOE_CMD_CREATE sets up. They carry the ipoe_driver marker and sit next to the existing ipoe tests, so the workflows run them in the steps that follow the insmod of the module. No workflow change is needed. The [modules] section has to list connlimit and radius before ipoe: libipoe.so refers to symbols of both, and with a strict dynamic linker loading it on its own fails with a relocation error instead of a missing feature. The tests assert that accel-pppd came up, so that this kind of misconfiguration is not reported as an unrelated cli connection failure. Restarting accel-pppd needs no explicit synchronisation: triton_load_modules() runs every DEFINE_INIT() before triton_run() starts the threads that serve the cli, so by the time accel-cmd 'show version' is answered the flush registered at DEFINE_INIT(19) has already run. Interfaces are compared by ifindex and not by name, because dhclient may get a new session in the meantime and the fresh interface would reuse the ipoe0 name. The check that nothing removes the interfaces while no accel-pppd is running is only printed, not asserted, so that the module is free to start doing it on its own later on.
2022-09-06tests ci: add testing in Qemu (Ubuntu 18.04, 20.04, 22.04, Debian 10,11,12)Sergey V. Lobanov
2022-09-04add tests and ci workflow for running testsSergey V. Lobanov
This commit adds tests (using python3 pytest framework): 1. Test basic accel-cmd commands (show version, show stat, etc) 2. Test ipoe shared session up (dhcpv4) without radius 3. Test pppoe discovery (without PADO delay) 4. Test pppoe discovery (without PADO delay) 5. Test pppoe session up (ipv4) without radius 6. Test vlan creation using vlan-mon (pppoe) These tests require external utils. Please read tests/README.md how to setup environment, how to run the tests and how to generate coverage report Also, run-tests.yml contains step-by-step instruction how to run the tests Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>