@@ -56,3 +56,36 @@ o Checks shall be added to lib.sh for any external dependencies.
56
56
o Code shall be checked using ShellCheck [1] prior to submission.
57
57
58
58
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