Skip to contentSkip to conversation

ltp: add support for running tests on NFS mounts

RFT Luis Chamberlain 1 participant 1 message Sep 22, 2025

lore
Share & tools
lore
#0 lore raw

Add support for running LTP tests on NFS/pNFS mounts when both CONFIG_LTP_TESTS_NFS and CONFIG_KDEVOPS_SETUP_NFSD are enabled.

Changes include:

1. Add CONFIG_LTP_RUN_TESTS_ON_NFS option to control NFS mount testing
- Depends on both NFS test group and NFS server being enabled
- Defaults to enabled when dependencies are met

2. Extend KDEVOPS_SETUP_NFSD dependencies to include LTP workflow
- Allows NFS server setup for LTP testing scenarios

3. Enhance LTP role with NFS mount capability:
- Mount NFS exports from kdevops NFS server before running tests
- Run LTP tests in NFS mount directory (/mnt/nfs-ltp/ltp-test)
- Use NFS v4.2 for comprehensive pNFS testing

4. Update nfs-ltp defconfig to enable full pNFS testing:
- Enable NFS test group (CONFIG_LTP_TESTS_NFS=y)
- Enable NFS server setup (CONFIG_KDEVOPS_SETUP_NFSD=y)
- Enable NFS mount testing (CONFIG_LTP_RUN_TESTS_ON_NFS=y)

This enables real pNFS testing where LTP tests execute on actual NFS mounts, providing comprehensive validation of NFS client functionality including parallel NFS capabilities.

Generated-by Claude AI

---

Chuck indicated LTP isn't exactly testing NFS, and indeed one needs to manually arrange things to test LTP. But it'd be nice to just leverage a defconfig and that's it. This will be useful for automation.

This requires further testing. I ran out of time.

 defconfigs/nfs-ltp                 | 18 ++++++-
 kconfigs/Kconfig.nfsd              |  7 +--
 playbooks/roles/ltp/tasks/main.yml | 77 +++++++++++++++++++++++++++++-
 workflows/ltp/Kconfig              | 12 +++++
 workflows/ltp/Makefile             |  6 +++
 5 files changed, 114 insertions(+), 6 deletions(-)
defconfigs/nfs-ltp +16 -2
index 4562874e..b7a9f4cd 100644
@@ -1,5 +1,13 @@
 # pNFS configuration for Linux Test Project (LTP)
-# Note: LTP doesn't specifically test pNFS, but can run on pNFS mounts
+#
+# This defconfig sets up LTP to run tests over pNFS (parallel NFS) mounts.
+# It configures:
+# 1. An NFS server node with exports (via CONFIG_KDEVOPS_SETUP_NFSD)
+# 2. LTP with NFS test group enabled (CONFIG_LTP_TESTS_NFS)
+# 3. Automatic NFS mount setup to run tests on NFS (CONFIG_LTP_RUN_TESTS_ON_NFS)
+#
+# The LTP tests will execute on NFS v4.2 mounts, providing comprehensive
+# testing of NFS client functionality including pNFS capabilities.
 
 # Use libvirt/QEMU for virtualization
 CONFIG_GUESTFS=y
@@ -24,8 +32,14 @@ CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
 CONFIG_KDEVOPS_WORKFLOW_DEDICATE_LTP=y
 CONFIG_KDEVOPS_WORKFLOW_ENABLE_LTP=y
 
-# Use kdevops-provided NFS server for pNFS mount
+# Enable NFS test group for pNFS testing
+CONFIG_LTP_TESTS_NFS=y
+
+# NFS server setup for pNFS testing
 CONFIG_KDEVOPS_SETUP_NFSD=y
 
+# Run LTP tests on NFS mounts (enables actual pNFS testing)
+CONFIG_LTP_RUN_TESTS_ON_NFS=y
+
 # Enable systemd journal remote for debugging
 CONFIG_DEVCONFIG_ENABLE_SYSTEMD_JOURNAL_REMOTE=y
\ No newline at end of file
kconfigs/Kconfig.nfsd +4 -3
index 8463e531..b5f20416 100644
@@ -2,9 +2,10 @@
 config KDEVOPS_SETUP_NFSD
 	bool "Set up the kernel nfs server"
 	depends on KDEVOPS_WORKFLOW_ENABLE_FSTESTS || \
-			   KDEVOPS_WORKFLOW_ENABLE_PYNFS || \
-			   KDEVOPS_WORKFLOW_ENABLE_NFSTEST || \
-			   KDEVOPS_WORKFLOW_ENABLE_GITR
+		KDEVOPS_WORKFLOW_ENABLE_PYNFS || \
+		KDEVOPS_WORKFLOW_ENABLE_NFSTEST || \
+		KDEVOPS_WORKFLOW_ENABLE_GITR || \
+		KDEVOPS_WORKFLOW_ENABLE_LTP
 	default n
 	help
 	  Configure and bring up the kernel NFS server. This will provision
playbooks/roles/ltp/tasks/main.yml +76 -1

89 lines not on this page · raw message

workflows/ltp/Kconfig +12 -0
index 8b01dfb6..f6600394 100644
@@ -61,6 +61,18 @@ config LTP_TESTS_TIRPC
 
 endmenu
 
+config LTP_RUN_TESTS_ON_NFS
+	bool "Run LTP tests on NFS mounts"
+	depends on LTP_TESTS_NFS && KDEVOPS_SETUP_NFSD
+	default y
+	help
+	  When enabled, LTP tests will be run on NFS mounts instead of
+	  local filesystems. This requires both NFS test group to be enabled
+	  and kdevops NFS server to be configured.
+
+	  The tests will mount NFS exports from the kdevops NFS server
+	  and run the LTP test suite on those mounts.
+
 endif # WORKFLOWS_DEDICATED_WORKFLOW
 
 config HAVE_MIRROR_LTP
workflows/ltp/Makefile +6 -0
index 592c4f2b..02a43bb9 100644
@@ -82,6 +82,12 @@ else
 LTP_ARGS += ltp_tests_tirpc='False'
 endif # CONFIG_LTP_TESTS_TIRPC
 
+ifeq (y,$(CONFIG_LTP_RUN_TESTS_ON_NFS))
+LTP_ARGS += ltp_run_tests_on_nfs='True'
+else
+LTP_ARGS += ltp_run_tests_on_nfs='False'
+endif # CONFIG_LTP_RUN_TESTS_ON_NFS
+
 WORKFLOW_ARGS += $(LTP_ARGS)
 WORKFLOW_ARGS_SEPARATED += ltp_enabled_test_groups='$(subst $(space),+,$(LTP_ENABLED_TEST_GROUPS))'
 
Signature · 1 line
2.51.0