Module Name:    src
Committed By:   mrg
Date:           Mon Apr 12 01:18:13 UTC 2021

Modified Files:
        src/tests/usr.sbin/cpuctl: t_cpuctl.sh

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.sbin/cpuctl/t_cpuctl.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.sbin/cpuctl/t_cpuctl.sh
diff -u src/tests/usr.sbin/cpuctl/t_cpuctl.sh:1.5 src/tests/usr.sbin/cpuctl/t_cpuctl.sh:1.6
--- src/tests/usr.sbin/cpuctl/t_cpuctl.sh:1.5	Fri Aug 14 05:22:25 2020
+++ src/tests/usr.sbin/cpuctl/t_cpuctl.sh	Mon Apr 12 01:18:13 2021
@@ -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 @@ identify_body() {
 	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_head() {
 
 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_head() {
 }
 
 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"
 }

Reply via email to