coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tests: avoid false failure when comparing /proc/cpuinfo


From: Bernhard Voelker
Subject: Re: [PATCH] tests: avoid false failure when comparing /proc/cpuinfo
Date: Thu, 16 Oct 2014 12:25:29 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0

On 10/16/2014 11:51 AM, Pádraig Brady wrote:
On 10/16/2014 09:57 AM, Bernhard Voelker wrote:
On 10/16/2014 10:34 AM, Pádraig Brady wrote:
On 10/16/2014 09:24 AM, Bernhard Voelker wrote:
How about /proc/version

Well, /proc/cpuinfo is a multi-line file while /proc/version
is not. Maybe it's better to use another multi-line one which
does not change too often - like /proc/filesystems ?

That would add a little more inconsistency.
Paul's patch used /proc/version elsewhere (which I just noticed now).
Multi-line is irrelevant to this test, so I'd just use /proc/version here also.

Agreed, patch below.

Have a nice day,
Berny

From 11fe3ca5ec04528dd22cb4b8f9f47154a32d38ac Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <address@hidden>
Date: Thu, 16 Oct 2014 12:23:04 +0200
Subject: [PATCH] tests: avoid false failure when comparing /proc files

At least the MHz number in /proc/cpuinfo may change, thus leading to
a false positive failure when comparing the expected against the
actual output file.  Use an invariant file instead: /proc/version.

* tests/misc/head-c.sh: s/cpuinfo/version/
---
 tests/misc/head-c.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/misc/head-c.sh b/tests/misc/head-c.sh
index 807e965..1015c22 100755
--- a/tests/misc/head-c.sh
+++ b/tests/misc/head-c.sh
@@ -44,7 +44,7 @@ esac

 # Make sure it works on funny files in /proc and /sys.

-for file in /proc/cpuinfo /sys/kernel/profiling; do
+for file in /proc/version /sys/kernel/profiling; do
   if test -r $file; then
     cp -f $file copy &&
     head -c -1 copy > exp1 || framework_failure_
--
1.8.4.5



reply via email to

[Prev in Thread] Current Thread [Next in Thread]