From 7cf4d11b7c51c3b512c7919dc10c25ebb34cd1b3 Mon Sep 17 00:00:00 2001 From: gpotter2 <10530980+gpotter2@users.noreply.github.com> Date: Sat, 15 Jun 2024 15:22:33 +0200 Subject: [PATCH 1/2] Clear DNS cache in OSX tests --- .config/ci/test.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.config/ci/test.sh b/.config/ci/test.sh index f6d58f5d150..98e9c8e00c7 100755 --- a/.config/ci/test.sh +++ b/.config/ci/test.sh @@ -133,3 +133,10 @@ sys.exit() EOF echo "DEBUG: TEMPFILE=${TEMPFILE}" ./run_scapy -H -c "${TEMPFILE}" || exit 1 + +# OSX: clear DNS cache +if [ "$OSTYPE" = "darwin"* ] +then + # https://www.hongkiat.com/blog/clear-dns-cache-mac/ + sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder +fi From b267969e36b786645e73f7c033f75e85e1d5f525 Mon Sep 17 00:00:00 2001 From: gpotter2 <10530980+gpotter2@users.noreply.github.com> Date: Sat, 15 Jun 2024 16:05:56 +0200 Subject: [PATCH 2/2] fixup --- .config/ci/test.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.config/ci/test.sh b/.config/ci/test.sh index 98e9c8e00c7..bfccbb89396 100755 --- a/.config/ci/test.sh +++ b/.config/ci/test.sh @@ -134,9 +134,16 @@ EOF echo "DEBUG: TEMPFILE=${TEMPFILE}" ./run_scapy -H -c "${TEMPFILE}" || exit 1 +# DEBUG # OSX: clear DNS cache -if [ "$OSTYPE" = "darwin"* ] +if [[ "$OSTYPE" = "darwin"* ]] then + echo "HEY" # https://www.hongkiat.com/blog/clear-dns-cache-mac/ sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder + ifconfig + cat /etc/resolv.conf + ping 1.1.1.1 + dig google.com fi +