public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP]  [PATCH v2] file01.sh: Fix in was not recognized
@ 2019-04-22  8:35 zhe.he
  2019-04-22  9:46 ` Xiao Yang
  0 siblings, 1 reply; 4+ messages in thread
From: zhe.he @ 2019-04-22  8:35 UTC (permalink / raw)
  To: ltp

From: He Zhe <zhe.he@windriver.com>

Some file has "pie" appending after LSB or MSB, which causes mismatch and the
following error.

"file01 10 TFAIL: in: was not recognized"
..."ELF 64-bit LSB pie executable"...

This patches tunes the regulation expression to include those cases.

Signed-off-by: He Zhe <zhe.he@windriver.com>
---
v1 to v2: split into two groups to just match the encountered case

 testcases/commands/file/file01.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/testcases/commands/file/file01.sh b/testcases/commands/file/file01.sh
index 0a8119e..55c0433 100755
--- a/testcases/commands/file/file01.sh
+++ b/testcases/commands/file/file01.sh
@@ -91,7 +91,9 @@ do_test()
 	 9) file_test in.m4 "M4 macro processor script, ASCII text" \
 			    "ASCII M4 macro language pre-processor text";;
 	10) file_test in "ELF .*-bit $TEST_ARCH executable, .*" \
-			 "ELF .*-bit $TEST_ARCH shared object, .*";;
+			 "ELF .*-bit $TEST_ARCH shared object, .*" \
+			 "ELF .*-bit $TEST_ARCH pie executable, .*" \
+			 "ELF .*-bit $TEST_ARCH pie shared object, .*";;
 	11) file_test in.ar "current ar archive";;
 	12) file_test in.tar "tar archive";;
 	13) file_test in.tar.gz "gzip compressed data, .*";;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [LTP] [PATCH v2] file01.sh: Fix in was not recognized
  2019-04-22  8:35 [LTP] [PATCH v2] file01.sh: Fix in was not recognized zhe.he
@ 2019-04-22  9:46 ` Xiao Yang
  2019-04-22  9:53   ` He Zhe
  0 siblings, 1 reply; 4+ messages in thread
From: Xiao Yang @ 2019-04-22  9:46 UTC (permalink / raw)
  To: ltp

On 2019/04/22 16:35, zhe.he@windriver.com wrote:
> From: He Zhe<zhe.he@windriver.com>
>
> Some file has "pie" appending after LSB or MSB, which causes mismatch and the
> following error.
>
> "file01 10 TFAIL: in: was not recognized"
> ..."ELF 64-bit LSB pie executable"...
>
> This patches tunes the regulation expression to include those cases.
>
> Signed-off-by: He Zhe<zhe.he@windriver.com>
> ---
> v1 to v2: split into two groups to just match the encountered case
>
>   testcases/commands/file/file01.sh | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/testcases/commands/file/file01.sh b/testcases/commands/file/file01.sh
> index 0a8119e..55c0433 100755
> --- a/testcases/commands/file/file01.sh
> +++ b/testcases/commands/file/file01.sh
> @@ -91,7 +91,9 @@ do_test()
>   	 9) file_test in.m4 "M4 macro processor script, ASCII text" \
>   			    "ASCII M4 macro language pre-processor text";;
>   	10) file_test in "ELF .*-bit $TEST_ARCH executable, .*" \
> -			 "ELF .*-bit $TEST_ARCH shared object, .*";;
> +			 "ELF .*-bit $TEST_ARCH shared object, .*" \
> +			 "ELF .*-bit $TEST_ARCH pie executable, .*" \
> +			 "ELF .*-bit $TEST_ARCH pie shared object, .*";;
Hi He,

Perhap, it's simpler to use the ‘.*’regexp directly as your first patch 
does:
-----------------------------------------------------------------------

-	10) file_test in "ELF .*-bit $TEST_ARCH executable, .*" \
-			 "ELF .*-bit $TEST_ARCH shared object, .*";;
+	10) file_test in "ELF .*-bit $TEST_ARCH .*executable, .*" \
+			 "ELF .*-bit $TEST_ARCH .*shared object, .*";;

-----------------------------------------------------------------------

Best Regards,
Xiao Yang
>   	11) file_test in.ar "current ar archive";;
>   	12) file_test in.tar "tar archive";;
>   	13) file_test in.tar.gz "gzip compressed data, .*";;




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LTP] [PATCH v2] file01.sh: Fix in was not recognized
  2019-04-22  9:46 ` Xiao Yang
@ 2019-04-22  9:53   ` He Zhe
  2019-05-09  4:36     ` Xiao Yang
  0 siblings, 1 reply; 4+ messages in thread
From: He Zhe @ 2019-04-22  9:53 UTC (permalink / raw)
  To: ltp



