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/head-c.sh: Replace the actual MHz number in the files
> to be compared by a placeholder.
> ---
> tests/misc/head-c.sh | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tests/misc/head-c.sh b/tests/misc/head-c.sh
> index 807e965..67c01b1 100755
> --- a/tests/misc/head-c.sh
> +++ b/tests/misc/head-c.sh
> @@ -50,6 +50,8 @@ for file in /proc/cpuinfo /sys/kernel/profiling; do
> head -c -1 copy > exp1 || framework_failure_
>
> head -c -1 $file > out1 || fail=1
> + test $file = /proc/cpuinfo \
> + && { sed -i -e '/MHz/ s/[0-9]/X/g' exp1 out1 || framework_failure_; }
> compare exp1 out1 || fail=1
> fi
> done
>
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
thanks,
Pádraig.