Skip to content

Commit

Permalink
ci: Add TMONLIST
Browse files Browse the repository at this point in the history
Add TMONLIST to enable traffic monitor on selected tests.

Signed-off-by: Kui-Feng Lee <[email protected]>
  • Loading branch information
ThinkerYzu1 committed Aug 15, 2024
1 parent 5489ef2 commit d5cc500
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ci/vmtest/configs/TMONLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select_reuseport
sockmap_listen
tc_redirect
14 changes: 13 additions & 1 deletion ci/vmtest/vmtest_selftests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ OUTPUT_DIR=/mnt/vmtest
WORKING_DIR="/${PROJECT_NAME}"
BPF_SELFTESTS_DIR="${WORKING_DIR}/selftests/bpf"
VMTEST_CONFIGS_PATH="${WORKING_DIR}/ci/vmtest/configs"
PKG_CONFIG=pkg-config

read_lists() {
(for path in "$@"; do
Expand All @@ -44,6 +45,16 @@ ALLOWLIST=$(read_lists \
"$VMTEST_CONFIGS_PATH/ALLOWLIST.${ARCH}" \
)

TMONLIST=""
if ${PKG_CONFIG} --exists libpcap 2>/dev/null; then
TMONLIST=$(read_lists \
"$BPF_SELFTESTS_DIR/TMONLIST" \
"$BPF_SELFTESTS_DIR/TMONLIST.${ARCH}" \
"$VMTEST_CONFIGS_PATH/TMONLIST" \
"$VMTEST_CONFIGS_PATH/TMONLIST.${ARCH}" \
)
fi

declare -a TEST_NAMES=()

read_test_names() {
Expand Down Expand Up @@ -83,7 +94,7 @@ test_progs_helper() {
# "&& true" does not change the return code (it is not executed
# if the Python script fails), but it prevents exiting on a
# failure due to the "set -e".
./${selftest} ${args} ${DENYLIST:+-d"$DENYLIST"} ${ALLOWLIST:+-a"$ALLOWLIST"} --json-summary "${json_file}" && true
./${selftest} ${args} ${DENYLIST:+-d"$DENYLIST"} ${ALLOWLIST:+-a"$ALLOWLIST"} ${TMONLIST:+-m"$TMONLIST"} --json-summary "${json_file}" && true
echo "${selftest}:$?" >>"${STATUS_FILE}"
foldable end ${selftest}
}
Expand Down Expand Up @@ -175,6 +186,7 @@ foldable end kernel_config
echo "DENYLIST: ${DENYLIST}"
echo "ALLOWLIST: ${ALLOWLIST}"
echo "TMONLIST: ${TMONLIST}"
cd ${PROJECT_NAME}/selftests/bpf
Expand Down

0 comments on commit d5cc500

Please sign in to comment.