public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] fstests: add support for ext2 filesystem testing
@ 2025-07-31 19:12 Luis Chamberlain
  2025-08-01 13:54 ` Chuck Lever
  0 siblings, 1 reply; 2+ messages in thread
From: Luis Chamberlain @ 2025-07-31 19:12 UTC (permalink / raw)
  To: Chuck Lever, Daniel Gomez, kdevops; +Cc: Luis Chamberlain

Add comprehensive ext2 filesystem testing support to the fstests workflow.
This enables running the xfstests test suite against ext2 filesystems with
different block size configurations.

The implementation includes:
- Add FSTESTS_EXT2 option to the main fstests Kconfig choice block
- Create ext2-specific Kconfig with manual coverage selection and test
  sections for different block sizes (defaults, 1k, 2k, 4k)
- Add ext2.config template for fstests configuration generation
- Create ext2 defconfig for easy deployment with all test sections enabled
- Integrate ext2 menu into the main fstests Kconfig structure

The ext2 test sections cover the standard block size variations that are
commonly tested for ext2 filesystems. Unlike ext4, ext2 doesn't support
advanced features like bigalloc, so the configuration is simpler and
focuses on core block size testing.

This follows the established patterns used by other filesystems in kdevops,
making it consistent with existing XFS, Btrfs, ext4, NFS, CIFS, and tmpfs
implementations.

Generated-by: Claude AI
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 defconfigs/ext2                               | 23 ++++++
 .../roles/fstests/templates/ext2/ext2.config  | 28 +++++++
 workflows/fstests/Kconfig                     | 12 +++
 workflows/fstests/ext2/Kconfig                | 73 +++++++++++++++++++
 4 files changed, 136 insertions(+)
 create mode 100644 defconfigs/ext2
 create mode 100644 playbooks/roles/fstests/templates/ext2/ext2.config
 create mode 100644 workflows/fstests/ext2/Kconfig

diff --git a/defconfigs/ext2 b/defconfigs/ext2
new file mode 100644
index 000000000000..9b8608219460
--- /dev/null
+++ b/defconfigs/ext2
@@ -0,0 +1,23 @@
+CONFIG_GUESTFS=y
+CONFIG_LIBVIRT=y
+
+CONFIG_WORKFLOWS=y
+CONFIG_WORKFLOW_LINUX_CUSTOM=y
+
+CONFIG_BOOTLINUX=y
+CONFIG_BOOTLINUX_9P=y
+
+CONFIG_WORKFLOWS_TESTS=y
+CONFIG_WORKFLOWS_LINUX_TESTS=y
+CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
+CONFIG_KDEVOPS_WORKFLOW_DEDICATE_FSTESTS=y
+CONFIG_KDEVOPS_WORKFLOW_ENABLE_FSTESTS=y
+
+CONFIG_FSTESTS_EXT2=y
+CONFIG_FSTESTS_FSTYP="ext2"
+CONFIG_FSTESTS_EXT2_SECTION_DEFAULTS=y
+CONFIG_FSTESTS_EXT2_SECTION_1K=y
+CONFIG_FSTESTS_EXT2_SECTION_2K=y
+CONFIG_FSTESTS_EXT2_SECTION_4K=y
+
+CONFIG_DEVCONFIG_ENABLE_SYSTEMD_JOURNAL_REMOTE=y
\ No newline at end of file
diff --git a/playbooks/roles/fstests/templates/ext2/ext2.config b/playbooks/roles/fstests/templates/ext2/ext2.config
new file mode 100644
index 000000000000..f1d4d7de01a4
--- /dev/null
+++ b/playbooks/roles/fstests/templates/ext2/ext2.config
@@ -0,0 +1,28 @@
+# Automatically generated file by kdevops
+[default]
+FSTYP=ext2
+TEST_DIR={{ fstests_test_dir }}
+SCRATCH_MNT={{ fstests_scratch_mnt }}
+RESULT_BASE=$PWD/results/$HOST/$(uname -r)
+DUMP_CORRUPT_FS=1
+CANON_DEVS=yes
+
+[ext2_defaults]
+TEST_DEV={{ fstests_test_dev }}
+SCRATCH_DEV_POOL="{{ fstests_scratch_devpool }}"
+MKFS_OPTIONS='-F'
+
+[ext2_1k]
+TEST_DEV={{ fstests_test_dev }}
+SCRATCH_DEV_POOL="{{ fstests_scratch_devpool }}"
+MKFS_OPTIONS='-F -b 1024'
+
+[ext2_2k]
+TEST_DEV={{ fstests_test_dev }}
+SCRATCH_DEV_POOL="{{ fstests_scratch_devpool }}"
+MKFS_OPTIONS='-F -b 2048'
+
+[ext2_4k]
+TEST_DEV={{ fstests_test_dev }}
+SCRATCH_DEV_POOL="{{ fstests_scratch_devpool }}"
+MKFS_OPTIONS='-F -b 4096'
\ No newline at end of file
diff --git a/workflows/fstests/Kconfig b/workflows/fstests/Kconfig
index a878b932c850..ce19dc31c8d3 100644
--- a/workflows/fstests/Kconfig
+++ b/workflows/fstests/Kconfig
@@ -74,6 +74,11 @@ config FSTESTS_EXT4
 	help
 	  This will target testing the ext4 filesystem.
 
+config FSTESTS_EXT2
+	bool "ext2"
+	help
+	  This will target testing the ext2 filesystem.
+
 config FSTESTS_NFS
 	bool "nfs"
 	select FSTESTS_NFS_ENABLE
@@ -101,6 +106,7 @@ config FSTESTS_FSTYP
 	default "xfs" if FSTESTS_XFS
 	default "btrfs" if FSTESTS_BTRFS
 	default "ext4" if FSTESTS_EXT4
+	default "ext2" if FSTESTS_EXT2
 	default "nfs" if FSTESTS_NFS
 	default "cifs" if FSTESTS_CIFS
 	default "tmpfs" if FSTESTS_TMPFS
@@ -286,6 +292,12 @@ endmenu
 
 endif # FSTESTS_EXT4
 
+if FSTESTS_EXT2
+menu "Configure how to test ext2"
+source "workflows/fstests/ext2/Kconfig"
+endmenu
+endif # FSTESTS_EXT2
+
 if FSTESTS_NFS
 
 menu "Configure how nfs should be tested"
diff --git a/workflows/fstests/ext2/Kconfig b/workflows/fstests/ext2/Kconfig
new file mode 100644
index 000000000000..af65fe9c17ab
--- /dev/null
+++ b/workflows/fstests/ext2/Kconfig
@@ -0,0 +1,73 @@
+# Distributions actively maintaining ext2 support should select this and then
+# be careful to select any of the other HAVE_DISTRO_EXT2_* below so that
+# testers can know what to test for.
+config HAVE_DISTRO_EXT2_PREFERS_MANUAL
+	bool
+	default n
+
+config FSTESTS_EXT2_MANUAL_COVERAGE
+	bool "Enable manual coverage selection"
+	default y if HAVE_DISTRO_EXT2_PREFERS_MANUAL
+	default n if !HAVE_DISTRO_EXT2_PREFERS_MANUAL
+	help
+	  By default we aim to spawn enough hosts to cover testing the full
+	  range of supported features upstream on the Linux kernel for ext2,
+	  and for you to also be able to do development on each section
+	  concurrently. Distributions however may override sensible defaults
+	  and only support certain features. Enabling this option lets you
+	  select and test only specific configurations.
+
+	  By default we enables all tests, but certain distributions may
+	  disable certain features and as such don't need to run certain
+	  type of tests.
+
+	  You can enable this to allow you to override the default test
+	  coverage.
+
+if FSTESTS_EXT2_MANUAL_COVERAGE
+
+config FSTESTS_EXT2_SECTION_DEFAULTS
+	bool "Enable testing section: ext2_defaults"
+	help
+	  Enabling this will test ext2 with the default options for the mkfs.ext2
+	  to create the filesystem.
+
+config FSTESTS_EXT2_SECTION_1K
+	bool "Enable testing section: ext2_1k"
+	help
+	  Enabling this will test ext2 with the default options for the mkfs.ext2
+	  to create the filesystem but with 1k block size.
+
+config FSTESTS_EXT2_SECTION_2K
+	bool "Enable testing section: ext2_2k"
+	help
+	  Enabling this will test ext2 with the default options for the mkfs.ext2
+	  to create the filesystem but with 2k block size.
+
+config FSTESTS_EXT2_SECTION_4K
+	bool "Enable testing section: ext2_4k"
+	help
+	  Enabling this will test ext2 with the default options for the mkfs.ext2
+	  to create the filesystem but with 4k block size.
+
+endif # FSTESTS_EXT2_MANUAL_COVERAGE
+
+if !FSTESTS_EXT2_MANUAL_COVERAGE
+
+config FSTESTS_EXT2_SECTION_DEFAULTS
+	bool
+	default y
+
+config FSTESTS_EXT2_SECTION_1K
+	bool
+	default y
+
+config FSTESTS_EXT2_SECTION_2K
+	bool
+	default y
+
+config FSTESTS_EXT2_SECTION_4K
+	bool
+	default y
+
+endif # !FSTESTS_EXT2_MANUAL_COVERAGE
-- 
2.45.2


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

* Re: [PATCH] fstests: add support for ext2 filesystem testing
  2025-07-31 19:12 [PATCH] fstests: add support for ext2 filesystem testing Luis Chamberlain
@ 2025-08-01 13:54 ` Chuck Lever
  0 siblings, 0 replies; 2+ messages in thread
