All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH testsuite v2 0/4] Test all filesystems by default
@ 2020-11-02  8:35 Ondrej Mosnacek
  2020-11-02  8:35 ` [PATCH testsuite v2 1/4] README,travis: add e2fsprogs, jfsutils, and dosfstools to deps Ondrej Mosnacek
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Ondrej Mosnacek @ 2020-11-02  8:35 UTC (permalink / raw)
  To: selinux; +Cc: Richard Haines, Paul Moore

This series enables testing all filesystems currently supported by the
testsuite (ext4, xfs, jfs, vfat) using the [fs_]filesystem subtests
without the need to run the tests manually or move to a different
filesystem. The filesystems not available on the tested kernel are
automatically excluded.

The series also updates dependencies with the packages containing the
required mkfs.* programs, fixes the mkfs.* invocation to not get stuck
when testing jfs, and fixes error output appearing during a successful
vfat test.

Note: The F32 CI will start failing after this and the kernel update
patches are merged (the old kernel on the image doesn't have the XFS
quota fix). It will be necessary to bump the stable Fedora testing to
F33.

v2 changes:
 - added a patch to fix the vfat tests output
 - fixed behavior when fs tests are executed directly
 - simplified the code changed/added by the last patch

Ondrej Mosnacek (4):
  README,travis: add e2fsprogs, jfsutils, and dosfstools to deps
  tests/filesystem: pipe "yes" to mkfs.* to fix jfs test
  tests/[fs_]filesystem: fix unwanted error output when testing vfat
  tests/[fs_]filesystem: test all filesystems

 README.md                      |  6 ++++
 tests/Makefile                 |  8 +++--
 tests/filesystem/Filesystem.pm |  2 +-
 tests/filesystem/ext4          |  1 +
 tests/filesystem/jfs           |  1 +
 tests/filesystem/test          | 58 +++++++++++++++---------------
 tests/filesystem/vfat          |  1 +
 tests/filesystem/xfs           |  1 +
 tests/fs_filesystem/ext4       |  1 +
 tests/fs_filesystem/jfs        |  1 +
 tests/fs_filesystem/test       | 64 ++++++++++++++++------------------
 tests/fs_filesystem/vfat       |  1 +
 tests/fs_filesystem/xfs        |  1 +
 travis-ci/run-testsuite.sh     |  3 ++
 14 files changed, 83 insertions(+), 66 deletions(-)
 create mode 120000 tests/filesystem/ext4
 create mode 120000 tests/filesystem/jfs
 create mode 120000 tests/filesystem/vfat
 create mode 120000 tests/filesystem/xfs
 create mode 120000 tests/fs_filesystem/ext4
 create mode 120000 tests/fs_filesystem/jfs
 create mode 120000 tests/fs_filesystem/vfat
 create mode 120000 tests/fs_filesystem/xfs

-- 
2.26.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH testsuite v2 1/4] README,travis: add e2fsprogs, jfsutils, and dosfstools to deps
  2020-11-02  8:35 [PATCH testsuite v2 0/4] Test all filesystems by default Ondrej Mosnacek
@ 2020-11-02  8:35 ` Ondrej Mosnacek
  2020-11-02 12:02   ` Richard Haines
  2020-11-02  8:35 ` [PATCH testsuite v2 2/4] tests/filesystem: pipe "yes" to mkfs.* to fix jfs test Ondrej Mosnacek
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Ondrej Mosnacek @ 2020-11-02  8:35 UTC (permalink / raw)
  To: selinux; +Cc: Richard Haines, Paul Moore

They are needed for ext4, jfs, and vfat tests, which will become
executed by default in an upcoming patch.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
 README.md                  | 6 ++++++
 travis-ci/run-testsuite.sh | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/README.md b/README.md
index 838a082..1149f30 100644
--- a/README.md
+++ b/README.md
@@ -58,6 +58,9 @@ similar dependencies):
 * keyutils-libs-devel _(tools used by the keys tests)_
 * kernel-devel _(used by the kernel module tests)_
 * quota, xfsprogs-devel and libuuid-devel _(used by the filesystem tests)_
+* e2fsprogs _(used by the ext4 filesystem tests)_
+* jfsutils _(used by the jfs filesystem tests)_
+* dosfstools _(used by the vfat filesystem tests)_
 * nftables _(used by inet_socket and sctp tests if ver >= 9.3 for secmark testing )_
 
 On a modern Fedora system you can install these dependencies with the
