summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTaehee Yoo <ap420073@gmail.com>2024-05-18 13:20:52 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-06-12 11:03:50 +0200
commit47c5707d4412e9d9da5f6ae9ff4bab8d88bf296e (patch)
tree0f38e382b06c498e80e5a20b4d7af5b168e89721 /tools
parent8f1fc3b86eaea70be6abcae2e9aa7e7b99453864 (diff)
downloadlinux-47c5707d4412e9d9da5f6ae9ff4bab8d88bf296e.tar.gz
linux-47c5707d4412e9d9da5f6ae9ff4bab8d88bf296e.tar.bz2
linux-47c5707d4412e9d9da5f6ae9ff4bab8d88bf296e.zip
selftests: net: kill smcrouted in the cleanup logic in amt.sh
[ Upstream commit cc563e749810f5636451d4b833fbd689899ecdb9 ] The amt.sh requires smcrouted for multicasting routing. So, it starts smcrouted before forwarding tests. It must be stopped after all tests, but it isn't. To fix this issue, it kills smcrouted in the cleanup logic. Fixes: c08e8baea78e ("selftests: add amt interface selftest script") Signed-off-by: Taehee Yoo <ap420073@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/net/amt.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/amt.sh b/tools/testing/selftests/net/amt.sh
index 5175a42cbe8a..7e7ed6c558da 100755
--- a/tools/testing/selftests/net/amt.sh
+++ b/tools/testing/selftests/net/amt.sh
@@ -77,6 +77,7 @@ readonly LISTENER=$(mktemp -u listener-XXXXXXXX)
readonly GATEWAY=$(mktemp -u gateway-XXXXXXXX)
readonly RELAY=$(mktemp -u relay-XXXXXXXX)
readonly SOURCE=$(mktemp -u source-XXXXXXXX)
+readonly SMCROUTEDIR="$(mktemp -d)"
ERR=4
err=0
@@ -85,6 +86,11 @@ exit_cleanup()
for ns in "$@"; do
ip netns delete "${ns}" 2>/dev/null || true
done
+ if [ -f "$SMCROUTEDIR/amt.pid" ]; then
+ smcpid=$(< $SMCROUTEDIR/amt.pid)
+ kill $smcpid
+ fi
+ rm -rf $SMCROUTEDIR
exit $ERR
}
@@ -167,7 +173,7 @@ setup_iptables()
setup_mcast_routing()
{
- ip netns exec "${RELAY}" smcrouted
+ ip netns exec "${RELAY}" smcrouted -P $SMCROUTEDIR/amt.pid
ip netns exec "${RELAY}" smcroutectl a relay_src \
172.17.0.2 239.0.0.1 amtr
ip netns exec "${RELAY}" smcroutectl a relay_src \