diff mbox series

tests/filesystem/xfs: use a 300M xfs filesystem image

Message ID 166135970524.184778.17486058814645360372.stgit@olly (mailing list archive)
State Accepted
Delegated to: Ondrej Mosnáček
Headers show
Series tests/filesystem/xfs: use a 300M xfs filesystem image | expand

Commit Message

Paul Moore Aug. 24, 2022, 4:48 p.m. UTC
Recent versions of mkfs.xfs require at least a 300M image to work
properly which unfortunately causes a large number of xfs test
failures as the test suite only allocates 16M for a filesystem
image.  This patch increases the xfs image size to 300M while
leaving the existing 16M image size for all other filesystem types.

This was first noticed with xfsprogs v5.19.0 but it is possible
earlier versions are also affected.

Signed-off-by: Paul Moore <paul@paul-moore.com>
---
 tests/filesystem/Filesystem.pm |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Ondrej Mosnacek Aug. 25, 2022, 8:07 a.m. UTC | #1
On Wed, Aug 24, 2022 at 6:50 PM Paul Moore <paul@paul-moore.com> wrote:
> Recent versions of mkfs.xfs require at least a 300M image to work
> properly which unfortunately causes a large number of xfs test
> failures as the test suite only allocates 16M for a filesystem
> image.  This patch increases the xfs image size to 300M while
> leaving the existing 16M image size for all other filesystem types.
>
> This was first noticed with xfsprogs v5.19.0 but it is possible
> earlier versions are also affected.
>
> Signed-off-by: Paul Moore <paul@paul-moore.com>
> ---
>  tests/filesystem/Filesystem.pm |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/tests/filesystem/Filesystem.pm b/tests/filesystem/Filesystem.pm
> index e3cd8ee..bd91a11 100644
> --- a/tests/filesystem/Filesystem.pm
> +++ b/tests/filesystem/Filesystem.pm
> @@ -122,10 +122,14 @@ sub attach_dev {
>
>  sub make_fs {
>      my ( $mk_type, $mk_dev, $mk_dir ) = @_;
> +    my $mk_size = 16;
> +    if ( $mk_type eq "xfs" ) {
> +        $mk_size = 300;
> +    }
>      print "Create $mk_dir/fstest with dd\n";
>      $result =
>        system(
> -        "dd if=/dev/zero of=$mk_dir/fstest bs=4096 count=4096 2>/dev/null");
> +        "dd if=/dev/zero of=$mk_dir/fstest bs=1M count=$mk_size 2>/dev/null");
>      if ( $result != 0 ) {
>          print "dd failed to create $mk_dir/fstest\n";
>      }
>

Thanks! I applied this with a minor edit in the patch description
(added upstream xfsprogs commit reference):

https://github.com/SELinuxProject/selinux-testsuite/commit/c592d7f49e5e8ca907d90cb1d6f54bb0d410d442

--
Ondrej Mosnacek
Senior Software Engineer, Linux Security - SELinux kernel
Red Hat, Inc.
diff mbox series

Patch

diff --git a/tests/filesystem/Filesystem.pm b/tests/filesystem/Filesystem.pm
index e3cd8ee..bd91a11 100644
--- a/tests/filesystem/Filesystem.pm
+++ b/tests/filesystem/Filesystem.pm
@@ -122,10 +122,14 @@  sub attach_dev {
 
 sub make_fs {
     my ( $mk_type, $mk_dev, $mk_dir ) = @_;
+    my $mk_size = 16;
+    if ( $mk_type eq "xfs" ) {
+        $mk_size = 300;
+    }
     print "Create $mk_dir/fstest with dd\n";
     $result =
       system(
-        "dd if=/dev/zero of=$mk_dir/fstest bs=4096 count=4096 2>/dev/null");
+        "dd if=/dev/zero of=$mk_dir/fstest bs=1M count=$mk_size 2>/dev/null");
     if ( $result != 0 ) {
         print "dd failed to create $mk_dir/fstest\n";
     }