From 5a33a2afb3a35949545a572cffa0b8e637446d4a Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Mon, 20 Mar 2017 23:07:34 +0000 Subject: [PATCH] Fix back-to-back runs of sys/netinet/fibs_test;slaac_on_nondefault_fib6 This test was failing if run twice because rtadvd takes too long to die. The rtadvd process from the first run was still running when the second run created its interfaces. The solution is to use SIGKILL during the cleanup instead of SIGTERM so rtadvd will die faster. While I'm here, randomize the addresses used for the test, which makes bugs like this easier to spot, and fix the cleanup order to be the opposite of the setup order PR: 217871 MFC after: 18 days X-MFC-With: 315458 Sponsored by: Spectra Logic Corp --- tests/sys/netinet/fibs_test.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/tests/sys/netinet/fibs_test.sh b/tests/sys/netinet/fibs_test.sh index 727b3f6770d3..febcbb7577f2 100755 --- a/tests/sys/netinet/fibs_test.sh +++ b/tests/sys/netinet/fibs_test.sh @@ -451,12 +451,12 @@ slaac_on_nondefault_fib6_head() } slaac_on_nondefault_fib6_body() { - atf_skip "BUG217871 SLAAC on a newly created epair sometimes fails to add routes" # Configure the epair interfaces to use nonrouteable RFC3849 # addresses and non-default FIBs - ADDR="2001:db8::2" - GATEWAY="2001:db8::1" - SUBNET="2001:db8:" + PREFIX="2001:db8:$(printf "%x" `jot -r 1 0 65535`):$(printf "%x" `jot -r 1 0 65535`)" + ADDR="$PREFIX::2" + GATEWAY="$PREFIX::1" + SUBNET="$PREFIX:" MASK="64" # Check system configuration @@ -509,19 +509,23 @@ slaac_on_nondefault_fib6_body() } slaac_on_nondefault_fib6_cleanup() { - cleanup_ifaces if [ -f "rtadvd.pid" ]; then - pkill -F rtadvd.pid + # rtadvd can take a long time to shutdown. Use SIGKILL to kill + # it right away. The downside to using SIGKILL is that it + # won't send final RAs to all interfaces, but we don't care + # because we're about to destroy its interface anyway. + pkill -kill -F rtadvd.pid rm -f rtadvd.pid fi + cleanup_ifaces + if [ -f "forwarding.state" ] ; then + sysctl "net.inet6.ip6.forwarding"=`cat "forwarding.state"` + rm "forwarding.state" + fi if [ -f "rfc6204w3.state" ] ; then sysctl "net.inet6.ip6.rfc6204w3"=`cat "rfc6204w3.state"` rm "rfc6204w3.state" fi - if [ -f "forwarding.state" ] ; then - sysctl "net.inet6.ip6.forwarding"=`cat "forwarding.state"` - rm "forwarding.state" - fi } # Regression test for kern/187550