Module Name: src Committed By: martin Date: Thu Mar 23 11:32:49 UTC 2023
Modified Files: src/tests/sbin/envstat: t_envstat.sh Log Message: 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). To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/sbin/envstat/t_envstat.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/sbin/envstat/t_envstat.sh diff -u src/tests/sbin/envstat/t_envstat.sh:1.1 src/tests/sbin/envstat/t_envstat.sh:1.2 --- src/tests/sbin/envstat/t_envstat.sh:1.1 Thu Jun 25 15:01:35 2020 +++ src/tests/sbin/envstat/t_envstat.sh Thu Mar 23 11:32:49 2023 @@ -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.2 2023/03/23 11:32:49 martin 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 - - tempf=$(envstat -d $dev | awk '/Current/{getline;print $3}') - tempi=$(printf "%.0f" $tempf) - - echo "$dev = $tempf =~ $tempi" - - if [ $tempi -eq 0 ]; then - atf_fail "Zero-temperature from $dev" - 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" + + if [ $tempi -eq 0 ]; then + + if [ $dev = "amdtemp0" ]; then + atf_expect_fail "PR kern/53410" + fi + atf_fail "Zero-temperature from $dev" + fi + done done }