Skip to content

Commit cc563e7

Browse files
TaeheeYoodavem330
authored andcommitted
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: c08e8ba ("selftests: add amt interface selftest script") Signed-off-by: Taehee Yoo <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5447f97 commit cc563e7

File tree

1 file changed

+7
-1
lines changed
  • tools/testing/selftests/net

1 file changed

+7
-1
lines changed

tools/testing/selftests/net/amt.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ readonly LISTENER=$(mktemp -u listener-XXXXXXXX)
7777
readonly GATEWAY=$(mktemp -u gateway-XXXXXXXX)
7878
readonly RELAY=$(mktemp -u relay-XXXXXXXX)
7979
readonly SOURCE=$(mktemp -u source-XXXXXXXX)
80+
readonly SMCROUTEDIR="$(mktemp -d)"
8081
ERR=4
8182
err=0
8283

@@ -85,6 +86,11 @@ exit_cleanup()
8586
for ns in "$@"; do
8687
ip netns delete "${ns}" 2>/dev/null || true
8788
done
89+
if [ -f "$SMCROUTEDIR/amt.pid" ]; then
90+
smcpid=$(< $SMCROUTEDIR/amt.pid)
91+
kill $smcpid
92+
fi
93+
rm -rf $SMCROUTEDIR
8894

8995
exit $ERR
9096
}
@@ -167,7 +173,7 @@ setup_iptables()
167173

168174
setup_mcast_routing()
169175
{
170-
ip netns exec "${RELAY}" smcrouted
176+
ip netns exec "${RELAY}" smcrouted -P $SMCROUTEDIR/amt.pid
171177
ip netns exec "${RELAY}" smcroutectl a relay_src \
172178
172.17.0.2 239.0.0.1 amtr
173179
ip netns exec "${RELAY}" smcroutectl a relay_src \

0 commit comments

Comments
 (0)