Skip to content

Commit

Permalink
packetdrill: limit // tests if no KVM or debug
Browse files Browse the repository at this point in the history
Because we can still see instabilities in such slow envs.

Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
  • Loading branch information
matttbe committed Jan 17, 2024
1 parent 818de76 commit cd7b787
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,12 @@ prepare() { local mode no_tap=1
build_packetdrill
prepare_hosts_file

is_ci && no_tap=0
if is_ci; then
no_tap=0 # we want subtests
if [ "${mode}" == "debug" ]; then
INPUT_MAX_THREADS=${INPUT_CPUS} ## avoid too many concurrent work
fi
fi

cat <<EOF > "${VIRTME_SCRIPT}"
#! /bin/bash
Expand All @@ -520,10 +525,20 @@ TAP_PREFIX="${KERNEL_SRC}/tools/testing/selftests/kselftest/prefix.pl"
RESULTS_DIR="${RESULTS_DIR}"
OUTPUT_VIRTME="${OUTPUT_VIRTME}"
KUNIT_CORE_LOADED=0
MAX_THREADS=${INPUT_MAX_THREADS:-$((INPUT_CPUS * 2))}
export SELFTESTS_MPTCP_LIB_EXPECT_ALL_FEATURES="${INPUT_SELFTESTS_MPTCP_LIB_EXPECT_ALL_FEATURES}"
export SELFTESTS_MPTCP_LIB_COLOR_FORCE="${INPUT_SELFTESTS_MPTCP_LIB_COLOR_FORCE}"
export SELFTESTS_MPTCP_LIB_NO_TAP="${no_tap}"
set_max_threads() {
# if QEmu without KVM support
if [ "\$(cat /sys/devices/virtual/dmi/id/sys_vendor)" = "QEMU" ] &&
[ "\$(cat /sys/devices/system/clocksource/clocksource0/current_clocksource)" != "kvm-clock" ]; then
MAX_THREADS=$((MAX_THREADS / 2)) # avoid too many concurrent work
fi
}
# \$1: name of the test
_can_run() { local tname
tname="\${1}"
Expand Down Expand Up @@ -728,7 +743,7 @@ run_packetdrill_one() { local pktd_dir pktd tap
cd /opt/packetdrill/gtests/net/
PYTHONUNBUFFERED=1 _tap "${RESULTS_DIR}/\${tap}" \
./packetdrill/run_all.py -l -v -P $((INPUT_CPUS * 2)) \${pktd_dir}
./packetdrill/run_all.py -l -v -P \${MAX_THREADS} \${pktd_dir}
}
run_packetdrill_all() { local pktd_dir rc=0
Expand Down Expand Up @@ -809,6 +824,8 @@ run_loop() {
run_loop_n 0 "\${@}"
}
set_max_threads
# To run commands before executing the tests
if [ -f "${VIRTME_EXEC_PRE}" ]; then
source "${VIRTME_EXEC_PRE}"
Expand Down

0 comments on commit cd7b787

Please sign in to comment.