@@ -81,6 +84,9 @@ following command (NOTE: On Fedora 32 and below you need to remove
 		quota \
 		xfsprogs-devel \
 		libuuid-devel \
+		e2fsprogs \
+		jfsutils \
+		dosfstools \
 		nftables \
 		kernel-devel-$(uname -r) \
 		kernel-modules-$(uname -r)
diff --git a/travis-ci/run-testsuite.sh b/travis-ci/run-testsuite.sh
index 051f9d8..bd9073c 100755
--- a/travis-ci/run-testsuite.sh
+++ b/travis-ci/run-testsuite.sh
@@ -38,6 +38,9 @@ dnf install -y \
     quota \
     xfsprogs-devel \
     libuuid-devel \
+    e2fsprogs \
+    jfsutils \
+    dosfstools \
     kernel-devel-"$(uname -r)" \
     kernel-modules-"$(uname -r)"
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH testsuite v2 2/4] tests/filesystem: pipe "yes" to mkfs.* to fix jfs test
  2020-11-02  8:35 [PATCH testsuite v2 0/4] Test all filesystems by default Ondrej Mosnacek
  2020-11-02  8:35 ` [PATCH testsuite v2 1/4] README,travis: add e2fsprogs, jfsutils, and dosfstools to deps Ondrej Mosnacek
@ 2020-11-02  8:35 ` Ondrej Mosnacek
  2020-11-02  8:35 ` [PATCH testsuite v2 3/4] tests/[fs_]filesystem: fix unwanted error output when testing vfat Ondrej Mosnacek
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Ondrej Mosnacek @ 2020-11-02  8:35 UTC (permalink / raw)
  To: selinux; +Cc: Richard Haines, Paul Moore

mkfs.jfs is reluctant to overwrite the device without the user's
consent, so shout a stream of y's on it to avoid the test getting stuck.
We can't universally pass -q to mkfs.*, because not all mkfs.* tools
support it.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
 tests/filesystem/Filesystem.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/filesystem/Filesystem.pm b/tests/filesystem/Filesystem.pm
index 2365ce8..c14e760 100644
--- a/tests/filesystem/Filesystem.pm
+++ b/tests/filesystem/Filesystem.pm
@@ -133,7 +133,7 @@ sub make_fs {
     attach_dev( $mk_dev, $mk_dir );
 
     print "Make $mk_type filesystem on $mk_dev\n";
-    $result = system("mkfs.$mk_type $mk_dev >& /dev/null");
+    $result = system("yes | mkfs.$mk_type $mk_dev >& /dev/null");
     if ( $result != 0 ) {
         system("losetup -d $mk_dev 2>/dev/null");
         print "mkfs.$mk_type failed to create filesystem on $mk_dev\n";
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH testsuite v2 3/4] tests/[fs_]filesystem: fix unwanted error output when testing vfat
  2020-11-02  8:35 [PATCH testsuite v2 0/4] Test all filesystems by default Ondrej Mosnacek
  2020-11-02  8:35 ` [PATCH testsuite v2 1/4] README,travis: add e2fsprogs, jfsutils, and dosfstools to deps Ondrej Mosnacek
  2020-11-02  8:35 ` [PATCH testsuite v2 2/4] tests/filesystem: pipe "yes" to mkfs.* to fix jfs test Ondrej Mosnacek
@ 2020-11-02  8:35 ` Ondrej Mosnacek
  2020-11-02  8:35 ` [PATCH testsuite v2 4/4] tests/[fs_]filesystem: test all filesystems Ondrej Mosnacek
  2020-11-02 12:04 ` [PATCH testsuite v2 0/4] Test all filesystems by default Richard Haines
  4 siblings, 0 replies; 9+ messages in thread
From: Ondrej Mosnacek @ 2020-11-02  8:35 UTC (permalink / raw)
  To: selinux; +Cc: Richard Haines, Paul Moore

The tests currently output "fsetfilecon(3) Failed: Operation not
supported" during a clean run. Since testing that fsetfilecon(3) returns
-EOPNOTSUPP on vfat is not all that useful, rather than conditionally
silencing the error output, just skip the fsetfilecon(3) tests for vfat.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
 tests/filesystem/test    | 30 +++++++++++++++---------------
 tests/fs_filesystem/test | 30 +++++++++++++++---------------
 2 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/tests/filesystem/test b/tests/filesystem/test
