NetBSD Problem Report #57284

From www@netbsd.org  Wed Mar 22 19:54:51 2023
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 972C41A9239
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 22 Mar 2023 19:54:51 +0000 (UTC)
Message-Id: <20230322195449.CEDA41A923C@mollari.NetBSD.org>
Date: Wed, 22 Mar 2023 19:54:49 +0000 (UTC)
From: jspath55@gmail.com
Reply-To: jspath55@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Unit test for envstat fails in ATF Tests suite on one machine
X-Send-Pr-Version: www-1.0

>Number:         57284
>Category:       misc
>Synopsis:       Unit test for envstat fails in ATF Tests suite on one machine
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    martin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 22 19:55:00 +0000 2023
>Closed-Date:    Sat Apr 15 12:14:29 +0000 2023
>Last-Modified:  Sat Apr 15 12:14:29 +0000 2023
>Originator:     Jim Spath
>Release:        10.0_BETA
>Organization:
>Environment:
NetBSD one.machine 10.0_BETA NetBSD 10.0_BETA (GENERIC) #0: Sun Feb 12 12:39:37 UTC 2023  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64 x86_64 AMD 686-class NetBSD

>Description:
I ran the atf suite (automated testing framework) on a machine, first with i386 and then the amd64 NetBSD 10.0 BETA. A few faults were specific to one architecture or the other but this result occurred on both installs. A different i386 machine did not produce the same result.

fail-i386.txt:tc, 0.031487, sbin/envstat/t_envstat, zerotemp, failed, Test case was expecting a failure but none were raised
fail-i386.txt:tp, 0.031992, sbin/envstat/t_envstat, failed 

fail-amd64.txt:tc, 0.058180, sbin/envstat/t_envstat, zerotemp, failed, Test case was expecting a failure but none were raised
fail-amd64.txt:tp, 0.058536, sbin/envstat/t_envstat, failed

XML output extract:

<tc-time>0.050701</tc-time></tc>
<tp-time>1.110082</tp-time></tp>
<tp id="sbin/envstat/t_envstat">
<tc id="zerotemp">
<so>amdtemp0 = 45.125 =~ 45</so>
<so>Skipping non-existent coretemp0</so>
<so>Skipping non-existent acpitz0</so>
<failed>Test case was expecting a failure but none were raised</failed>

Output from dmesg shows this thermal unit:

[     1.055110] amdtemp0 at amdnb_misc0: AMD CPU Temperature Sensors (Family16h)

The system board is date stamped as hp, 2014.

Running envstat produces:

$ /usr/sbin/envstat
                      Current  CritMax  WarnMax  WarnMin  CritMin  Unit
[amdtemp0]
  cpu0 temperature:    40.875                                      degC


>How-To-Repeat:
Other than a similar system board and processor, this result may not be repeatable on other systems.
>Fix:
I looked at the test source and will read more deeply in the meantime how it should work.

/usr/tests/sbin/envstat/t_envstat


[...]
                if [ $dev = "amdtemp0" ]; then
                        atf_expect_fail "PR kern/53410"
                fi

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: misc-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: misc/57284: Unit test for envstat fails in ATF Tests suite on
 one machine
Date: Thu, 23 Mar 2023 11:58:55 +0100

 That test case is poorly written. It has a fixed list of three(!) device
 types that it tries, all of them very x86-centric.

 Instead it should extract names from envstat, like:

 	devices=$( envstat -D|awk '{print $1}' )

 Martin

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57284 CVS commit: src/tests/sbin/envstat
Date: Thu, 23 Mar 2023 11:32:50 +0000

 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.

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: misc/57284: Unit test for envstat fails in ATF Tests suite on
 one machine
Date: Thu, 23 Mar 2023 12:34:46 +0100

 I just commited a potential fix to -current, can you use a t_envstat
 from -current with that fix (rev. 1.2 or newer) and test on your machine?

 Martin

