public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Lijin(Euler Dept 8) <lijin14@huawei.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] Fix wrong pattern used by fnmatch in test case proc01.c
Date: Tue, 1 Dec 2015 09:30:27 +0800	[thread overview]
Message-ID: <565CF833.4070101@huawei.com> (raw)
In-Reply-To: <733187539.20734579.1448887572067.JavaMail.zimbra@redhat.com>

On 2015/11/30 20:46, Jan Stancek wrote:
> 
> 
> 
> 
> ----- Original Message -----
>> From: "Li Jin" <King.lijin@huawei.com>
>> To: "king lijin" <king.lijin@huawei.com>, ltp@lists.linux.it
>> Cc: "Li Jin" <King.lijin@huawei.com>
>> Sent: Friday, 27 November, 2015 7:44:09 AM
>> Subject: [LTP] [PATCH] Fix wrong pattern used by fnmatch in test case	proc01.c
>>
>> fnmatch() in proc01.c should use pattern ipv6/conf/[a-z]*/stable_secret
>> to replace /ipv6/conf/*/stable_secret to check the known issue string such as
>> /proc/sys/net/ipv6/conf/all/stable_secret
> 
> Hi,
> 
> An explanation _why_ it is wrong would be helpful too.

Got it. The reason is that a single "*" can not be used to match the any string in fnmatch.
> 
>>
>> Signed-off-by: Li Jin <King.lijin@huawei.com>
>> ---
>>  testcases/kernel/fs/proc/proc01.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/testcases/kernel/fs/proc/proc01.c
>> b/testcases/kernel/fs/proc/proc01.c
>> index 2825b51..197eb55 100644
>> --- a/testcases/kernel/fs/proc/proc01.c
>> +++ b/testcases/kernel/fs/proc/proc01.c
>> @@ -107,7 +107,7 @@ static const struct mapping known_issues[] = {
>>  	{"read", "/proc/fs/nfsd/.getfs", EINVAL},
>>  	{"read", "/proc/fs/nfsd/.getfd", EINVAL},
>>  	{"read", "/proc/self/net/rpc/use-gss-proxy", EAGAIN},
>> -	{"read", "/proc/sys/net/ipv6/conf/*/stable_secret", EIO},
>> +	{"read", "/proc/sys/net/ipv6/conf/[a-z]*/stable_secret", EIO},
> 
> This has problems as well:

Just ignore it. It's the problem of my linux system

> 
> # ip tuntap add 1tap mode tap
> # ./proc01 -m 128
> proc01      0  TINFO  :  /proc/sys/fs/binfmt_misc/register: is write-only.
> proc01      1  TFAIL  :  proc01.c:393: read failed: /proc/sys/net/ipv6/conf/1tap/stable_secret: errno=EIO(5): Input/output error
> ...
> 
> How about:
> +       {"read", "/proc/sys/net/ipv6/conf/?*/stable_secret", EIO},

Good idea. It works and I will send V2 patch.

Regards,

Jin

> 
> Regards,
> Jan
> 
>>  	{"", "", 0}
>>  };
>>  
>> --
>> 1.8.3.1
>>
>>
>> --
>> Mailing list info: http://lists.linux.it/listinfo/ltp
>>
> 
> .
> 



  reply	other threads:[~2015-12-01  1:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27  6:44 [LTP] Fix wrong pattern used by fnmatch in test case proc01.c Li Jin
2015-11-27  6:44 ` [LTP] [PATCH] " Li Jin
2015-11-30 12:46   ` Jan Stancek
2015-12-01  1:30     ` Lijin [this message]
2015-12-01  8:35       ` Jan Stancek
2015-12-01  9:34         ` Lijin
2015-12-01 10:02           ` Jan Stancek
2015-12-01 17:10           ` Jeffrey Bastian
2015-12-02  6:05             ` Lijin
2015-12-02  6:25             ` Jin Li
2015-12-02  9:47               ` Jan Stancek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=565CF833.4070101@huawei.com \
    --to=lijin14@huawei.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox