From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB7BF2882A5 for ; Mon, 22 Sep 2025 09:44:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758534278; cv=none; b=S1tRWq5w/9i4lRFam5qAEK0Zjn2gX2ggiKLeENXs+jplfM2d0hC0Jnqc+xBg3jtDQUlpEV3xEEDYwKavXzjYDENmLUFoGV9jVm1Zeca1k3VSkE/6ifc3QOxObx1CLJUpKsYat5otLns5FtKL5/SZauoJ0fdvXGAqBQEZl2ZRt98= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758534278; c=relaxed/simple; bh=zP0UbZVGKw3YyOTbZDCvnAEFlP9w01bFDvKEkzuZJX0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ruAR2Ibm7jHDsRsGxjU4RAX/JJ809LCkwV/8gibopzKeqxKCmoR7ioFblzfzJEBpsz87jY9liVraLtXKA6DW1cl/oBQ+RPP6V/ygX9Tq9LEFojXCBk23FGAE2ny+Ul0D3m7kpQkL+EIFC9/zo34usD71WbxEDDJQgX87hNkBsCg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=ThoSdXn1; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ThoSdXn1" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=0i0aEQ+Cz6Zv3sY9DBuxZ++IvNgRw7x7NBXoz68y5dI=; b=ThoSdXn1SIHn3DTUt1AkP/C9jf 14S2+lSdELUWs9MFzCUCiqR5KpizI4E6uFkdIiSu4pihIstEikKtqY9wXaoZQXjDgxwDQ+b1AhAUu aOMg57nV4s2/9QLPKCXGeF/wj0V8wACK1gEkG12H/UJxEPKlj+tIqcGzbzWNMaRre+x4JcCDItlvt e26Anb4BHA1kky8hwQvXq4jdDFYCrp+LG1Ts6X1IQ4WVLqU68PciOoGB7djuf92EXO3whT6IhQf4/ q9EVLCVwEzqrAsZiuUlPQfwfq8R/G/VmeGPI0iYrFzlJt2iVYmJbnERvCwwJVTxcML0u9hbVRJwAM WaXhXvXQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1v0d64-00000009vWJ-1TJr; Mon, 22 Sep 2025 09:44:36 +0000 From: Luis Chamberlain To: Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [RFT] ltp: add support for running tests on NFS mounts Date: Mon, 22 Sep 2025 02:44:34 -0700 Message-ID: <20250922094434.2366051-1-mcgrof@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain 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 Signed-off-by: Luis Chamberlain --- 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(-) diff --git a/defconfigs/nfs-ltp b/defconfigs/nfs-ltp index 4562874e..b7a9f4cd 100644 --- a/defconfigs/nfs-ltp +++ b/defconfigs/nfs-ltp @@ -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 diff --git a/kconfigs/Kconfig.nfsd b/kconfigs/Kconfig.nfsd index 8463e531..b5f20416 100644 --- a/kconfigs/Kconfig.nfsd +++ b/kconfigs/Kconfig.nfsd @@ -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 diff --git a/playbooks/roles/ltp/tasks/main.yml b/playbooks/roles/ltp/tasks/main.yml index 1b966771..3335f018 100644 --- a/playbooks/roles/ltp/tasks/main.yml +++ b/playbooks/roles/ltp/tasks/main.yml @@ -248,7 +248,64 @@ state: reloaded enabled: true -- name: Run ltp +# NFS mount support for running LTP tests on NFS +- name: Set NFS server address + tags: ["ltp", "run_tests"] + ansible.builtin.set_fact: + nfs_server_host: "{{ kdevops_host_prefix }}-nfs" + when: + - ltp_run_tests_on_nfs|default(false)|bool + +- name: Create NFS mount point for LTP tests + tags: ["ltp", "run_tests"] + become: true + become_flags: "su - -c" + become_method: ansible.builtin.sudo + ansible.builtin.file: + path: "/mnt/nfs-ltp" + state: directory + mode: "0755" + when: + - ltp_run_tests_on_nfs|default(false)|bool + +- name: Mount NFS export for LTP testing + tags: ["ltp", "run_tests"] + become: true + become_flags: "su - -c" + become_method: ansible.builtin.sudo + ansible.builtin.mount: + path: "/mnt/nfs-ltp" + src: "{{ nfs_server_host }}:{{ nfsd_export_path }}/0" + fstype: "nfs" + opts: "vers=4.2" + state: mounted + when: + - ltp_run_tests_on_nfs|default(false)|bool + +- name: Create LTP test directory on NFS mount + tags: ["ltp", "run_tests"] + become: true + become_flags: "su - -c" + become_method: ansible.builtin.sudo + ansible.builtin.file: + path: "/mnt/nfs-ltp/ltp-test" + state: directory + mode: "0777" + when: + - ltp_run_tests_on_nfs|default(false)|bool + +- name: Change to NFS mount directory for LTP tests + tags: ["run_tests"] + become: true + become_flags: "su - -c" + become_method: ansible.builtin.sudo + ansible.builtin.shell: | + cd /mnt/nfs-ltp/ltp-test + pwd + when: + - ltp_run_tests_on_nfs|default(false)|bool + +- name: Run ltp on local filesystem tags: ["run_tests"] become: true become_flags: "su - -c" @@ -259,6 +316,24 @@ cmd: "/opt/ltp/runltp {{ ltp_runltp_arg_dict[ltp_test_group] }}" changed_when: true failed_when: false + when: + - not ltp_run_tests_on_nfs|default(false)|bool + +- name: Run ltp on NFS mount + tags: ["run_tests"] + become: true + become_flags: "su - -c" + become_method: ansible.builtin.sudo + environment: + CREATE_ENTRIES: 1 + TMPDIR: "/mnt/nfs-ltp/ltp-test" + ansible.builtin.command: + cmd: "/opt/ltp/runltp -d /mnt/nfs-ltp/ltp-test {{ ltp_runltp_arg_dict[ltp_test_group] }}" + chdir: "/mnt/nfs-ltp/ltp-test" + changed_when: true + failed_when: false + when: + - ltp_run_tests_on_nfs|default(false)|bool - name: Look for test results in target node's /opt/ltp/results tags: ["copy_results"] diff --git a/workflows/ltp/Kconfig b/workflows/ltp/Kconfig index 8b01dfb6..f6600394 100644 --- a/workflows/ltp/Kconfig +++ b/workflows/ltp/Kconfig @@ -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 diff --git a/workflows/ltp/Makefile b/workflows/ltp/Makefile index 592c4f2b..02a43bb9 100644 --- a/workflows/ltp/Makefile +++ b/workflows/ltp/Makefile @@ -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))' -- 2.51.0