Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
vasild committed Nov 28, 2024
1 parent 803ed46 commit e51ac12
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ci/test/00_setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export BASE_OUTDIR=${BASE_OUTDIR:-$BASE_SCRATCH_DIR/out}
# The folder for previous release binaries.
# This folder exists only on the ci guest, and on the ci host as a volume.
export PREVIOUS_RELEASES_DIR=${PREVIOUS_RELEASES_DIR:-$BASE_ROOT_DIR/prev_releases}
export CI_BASE_PACKAGES=${CI_BASE_PACKAGES:-build-essential pkg-config curl ca-certificates ccache python3 rsync git procps bison e2fsprogs cmake net-tools tcpdump}
export CI_BASE_PACKAGES=${CI_BASE_PACKAGES:-build-essential pkg-config curl ca-certificates ccache python3 rsync git procps bison e2fsprogs cmake net-tools tcpdump bind9-host iptables inetutils-telnet}
export GOAL=${GOAL:-install}
export DIR_QA_ASSETS=${DIR_QA_ASSETS:-${BASE_SCRATCH_DIR}/qa-assets}
export CI_RETRY_EXE=${CI_RETRY_EXE:-"retry --"}
10 changes: 9 additions & 1 deletion ci/test/02_run_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,15 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
# Append $USER to /tmp/env to support multi-user systems and $CONTAINER_NAME
# to allow support starting multiple runs simultaneously by the same user.
# shellcheck disable=SC2086
CI_CONTAINER_ID=$(docker run --cap-add LINUX_IMMUTABLE $CI_CONTAINER_CAP --rm --interactive --detach --tty \
CI_CONTAINER_ID=$(docker run \
--cap-add LINUX_IMMUTABLE \
--cap-add NET_ADMIN \
--cap-add SYSLOG \
$CI_CONTAINER_CAP \
--rm \
--interactive \
--detach \
--tty \
--mount "type=bind,src=$BASE_READ_ONLY_DIR,dst=$BASE_READ_ONLY_DIR,readonly" \
--mount "${CI_CCACHE_MOUNT}" \
--mount "${CI_DEPENDS_MOUNT}" \
Expand Down
18 changes: 17 additions & 1 deletion ci/test/03_test_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function traffic_monitor_end()

for ifname in $(get_interfaces) ; do
f=$(tcpdump_file_for_interface "$ifname")
if [ ! -e "$f" -a "$FILE_ENV" != "./ci/test/00_setup_env_native_asan.sh" ] ; then
if [ ! -e "$f" ] && [ "$FILE_ENV" != "./ci/test/00_setup_env_native_asan.sh" ] ; then
# In some CI environments this script is not running as root and so the
# tcpdump errors and does not create $f. Skip silently those, but we
# need at least one where tcpdump can run and this is the ASAN one. So
Expand All @@ -190,6 +190,22 @@ function traffic_monitor_end()
done
}

traffic_monitor_begin
iptables -A OUTPUT -j LOG --log-prefix "ttttt1" --log-level emerg || :
ip6tables -A OUTPUT -j LOG --log-prefix "ttttt2" --log-level emerg || :
iptables -A OUTPUT -m addrtype \! --dst-type LOCAL -j LOG --log-prefix "ttttt3" --log-level emerg || :
ip6tables -A OUTPUT -m addrtype \! --dst-type LOCAL -j LOG --log-prefix "ttttt4" --log-level emerg || :
id || :
cat /etc/resolv.conf || :
host bitcoin.org || :
host nonexistentinvalidfoobarbaz.org || :
telnet 50.60.1.2 3456 || :
dmesg |grep ttttt || :
grep -r ttttt /var/log/ || :
iptables -v -x -n -L || :
traffic_monitor_end
exit 34

if [ "$RUN_UNIT_TESTS" = "true" ]; then
traffic_monitor_begin
DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" CTEST_OUTPUT_ON_FAILURE=ON ctest --stop-on-failure "${MAKEJOBS}" --timeout $(( TEST_RUNNER_TIMEOUT_FACTOR * 60 ))
Expand Down

0 comments on commit e51ac12

Please sign in to comment.