[LTP] [PATCH v2] skipfile: allow regular expressions

Cyril Hrubis chrubis@suse.cz
Wed Feb 7 16:32:09 CET 2018


Hi!
> Sorry for the delay. I found that my patch had a flaw while testing it on runltplite.sh.
> For example, "rwtest.*" doesn't work for rwtest:  
> rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f sync ..
> 
> The reason is that "rwtest.*"  matches too much. If I use "rwtest[a-zA-Z0-9]" as a regex on the skipfile
> then it works as expected
> 
> Example:
> $ STRING="rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f"
> $ sed "s/^\(rwtest.*\)\s.*/\1 exit 32;/" <<< $STRING
>     rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s -f exit 32  (BAD!!)
> $ sed "s/^\(rwtest[a-zA-Z0-9]*\)\s.*/\1 exit 32;/" <<< $STRING
> rwtest01 exit 32 (GOOD!!)

Ah looks like your first attempt ends up eating the source greadily
so \1 ends up being everything to the last whitespace.

I guess that s/^\(rwtest[\S]*\).*/\1 exit 32;/ should work, since it
will stop at first whitespace.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list