config.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #! /bin/bash
  2. # SPDX-License-Identifier: GPL-2.0
  3. set -e
  4. set -u
  5. set -x
  6. unset KBUILD_OUTPUT
  7. GENERATE_GCOV_REPORT=0
  8. while getopts "g" opt; do
  9. case ${opt} in
  10. g)
  11. GENERATE_GCOV_REPORT=1
  12. ;;
  13. :)
  14. echo "USAGE: config.sh [-g]"
  15. exit 1
  16. ;;
  17. ?)
  18. echo "Invalid option: -${OPTARG}."
  19. exit 1
  20. ;;
  21. esac
  22. done
  23. CONF_FILE="tools/testing/selftests/net/config"
  24. # no modules
  25. scripts/config --file "$CONF_FILE" --disable CONFIG_MODULES
  26. # enable RDS
  27. scripts/config --file "$CONF_FILE" --enable CONFIG_RDS
  28. scripts/config --file "$CONF_FILE" --enable CONFIG_RDS_TCP
  29. if [ "$GENERATE_GCOV_REPORT" -eq 1 ]; then
  30. # instrument RDS and only RDS
  31. scripts/config --file "$CONF_FILE" --enable CONFIG_GCOV_KERNEL
  32. scripts/config --file "$CONF_FILE" --disable GCOV_PROFILE_ALL
  33. scripts/config --file "$CONF_FILE" --enable GCOV_PROFILE_RDS
  34. else
  35. scripts/config --file "$CONF_FILE" --disable CONFIG_GCOV_KERNEL
  36. scripts/config --file "$CONF_FILE" --disable GCOV_PROFILE_ALL
  37. scripts/config --file "$CONF_FILE" --disable GCOV_PROFILE_RDS
  38. fi
  39. # need network namespaces to run tests with veth network interfaces
  40. scripts/config --file "$CONF_FILE" --enable CONFIG_NET_NS
  41. scripts/config --file "$CONF_FILE" --enable CONFIG_VETH
  42. # simulate packet loss
  43. scripts/config --file "$CONF_FILE" --enable CONFIG_NET_SCH_NETEM