On Mon, 25 Mar 2024 18:29:10 +0100 Petr Machata wrote:
+The forwarding selftests framework uses a number of variables that +influence its behavior and tools it invokes, and how it invokes them, in +various ways. A number of these variables can be overridden. The way these +overridable variables are specified is typically one of the following two +syntaxes:
- : "${VARIABLE:=default_value}"
- VARIABLE=${VARIABLE:=default_value}
+Any of these variables can be overridden. Notably net/forwarding/lib.sh and +net/lib.sh contain a number of overridable variables.
+One way of overriding these variables is through the environment:
- PAUSE_ON_FAIL=yes ./some_test.sh
I like this conversion a lot. Makes me want to propose that we make this a standard feature of kselftest. If "env" file exists in the test directory kselftest would load its contents before running every test.
That's more of a broader question to anyone reading on linux-kselftest@ if there's no interest more than happy to merge as is :)
+The variable NETIFS is special. Since it is an array variable, there is no +way to pass it through the environment. Its value can instead be given as +consecutive arguments to the selftest:
- ./some_test.sh swp{1..8}
Did you consider allowing them to be defined as NETIF_0, NETIF_1 etc.? We can have lib.sh convert that into an array with a ugly-but-short loop, it's a bit tempting to get rid of the exception.