Jakub Kicinski kuba@kernel.org writes:
On Tue, 26 Mar 2024 11:31:31 +0100 Petr Machata wrote:
Jakub Kicinski kuba@kernel.org writes:
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 :)
On Mon, 25 Mar 2024 18:29:10 +0100 Petr Machata wrote:
+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.
Maybe we could do this though?
NETIFS="swp1 swp2 swp3 swp4 swp5 swp6 swp7 swp8" ./some_test.sh
But NETIFS is going to be a special case one way or another. That you need to specify it through several variables, or a variable with a special value, means you need to explain it as a special case in the documentation. At which point you have two exceptions, and an interaction between them, to describe.
I think there's some value in passing all inputs in the same way (thru env rather than argv). I guess it's subjective, you're coding it up, so you can pick.
I kinda like the NETIFS="a b c" approach. If somebody wants to code that up, I'll be happy to review :) I might get around to it at some point.