On 4/22/19 5:46 PM, Xiao Yang wrote:
> On 2019/04/22 16:35, zhe.he@windriver.com wrote:
>> From: He Zhe<zhe.he@windriver.com>
>>
>> Some file has "pie" appending after LSB or MSB, which causes mismatch and the
>> following error.
>>
>> "file01 10 TFAIL: in: was not recognized"
>> ..."ELF 64-bit LSB pie executable"...
>>
>> This patches tunes the regulation expression to include those cases.
>>
>> Signed-off-by: He Zhe<zhe.he@windriver.com>
>> ---
>> v1 to v2: split into two groups to just match the encountered case
>>
>>   testcases/commands/file/file01.sh | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/testcases/commands/file/file01.sh b/testcases/commands/file/file01.sh
>> index 0a8119e..55c0433 100755
>> --- a/testcases/commands/file/file01.sh
>> +++ b/testcases/commands/file/file01.sh
>> @@ -91,7 +91,9 @@ do_test()
>>        9) file_test in.m4 "M4 macro processor script, ASCII text" \
>>                   "ASCII M4 macro language pre-processor text";;
>>       10) file_test in "ELF .*-bit $TEST_ARCH executable, .*" \
>> -             "ELF .*-bit $TEST_ARCH shared object, .*";;
>> +             "ELF .*-bit $TEST_ARCH shared object, .*" \
>> +             "ELF .*-bit $TEST_ARCH pie executable, .*" \
>> +             "ELF .*-bit $TEST_ARCH pie shared object, .*";;
> Hi He,
>
> Perhap, it's simpler to use the ‘.*’regexp directly as your first patch does:
> -----------------------------------------------------------------------
>
> -    10) file_test in "ELF .*-bit $TEST_ARCH executable, .*" \
> -             "ELF .*-bit $TEST_ARCH shared object, .*";;
> +    10) file_test in "ELF .*-bit $TEST_ARCH .*executable, .*" \
> +             "ELF .*-bit $TEST_ARCH .*shared object, .*";;
>
> -----------------------------------------------------------------------

Not exactly, now it can match 4 different cases.

Zhe

>
> Best Regards,
> Xiao Yang
>>       11) file_test in.ar "current ar archive";;
>>       12) file_test in.tar "tar archive";;
>>       13) file_test in.tar.gz "gzip compressed data, .*";;
>
>
>
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LTP] [PATCH v2] file01.sh: Fix in was not recognized
  2019-04-22  9:53   ` He Zhe
@ 2019-05-09  4:36     ` Xiao Yang
  0 siblings, 0 replies; 4+ messages in thread
From: Xiao Yang @ 2019-05-09  4:36 UTC (permalink / raw)
  To: ltp

Hi Zhe,

I am sorry for the late reply.  Thanks for your pacth and pushed.

BTW:
I try to think about simplifying all keywords by extended regular 
expression.
(e.g. use (pie )? to match your encountered keywords).

Best Regards,
Xiao Yang
On 2019/04/22 17:53, He Zhe wrote:
>
> On 4/22/19 5:46 PM, Xiao Yang wrote:
>> On 2019/04/22 16:35, zhe.he@windriver.com wrote:
>>> From: He Zhe<zhe.he@windriver.com>
>>>
>>> Some file has "pie" appending after LSB or MSB, which causes mismatch and the
>>> following error.
>>>
>>> "file01 10 TFAIL: in: was not recognized"
>>> ..."ELF 64-bit LSB pie executable"...
>>>
>>> This patches tunes the regulation expression to include those cases.
>>>
>>> Signed-off-by: He Zhe<zhe.he@windriver.com>
>>> ---
>>> v1 to v2: split into two groups to just match the encountered case
>>>
>>>    testcases/commands/file/file01.sh | 4 +++-
>>>    1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/testcases/commands/file/file01.sh b/testcases/commands/file/file01.sh
>>> index 0a8119e..55c0433 100755
>>> --- a/testcases/commands/file/file01.sh
>>> +++ b/testcases/commands/file/file01.sh
>>> @@ -91,7 +91,9 @@ do_test()
>>>         9) file_test in.m4 "M4 macro processor script, ASCII text" \
>>>                    "ASCII M4 macro language pre-processor text";;
>>>        10) file_test in "ELF .*-bit $TEST_ARCH executable, .*" \
>>> -             "ELF .*-bit $TEST_ARCH shared object, .*";;
>>> +             "ELF .*-bit $TEST_ARCH shared object, .*" \
>>> +             "ELF .*-bit $TEST_ARCH pie executable, .*" \
>>> +             "ELF .*-bit $TEST_ARCH pie shared object, .*";;
>> Hi He,
>>
>> Perhap, it's simpler to use the ‘.*’regexp directly as your first patch does:
>> -----------------------------------------------------------------------
>>
>> -    10) file_test in "ELF .*-bit $TEST_ARCH executable, .*" \
>> -             "ELF .*-bit $TEST_ARCH shared object, .*";;
>> +    10) file_test in "ELF .*-bit $TEST_ARCH .*executable, .*" \
>> +             "ELF .*-bit $TEST_ARCH .*shared object, .*";;
>>
>> -----------------------------------------------------------------------
> Not exactly, now it can match 4 different cases.
>
> Zhe
>
>> Best Regards,
>> Xiao Yang
>>>        11) file_test in.ar "current ar archive";;
>>>        12) file_test in.tar "tar archive";;
>>>        13) file_test in.tar.gz "gzip compressed data, .*";;
>>
>>
>>
>
>
> .
>




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-05-09  4:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-22  8:35 [LTP] [PATCH v2] file01.sh: Fix in was not recognized zhe.he
2019-04-22  9:46 ` Xiao Yang
2019-04-22  9:53   ` He Zhe
2019-05-09  4:36     ` Xiao Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox