The file_test.sh test assumes all PPC systems are big-endian (MSB), but
this assumption is incorrect on the new ppc64le little-endian (LSB)
systems and file06 and file10 report false failures:

file06      0  TINFO  :  TEST #6: file command recognizes ELF executables
file06      6  TFAIL  :  ltpapicmd.c:156: file: Failed to Recognize ELF binary 
executable. Reason:
/tmp//cprog: ELF 64-bit LSB executable, version 1 (SYSV), dynamically linked 
(uses shared libs), ...
...
file10      0  TINFO  :  TEST #10: file command recognizes vmlinu file
file10     10  TFAIL  :  ltpapicmd.c:156: file: Failed to Recognize vmlinu 
correctly. Reason:
/boot/vmlinuz: ELF 64-bit LSB shared object, version 1 (SYSV), statically 
linked, ...

This patch fixes the test so ppc64le is checked for "LSB", not "MSB".

Signed-off-by: Jeff Bastian <jbast...@redhat.com>
---
 testcases/commands/ade/file/file_test.sh | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/testcases/commands/ade/file/file_test.sh 
b/testcases/commands/ade/file/file_test.sh
index 101a8cca8bc9..fd7943807bdb 100755
--- a/testcases/commands/ade/file/file_test.sh
+++ b/testcases/commands/ade/file/file_test.sh
@@ -332,10 +332,10 @@ fi
 
 
 # TEST #6
-# Test if file command can recognize ELF binay executables
+# Test if file command can recognize ELF binary executables
 
-# Check ppc architecture
-  TEST_ARCH=LSB   # Assume the architecture is Intel
+# Check architecture endianness
+  TEST_ARCH=LSB   # Assume the architecture is little-endian
 
   if uname -m |
     grep -qe '\(m68k\)\|\(sparc\)\|\(mips\b\)\|\(mipseb\)\|\(sh.eb\)' \
@@ -343,6 +343,11 @@ fi
      TEST_ARCH=MSB
   fi
 
+  # ppc is usually big-endian, but not necessarily
+  if uname -m | grep -qe '\(ppc64le\)'; then
+     TEST_ARCH=LSB
+  fi
+
 export TCID=file06
 export TST_COUNT=6
 

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to