xref: /linux/tools/testing/selftests/net/rds/config.sh (revision 9410645520e9b820069761f3450ef6661418e279)
1*3ade6ce1SVegard Nossum#! /bin/bash
2*3ade6ce1SVegard Nossum# SPDX-License-Identifier: GPL-2.0
3*3ade6ce1SVegard Nossum
4*3ade6ce1SVegard Nossumset -e
5*3ade6ce1SVegard Nossumset -u
6*3ade6ce1SVegard Nossumset -x
7*3ade6ce1SVegard Nossum
8*3ade6ce1SVegard Nossumunset KBUILD_OUTPUT
9*3ade6ce1SVegard Nossum
10*3ade6ce1SVegard NossumGENERATE_GCOV_REPORT=0
11*3ade6ce1SVegard Nossumwhile getopts "g" opt; do
12*3ade6ce1SVegard Nossum  case ${opt} in
13*3ade6ce1SVegard Nossum    g)
14*3ade6ce1SVegard Nossum      GENERATE_GCOV_REPORT=1
15*3ade6ce1SVegard Nossum      ;;
16*3ade6ce1SVegard Nossum    :)
17*3ade6ce1SVegard Nossum      echo "USAGE: config.sh [-g]"
18*3ade6ce1SVegard Nossum      exit 1
19*3ade6ce1SVegard Nossum      ;;
20*3ade6ce1SVegard Nossum    ?)
21*3ade6ce1SVegard Nossum      echo "Invalid option: -${OPTARG}."
22*3ade6ce1SVegard Nossum      exit 1
23*3ade6ce1SVegard Nossum      ;;
24*3ade6ce1SVegard Nossum  esac
25*3ade6ce1SVegard Nossumdone
26*3ade6ce1SVegard Nossum
27*3ade6ce1SVegard NossumCONF_FILE="tools/testing/selftests/net/config"
28*3ade6ce1SVegard Nossum
29*3ade6ce1SVegard Nossum# no modules
30*3ade6ce1SVegard Nossumscripts/config --file "$CONF_FILE" --disable CONFIG_MODULES
31*3ade6ce1SVegard Nossum
32*3ade6ce1SVegard Nossum# enable RDS
33*3ade6ce1SVegard Nossumscripts/config --file "$CONF_FILE" --enable CONFIG_RDS
34*3ade6ce1SVegard Nossumscripts/config --file "$CONF_FILE" --enable CONFIG_RDS_TCP
35*3ade6ce1SVegard Nossum
36*3ade6ce1SVegard Nossumif [ "$GENERATE_GCOV_REPORT" -eq 1 ]; then
37*3ade6ce1SVegard Nossum	# instrument RDS and only RDS
38*3ade6ce1SVegard Nossum	scripts/config --file "$CONF_FILE" --enable CONFIG_GCOV_KERNEL
39*3ade6ce1SVegard Nossum	scripts/config --file "$CONF_FILE" --disable GCOV_PROFILE_ALL
40*3ade6ce1SVegard Nossum	scripts/config --file "$CONF_FILE" --enable GCOV_PROFILE_RDS
41*3ade6ce1SVegard Nossumelse
42*3ade6ce1SVegard Nossum	scripts/config --file "$CONF_FILE" --disable CONFIG_GCOV_KERNEL
43*3ade6ce1SVegard Nossum	scripts/config --file "$CONF_FILE" --disable GCOV_PROFILE_ALL
44*3ade6ce1SVegard Nossum	scripts/config --file "$CONF_FILE" --disable GCOV_PROFILE_RDS
45*3ade6ce1SVegard Nossumfi
46*3ade6ce1SVegard Nossum
47*3ade6ce1SVegard Nossum# need network namespaces to run tests with veth network interfaces
48*3ade6ce1SVegard Nossumscripts/config --file "$CONF_FILE" --enable CONFIG_NET_NS
49*3ade6ce1SVegard Nossumscripts/config --file "$CONF_FILE" --enable CONFIG_VETH
50*3ade6ce1SVegard Nossum
51*3ade6ce1SVegard Nossum# simulate packet loss
52*3ade6ce1SVegard Nossumscripts/config --file "$CONF_FILE" --enable CONFIG_NET_SCH_NETEM
53*3ade6ce1SVegard Nossum
54