linux/tools/testing/selftests/net/rds/config.sh
Allison Henderson 381a503f0e selftests: rds: Add -c config option to rds/config.sh
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.

Signed-off-by: Allison Henderson <achender@kernel.org>
Link: https://patch.msgid.link/20260320041834.2761069-3-achender@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-03-23 19:39:07 -07:00

61 lines
1.3 KiB
Bash
Executable File

#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
set -e
set -u
set -x
unset KBUILD_OUTPUT
CONF_FILE=""
FLAGS=()
GENERATE_GCOV_REPORT=0
while getopts "gc:" opt; do
case ${opt} in
g)
GENERATE_GCOV_REPORT=1
;;
c)
CONF_FILE=$OPTARG
;;
:)
echo "USAGE: config.sh [-g] [-c config]"
exit 1
;;
?)
echo "Invalid option: -${OPTARG}."
exit 1
;;
esac
done
if [[ "$CONF_FILE" != "" ]]; then
FLAGS=(--file "$CONF_FILE")
fi
# no modules
scripts/config "${FLAGS[@]}" --disable CONFIG_MODULES
# enable RDS
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 "${FLAGS[@]}" --enable CONFIG_GCOV_KERNEL
scripts/config "${FLAGS[@]}" --disable GCOV_PROFILE_ALL
scripts/config "${FLAGS[@]}" --enable GCOV_PROFILE_RDS
else
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 "${FLAGS[@]}" --enable CONFIG_NET_NS
scripts/config "${FLAGS[@]}" --enable CONFIG_VETH
# simulate packet loss
scripts/config "${FLAGS[@]}" --enable CONFIG_NET_SCH_NETEM