diff mbox series

[2/2] syscalls: update tcases using dev_fs_type to use some_filesystems

Message ID 20190530102336.10898-2-xzhou@redhat.com
State Changes Requested
Headers show
Series [1/2] lib/tst_test: introduce tst_test->some_filesystems | expand

Commit Message

Murphy Zhou May 30, 2019, 10:23 a.m. UTC
Not all of them. Some tests need to run specific filesystem.

Signed-off-by: Murphy Zhou <xzhou@redhat.com>
---
 .../kernel/syscalls/copy_file_range/copy_file_range02.c   | 8 ++++++--
 testcases/kernel/syscalls/getxattr/getxattr04.c           | 7 +++++--
 2 files changed, 11 insertions(+), 4 deletions(-)

Comments

Cyril Hrubis May 30, 2019, 11:10 a.m. UTC | #1
Hi!
> Signed-off-by: Murphy Zhou <xzhou@redhat.com>
> ---
>  .../kernel/syscalls/copy_file_range/copy_file_range02.c   | 8 ++++++--

I guess that we can enable the this test for all filesystems, there is
in-kernel fallback for filesystems that does not support the syscall so
it should work on all filesystems and the fallback code should be tested
as well.

>  testcases/kernel/syscalls/getxattr/getxattr04.c           | 7 +++++--

Well I would be slightly in favor of enabling this test for all
filesystems as well.

If we ever want to maintain list of filesystems that support extended
attributes there should be only one somewhere in the test library so
that we don't have to change thousand testcases later on.
Murphy Zhou May 30, 2019, 3:05 p.m. UTC | #2
On Thu, May 30, 2019 at 01:10:30PM +0200, Cyril Hrubis wrote:
> Hi!
> > Signed-off-by: Murphy Zhou <xzhou@redhat.com>
> > ---
> >  .../kernel/syscalls/copy_file_range/copy_file_range02.c   | 8 ++++++--
> 
> I guess that we can enable the this test for all filesystems, there is
> in-kernel fallback for filesystems that does not support the syscall so
> it should work on all filesystems and the fallback code should be tested
> as well.
> 
> >  testcases/kernel/syscalls/getxattr/getxattr04.c           | 7 +++++--
> 
> Well I would be slightly in favor of enabling this test for all
> filesystems as well.
> 
> If we ever want to maintain list of filesystems that support extended
> attributes there should be only one somewhere in the test library so
> that we don't have to change thousand testcases later on.

Hmm.. So we actually don't need this array. Just enable some proper
tests for all filesystems.

> 
> -- 
> Cyril Hrubis
> chrubis@suse.cz
Cyril Hrubis May 30, 2019, 3:27 p.m. UTC | #3
Hi!
> > I guess that we can enable the this test for all filesystems, there is
> > in-kernel fallback for filesystems that does not support the syscall so
> > it should work on all filesystems and the fallback code should be tested
> > as well.
> > 
> > >  testcases/kernel/syscalls/getxattr/getxattr04.c           | 7 +++++--
> > 
> > Well I would be slightly in favor of enabling this test for all
> > filesystems as well.
> > 
> > If we ever want to maintain list of filesystems that support extended
> > attributes there should be only one somewhere in the test library so
> > that we don't have to change thousand testcases later on.
> 
> Hmm.. So we actually don't need this array. Just enable some proper
> tests for all filesystems.

Looks like that, I've checked the fgetxattr01.c test and we only skip
fat and vfat when the test is executed, all the other filesystems do
support extended attributes. Disabling fat and vfat does not seem to
speed up the test at all, I guess that the mkfs + mount is fast enough
so that the difference is not measureable.
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/copy_file_range/copy_file_range02.c b/testcases/kernel/syscalls/copy_file_range/copy_file_range02.c
index 07c0207c2..de200febe 100644
--- a/testcases/kernel/syscalls/copy_file_range/copy_file_range02.c
+++ b/testcases/kernel/syscalls/copy_file_range/copy_file_range02.c
@@ -47,6 +47,8 @@  static struct tcase {
 	{&fd_dest,	-1,	EINVAL},
 };
 
+static char *some_filesystems[] = {"ext4", "xfs"};
+
 static void verify_copy_file_range(unsigned int n)
 {
 	struct tcase *tc = &tcases[n];
@@ -111,8 +113,10 @@  static struct tst_test test = {
 	.setup = setup,
 	.cleanup = cleanup,
 	.needs_root = 1,
-	.mount_device = 1,
+	.mount_device = 0,
+	.needs_device = 1,
+	.format_device = 1,
 	.mntpoint = MNTPOINT,
-	.dev_fs_type = "ext4",
+	.some_filesystems = some_filesystems,
 	.test_variants = TEST_VARIANTS,
 };
diff --git a/testcases/kernel/syscalls/getxattr/getxattr04.c b/testcases/kernel/syscalls/getxattr/getxattr04.c
index 1dcb14da3..c5ae03f46 100644
--- a/testcases/kernel/syscalls/getxattr/getxattr04.c
+++ b/testcases/kernel/syscalls/getxattr/getxattr04.c
@@ -54,6 +54,7 @@ 
 static volatile int end;
 static char big_value[512];
 static char small_value[32];
+static char *some_filesystems[] = {"ext4", "xfs"};
 
 static void sigproc(int sig)
 {
@@ -120,9 +121,11 @@  static void setup(void)
 static struct tst_test test = {
 	.needs_tmpdir = 1,
 	.needs_root = 1,
-	.mount_device = 1,
-	.dev_fs_type = "xfs",
+	.mount_device = 0,
+	.needs_device = 1,
+	.format_device = 1,
 	.mntpoint = MNTPOINT,
+	.some_filesystems = some_filesystems,
 	.forks_child = 1,
 	.test_all = verify_getxattr,
 	.setup = setup