From: Chuck Lever @ 2025-08-01 13:54 UTC (permalink / raw)
  To: Luis Chamberlain; +Cc: Daniel Gomez, kdevops

On 7/31/25 3:12 PM, Luis Chamberlain wrote:
> Add comprehensive ext2 filesystem testing support to the fstests workflow.
> This enables running the xfstests test suite against ext2 filesystems with
> different block size configurations.
> 
> The implementation includes:
> - Add FSTESTS_EXT2 option to the main fstests Kconfig choice block
> - Create ext2-specific Kconfig with manual coverage selection and test
>   sections for different block sizes (defaults, 1k, 2k, 4k)
> - Add ext2.config template for fstests configuration generation
> - Create ext2 defconfig for easy deployment with all test sections enabled
> - Integrate ext2 menu into the main fstests Kconfig structure
> 
> The ext2 test sections cover the standard block size variations that are
> commonly tested for ext2 filesystems. Unlike ext4, ext2 doesn't support
> advanced features like bigalloc, so the configuration is simpler and
> focuses on core block size testing.
> 
> This follows the established patterns used by other filesystems in kdevops,
> making it consistent with existing XFS, Btrfs, ext4, NFS, CIFS, and tmpfs
> implementations.

Random thought: The patch could also allow "ext2" to be a choice for
CONFIG_NFSD_EXPORT_FSTYPE and CONFIG_SMBD_SHARE_FSTYPE, since fstests
targeting NFS or SMB can make use of ext2 on a shared file system.


> Generated-by: Claude AI
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
> ---
>  defconfigs/ext2                               | 23 ++++++
>  .../roles/fstests/templates/ext2/ext2.config  | 28 +++++++
>  workflows/fstests/Kconfig                     | 12 +++
>  workflows/fstests/ext2/Kconfig                | 73 +++++++++++++++++++
>  4 files changed, 136 insertions(+)
>  create mode 100644 defconfigs/ext2
>  create mode 100644 playbooks/roles/fstests/templates/ext2/ext2.config
>  create mode 100644 workflows/fstests/ext2/Kconfig
> 
> diff --git a/defconfigs/ext2 b/defconfigs/ext2
> new file mode 100644
> index 000000000000..9b8608219460
> --- /dev/null
> +++ b/defconfigs/ext2
> @@ -0,0 +1,23 @@
> +CONFIG_GUESTFS=y
> +CONFIG_LIBVIRT=y
> +
> +CONFIG_WORKFLOWS=y
> +CONFIG_WORKFLOW_LINUX_CUSTOM=y
> +
> +CONFIG_BOOTLINUX=y
> +CONFIG_BOOTLINUX_9P=y
> +
> +CONFIG_WORKFLOWS_TESTS=y
> +CONFIG_WORKFLOWS_LINUX_TESTS=y
> +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
> +CONFIG_KDEVOPS_WORKFLOW_DEDICATE_FSTESTS=y
> +CONFIG_KDEVOPS_WORKFLOW_ENABLE_FSTESTS=y
> +
> +CONFIG_FSTESTS_EXT2=y
> +CONFIG_FSTESTS_FSTYP="ext2"
> +CONFIG_FSTESTS_EXT2_SECTION_DEFAULTS=y
> +CONFIG_FSTESTS_EXT2_SECTION_1K=y
> +CONFIG_FSTESTS_EXT2_SECTION_2K=y
> +CONFIG_FSTESTS_EXT2_SECTION_4K=y
> +
> +CONFIG_DEVCONFIG_ENABLE_SYSTEMD_JOURNAL_REMOTE=y
> \ No newline at end of file
> diff --git a/playbooks/roles/fstests/templates/ext2/ext2.config b/playbooks/roles/fstests/templates/ext2/ext2.config
> new file mode 100644
> index 000000000000..f1d4d7de01a4
> --- /dev/null
> +++ b/playbooks/roles/fstests/templates/ext2/ext2.config
> @@ -0,0 +1,28 @@
> +# Automatically generated file by kdevops
> +[default]
> +FSTYP=ext2
> +TEST_DIR={{ fstests_test_dir }}
> +SCRATCH_MNT={{ fstests_scratch_mnt }}
> +RESULT_BASE=$PWD/results/$HOST/$(uname -r)
> +DUMP_CORRUPT_FS=1
> +CANON_DEVS=yes
> +
> +[ext2_defaults]
> +TEST_DEV={{ fstests_test_dev }}
> +SCRATCH_DEV_POOL="{{ fstests_scratch_devpool }}"
> +MKFS_OPTIONS='-F'
> +
> +[ext2_1k]
> +TEST_DEV={{ fstests_test_dev }}
> +SCRATCH_DEV_POOL="{{ fstests_scratch_devpool }}"
> +MKFS_OPTIONS='-F -b 1024'
> +
> +[ext2_2k]
> +TEST_DEV={{ fstests_test_dev }}
> +SCRATCH_DEV_POOL="{{ fstests_scratch_devpool }}"
> +MKFS_OPTIONS='-F -b 2048'
> +
> +[ext2_4k]
> +TEST_DEV={{ fstests_test_dev }}
> +SCRATCH_DEV_POOL="{{ fstests_scratch_devpool }}"
> +MKFS_OPTIONS='-F -b 4096'
> \ No newline at end of file
> diff --git a/workflows/fstests/Kconfig b/workflows/fstests/Kconfig
> index a878b932c850..ce19dc31c8d3 100644
> --- a/workflows/fstests/Kconfig
> +++ b/workflows/fstests/Kconfig
> @@ -74,6 +74,11 @@ config FSTESTS_EXT4
>  	help
>  	  This will target testing the ext4 filesystem.
>  
> +config FSTESTS_EXT2
> +	bool "ext2"
> +	help
> +	  This will target testing the ext2 filesystem.
> +
>  config FSTESTS_NFS
>  	bool "nfs"
>  	select FSTESTS_NFS_ENABLE
> @@ -101,6 +106,7 @@ config FSTESTS_FSTYP
>  	default "xfs" if FSTESTS_XFS
>  	default "btrfs" if FSTESTS_BTRFS
>  	default "ext4" if FSTESTS_EXT4
> +	default "ext2" if FSTESTS_EXT2
>  	default "nfs" if FSTESTS_NFS
>  	default "cifs" if FSTESTS_CIFS
>  	default "tmpfs" if FSTESTS_TMPFS
> @@ -286,6 +292,12 @@ endmenu
>  
>  endif # FSTESTS_EXT4
>  
> +if FSTESTS_EXT2
> +menu "Configure how to test ext2"
> +source "workflows/fstests/ext2/Kconfig"
> +endmenu
> +endif # FSTESTS_EXT2
> +
>  if FSTESTS_NFS
>  
>  menu "Configure how nfs should be tested"
> diff --git a/workflows/fstests/ext2/Kconfig b/workflows/fstests/ext2/Kconfig
> new file mode 100644
> index 000000000000..af65fe9c17ab
> --- /dev/null
> +++ b/workflows/fstests/ext2/Kconfig
> @@ -0,0 +1,73 @@
> +# Distributions actively maintaining ext2 support should select this and then
> +# be careful to select any of the other HAVE_DISTRO_EXT2_* below so that
> +# testers can know what to test for.
> +config HAVE_DISTRO_EXT2_PREFERS_MANUAL
> +	bool
> +	default n
> +
> +config FSTESTS_EXT2_MANUAL_COVERAGE
> +	bool "Enable manual coverage selection"
> +	default y if HAVE_DISTRO_EXT2_PREFERS_MANUAL
> +	default n if !HAVE_DISTRO_EXT2_PREFERS_MANUAL
> +	help
> +	  By default we aim to spawn enough hosts to cover testing the full
> +	  range of supported features upstream on the Linux kernel for ext2,
> +	  and for you to also be able to do development on each section
> +	  concurrently. Distributions however may override sensible defaults
> +	  and only support certain features. Enabling this option lets you
> +	  select and test only specific configurations.
> +
> +	  By default we enables all tests, but certain distributions may
> +	  disable certain features and as such don't need to run certain
> +	  type of tests.
> +
> +	  You can enable this to allow you to override the default test
> +	  coverage.
> +
> +if FSTESTS_EXT2_MANUAL_COVERAGE
> +
> +config FSTESTS_EXT2_SECTION_DEFAULTS
> +	bool "Enable testing section: ext2_defaults"
> +	help
> +	  Enabling this will test ext2 with the default options for the mkfs.ext2
> +	  to create the filesystem.
> +
> +config FSTESTS_EXT2_SECTION_1K
> +	bool "Enable testing section: ext2_1k"
> +	help
> +	  Enabling this will test ext2 with the default options for the mkfs.ext2
> +	  to create the filesystem but with 1k block size.
> +
> +config FSTESTS_EXT2_SECTION_2K
> +	bool "Enable testing section: ext2_2k"
> +	help
> +	  Enabling this will test ext2 with the default options for the mkfs.ext2
> +	  to create the filesystem but with 2k block size.
> +
> +config FSTESTS_EXT2_SECTION_4K
> +	bool "Enable testing section: ext2_4k"
> +	help
> +	  Enabling this will test ext2 with the default options for the mkfs.ext2
> +	  to create the filesystem but with 4k block size.
> +
> +endif # FSTESTS_EXT2_MANUAL_COVERAGE
> +
> +if !FSTESTS_EXT2_MANUAL_COVERAGE
> +
> +config FSTESTS_EXT2_SECTION_DEFAULTS
> +	bool
> +	default y
> +
> +config FSTESTS_EXT2_SECTION_1K
> +	bool
> +	default y
> +
> +config FSTESTS_EXT2_SECTION_2K
> +	bool
> +	default y
> +
> +config FSTESTS_EXT2_SECTION_4K
> +	bool
> +	default y
> +
> +endif # !FSTESTS_EXT2_MANUAL_COVERAGE


-- 
Chuck Lever

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

end of thread, other threads:[~2025-08-01 13:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-31 19:12 [PATCH] fstests: add support for ext2 filesystem testing Luis Chamberlain
2025-08-01 13:54 ` Chuck Lever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox