Skip to contentSkip to conversation

selftests: rds: add config file and config.sh -c option

PATCH In review Allison Henderson 3 participants 5 messages Mar 20 – Mar 24

Subsystems (5)
lore
Share & tools
lore

Allison Henderson

author maintainer
#0 lore raw

v3 cover selftests: rds: add config file and config.sh -c option

This series adds an RDS-specific config file for ksft CI and extends config.sh with a -c flag to specify an alternate config file path. Users can now specify the path of the config they want to update, or default to .config if none is specified.

---
Changes v2 -> v3:
[PATCH net-next v3 1/2] selftests: rds: add tools/testing/selftests/net/rds/config
- Sort CONFIG entries in tools/testing/selftests/net/rds/config
- Sort TEST_FILES entries alphabetically in Makefile
[PATCH net-next v3 2/2] selftests: rds: Add -c config option to rds/config.sh
- Use bash array for FLAGS to keep config.sh shellcheck clean

Allison Henderson (2):
selftests: rds: add tools/testing/selftests/net/rds/config
selftests: rds: Add -c config option to rds/config.sh

 tools/testing/selftests/net/rds/Makefile   |  1 +
 tools/testing/selftests/net/rds/README.txt |  5 ++-
 tools/testing/selftests/net/rds/config     |  5 +++
 tools/testing/selftests/net/rds/config.sh  | 37 +++++++++++++---------
 4 files changed, 32 insertions(+), 16 deletions(-)
 create mode 100644 tools/testing/selftests/net/rds/config
Signature · 1 line
2.43.0
author maintainer
#1 lore raw

PATCH v3 1/2 selftests: rds: add tools/testing/selftests/net/rds/config

The ksft CI runtime needs an rds specific config file to build a minimal kernel with the right options enabled. This patch adds an rds selftest config containing the required CONFIG_RDS* and CONFIG_NET_* options.

---
 tools/testing/selftests/net/rds/Makefile | 1 +
 tools/testing/selftests/net/rds/config   | 5 +++++
 2 files changed, 6 insertions(+)
tools/testing/selftests/net/rds/Makefile +1 -0
index fe363be8e358..a3462dadb47c 100644
@@ -6,6 +6,7 @@ all:
 TEST_PROGS := run.sh
 
 TEST_FILES := \
+	config \
 	include.sh \
 	settings \
 	test.py \
tools/testing/selftests/net/rds/config new file +5 -0
new file mode 100644
index 000000000000..97db7ecb892a
@@ -0,0 +1,5 @@
+CONFIG_NET_NS=y
+CONFIG_NET_SCH_NETEM=y
+CONFIG_RDS=y
+CONFIG_RDS_TCP=y
+CONFIG_VETH=y
Signature · 1 line
2.43.0
author maintainer
#4 lore raw

PATCH v3 2/2 selftests: rds: Add -c config option to rds/config.sh

In reply to Allison Henderson

This patch adds a new -c flag to config.sh that enables callers to specify the file path of the config they would like to update. If no config is specified, the default will be the .config of the current directory.

---
 tools/testing/selftests/net/rds/README.txt |  5 ++-
 tools/testing/selftests/net/rds/config.sh  | 37 +++++++++++++---------
 2 files changed, 26 insertions(+), 16 deletions(-)
tools/testing/selftests/net/rds/README.txt +4 -1
index cbde2951ab13..c6fe003d503b 100644
@@ -31,8 +31,11 @@ EXAMPLE:
     # Alternatly create a gcov disabled .config
     tools/testing/selftests/net/rds/config.sh
 
+    # Config paths may also be specified with the -c flag
+    tools/testing/selftests/net/rds/config.sh -c .config.local
+
     # build the kernel
-    vng --build  --config tools/testing/selftests/net/config
+    vng --build --config .config
 
     # launch the tests in a VM
     vng -v --rwdir ./ --run . --user root --cpus 4 -- \
tools/testing/selftests/net/rds/config.sh +22 -15
index 791c8dbe1095..29a79314dd60 100755
@@ -6,15 +6,20 @@ set -u
 set -x
 
 unset KBUILD_OUTPUT
+CONF_FILE=""
+FLAGS=()
 
 GENERATE_GCOV_REPORT=0
-while getopts "g" opt; do
+while getopts "gc:" opt; do
   case ${opt} in
     g)
       GENERATE_GCOV_REPORT=1
       ;;
+    c)
+      CONF_FILE=$OPTARG
+      ;;
     :)
