[LTP] 答复: [PATCH] ttype: using TERRNO to macth errno

zhaogongyi zhaogongyi@huawei.com
Fri Feb 5 09:43:33 CET 2021


Hi Li,

The check script may be as follows:

#!/bin/bash

grep TTERRNO . -rn -B 3 --exclude=grep.output --exclude=check.sh > grep.output

##Prepare for checking line by line
sed -i '1i\--' grep.output

do_check()
{
        grep TEST $i && return 0
        grep TST_RET $i && return 0
        grep TST_ERR $i && return 0
        grep TEST_RETURN $i && return 0
        return 1
}

start=0
i=0
while read line
do
        echo $line | grep \\\-\\\-
        ret=$?
        if [ $ret -eq 0 -a $start -eq 0 ];then
                        start=1
                        continue
        fi
        if [ $ret -eq 0 -a $start -eq 1 ];then
                start=0
                do_check $i
                if [ $? -eq 0 ];then
                        rm $i
                fi
                let i=$i+1
                continue
        fi
        echo $line >> $i
done < grep.output


Thank You

发件人: Li Wang [mailto:liwang@redhat.com]
发送时间: 2021年2月5日 12:38
收件人: zhaogongyi <zhaogongyi@huawei.com>
抄送: LTP List <ltp@lists.linux.it>
主题: Re: [LTP] [PATCH] ttype: using TERRNO to macth errno

Hi Gongyi,

Thanks for your work!

That'd be awesome if you posting/sharing the method of your script too.

On Fri, Feb 5, 2021 at 11:44 AM zhaogongyi <zhaogongyi@huawei.com<mailto:zhaogongyi@huawei.com>> wrote:
Hi Li

The problem of wrong usage of TTERRNO has been checked all of the project by my local script.

The problem of wrong usage of TERRNO will be fixed in my next patch.

Thank You

发件人: Li Wang [mailto:liwang@redhat.com<mailto:liwang@redhat.com>]
发送时间: 2021年2月5日 10:49
收件人: zhaogongyi <zhaogongyi@huawei.com<mailto:zhaogongyi@huawei.com>>
抄送: LTP List <ltp@lists.linux.it<mailto:ltp@lists.linux.it>>
主题: Re: [LTP] [PATCH] ttype: using TERRNO to macth errno

Hi Gongyi,

Any possibility of finding a way to correct all of the unprecise res-flags in LTP tests?

--
Regards,
Li Wang


--
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20210205/06e3aaef/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check.sh
Type: application/octet-stream
Size: 602 bytes
Desc: check.sh
URL: <http://lists.linux.it/pipermail/ltp/attachments/20210205/06e3aaef/attachment-0001.obj>


More information about the ltp mailing list