public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 4/7] syscalls/fsmount: New tests
Date: Mon, 17 Feb 2020 09:58:18 +0100	[thread overview]
Message-ID: <20200217085818.GA11345@dell5510> (raw)
In-Reply-To: <20200217082931.vbjkg2f53lek4uf3@vireshk-i7>

> On 17-02-20, 16:17, Li Wang wrote:
> > Viresh Kumar <viresh.kumar@linaro.org> wrote:

> > ....
> > > +/*
> > > + * Copyright (c) 2020 Viresh Kumar <viresh.kumar@linaro.org>
> > > + *
> > > + * Description:
> > > + * Basic fsmount() test.
> > > + */
> > > +#include "tst_test.h"
> > > +#include "lapi/fsmount.h"


> > Adding #include "lapi/fcntl.h" in case of ?AT_FDCWD? undeclared. It seems
> > we have to do this for all the tests involves  ?AT_FDCWD?.

> my fsmount.h header includes <fcntl.h>, won't that be enough ?
Unfortunately it won't be enough. LAPI files are here for adding missing
definitions in old distros, which is exactly the case for AT_FDCWD on old RHEL.

I also suggest following change to v7, see diff below (fsmount.h using
"lapi/fcntl.h", thus not needed in fsmount01.c).

> > > +static void run(void)
> > > +{
> > > ...
> > > +
> > > +       TEST(fsmount(fd, 0, 0));


> > As this fsmount01.c is duplicated with zlang@'s patch, I suggest rewriting
> > an enhancement version maybe name fsmount02.c to cover more fsmount
> > attributes. Since it is named basic fsmount() test, it shouldn't only test
> > fsmount(fd, 0, 0), right?
+1.

> > +#define MOUNT_ATTR_RDONLY      0x00000001 /* Mount read-only */
> > +#define MOUNT_ATTR_NOSUID      0x00000002 /* Ignore suid and sgid bits */
> > +#define MOUNT_ATTR_NODEV       0x00000004 /* Disallow access to device
> > special files */
> > +#define MOUNT_ATTR_NOEXEC      0x00000008 /* Disallow program execution */
> > +#define MOUNT_ATTR__ATIME      0x00000070 /* Setting on how atime should
> > be updated */
> > +#define MOUNT_ATTR_RELATIME    0x00000000 /* - Update atime relative to
> > mtime/ctime. */
> > +#define MOUNT_ATTR_NOATIME     0x00000010 /* - Do not update access times.
> > */
> > +#define MOUNT_ATTR_STRICTATIME 0x00000020 /* - Always perform atime
> > updates */
> > +#define MOUNT_ATTR_NODIRATIME  0x00000080 /* Do not update directory
> > access times */

> Okay, I will give it a try.
Great thanks!

> > > +       if (TST_RET == -1)
> > > +               tst_brk(TFAIL | TERRNO, "fsmount() failed");
> > > +
> > > +       fsmfd = TST_RET;
> > > +
> > > +       TEST(move_mount(fsmfd, "", AT_FDCWD, MNTPOINT,
> > > +                       MOVE_MOUNT_F_EMPTY_PATH));
> > > +       SAFE_CLOSE(fsmfd);


> > I guess we probably need a way to verify the move_mount() does work. The
> > function ismount() in zlang@'s patch could be extracted into the library as
> > tst_ismount() for all of these tests.
> > @Petr Vorel <pvorel@suse.cz>  WDT?

> Yeah, I will do that.
+1. But I'd suggest to first merge tests which I sent as v7 [1] (with change
below) and then doing this.

Kind regards,
Petr

[1] https://patchwork.ozlabs.org/project/ltp/list/?series=158902&state=*
[2] https://travis-ci.org/pevik/ltp/builds/651390749

diff --git include/lapi/fsmount.h include/lapi/fsmount.h
index 87f2f229c..97c41629c 100644
--- include/lapi/fsmount.h
+++ include/lapi/fsmount.h
@@ -7,12 +7,12 @@
 #ifndef FSMOUNT_H__
 #define FSMOUNT_H__
 
-#include <fcntl.h>
+#include "config.h"
 #include <sys/mount.h>
 #include <sys/syscall.h>
 #include <sys/types.h>
 
-#include "config.h"
+#include "lapi/fcntl.h"
 #include "lapi/syscalls.h"
 
 #ifndef HAVE_FSOPEN
diff --git testcases/kernel/syscalls/fsmount/fsmount01.c testcases/kernel/syscalls/fsmount/fsmount01.c
index 464458080..6ba226acc 100644
--- testcases/kernel/syscalls/fsmount/fsmount01.c
+++ testcases/kernel/syscalls/fsmount/fsmount01.c
@@ -10,7 +10,6 @@
 #include <sys/mount.h>
 
 #include "tst_test.h"
-#include "lapi/fcntl.h"
 #include "lapi/fsmount.h"
 #include "tst_safe_stdio.h"
 

  parent reply	other threads:[~2020-02-17  8:58 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 11:35 [LTP] [PATCH 0/7] Add new LTP tests related to fsmount family of syscalls Viresh Kumar
2020-02-14 11:35 ` [LTP] [PATCH 1/7] lapi/fsmount: Add definitions for fsmount related syscalls Viresh Kumar
2020-02-16  9:09   ` Li Wang
2020-02-17  8:08     ` Viresh Kumar
2020-02-14 11:35 ` [LTP] [PATCH 2/7] syscalls/fsopen: New tests Viresh Kumar
2020-02-16 10:11   ` Li Wang
2020-02-17  8:09     ` Viresh Kumar
2020-02-17 13:36     ` Cyril Hrubis
2020-02-18  1:15       ` Li Wang
2020-02-18  8:25         ` Viresh Kumar
2020-02-18  9:02           ` Li Wang
2020-02-18  9:08             ` Viresh Kumar
2020-02-19  8:23         ` Petr Vorel
2020-02-19  8:34           ` Viresh Kumar
2020-02-19  8:50         ` Petr Vorel
2020-02-19  8:51           ` Viresh Kumar
2020-02-14 11:35 ` [LTP] [PATCH 3/7] syscalls/fsconfig: " Viresh Kumar
2020-02-14 11:35 ` [LTP] [PATCH 4/7] syscalls/fsmount: " Viresh Kumar
2020-02-17  8:17   ` Li Wang
2020-02-17  8:29     ` Viresh Kumar
2020-02-17  8:54       ` Li Wang
2020-02-17  9:58         ` Petr Vorel
2020-02-17 10:28           ` Li Wang
2020-02-17 10:37             ` Li Wang
2020-02-17 11:02               ` Petr Vorel
2020-02-17  8:58       ` Petr Vorel [this message]
2020-02-14 11:35 ` [LTP] [PATCH 5/7] syscalls/move_mount: " Viresh Kumar
2020-02-14 11:35 ` [LTP] [PATCH 6/7] syscalls/fspick: " Viresh Kumar
2020-02-14 11:35 ` [LTP] [PATCH 7/7] syscalls/open_tree: " Viresh Kumar
2020-02-18  6:19 ` [LTP] [PATCH 0/7] Add new LTP tests related to fsmount family of syscalls Zorro Lang
2020-02-18  6:50   ` Li Wang
2020-02-18  6:58   ` Viresh Kumar

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=20200217085818.GA11345@dell5510 \
    --to=pvorel@suse.cz \
    --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