[Top][All Lists]

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

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

From: Pádraig Brady
Subject: Re: [PATCH] tests: avoid false failure when comparing /proc/cpuinfo
Date: Thu, 16 Oct 2014 10:51:53 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

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:
>>> The MHz number in /proc/cpuinfo may change, thus leading to
>>> a false positive failure when comparing the expected against
>>> the actual output file.
>>> * tests/misc/ Replace the actual MHz number in the files
>>> to be compared by a placeholder.
>> Oh right good one.
>> It's probably better to use an invariant file rather than
>> messing with sed and GHz and possible other variant parts.
>> 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.

BTW, I just noticed a separate issue while looking
at /proc usage in the tests, which the following should fix up.


commit 437f24764963ca2935e1bce368667f8270275a4b
Author: Pádraig Brady <address@hidden>
Date:   Thu Oct 16 10:33:46 2014 +0100

    tests: fix test hang with unstable inodes in /proc

    * cp/ Search the 'err' file
    for the error to ignore, not stdin.

diff --git a/tests/cp/ b/tests/cp/
index 3fcd5aa..8dd8460 100755
--- a/tests/cp/
+++ b/tests/cp/
@@ -31,7 +31,7 @@ cat $f > out || fail=1
 # number of the file changed during the cp run.
 cp $f exp 2>err \
   || { fail=1;
-       grep 'replaced while being copied' \
+       grep 'replaced while being copied' err \
          && skip_ "File $f is being replaced while being copied"; }

 # Don't simply compare contents; they might differ,

reply via email to

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