Source-Changes-HG archive

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

[src/trunk]: src/tests/usr.sbin/cpuctl don't run the "offline" or "nointr" te...



details:   https://anonhg.NetBSD.org/src/rev/cb903e6e75a0
branches:  trunk
changeset: 1020410:cb903e6e75a0
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Apr 12 01:18:13 2021 +0000

description:
don't run the "offline" or "nointr" tests by default.  they exercise
bugs that exist in the current code and leave the target machine in
a broken state, requiring ddb or hard reset.

setting ATF_USR_SBIN_CPUCTL_OFFLINE_ENABLE to any non-empty string
will enable these tests again.

diffstat:

 tests/usr.sbin/cpuctl/t_cpuctl.sh |  23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diffs (51 lines):

diff -r 6d886b00db89 -r cb903e6e75a0 tests/usr.sbin/cpuctl/t_cpuctl.sh
--- a/tests/usr.sbin/cpuctl/t_cpuctl.sh Mon Apr 12 00:05:54 2021 +0000
+++ b/tests/usr.sbin/cpuctl/t_cpuctl.sh Mon Apr 12 01:18:13 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_cpuctl.sh,v 1.5 2020/08/14 05:22:25 martin Exp $
+# $NetBSD: t_cpuctl.sh,v 1.6 2021/04/12 01:18:13 mrg Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -167,6 +167,16 @@
        atf_pass
 }
 
+#
+# check_cpuctl_ok - only run some tests if
+# is set ATF_USR_SBIN_CPUCTL_OFFLINE_ENABLE.
+check_cpuctl_ok() {
+       if [ -z "$ATF_USR_SBIN_CPUCTL_OFFLINE_ENABLE" ]; then
+               return 1
+       fi
+       return 0
+}
+
 # offline
 #
 atf_test_case offline cleanup
@@ -178,6 +188,11 @@
 
 offline_body() {
 
+       if ! check_cpuctl_ok; then
+               atf_skip \
+                  "test sometimes hangs or upsets machine"
+       fi
+
        cpuctl list > $tmp
        setcpu "offline" atf_fail "error in setting a CPU offline"
 
@@ -216,6 +231,12 @@
 }
 
 nointr_body() {
+
+       if ! check_cpuctl_ok; then
+               atf_skip \
+                  "test sometimes hangs or upsets machine"
+       fi
+
        cpuctl list > $tmp
        setcpu "nointr" atf_fail "error in disabling interrupts"
 }



Home | Main Index | Thread Index | Old Index