Instead of just skipping interfaces that are "up", skip the whole

repeated_updown test case unless explicitly enabled with "atf-run -v
run_unsafe=yes".  Gratuitously configuring interfaces "up" is no more
safe than gratuitously configuring them "down"; for example, it could
lead to accidentally connecting to an insecure network or diverting
traffic from the desired route.
This commit is contained in:
gson 2020-07-27 06:52:48 +00:00
parent 8cced7413f
commit 7836998153

View File

@ -1,4 +1,4 @@
# $NetBSD: t_repeated_updown.sh,v 1.4 2020/07/22 05:47:24 martin Exp $
# $NetBSD: t_repeated_updown.sh,v 1.5 2020/07/27 06:52:48 gson Exp $
#
# Copyright (c) 2020 The NetBSD Foundation, Inc.
# All rights reserved.
@ -36,18 +36,25 @@ repeated_updown_head() {
repeated_updown_body() {
if ! [ $(atf_config_get "run_unsafe" "no") = "yes" ]
then
atf_skip "can disrupt networking; also PR port-evbarm/55504"
fi
# Try to avoid stalling any automated test runs.
#
n=35
for i in $(ifconfig -l); do
# skip all interfaces that are already marked UP
ifconfig $i | fgrep -q UP >/dev/null && continue
state="up"
ifconfig -s $i
if [ $? -eq 1 ]; then
state="down"
ifconfig $i up
echo "Initialized $i up"
fi
while [ $n -gt 0 ]; do
ifconfig $i down