-      echo "USAGE: config.sh [-g]"
+      echo "USAGE: config.sh [-g] [-c config]"
       exit 1
       ;;
     ?)
@@ -24,30 +29,32 @@ while getopts "g" opt; do
   esac
 done
 
-CONF_FILE="tools/testing/selftests/net/config"
+if [[ "$CONF_FILE" != "" ]]; then
+	FLAGS=(--file "$CONF_FILE")
+fi
 
 # no modules
-scripts/config --file "$CONF_FILE" --disable CONFIG_MODULES
+scripts/config "${FLAGS[@]}" --disable CONFIG_MODULES
 
 # enable RDS
-scripts/config --file "$CONF_FILE" --enable CONFIG_RDS
-scripts/config --file "$CONF_FILE" --enable CONFIG_RDS_TCP
+scripts/config "${FLAGS[@]}" --enable CONFIG_RDS
+scripts/config "${FLAGS[@]}" --enable CONFIG_RDS_TCP
 
 if [ "$GENERATE_GCOV_REPORT" -eq 1 ]; then
 	# instrument RDS and only RDS
-	scripts/config --file "$CONF_FILE" --enable CONFIG_GCOV_KERNEL
-	scripts/config --file "$CONF_FILE" --disable GCOV_PROFILE_ALL
-	scripts/config --file "$CONF_FILE" --enable GCOV_PROFILE_RDS
+	scripts/config "${FLAGS[@]}" --enable CONFIG_GCOV_KERNEL
+	scripts/config "${FLAGS[@]}" --disable GCOV_PROFILE_ALL
+	scripts/config "${FLAGS[@]}" --enable GCOV_PROFILE_RDS
 else
-	scripts/config --file "$CONF_FILE" --disable CONFIG_GCOV_KERNEL
-	scripts/config --file "$CONF_FILE" --disable GCOV_PROFILE_ALL
-	scripts/config --file "$CONF_FILE" --disable GCOV_PROFILE_RDS
+	scripts/config "${FLAGS[@]}" --disable CONFIG_GCOV_KERNEL
+	scripts/config "${FLAGS[@]}" --disable GCOV_PROFILE_ALL
+	scripts/config "${FLAGS[@]}" --disable GCOV_PROFILE_RDS
 fi
 
 # need network namespaces to run tests with veth network interfaces
-scripts/config --file "$CONF_FILE" --enable CONFIG_NET_NS
-scripts/config --file "$CONF_FILE" --enable CONFIG_VETH
+scripts/config "${FLAGS[@]}" --enable CONFIG_NET_NS
+scripts/config "${FLAGS[@]}" --enable CONFIG_VETH
 
 # simulate packet loss
-scripts/config --file "$CONF_FILE" --enable CONFIG_NET_SCH_NETEM
+scripts/config "${FLAGS[@]}" --enable CONFIG_NET_SCH_NETEM
 
Signature · 1 line
2.43.0
maintainer
#2 lore raw

Re: [PATCH net-next v3 1/2] selftests: rds: add tools/testing/selftests/net/rds/config

In reply to Allison Henderson

tools/testing/selftests/net/rds/Makefile all: · line 12

Quoted 10 lines · On Thu, 19 Mar 2026 21:18:33 -0700 Allison Henderson wrote:
tools/testing/selftests/net/rds/Makefile +1 -0
@@ -6,6 +6,7 @@ all:
 TEST_PROGS := run.sh
 
 TEST_FILES := \
+	config \
 	include.sh \
 	settings \
 	test.py \

I don't believe this chunk is necessary, only files which the tests themselves need to _run_ need to be listed.

I dropped this chunk when applying, thanks!

#3 lore raw

Re: [PATCH net-next v3 1/2] selftests: rds: add tools/testing/selftests/net/rds/config

Quoted 15 lines · Jakub Kicinski

tools/testing/selftests/net/rds/Makefile all: · line 12

Quoted 10 lines · On Thu, 19 Mar 2026 21:18:33 -0700 Allison Henderson wrote:
tools/testing/selftests/net/rds/Makefile +1 -0
@@ -6,6 +6,7 @@ all:
 TEST_PROGS := run.sh
 
 TEST_FILES := \
+	config \
 	include.sh \
 	settings \
 	test.py \

I don't believe this chunk is necessary, only files which the tests themselves need to _run_ need to be listed.

Quoted 1 line

I dropped this chunk when applying, thanks!

Thank you! Let me know if you run into any other issues.

Allison