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.
This commit is contained in:
mrg 2021-04-12 01:18:13 +00:00
parent b4369c1e58
commit bfab3a83f7
1 changed files with 22 additions and 1 deletions

View File

@ -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. # Copyright (c) 2020 The NetBSD Foundation, Inc.
# All rights reserved. # All rights reserved.
@ -167,6 +167,16 @@ identify_body() {
atf_pass 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 # offline
# #
atf_test_case offline cleanup atf_test_case offline cleanup
@ -178,6 +188,11 @@ offline_head() {
offline_body() { offline_body() {
if ! check_cpuctl_ok; then
atf_skip \
"test sometimes hangs or upsets machine"
fi
cpuctl list > $tmp cpuctl list > $tmp
setcpu "offline" atf_fail "error in setting a CPU offline" setcpu "offline" atf_fail "error in setting a CPU offline"
@ -216,6 +231,12 @@ nointr_head() {
} }
nointr_body() { nointr_body() {
if ! check_cpuctl_ok; then
atf_skip \
"test sometimes hangs or upsets machine"
fi
cpuctl list > $tmp cpuctl list > $tmp
setcpu "nointr" atf_fail "error in disabling interrupts" setcpu "nointr" atf_fail "error in disabling interrupts"
} }