Re: [LTP] [PATCH] file_test: fix testcase for ppc64le

2014-12-02 Thread Cyril Hrubis
Hi! > +# check for CPU endianness > +READELF=$(which readelf 2>/dev/null) > +case $(${READELF} -h ${READELF}) in I've simplified these two lines to: case $(readelf -h /bin/sh) in And pushed, thanks. -- Cyril Hrubis chru...@suse.cz --

Re: [LTP] [PATCH] file_test: fix testcase for ppc64le

2014-11-05 Thread Mike Frysinger
On 05 Nov 2014 12:37, Jeffrey Bastian wrote: > If a missing readelf command becomes a problem, there are a number of > other ways to check: > 1. echo -n I | od -to2 `printf I` :) > 2. lscpu | grep "Byte Order" > 3. python -c "import sys;print sys.byteorder;" > 4. perl -MConfig -e 'print $

Re: [LTP] [PATCH] file_test: fix testcase for ppc64le

2014-11-05 Thread Jeffrey Bastian
On Tue, Nov 04, 2014 at 09:14:15PM -0500, Mike Frysinger wrote: > interesting idea. there's a few issues with this code, but rather > than get into that, why don't ew just rely on readelf and be done ? i > don't think we want to maintain two code paths here. I was just trying to give the test th

Re: [LTP] [PATCH] file_test: fix testcase for ppc64le

2014-11-04 Thread Mike Frysinger
On 04 Nov 2014 15:01, Jeffrey Bastian wrote: > +# check for CPU endianness > +TEST_ARCH=NULL > +ENDIAN=$(echo -n I | od -to2 2>/dev/null | > + awk '{print substr($2,6,1); exit}' 2>/dev/null) interesting idea. there's a few issues with this code, but rather than get into that, why do

Re: [LTP] [PATCH] file_test: fix testcase for ppc64le

2014-11-04 Thread Jeffrey Bastian
On Mon, Nov 03, 2014 at 05:52:47PM -0500, Mike Frysinger wrote: > the test requires `cc` to be installed and fully functional. that means > binutils also have to be installed (`as` and `ld`). i'm not aware of any > distro that splits `readelf` out from the others. Ok, it's reasonable to assume

Re: [LTP] [PATCH] file_test: fix testcase for ppc64le

2014-11-03 Thread Mike Frysinger
On 03 Nov 2014 16:18, Jeffrey Bastian wrote: > On Mon, Nov 03, 2014 at 04:45:10PM -0500, Mike Frysinger wrote: > > we should delete the uname logic entirely. how about instead we use > > `readelf > > -h` and look at the Data field. > > That's a good idea, although 'lscpu' is even easier to use.

Re: [LTP] [PATCH] file_test: fix testcase for ppc64le

2014-11-03 Thread Jeffrey Bastian
On Mon, Nov 03, 2014 at 04:45:10PM -0500, Mike Frysinger wrote: > we should delete the uname logic entirely. how about instead we use `readelf > -h` and look at the Data field. That's a good idea, although 'lscpu' is even easier to use. But what if lscpu or readelf are not installed? ~]$ uname

Re: [LTP] [PATCH] file_test: fix testcase for ppc64le

2014-11-03 Thread Mike Frysinger
On 03 Nov 2014 14:15, Jeffrey Bastian wrote: > 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 rec

[LTP] [PATCH] file_test: fix testcase for ppc64le

2014-11-03 Thread Jeffrey Bastian
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 : ltpapi