Skip to content

Commit 0cb8628

Browse files
pmachatakuba-moo
authored andcommitted
selftests: forwarding: README: Document customization
That any sort of customization is possible at all, let alone how it should be done, is currently not at all clear. Document the whats and hows in README. Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Benjamin Poirier <[email protected]> Link: https://lore.kernel.org/r/e819623af6aaeea49e9dc36cecd95694fad73bb8.1711464583.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent fd36fd2 commit 0cb8628

File tree

1 file changed

+33
-0
lines changed
  • tools/testing/selftests/net/forwarding

1 file changed

+33
-0
lines changed

tools/testing/selftests/net/forwarding/README

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,36 @@ o Checks shall be added to lib.sh for any external dependencies.
5656
o Code shall be checked using ShellCheck [1] prior to submission.
5757

5858
1. https://www.shellcheck.net/
59+
60+
Customization
61+
=============
62+
63+
The forwarding selftests framework uses a number of variables that
64+
influence its behavior and tools it invokes, and how it invokes them, in
65+
various ways. A number of these variables can be overridden. The way these
66+
overridable variables are specified is typically one of the following two
67+
syntaxes:
68+
69+
: "${VARIABLE:=default_value}"
70+
VARIABLE=${VARIABLE:=default_value}
71+
72+
Any of these variables can be overridden. Notably net/forwarding/lib.sh and
73+
net/lib.sh contain a number of overridable variables.
74+
75+
One way of overriding these variables is through the environment:
76+
77+
PAUSE_ON_FAIL=yes ./some_test.sh
78+
79+
The variable NETIFS is special. Since it is an array variable, there is no
80+
way to pass it through the environment. Its value can instead be given as
81+
consecutive arguments to the selftest:
82+
83+
./some_test.sh swp{1..8}
84+
85+
A way to customize variables in a persistent fashion is to create a file
86+
named forwarding.config in this directory. lib.sh sources the file if
87+
present, so it can contain any shell code. Typically it will contain
88+
assignments of variables whose value should be overridden.
89+
90+
forwarding.config.sample is available in the directory as an example of
91+
how forwarding.config might look.

0 commit comments

Comments
 (0)