Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-10]: src/tests/sbin/envstat Pull up the following revision (reque...
details: https://anonhg.NetBSD.org/src/rev/6af607b4e0e7
branches: netbsd-10
changeset: 374265:6af607b4e0e7
user: jdc <jdc%NetBSD.org@localhost>
date: Sat Apr 15 12:08:42 2023 +0000
description:
Pull up the following revision (requested by martin in ticket #127):
tests/sbin/envstat/t_envstat.sh: revision 1.2
PR 57284: rewrite test to extract all temperaturs from all local sensors
and test them (instead of only one temperature from a tiny list of hard
coded possible devices).
diffstat:
tests/sbin/envstat/t_envstat.sh | 32 ++++++++++++++++++--------------
1 files changed, 18 insertions(+), 14 deletions(-)
diffs (55 lines):
diff -r a601f8412262 -r 6af607b4e0e7 tests/sbin/envstat/t_envstat.sh
--- a/tests/sbin/envstat/t_envstat.sh Mon Apr 03 18:36:09 2023 +0000
+++ b/tests/sbin/envstat/t_envstat.sh Sat Apr 15 12:08:42 2023 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_envstat.sh,v 1.1 2020/06/25 15:01:35 jruoho Exp $
+# $NetBSD: t_envstat.sh,v 1.1.6.1 2023/04/15 12:08:42 jdc Exp $
#
# Copyright (c) 2020 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -36,9 +36,8 @@ zerotemp_head() {
zerotemp_body() {
- devices="amdtemp0 coretemp0 acpitz0" # XXX: What else?
-
- for dev in $devices; do
+ for dev in $( envstat -D | awk '{print $1}' )
+ do
envstat -d $dev >/dev/null 2>&1
@@ -47,18 +46,23 @@ zerotemp_body() {
continue
fi
- if [ $dev = "amdtemp0" ]; then
- atf_expect_fail "PR kern/53410"
- fi
+ # extract all temperatures from $dev
+ for tempf in $(envstat -d $dev | \
+ awk -F: '/degC$/{print $2}' | \
+ awk '{print $1}' )
+ do
+ tempi=$(printf "%.0f" $tempf)
+
+ echo "$dev = $tempf =~ $tempi"
- tempf=$(envstat -d $dev | awk '/Current/{getline;print $3}')
- tempi=$(printf "%.0f" $tempf)
+ if [ $tempi -eq 0 ]; then
- echo "$dev = $tempf =~ $tempi"
-
- if [ $tempi -eq 0 ]; then
- atf_fail "Zero-temperature from $dev"
- fi
+ if [ $dev = "amdtemp0" ]; then
+ atf_expect_fail "PR kern/53410"
+ fi
+ atf_fail "Zero-temperature from $dev"
+ fi
+ done
done
}
Home |
Main Index |
Thread Index |
Old Index