Yao Zhao | 20 Jul 2012 21:11
Favicon

[PATCH] mkfs.minix.tests: fix the tests on big endian platform.

minix filesystem will have a different md5sum if run on a big endian
platform as it is endian dependent filesystem.
Change test script to have correct md5sum on big endian platform.

Signed-off-by: Yao Zhao <yao.zhao <at> windriver.com>
---
 testsuite/mkfs.minix.tests |   26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/testsuite/mkfs.minix.tests b/testsuite/mkfs.minix.tests
index 8a33c16..73cd913 100755
--- a/testsuite/mkfs.minix.tests
+++ b/testsuite/mkfs.minix.tests
 <at>  <at>  -8,7 +8,19  <at>  <at> 

 # testing "test name" "options" "expected result" "file input" "stdin"

-testing "mkfs.minix" \
+# 'a' ascii is 0x61, on little endian is 97, on big endian is 1627389952
+get_a_value="$(echo -n "a" | od -i | head -1 | sed -e 's/ \+/ /g' | \
+               cut -d " " -f 2)"
+endian=0
+if [ "97" = "$get_a_value" ]; then 
+    echo "little endian platform" 
+else 
+    echo "big endian platform"
+    endian=1
+fi
+
+if [ $endian -eq 0 ]; then
(Continue reading)

Denys Vlasenko | 24 Jul 2012 14:04

Re: [PATCH] mkfs.minix.tests: fix the tests on big endian platform.

On Fri, Jul 20, 2012 at 9:11 PM, Yao Zhao <yao.zhao <at> windriver.com> wrote:
> minix filesystem will have a different md5sum if run on a big endian
> platform as it is endian dependent filesystem.
> Change test script to have correct md5sum on big endian platform.

Applied, thanks!

Gmane