Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/sbin/ifconfig disable these tests unless ATF_SBIN_IFCO...



details:   https://anonhg.NetBSD.org/src/rev/0e32bd17fb69
branches:  trunk
changeset: 954670:0e32bd17fb69
user:      mrg <mrg%NetBSD.org@localhost>
date:      Tue Sep 08 06:11:32 2020 +0000

description:
disable these tests unless ATF_SBIN_IFCONFIG_WIFI_ENABLE=yes is
in the environment.  they change wifi configuration, restart
wpa_supplicant and hostapd, and, on broken wifi chipsets, may
hang the test run.

diffstat:

 tests/sbin/ifconfig/t_woptions.sh |  13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diffs (48 lines):

diff -r eab4eaec3b9a -r 0e32bd17fb69 tests/sbin/ifconfig/t_woptions.sh
--- a/tests/sbin/ifconfig/t_woptions.sh Tue Sep 08 05:33:05 2020 +0000
+++ b/tests/sbin/ifconfig/t_woptions.sh Tue Sep 08 06:11:32 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_woptions.sh,v 1.1 2020/06/27 05:07:08 jruoho Exp $
+# $NetBSD: t_woptions.sh,v 1.2 2020/09/08 06:11:32 mrg Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -27,6 +27,14 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
+# These tests play around with the wifi configuration on a system
+# which may not be safe, destroy configuration or hang.
+check_ifconfig_tests_enabled() {
+       if [ "${ATF_SBIN_IFCONFIG_WIFI_ENABLE}" != "yes" ]; then
+               atf_skip "Test triggers real device activity and may destroy configuration or hang."
+       fi
+}
+
 atf_test_case chan
 chan_head() {
        atf_set "require.user" "root"
@@ -35,6 +43,7 @@
 }
 
 chan_body() {
+       check_ifconfig_tests_enabled
 
        # This sequence covers both valid and invalid channels.
        # Different 802.11 modes are not taken into account, and
@@ -97,6 +106,7 @@
 }
 
 mediaopt_body() {
+       check_ifconfig_tests_enabled
 
        # Again, also non-802.11 interfaces are tested.
        #
@@ -158,6 +168,7 @@
 }
 
 modes_body() {
+       check_ifconfig_tests_enabled
 
        # Although 11n is not yet supported, the system
        # should not panic from invalid input parameters.



Home | Main Index | Thread Index | Old Index