public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: "gux.fnst@cn.fujitsu.com" <gux.fnst@cn.fujitsu.com>
Cc: "ltp-list@lists.sourceforge.net" <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCH 2/2] rmdir/rmdir02.c: add ELOOP, EROFS and EBUSY error value tests
Date: Thu, 15 May 2014 14:14:30 +0200	[thread overview]
Message-ID: <20140515121430.GC23965@rei.Home> (raw)
In-Reply-To: <1397731818-26430-2-git-send-email-gux.fnst@cn.fujitsu.com>

Hi!
>  int main(int ac, char **av)
>  {
>  	int i, lc;
>  	char *msg;
>  
> -	msg = parse_opts(ac, av, NULL, NULL);
> +	msg = parse_opts(ac, av, options, help);
>  	if (msg != NULL)
>  		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
>  
> +	if (!device) {
> +		tst_brkm(TBROK, NULL, "you must specify the device "
> +			"used for mounting with -D option");
                 This should be TCONF rather than TBROK (I've fixed
		 that).


>  	setup();
>  
>  	TEST_EXP_ENOS(exp_enos);
> @@ -108,12 +141,34 @@ int main(int ac, char **av)
>  
>  static void setup(void)
>  {
> +	int i;
> +	struct passwd *ltpuser;
> +
> +	tst_require_root(NULL);
> +
>  	tst_sig(NOFORK, DEF_HANDLER, cleanup);
>  
>  	TEST_PAUSE;
>  
>  	tst_tmpdir();
>  
> +	tst_mkfs(NULL, device, fstype, NULL);
> +	SAFE_MKDIR(cleanup, MNTPOINT, DIR_MODE);
> +	if (mount(device, MNTPOINT, fstype, 0, NULL) == -1) {
> +		tst_brkm(TBROK | TERRNO, cleanup,
> +			"mount device:%s failed", device);
> +	}
> +	SAFE_MKDIR(cleanup, TESTDIR5, DIR_MODE);
> +	if (mount(device, MNTPOINT, fstype, MS_REMOUNT | MS_RDONLY,
> +			NULL) == -1) {
> +		tst_brkm(TBROK | TERRNO, cleanup,
> +			"mount device:%s failed", device);
> +	}
> +	mount_flag = 1;
> +
> +	ltpuser = SAFE_GETPWNAM(cleanup, "nobody");
> +	SAFE_SETEUID(cleanup, ltpuser->pw_uid);

I've removed the EUID changes for all because these has no effect on the
test behavior (at least I haven't figured out why they are needed).

And pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2014-05-15 12:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-17 10:50 [LTP] [PATCH 1/2] rmdir/rmdir02.c: cleanup gux.fnst
2014-04-17 10:50 ` [LTP] [PATCH 2/2] rmdir/rmdir02.c: add ELOOP, EROFS and EBUSY error value tests gux.fnst
2014-05-15 12:14   ` chrubis [this message]
     [not found]     ` <53756E7A.6070009@cn.fujitsu.com>
2014-05-19 12:15       ` chrubis
2014-05-15 12:12 ` [LTP] [PATCH 1/2] rmdir/rmdir02.c: cleanup chrubis
2014-05-15 12:15   ` chrubis

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=20140515121430.GC23965@rei.Home \
    --to=chrubis@suse.cz \
    --cc=gux.fnst@cn.fujitsu.com \
    --cc=ltp-list@lists.sourceforge.net \
    /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