testsuite: make mkfs.minix test not fail spuriously on big endian
authorYao Zhao <yao.zhao@windriver.com>
Tue, 24 Jul 2012 11:58:12 +0000 (13:58 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 24 Jul 2012 11:58:12 +0000 (13:58 +0200)
Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
testsuite/mkfs.minix.tests

index 8a33c16813efa9f21c897463b5b768ab62f49c1e..7eecaf230c43ab1e64709d897a3d49032963d934 100755 (executable)
@@ -8,6 +8,14 @@
 
 # testing "test name" "options" "expected result" "file input" "stdin"
 
+# '\n' produces 10 on little endian, but not on big endian
+cr=`echo | od -i | sed 's/.* //g;2d'`
+if [ x"$cr" = x"10" ]; then
+       hash=4f35f7afeba07d56055bed1f29ae20b7
+else
+       hash=5adbc1b3ccd20ca5d0ab5bc1e13ac3fc
+fi
+
 testing "mkfs.minix" \
        "dd if=/dev/zero of=input bs=1k count=1024 2>/dev/null; mkfs.minix input; md5sum <input" \
 "352 inodes\n"\
@@ -15,7 +23,7 @@ testing "mkfs.minix" \
 "Firstdatazone=15 (15)\n"\
 "Zonesize=1024\n"\
 "Maxsize=268966912\n"\
-"4f35f7afeba07d56055bed1f29ae20b7  -\n" \
+"$hash  -\n" \
        "" \
        ""