public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Wangyicheng <yicheng.wang@huawei.com>
Cc: "ltp-list@lists.sourceforge.net" <ltp-list@lists.sourceforge.net>,
	Dingguofu <dingguofu@huawei.com>
Subject: Re: [LTP] testcases/kernel/syscalls/mount test cases of mount2 and mount3 faild in JUNE 2012 STABLE :ltp-full-20120614
Date: Wed, 17 Oct 2012 18:32:42 +0200	[thread overview]
Message-ID: <20121017163242.GE27890@rei> (raw)
In-Reply-To: <9D7565DAE340BD42B8D00446E021992C28ABAD91@SZXEML506-MBS.china.huawei.com>

Hi!
> There are egiht items in the exp_enos, but the value of TST_TOTAL is
> 13, it means there are 13 checkpoints int the testcase.  As a result
> ,in the setup_test function , there are 13 switch-cases ( case
> 0??case1 ... case 12)
>
> But the number of the expect result in the exp_enos array is mismatch
> with the number of checkpoint, so the TBROK  happend.

That seems to be correct. Could you please send signed patch against
latest LTP git? Ideally attached as well as inline (the best way to send
git patches is using the 'git send-email').

Also please check your coding style (which could be easily done by
checkpatch.pl script that is shipped with linux kernel sources).

> In mount03.c, there are three issues:
>
>   1??In setup function,  the setuid_test file is in the testhome_path
>   instead of the temporary directory Path_name. It results "stat for
>   setuid_test failed"
>
>   2??In setup function,  snprintf(Path_name, PATH_MAX, "%s/%s/",
>   Path_name, mntpoint)?? it can not implement appending the mntpoint
>   string to the Path_name string;

There is still quite a lot of unnecessary string handling. Couldn't the
whole setup be done with two or three snprintf()?

>   3??In test_rwflag function, in the part of "case 2"(at line 280 in
>   mount03.c), if the "execlp(file, basename(file), NULL)" will return
>   (actually it will return), the return value of test_rwflag is always
>   1 (1 means fail),so the testcase is always failed; Another hand, if
>   it will not return (if kernel bug exists), the process will
>   terminate unexpectedly.

I'm not sure that I follow, but you changed execlp to system so that the
file gets executed in child and the return value gets passed to the
test?

> I fix them in the patch (See the attachment), and both of the tow
> testcase can get pass. Pls check the patch attachmented.

And while you are looking at these files, there are several things that
could be fixed too. These tests should use tst_require_root(NULL)
instead of if (getuid() != 0). There are unnecessary casts for pointers
returned from malloc() and useless comments like /* this is loop counter */.
If you care enough to fix them, these should be ideally fixed in separate patch.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

      reply	other threads:[~2012-10-17 16:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-12  7:14 [LTP] testcases/kernel/syscalls/mount test cases of mount2 and mount3 faild in JUNE 2012 STABLE :ltp-full-20120614 Wangyicheng
2012-10-17 16:32 ` chrubis [this message]

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=20121017163242.GE27890@rei \
    --to=chrubis@suse.cz \
    --cc=dingguofu@huawei.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=yicheng.wang@huawei.com \
    /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