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
[email protected]

------------------------------------------------------------------------------
"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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to