| 501679f5 | 24-Nov-2023 |
Pedro Tammela <[email protected]> |
selftests: tc-testing: cleanup on Ctrl-C
Cleanup net namespaces and other resources if we get a SIGINT (Ctrl-C). As user visible resources are allocated on a per test basis, it's only required to ca
selftests: tc-testing: cleanup on Ctrl-C
Cleanup net namespaces and other resources if we get a SIGINT (Ctrl-C). As user visible resources are allocated on a per test basis, it's only required to catch this condition when (possibly) running tests.
So far calling post_suite is enough to free up anything that might linger.
A missing keyword replacement for nsPlugin is also included.
Signed-off-by: Pedro Tammela <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
| 56e16bc6 | 24-Nov-2023 |
Pedro Tammela <[email protected]> |
selftests: tc-testing: prefix iproute2 functions with "ipr2"
As suggested by Simon, prefix the functions that operate on iproute2 commands in contrast with the "nl" netlink prefix.
Cc: Simon Horman
selftests: tc-testing: prefix iproute2 functions with "ipr2"
As suggested by Simon, prefix the functions that operate on iproute2 commands in contrast with the "nl" netlink prefix.
Cc: Simon Horman <[email protected]> Signed-off-by: Pedro Tammela <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
| 4b480cfb | 17-Nov-2023 |
Pedro Tammela <[email protected]> |
selftests: tc-testing: timeout on unbounded loops
In the spirit of failing early, timeout on unbounded loops that take longer than 20 ticks to complete. Such loops are to ensure that objects created
selftests: tc-testing: timeout on unbounded loops
In the spirit of failing early, timeout on unbounded loops that take longer than 20 ticks to complete. Such loops are to ensure that objects created are already visible so tests can proceed without any issues.
If a test setup takes more than 20 ticks to see an object, there's definetely something wrong.
Signed-off-by: Pedro Tammela <[email protected]> Reviewed-by: Simon Horman <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
| 3f2d94a4 | 17-Nov-2023 |
Pedro Tammela <[email protected]> |
selftests: tc-testing: leverage -all in suite ns teardown
Instead of listing lingering ns pinned files and delete them one by one, leverage '-all' from iproute2 to do it in a single process fork.
S
selftests: tc-testing: leverage -all in suite ns teardown
Instead of listing lingering ns pinned files and delete them one by one, leverage '-all' from iproute2 to do it in a single process fork.
Signed-off-by: Pedro Tammela <[email protected]> Reviewed-by: Simon Horman <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
| 3d5026fc | 17-Nov-2023 |
Pedro Tammela <[email protected]> |
selftests: tc-testing: use netns delete from pyroute2
When pyroute2 is available, use the native netns delete routine instead of calling iproute2 to do it. As forks are expensive with some kernel co
selftests: tc-testing: use netns delete from pyroute2
When pyroute2 is available, use the native netns delete routine instead of calling iproute2 to do it. As forks are expensive with some kernel configs, minimize its usage to avoid kselftests timeouts.
Signed-off-by: Pedro Tammela <[email protected]> Reviewed-by: Simon Horman <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
| fa63d353 | 14-Nov-2023 |
Pedro Tammela <[email protected]> |
selftests: tc-testing: rework namespaces and devices setup
As mentioned in the TC Workshop 0x17, our recent changes to tdc broke downstream CI systems like tuxsuite. The issue is the classic problem
selftests: tc-testing: rework namespaces and devices setup
As mentioned in the TC Workshop 0x17, our recent changes to tdc broke downstream CI systems like tuxsuite. The issue is the classic problem with rcu/workqueue objects where you can miss them if not enough wall time has passed. The latter is subjective to the system and kernel config, in my machine could be nanoseconds while in another could be microseconds or more.
In order to make the suite deterministic, poll for the existence of the objects in a reasonable manner. Talking netlink directly is the the best solution in order to avoid paying the cost of multiple 'fork()' calls, so introduce a netlink based setup routine using pyroute2. We leave the iproute2 one as a fallback when pyroute2 is not available.
Also rework the iproute2 side to mimic the netlink routine where it creates DEV0 as the peer of DEV1 and moves DEV1 into the net namespace. This way when the namespace is deleted DEV0 is also deleted automatically, leaving no margin for resource leaks.
Another bonus of this change is that our setup time sped up by a factor of 2 when using netlink.
Signed-off-by: Pedro Tammela <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
| 11f04de9 | 22-Jun-2021 |
Marcelo Ricardo Leitner <[email protected]> |
tc-testing: add support for sending various scapy packets
It can be worth sending different scapy packets on a given test, as in the last patch of this series. For that, lets listify the scapy attri
tc-testing: add support for sending various scapy packets
It can be worth sending different scapy packets on a given test, as in the last patch of this series. For that, lets listify the scapy attribute and simply iterate over it.
Signed-off-by: Marcelo Ricardo Leitner <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
| 14e5175e | 09-Jul-2019 |
Lucas Bates <[email protected]> |
tc-testing: introduce scapyPlugin for basic traffic
The scapyPlugin allows for simple traffic generation in tdc to test various tc features. It was tested with scapy v2.4.2, but should work with any
tc-testing: introduce scapyPlugin for basic traffic
The scapyPlugin allows for simple traffic generation in tdc to test various tc features. It was tested with scapy v2.4.2, but should work with any successive version.
In order to use the plugin's functionality, scapy must be installed. This can be done with: pip3 install scapy
or to install 2.4.2: pip3 install scapy==2.4.2
If the plugin is unable to import the scapy module, it will terminate the tdc run.
The plugin makes use of a new key in the test case data, 'scapy'. This block contains three other elements: 'iface', 'count', and 'packet':
"scapy": { "iface": "$DEV0", "count": 1, "packet": "Ether(type=0x800)/IP(src='16.61.16.61')/ICMP()" },
* iface is the name of the device on the host machine from which the packet(s) will be sent. Values contained within tdc_config.py's NAMES dict can be used here - this is useful if paired with nsPlugin * count is the number of copies of this packet to be sent * packet is a string detailing the different layers of the packet to be sent. If a property isn't explicitly set, scapy will set default values for you.
Layers in the packet info are separated by slashes. For info about common TCP and IP properties, see: https://blogs.sans.org/pen-testing/files/2016/04/ScapyCheatSheet_v0.2.pdf
Caution is advised when running tests using the scapy functionality, since the plugin blindly sends the packet as defined in the test case data.
See creating-testcases/scapy-example.json for sample test cases; the first test is intended to pass while the second is intended to fail.
Signed-off-by: Lucas Bates <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|