From: Jim Spath <jspath55@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: misc/57284
Date: Thu, 23 Mar 2023 09:23:25 -0400

 Martin Huseman wrote:

 > I just commited a potential fix to -current, can you use a t_envstat from -current with that fix (rev. 1.2 or newer) and test on your machine?

 Done; here are the results:

 info: atf.version, Automated Testing Framework 0.20 (atf-0.20)
 info: tests.root, /usr/tests
 info: time.start, Thu Mar 23 12:48:39 UTC 2023
 [...]
 tp-start: 1679575719.292688, sbin/envstat/t_envstat, 1
 tc-start: 1679575719.292730, zerotemp
 tc-so:amdtemp0 = 42.375 =~ 42
 tc-end: 1679575719.369277, zerotemp, passed
 tp-end: 1679575719.369918, sbin/envstat/t_envstat
 info: time.end, Thu Mar 23 12:48:39 UTC 2023

 I will run this script on other architectures I have available.

 Jim

 p.s. the answer is 42!

From: Jim Spath <jspath55@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: misc/57284
Date: Thu, 23 Mar 2023 15:23:26 -0400

 I ran the new envstat test on other architectures.
 A Raspberry Pi Zero 2W
 Before:
 tps-count: 1
 tp-start: 1679598608.429388, sbin/envstat/t_envstat, 1
 tc-start: 1679598608.429702, zerotemp
 tc-so:Skipping non-existent amdtemp0
 tc-so:Skipping non-existent coretemp0
 tc-so:Skipping non-existent acpitz0
 tc-end: 1679598608.548072, zerotemp, passed
 tp-end: 1679598608.560797, sbin/envstat/t_envstat
 info: time.end, Thu Mar 23 19:10:08 UTC 2023

 After:
 tps-count: 1
 tp-start: 1679598720.467940, sbin/envstat/t_envstat, 1
 tc-start: 1679598720.467994, zerotemp
 tc-so:vcmbox0 = 44.546 =~ 45
 tc-end: 1679598720.597889, zerotemp, passed
 tp-end: 1679598720.610509, sbin/envstat/t_envstat
 info: time.end, Thu Mar 23 19:12:00 UTC 2023

 A Raspberry Pi 4:
 tps-count: 1
 tp-start: 1679598487.743577, sbin/envstat/t_envstat, 1
 tc-start: 1679598487.743615, zerotemp
 tc-so:acpitz0 = 43.000 =~ 43
 tc-so:vcmbox0 = 32.000 =~ 32
 tc-end: 1679598487.809222, zerotemp, passed
 tp-end: 1679598487.809477, sbin/envstat/t_envstat
 info: time.end, Thu Mar 23 19:08:07 UTC 2023

 An Intel Atom i386:
 tps-count: 1
 tp-start: 1679579619.765972, sbin/envstat/t_envstat, 1
 tc-start: 1679579619.766178, zerotemp
 tc-so:acpitz0 = 51.000 =~ 51
 tc-so:acpitz1 = 51.000 =~ 51
 tc-so:coretemp0 = 54.000 =~ 54
 tc-end: 1679579619.902485, zerotemp, passed
 tp-end: 1679579619.903026, sbin/envstat/t_envstat
 info: time.end, Thu Mar 23 13:53:39 UTC 2023

 Everything is awesome.

 Jim

State-Changed-From-To: open->needs-pullups
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 01 Apr 2023 23:21:39 +0000
State-Changed-Why:
fixed, should probably get into -10


Responsible-Changed-From-To: misc-bug-people->martin
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Sun, 02 Apr 2023 07:37:04 +0000
Responsible-Changed-Why:
I fixed it


State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: martin@NetBSD.org
State-Changed-When: Sun, 02 Apr 2023 07:37:04 +0000
State-Changed-Why:
[pullup-10 #127]


From: "Julian Coleman" <jdc@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57284 CVS commit: [netbsd-10] src/tests/sbin/envstat
Date: Sat, 15 Apr 2023 12:08:42 +0000

 Module Name:	src
 Committed By:	jdc
 Date:		Sat Apr 15 12:08:42 UTC 2023

 Modified Files:
 	src/tests/sbin/envstat [netbsd-10]: t_envstat.sh

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


 To generate a diff of this commit:
 cvs rdiff -u -r1.1 -r1.1.6.1 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.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: jdc@NetBSD.org
State-Changed-When: Sat, 15 Apr 2023 12:14:29 +0000
State-Changed-Why:
Pullups processed.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.