index 7d4654d..5a9f0f6 100755
--- a/tests/filesystem/test
+++ b/tests/filesystem/test
@@ -104,6 +104,9 @@ BEGIN {
     }
     elsif ($vfat_enabled) {
 
+        # For setfilecon tests as not supported
+        $test_count -= 2;
+
         # For hooks.c may_create() FILESYSTEM__ASSOCIATE as not supported
         $test_count -= 3;
 
@@ -243,15 +246,12 @@ if ($test_type_trans) {
     ok( $result eq 0 );
 }
 
-print "Creating 'test_file' and changing its context via setfilecon(3)\n";
-$result =
-  system(
+if ( not $vfat_enabled ) {
+    print "Creating 'test_file' and changing its context via setfilecon(3)\n";
+    $result =
+      system(
 "runcon -t test_filesystem_t $basedir/create_file_change_context -t test_filesystem_filecon_t -f $private_path/mp1/test_file $v"
-  );
-if ($vfat_enabled) {
-    ok( $result >> 8 eq 95 );    # EOPNOTSUPP
-}
-else {
+      );
     ok( $result eq 0 );
 }
 
@@ -981,16 +981,16 @@ if ( not $nfs_enabled ) {
     ok( $result eq 0 );
 
     # Create file with 'test_filesystem_filecon_t' context
-    print "Creating test file $basedir/mntpoint/mp1/test_file\n";
-    $result =
-      system(
+    if ( not $vfat_enabled ) {
+        print "Creating test file $basedir/mntpoint/mp1/test_file\n";
+        $result =
+          system(
 "runcon -t test_filesystem_context_t $basedir/create_file_change_context -t test_filesystem_filecon_t -f $private_path/mp1/test_file $v"
-      );
-    if ($vfat_enabled) {
-        ok( $result >> 8 eq 95 );    # EOPNOTSUPP
+          );
+        ok( $result eq 0 );
     }
     else {
-        ok( $result eq 0 );
+        system("touch $private_path/mp1/test_file");
     }
 
     print "Unmount filesystem from $basedir/mntpoint/mp1\n";
diff --git a/tests/fs_filesystem/test b/tests/fs_filesystem/test
index 5dedf83..4462438 100755
--- a/tests/fs_filesystem/test
+++ b/tests/fs_filesystem/test
@@ -112,6 +112,9 @@ BEGIN {
     }
     elsif ($vfat_enabled) {
 
+        # For setfilecon tests as not supported
+        $test_count -= 2;
+
         # For hooks.c may_create() FILESYSTEM__ASSOCIATE as not supported
         $test_count -= 3;
 
@@ -243,15 +246,12 @@ if ($test_type_trans) {
     ok( $result eq 0 );
 }
 
-print "Creating 'test_file' and changing its context via setfilecon(3)\n";
-$result =
-  system(
+if ( not $vfat_enabled ) {
+    print "Creating 'test_file' and changing its context via setfilecon(3)\n";
+    $result =
+      system(
 "runcon -t test_filesystem_t $filesystem_dir/create_file_change_context -t test_filesystem_filecon_t -f $private_path/mp1/test_file $v"
-  );
-if ($vfat_enabled) {
-    ok( $result >> 8 eq 95 );    # EOPNOTSUPP
-}
-else {
+      );
     ok( $result eq 0 );
 }
 
@@ -1010,16 +1010,16 @@ if ( not $nfs_enabled ) {
     ok( $result eq 0 );
 
     # Create file with 'test_filesystem_filecon_t' context
-    print "Creating test file $basedir/mntpoint/mp1/test_file\n";
-    $result =
-      system(
+    if ( not $vfat_enabled ) {
+        print "Creating test file $basedir/mntpoint/mp1/test_file\n";
+        $result =
+          system(
 "runcon -t test_filesystem_context_t $filesystem_dir/create_file_change_context -t test_filesystem_filecon_t -f $private_path/mp1/test_file $v"
-      );
-    if ($vfat_enabled) {
-        ok( $result >> 8 eq 95 );    # EOPNOTSUPP
+          );
+        ok( $result eq 0 );
     }
     else {
-        ok( $result eq 0 );
+        system("touch $private_path/mp1/test_file");
     }
 
     print "Unmount filesystem from $basedir/mntpoint/mp1\n";
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH testsuite v2 4/4] tests/[fs_]filesystem: test all filesystems
  2020-11-02  8:35 [PATCH testsuite v2 0/4] Test all filesystems by default Ondrej Mosnacek
                   ` (2 preceding siblings ...)
  2020-11-02  8:35 ` [PATCH testsuite v2 3/4] tests/[fs_]filesystem: fix unwanted error output when testing vfat Ondrej Mosnacek
@ 2020-11-02  8:35 ` Ondrej Mosnacek
  2020-11-02 12:04 ` [PATCH testsuite v2 0/4] Test all filesystems by default Richard Haines
  4 siblings, 0 replies; 9+ messages in thread
From: Ondrej Mosnacek @ 2020-11-02  8:35 UTC (permalink / raw)
  To: selinux; +Cc: Richard Haines, Paul Moore

Run [fs_]filesystem tests always for all common filesystems (xfs, ext4,
jfs, vfat). Use symlinks to achieve this without changing much code
while still allowing to run the test script directly (optionally
specifying the filesystem type).

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
 tests/Makefile           |  8 ++++++--
 tests/filesystem/ext4    |  1 +
 tests/filesystem/jfs     |  1 +
 tests/filesystem/test    | 28 +++++++++++++---------------
 tests/filesystem/vfat    |  1 +
 tests/filesystem/xfs     |  1 +
 tests/fs_filesystem/ext4 |  1 +
 tests/fs_filesystem/jfs  |  1 +
 tests/fs_filesystem/test | 34 ++++++++++++++++------------------
 tests/fs_filesystem/vfat |  1 +
 tests/fs_filesystem/xfs  |  1 +
 11 files changed, 43 insertions(+), 35 deletions(-)
 create mode 120000 tests/filesystem/ext4
 create mode 120000 tests/filesystem/jfs
 create mode 120000 tests/filesystem/vfat
 create mode 120000 tests/filesystem/xfs
 create mode 120000 tests/fs_filesystem/ext4
 create mode 120000 tests/fs_filesystem/jfs
 create mode 120000 tests/fs_filesystem/vfat
 create mode 120000 tests/fs_filesystem/xfs

diff --git a/tests/Makefile b/tests/Makefile
index 001639b..b441031 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -4,6 +4,7 @@ SBINDIR ?= $(PREFIX)/sbin
 POLDEV ?= $(PREFIX)/share/selinux/devel
 INCLUDEDIR ?= $(PREFIX)/include
 SELINUXFS ?= /sys/fs/selinux
+FILESYSTEMS ?= ext4 xfs jfs vfat
 
 export CFLAGS+=-g -O0 -Wall -D_GNU_SOURCE
 
@@ -17,6 +18,9 @@ MOD_POL_VERS := $(shell $(CHECKMODULE) -V |cut -f 2 -d '-')
 MAX_KERNEL_POLICY := $(shell cat $(SELINUXFS)/policyvers)
 POL_TYPE := $(shell ./pol_detect $(SELINUXFS))
 
+# Filter out unavailable filesystems
+FILESYSTEMS := $(foreach fs,$(FILESYSTEMS),$(shell modprobe $(fs) && echo $(fs)))
+
 SUBDIRS:= domain_trans entrypoint execshare exectrace execute_no_trans \
 	fdreceive inherit link mkdir msg open ptrace readlink relabel rename \
 	rxdir sem setattr setnice shm sigkill stat sysctl task_create \
@@ -111,7 +115,7 @@ SUBDIRS += lockdown
 endif
 
 ifeq ($(shell grep -q filesystem $(POLDEV)/include/support/all_perms.spt && echo true),true)
-SUBDIRS += filesystem
+SUBDIRS += $(addprefix filesystem/,$(FILESYSTEMS))
 ifeq ($(shell grep -q all_filesystem_perms.*watch $(POLDEV)/include/support/all_perms.spt && echo true),true)
 export CFLAGS += -DHAVE_FS_WATCH_PERM
 endif
@@ -119,7 +123,7 @@ endif
 
 ifeq ($(shell grep -q filesystem $(POLDEV)/include/support/all_perms.spt && echo true),true)
 ifneq ($(shell ./kvercmp $$(uname -r) 5.2),-1)
-SUBDIRS += fs_filesystem
+SUBDIRS += $(addprefix fs_filesystem/,$(FILESYSTEMS))
 endif
 endif
 
diff --git a/tests/filesystem/ext4 b/tests/filesystem/ext4
new file mode 120000
index 0000000..945c9b4
--- /dev/null
+++ b/tests/filesystem/ext4
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/tests/filesystem/jfs b/tests/filesystem/jfs
new file mode 120000
index 0000000..945c9b4
--- /dev/null
+++ b/tests/filesystem/jfs
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/tests/filesystem/test b/tests/filesystem/test
index 5a9f0f6..c94deda 100755
--- a/tests/filesystem/test
+++ b/tests/filesystem/test
@@ -2,15 +2,22 @@
 use Test::More;
 
 # Load common subroutines.
-use File::Basename qw(dirname);
+use File::Basename qw(dirname basename);
 use Cwd qw(abs_path);
-use lib dirname( abs_path $0);
+
+BEGIN {
+    $basedir = dirname($0);
+    $basedir = `cd $basedir && pwd`;
+    chomp($basedir);
+}
+use lib $basedir;
 use Filesystem
   qw(check_config udisks2_stop udisks2_restart get_loop_dev attach_dev make_fs mk_mntpoint_1 mk_mntpoint_2 cleanup cleanup1 reaper nfs_gen_opts);
 
 BEGIN {
-    $basedir = $0;
-    $basedir =~ s|(.*)/[^/]*|$1|;
+    # extract fs_type
+    $test_name = basename($basedir);
+    $fs_type   = $test_name ne "filesystem" ? $test_name : " ";
 
     # Options: -v Verbose, -e enable udisks(8) daemon, -f filesystem type
     $v              = " ";
@@ -20,8 +27,7 @@ BEGIN {
     $nfs_enabled    = 0;
     $vfat_enabled   = 0;
 
-    $i       = 0;
-    $fs_type = " ";
+    $i = 0;
     foreach $arg (@ARGV) {
         if ( $arg eq "-v" ) {
             $v = $arg;
@@ -131,15 +137,7 @@ print "Testing filesystem fs_type: $fs_type\n";
 
 # mount(2) MS_BIND | MS_PRIVATE requires an absolute path to a private mount
 # point before MS_MOVE
-$cwd = `pwd 2>/dev/null`;
-chomp($cwd);
-$private_path = "$cwd";
-if ( $basedir eq "." ) {
-    $private_path = "$cwd/mntpoint";
-}
-else {
-    $private_path = "$cwd/$basedir/mntpoint";
-}
+$private_path = abs_path($basedir) . "/mntpoint";
 
 # Keep a list of devices used for removal at end of test.
 $device_count = 0;
diff --git a/tests/filesystem/vfat b/tests/filesystem/vfat
new file mode 120000
index 0000000..945c9b4
--- /dev/null
+++ b/tests/filesystem/vfat
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/tests/filesystem/xfs b/tests/filesystem/xfs
new file mode 120000
index 0000000..945c9b4
--- /dev/null
+++ b/tests/filesystem/xfs
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/tests/fs_filesystem/ext4 b/tests/fs_filesystem/ext4
new file mode 120000
index 0000000..945c9b4
--- /dev/null
+++ b/tests/fs_filesystem/ext4
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/tests/fs_filesystem/jfs b/tests/fs_filesystem/jfs
new file mode 120000
index 0000000..945c9b4
--- /dev/null
+++ b/tests/fs_filesystem/jfs
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/tests/fs_filesystem/test b/tests/fs_filesystem/test
index 4462438..e706e42 100755
--- a/tests/fs_filesystem/test
+++ b/tests/fs_filesystem/test
@@ -2,18 +2,25 @@
 use Test::More;
 
 # Load common subroutines.
-use File::Basename qw(dirname);
+use File::Basename qw(dirname basename);
 use Cwd qw(abs_path);
-use lib dirname( abs_path $0) . '/../filesystem';
-use Filesystem
-  qw(check_config udisks2_stop udisks2_restart get_loop_dev attach_dev make_fs mk_mntpoint_1 mk_mntpoint_2 cleanup cleanup1 reaper nfs_gen_opts);
 
 BEGIN {
-    $basedir = $0;
-    $basedir =~ s|(.*)/[^/]*|$1|;
+    $basedir = dirname($0);
+    $basedir = `cd $basedir && pwd`;
+    chomp($basedir);
 
     # Some code in tests/filesystem is reused
-    $filesystem_dir = "$basedir/../filesystem";
+    $filesystem_dir = abs_path($basedir) . "/../filesystem";
+}
+use lib $filesystem_dir;
+use Filesystem
+  qw(check_config udisks2_stop udisks2_restart get_loop_dev attach_dev make_fs mk_mntpoint_1 mk_mntpoint_2 cleanup cleanup1 reaper nfs_gen_opts);
+
+BEGIN {
+    # extract fs_type
+    $test_name = basename($basedir);
+    $fs_type   = $test_name ne "fs_filesystem" ? $test_name : " ";
 
     # Options: -v = Verbose, -e enable udisks(8) daemon, -f filesystem type
     $v              = " ";
@@ -23,8 +30,7 @@ BEGIN {
     $nfs_enabled    = 0;
     $vfat_enabled   = 0;
 
-    $i       = 0;
-    $fs_type = " ";
+    $i = 0;
     foreach $arg (@ARGV) {
         if ( $arg eq "-v" ) {
             $v = $arg;
@@ -133,15 +139,7 @@ BEGIN {
 print "Testing filesystem fs_type: $fs_type\n";
 
 # Generate an absolute path to a private mount
-$cwd = `pwd 2>/dev/null`;
-chomp($cwd);
-$private_path = "$cwd";
-if ( $basedir eq "." ) {
-    $private_path = "$cwd/mntpoint";
-}
-else {
-    $private_path = "$cwd/$basedir/mntpoint";
-}
+$private_path = abs_path($basedir) . "/mntpoint";
 
 # Keep a list of devices used for removal at end of test.
 $device_count = 0;
diff --git a/tests/fs_filesystem/vfat b/tests/fs_filesystem/vfat
new file mode 120000
index 0000000..945c9b4
--- /dev/null
+++ b/tests/fs_filesystem/vfat
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/tests/fs_filesystem/xfs b/tests/fs_filesystem/xfs
new file mode 120000
index 0000000..945c9b4
--- /dev/null
+++ b/tests/fs_filesystem/xfs
@@ -0,0 +1 @@
+.
\ No newline at end of file
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH testsuite v2 1/4] README,travis: add e2fsprogs, jfsutils, and dosfstools to deps
  2020-11-02  8:35 ` [PATCH testsuite v2 1/4] README,travis: add e2fsprogs, jfsutils, and dosfstools to deps Ondrej Mosnacek
@ 2020-11-02 12:02   ` Richard Haines
  2020-11-02 12:20     ` Ondrej Mosnacek
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Haines @ 2020-11-02 12:02 UTC (permalink / raw)
  To: Ondrej Mosnacek, selinux; +Cc: Paul Moore

On Mon, 2020-11-02 at 09:35 +0100, Ondrej Mosnacek wrote:
> They are needed for ext4, jfs, and vfat tests, which will become
> executed by default in an upcoming patch.
> 
> Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
> ---
>  README.md                  | 6 ++++++
>  travis-ci/run-testsuite.sh | 3 +++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/README.md b/README.md
> index 838a082..1149f30 100644
> --- a/README.md
> +++ b/README.md
> @@ -58,6 +58,9 @@ similar dependencies):
>  * keyutils-libs-devel _(tools used by the keys tests)_
>  * kernel-devel _(used by the kernel module tests)_
>  * quota, xfsprogs-devel and libuuid-devel _(used by the filesystem
> tests)_
> +* e2fsprogs _(used by the ext4 filesystem tests)_
> +* jfsutils _(used by the jfs filesystem tests)_
> +* dosfstools _(used by the vfat filesystem tests)_
>  * nftables _(used by inet_socket and sctp tests if ver >= 9.3 for
> secmark testing )_
>  
>  On a modern Fedora system you can install these dependencies with
> the
> @@ -81,6 +84,9 @@ following command (NOTE: On Fedora 32 and below you
> need to remove
>  		quota \
>  		xfsprogs-devel \
>  		libuuid-devel \
> +		e2fsprogs \
> +		jfsutils \
> +		dosfstools \

I guess these should also be under Debian as well.

>  		nftables \
>  		kernel-devel-$(uname -r) \
>  		kernel-modules-$(uname -r)
> diff --git a/travis-ci/run-testsuite.sh b/travis-ci/run-testsuite.sh
> index 051f9d8..bd9073c 100755
> --- a/travis-ci/run-testsuite.sh
> +++ b/travis-ci/run-testsuite.sh
> @@ -38,6 +38,9 @@ dnf install -y \
>      quota \
>      xfsprogs-devel \
>      libuuid-devel \
> +    e2fsprogs \
> +    jfsutils \
> +    dosfstools \
>      kernel-devel-"$(uname -r)" \
>      kernel-modules-"$(uname -r)"
>  


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH testsuite v2 0/4] Test all filesystems by default
  2020-11-02  8:35 [PATCH testsuite v2 0/4] Test all filesystems by default Ondrej Mosnacek
                   ` (3 preceding siblings ...)
  2020-11-02  8:35 ` [PATCH testsuite v2 4/4] tests/[fs_]filesystem: test all filesystems Ondrej Mosnacek
@ 2020-11-02 12:04 ` Richard Haines
  2020-11-03  9:44   ` Ondrej Mosnacek
  4 siblings, 1 reply; 9+ messages in thread
From: Richard Haines @ 2020-11-02 12:04 UTC (permalink / raw)
  To: Ondrej Mosnacek, selinux; +Cc: Paul Moore

On Mon, 2020-11-02 at 09:35 +0100, Ondrej Mosnacek wrote:
> This series enables testing all filesystems currently supported by
> the
> testsuite (ext4, xfs, jfs, vfat) using the [fs_]filesystem subtests
> without the need to run the tests manually or move to a different
> filesystem. The filesystems not available on the tested kernel are
> automatically excluded.
> 
> The series also updates dependencies with the packages containing the
> required mkfs.* programs, fixes the mkfs.* invocation to not get
> stuck
> when testing jfs, and fixes error output appearing during a
> successful
> vfat test.
> 
> Note: The F32 CI will start failing after this and the kernel update
> patches are merged (the old kernel on the image doesn't have the XFS
> quota fix). It will be necessary to bump the stable Fedora testing to
> F33.
> 
> v2 changes:
>  - added a patch to fix the vfat tests output
>  - fixed behavior when fs tests are executed directly
>  - simplified the code changed/added by the last patch
> 
> Ondrej Mosnacek (4):
>   README,travis: add e2fsprogs, jfsutils, and dosfstools to deps
>   tests/filesystem: pipe "yes" to mkfs.* to fix jfs test
>   tests/[fs_]filesystem: fix unwanted error output when testing vfat
>   tests/[fs_]filesystem: test all filesystems


Apart from the minor nit in patch 1, all fs types tested okay so:

Acked-by: Richard Haines <richard_c_haines@btinternet.com>

> 
>  README.md                      |  6 ++++
>  tests/Makefile                 |  8 +++--
>  tests/filesystem/Filesystem.pm |  2 +-
>  tests/filesystem/ext4          |  1 +
>  tests/filesystem/jfs           |  1 +
>  tests/filesystem/test          | 58 +++++++++++++++---------------
>  tests/filesystem/vfat          |  1 +
>  tests/filesystem/xfs           |  1 +
>  tests/fs_filesystem/ext4       |  1 +
>  tests/fs_filesystem/jfs        |  1 +
>  tests/fs_filesystem/test       | 64 ++++++++++++++++--------------
> ----
>  tests/fs_filesystem/vfat       |  1 +
>  tests/fs_filesystem/xfs        |  1 +
>  travis-ci/run-testsuite.sh     |  3 ++
>  14 files changed, 83 insertions(+), 66 deletions(-)
>  create mode 120000 tests/filesystem/ext4
>  create mode 120000 tests/filesystem/jfs
>  create mode 120000 tests/filesystem/vfat
>  create mode 120000 tests/filesystem/xfs
>  create mode 120000 tests/fs_filesystem/ext4
>  create mode 120000 tests/fs_filesystem/jfs
>  create mode 120000 tests/fs_filesystem/vfat
>  create mode 120000 tests/fs_filesystem/xfs
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH testsuite v2 1/4] README,travis: add e2fsprogs, jfsutils, and dosfstools to deps
  2020-11-02 12:02   ` Richard Haines
@ 2020-11-02 12:20     ` Ondrej Mosnacek
  0 siblings, 0 replies; 9+ messages in thread
From: Ondrej Mosnacek @ 2020-11-02 12:20 UTC (permalink / raw)
  To: Richard Haines; +Cc: SElinux list, Paul Moore

On Mon, Nov 2, 2020 at 1:03 PM Richard Haines
<richard_c_haines@btinternet.com> wrote:
>
> On Mon, 2020-11-02 at 09:35 +0100, Ondrej Mosnacek wrote:
> > They are needed for ext4, jfs, and vfat tests, which will become
> > executed by default in an upcoming patch.
> >
> > Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
> > ---
> >  README.md                  | 6 ++++++
> >  travis-ci/run-testsuite.sh | 3 +++
> >  2 files changed, 9 insertions(+)
> >
> > diff --git a/README.md b/README.md
> > index 838a082..1149f30 100644
> > --- a/README.md
> > +++ b/README.md
> > @@ -58,6 +58,9 @@ similar dependencies):
> >  * keyutils-libs-devel _(tools used by the keys tests)_
> >  * kernel-devel _(used by the kernel module tests)_
> >  * quota, xfsprogs-devel and libuuid-devel _(used by the filesystem
> > tests)_
> > +* e2fsprogs _(used by the ext4 filesystem tests)_
> > +* jfsutils _(used by the jfs filesystem tests)_
> > +* dosfstools _(used by the vfat filesystem tests)_
> >  * nftables _(used by inet_socket and sctp tests if ver >= 9.3 for
> > secmark testing )_
> >
> >  On a modern Fedora system you can install these dependencies with
> > the
> > @@ -81,6 +84,9 @@ following command (NOTE: On Fedora 32 and below you
> > need to remove
> >               quota \
> >               xfsprogs-devel \
> >               libuuid-devel \
> > +             e2fsprogs \
> > +             jfsutils \
> > +             dosfstools \
>
> I guess these should also be under Debian as well.

Yes, absolutely! I missed that section, because I saw only the line
"apt-get install selinux-basics selinux-policy-default auditd" and
thought that there is no such comprehensive list for Debian... Should
have looked more carefully.

Given that this is just documentation, I'll add them when applying so
I don't need to repost everything. I'll make sure to double-check the
package names, which might be different on Debian.

Thank you for the review!


>
> >               nftables \
> >               kernel-devel-$(uname -r) \
> >               kernel-modules-$(uname -r)
> > diff --git a/travis-ci/run-testsuite.sh b/travis-ci/run-testsuite.sh
> > index 051f9d8..bd9073c 100755
> > --- a/travis-ci/run-testsuite.sh
> > +++ b/travis-ci/run-testsuite.sh
> > @@ -38,6 +38,9 @@ dnf install -y \
> >      quota \
> >      xfsprogs-devel \
> >      libuuid-devel \
> > +    e2fsprogs \
> > +    jfsutils \
> > +    dosfstools \
> >      kernel-devel-"$(uname -r)" \
> >      kernel-modules-"$(uname -r)"
> >
>


--
Ondrej Mosnacek
Software Engineer, Platform Security - SELinux kernel
Red Hat, Inc.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH testsuite v2 0/4] Test all filesystems by default
  2020-11-02 12:04 ` [PATCH testsuite v2 0/4] Test all filesystems by default Richard Haines
@ 2020-11-03  9:44   ` Ondrej Mosnacek
  0 siblings, 0 replies; 9+ messages in thread
From: Ondrej Mosnacek @ 2020-11-03  9:44 UTC (permalink / raw)
  To: Richard Haines; +Cc: SElinux list, Paul Moore

On Mon, Nov 2, 2020 at 1:05 PM Richard Haines
<richard_c_haines@btinternet.com> wrote:
> On Mon, 2020-11-02 at 09:35 +0100, Ondrej Mosnacek wrote:
> > This series enables testing all filesystems currently supported by
> > the
> > testsuite (ext4, xfs, jfs, vfat) using the [fs_]filesystem subtests
> > without the need to run the tests manually or move to a different
> > filesystem. The filesystems not available on the tested kernel are
> > automatically excluded.
> >
> > The series also updates dependencies with the packages containing the
> > required mkfs.* programs, fixes the mkfs.* invocation to not get
> > stuck
> > when testing jfs, and fixes error output appearing during a
> > successful
> > vfat test.
> >
> > Note: The F32 CI will start failing after this and the kernel update
> > patches are merged (the old kernel on the image doesn't have the XFS
> > quota fix). It will be necessary to bump the stable Fedora testing to
> > F33.
> >
> > v2 changes:
> >  - added a patch to fix the vfat tests output
> >  - fixed behavior when fs tests are executed directly
> >  - simplified the code changed/added by the last patch
> >
> > Ondrej Mosnacek (4):
> >   README,travis: add e2fsprogs, jfsutils, and dosfstools to deps
> >   tests/filesystem: pipe "yes" to mkfs.* to fix jfs test
> >   tests/[fs_]filesystem: fix unwanted error output when testing vfat
> >   tests/[fs_]filesystem: test all filesystems
>
>
> Apart from the minor nit in patch 1, all fs types tested okay so:
>
> Acked-by: Richard Haines <richard_c_haines@btinternet.com>

Thanks, all four patches are now applied:
https://github.com/SELinuxProject/selinux-testsuite/commits/071ec9c5e5f0442aae0b14f455ea6e6b34ada1e0

>
> >
> >  README.md                      |  6 ++++
> >  tests/Makefile                 |  8 +++--
> >  tests/filesystem/Filesystem.pm |  2 +-
> >  tests/filesystem/ext4          |  1 +
> >  tests/filesystem/jfs           |  1 +
> >  tests/filesystem/test          | 58 +++++++++++++++---------------
> >  tests/filesystem/vfat          |  1 +
> >  tests/filesystem/xfs           |  1 +
> >  tests/fs_filesystem/ext4       |  1 +
> >  tests/fs_filesystem/jfs        |  1 +
> >  tests/fs_filesystem/test       | 64 ++++++++++++++++--------------
> > ----
> >  tests/fs_filesystem/vfat       |  1 +
> >  tests/fs_filesystem/xfs        |  1 +
> >  travis-ci/run-testsuite.sh     |  3 ++
> >  14 files changed, 83 insertions(+), 66 deletions(-)
> >  create mode 120000 tests/filesystem/ext4
> >  create mode 120000 tests/filesystem/jfs
> >  create mode 120000 tests/filesystem/vfat
> >  create mode 120000 tests/filesystem/xfs
> >  create mode 120000 tests/fs_filesystem/ext4
> >  create mode 120000 tests/fs_filesystem/jfs
> >  create mode 120000 tests/fs_filesystem/vfat
> >  create mode 120000 tests/fs_filesystem/xfs
> >
>

-- 
Ondrej Mosnacek
Software Engineer, Platform Security - SELinux kernel
Red Hat, Inc.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-11-03  9:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02  8:35 [PATCH testsuite v2 0/4] Test all filesystems by default Ondrej Mosnacek
2020-11-02  8:35 ` [PATCH testsuite v2 1/4] README,travis: add e2fsprogs, jfsutils, and dosfstools to deps Ondrej Mosnacek
2020-11-02 12:02   ` Richard Haines
2020-11-02 12:20     ` Ondrej Mosnacek
2020-11-02  8:35 ` [PATCH testsuite v2 2/4] tests/filesystem: pipe "yes" to mkfs.* to fix jfs test Ondrej Mosnacek
2020-11-02  8:35 ` [PATCH testsuite v2 3/4] tests/[fs_]filesystem: fix unwanted error output when testing vfat Ondrej Mosnacek
2020-11-02  8:35 ` [PATCH testsuite v2 4/4] tests/[fs_]filesystem: test all filesystems Ondrej Mosnacek
2020-11-02 12:04 ` [PATCH testsuite v2 0/4] Test all filesystems by default Richard Haines
2020-11-03  9:44   ` Ondrej Mosnacek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.