[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] tests: avoid false failure when comparing /proc/cpuinfo
From: |
Bernhard Voelker |
Subject: |
[PATCH] tests: avoid false failure when comparing /proc/cpuinfo |
Date: |
Thu, 16 Oct 2014 10:24:53 +0200 |
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
--
1.8.4.5
- [PATCH] tests: avoid false failure when comparing /proc/cpuinfo,
Bernhard Voelker <=