Commit cc563e74 authored by Taehee Yoo's avatar Taehee Yoo Committed by David S. Miller

selftests: net: kill smcrouted in the cleanup logic in amt.sh

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: c08e8bae ("selftests: add amt interface selftest script")
Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5447f970
...@@ -77,6 +77,7 @@ readonly LISTENER=$(mktemp -u listener-XXXXXXXX) ...@@ -77,6 +77,7 @@ readonly LISTENER=$(mktemp -u listener-XXXXXXXX)
readonly GATEWAY=$(mktemp -u gateway-XXXXXXXX) readonly GATEWAY=$(mktemp -u gateway-XXXXXXXX)
readonly RELAY=$(mktemp -u relay-XXXXXXXX) readonly RELAY=$(mktemp -u relay-XXXXXXXX)
readonly SOURCE=$(mktemp -u source-XXXXXXXX) readonly SOURCE=$(mktemp -u source-XXXXXXXX)
readonly SMCROUTEDIR="$(mktemp -d)"
ERR=4 ERR=4
err=0 err=0
...@@ -85,6 +86,11 @@ exit_cleanup() ...@@ -85,6 +86,11 @@ exit_cleanup()
for ns in "$@"; do for ns in "$@"; do
ip netns delete "${ns}" 2>/dev/null || true ip netns delete "${ns}" 2>/dev/null || true
done done
if [ -f "$SMCROUTEDIR/amt.pid" ]; then
smcpid=$(< $SMCROUTEDIR/amt.pid)
kill $smcpid
fi
rm -rf $SMCROUTEDIR
exit $ERR exit $ERR
} }
...@@ -167,7 +173,7 @@ setup_iptables() ...@@ -167,7 +173,7 @@ setup_iptables()
setup_mcast_routing() 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 \ ip netns exec "${RELAY}" smcroutectl a relay_src \
172.17.0.2 239.0.0.1 amtr 172.17.0.2 239.0.0.1 amtr
ip netns exec "${RELAY}" smcroutectl a relay_src \ ip netns exec "${RELAY}" smcroutectl a relay_src \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment