Skip to contentSkip to conversation

workflows: Workflow stub for Jorge Mora's nfstest suite

PATCH In review [email protected] 4 participants 17 messages Apr 10, 2024 – Apr 12, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 workflows: Workflow stub for Jorge Mora's nfstest suite

From: Chuck Lever <[email protected]>

The nfstest suite is a detailed test of NFS functionality for NFS versions 3 and newer, including delegation, attribute cache consistency, sparse files, and server-to-server copy offload.

When configured in dedicated mode, each nfstest suite is run in a separate target node to achieve good parallelism. You can select specific test groups to run via Kconfig options.

This commit introduces the workflow's documentation and Kconfig apparatus to show how this workflow can be configured. Following commits will bring in the kdevops components to get the workflow working.

The careful reader will note that not every nfstest group is available here. Three groups require the use of a second client, and I haven't figured out how that needs to work. For now, those groups are not included in this series.

---
 .gitignore                                    |  1 +
 README.md                                     | 12 ++-
 docs/nfstest.md                               | 21 ++++
 kconfigs/workflows/Kconfig                    | 25 +++++
 scripts/workflows/nfstest/run_kernel_ci.sh    |  1 +
 .../workflows/nfstest/run_kernel_ci_kotd.sh   |  1 +
 scripts/workflows/nfstest/run_loop.sh         | 58 +++++++++++
 workflows/Makefile                            |  5 +
 workflows/nfstest/Kconfig                     | 87 ++++++++++++++++
 workflows/nfstest/Makefile                    | 99 +++++++++++++++++++
 10 files changed, 309 insertions(+), 1 deletion(-)
 create mode 100644 docs/nfstest.md
 create mode 120000 scripts/workflows/nfstest/run_kernel_ci.sh
 create mode 120000 scripts/workflows/nfstest/run_kernel_ci_kotd.sh
 create mode 100755 scripts/workflows/nfstest/run_loop.sh
 create mode 100644 workflows/nfstest/Kconfig
 create mode 100644 workflows/nfstest/Makefile
.gitignore +1 -0
index 5cb41682dd45..3a1ecd48d84f 100644
@@ -62,6 +62,7 @@ workflows/demos/reboot-limit/results/
 
 workflows/gitr/results/
 workflows/ltp/results/
+workflows/nfstest/results/
 
 playbooks/roles/linux-mirror/linux-mirror-systemd/mirrors.yaml
 # We should strive to ignore all and port them to the new mirrors.yaml
README.md +11 -1
index 96e048bc8405..ea6b41004767 100644
@@ -135,7 +135,17 @@ To test a kernel using the ltp suite, enable the ltp workflow and then run:
   * `make ltp`
   * `make ltp-baseline`
 
-For more details see [kdevops gitr docs](docs/gitr.md)
+For more details see [kdevops ltp docs](docs/ltp.md)
+
+### Start running the nfstest suite in 2 commands
+
+To test a kernel using the nfstest suite, enable the nfstest workflow and
+then run:
+
+  * `make nfstest`
+  * `make nfstest-baseline`
+
+For more details see [kdevops nfstest docs](docs/nfstest.md)
 
 ### Runs some kernel selftests in a parallel manner
 
docs/nfstest.md new file +21 -0
new file mode 100644
index 000000000000..b358389c2571
@@ -0,0 +1,21 @@
+# kdevops nfstest suite
+
+kdevops can run Jorge Mora's nfstest suite against an NFS server.
+
+Run `make menuconfig` and select:
+
+  Target workflows -> Dedicated target Linux test workflow ->nfstest
+
+Then configure the test parameters by going to:
+
+  Target workflows -> Configure and run the nfstest suite
+
+Choose the location of the repo that contains the version of nfstest
+you want to use for the test.
+
+Then, run:
+
+  * `make`
+  * `make bringup`
+  * `make nfstest`
+  * `make nfstest-baseline`
kconfigs/workflows/Kconfig +25 -0
index ff6372b7e98f..2fd5bf31347f 100644
@@ -166,6 +166,13 @@ config KDEVOPS_WORKFLOW_DEDICATE_LTP
 	  This will dedicate your configuration to running only the
 	  ltp workflow in separate target nodes per testing group.
 
+config KDEVOPS_WORKFLOW_DEDICATE_NFSTEST
+	bool "nfstest"
+	select KDEVOPS_WORKFLOW_ENABLE_NFSTEST
+	help
+	  This will dedicate your configuration to running only the
+	  nfstest workflow in separate target nodes per testing group.
+
 endchoice
 
 endif
@@ -239,6 +246,14 @@ config KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_LTP
 	  Select this option if you want to provision ltp on a single
 	  target node for by-hand testing.
 
+config KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_NFSTEST
+	bool "nfstest"
+	select KDEVOPS_WORKFLOW_ENABLE_NFSTEST
+	depends on LIBVIRT || TERRAFORM_PRIVATE_NET
+	help
+	  Select this option if you want to provision nfstest on a
+	  single target node for by-hand testing.
+
 endif # !WORKFLOWS_DEDICATED_WORKFLOW
 
 config KDEVOPS_WORKFLOW_ENABLE_FSTESTS
@@ -312,6 +327,16 @@ source "workflows/ltp/Kconfig"
 endmenu
 endif # KDEVOPS_WORKFLOW_ENABLE_GITR
 
+config KDEVOPS_WORKFLOW_ENABLE_NFSTEST
+	bool
+	default y if KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_NFSTEST || KDEVOPS_WORKFLOW_DEDICATE_NFSTEST
+
+if KDEVOPS_WORKFLOW_ENABLE_NFSTEST
+menu "Configure and run the nfstest suite"
+source "workflows/nfstest/Kconfig"
+endmenu
+endif # KDEVOPS_WORKFLOW_ENABLE_NFSTEST
+
 config KDEVOPS_WORKFLOW_GIT_CLONES_KDEVOPS_GIT
 	bool
 	default y if KDEVOPS_WORKFLOW_ENABLE_FSTESTS || KDEVOPS_WORKFLOW_ENABLE_BLKTESTS
scripts/workflows/nfstest/run_kernel_ci.sh new file +1 -0
new file mode 120000
index 000000000000..4fd5dc5e8e13
@@ -0,0 +1 @@
+../generic/run_kernel_ci.sh
\ No newline at end of file
scripts/workflows/nfstest/run_kernel_ci_kotd.sh new file +1 -0
new file mode 120000
index 000000000000..8f94d6ba4f52
@@ -0,0 +1 @@
+../kotd/run_kernel_ci_kotd.sh
\ No newline at end of file
scripts/workflows/nfstest/run_loop.sh new file +58 -0

58 lines not on this page · raw message

workflows/Makefile +5 -0
index 7e3e5e351a49..e305f2629abf 100644
@@ -53,6 +53,11 @@ WORKFLOW_ARGS += kdevops_workflow_enable_ltp='True'
 include workflows/ltp/Makefile
 endif # CONFIG_KDEVOPS_WORKFLOW_ENABLE_LTP == y
 
+ifeq (y,$(CONFIG_KDEVOPS_WORKFLOW_ENABLE_NFSTEST))
+WORKFLOW_ARGS += kdevops_workflow_enable_nfstest='True'
+include workflows/nfstest/Makefile
+endif # CONFIG_KDEVOPS_WORKFLOW_ENABLE_NFSTEST == y
+
 ANSIBLE_EXTRA_ARGS += $(WORKFLOW_ARGS)
 ANSIBLE_EXTRA_ARGS_SEPARATED += $(WORKFLOW_ARGS_SEPARATED)
 ANSIBLE_EXTRA_ARGS_DIRECT += $(WORKFLOW_ARGS_DIRECT)
workflows/nfstest/Kconfig new file +87 -0

87 lines not on this page · raw message

workflows/nfstest/Makefile new file +99 -0

99 lines not on this page · raw message

Signature · 1 line
2.44.0
#1 lore raw

PATCH 2/4 gen_nodes: Add support for the nfstest workflow

From: Chuck Lever <[email protected]>

Add functionality to provision target nodes for the nfstest workflow.

---
 playbooks/roles/gen_nodes/defaults/main.yml |  1 +
 playbooks/roles/gen_nodes/tasks/main.yml    | 10 ++++++++
 playbooks/roles/gen_nodes/tasks/nfstest.yml | 28 +++++++++++++++++++++
 3 files changed, 39 insertions(+)
 create mode 100644 playbooks/roles/gen_nodes/tasks/nfstest.yml
playbooks/roles/gen_nodes/defaults/main.yml +1 -0
index d03306baec6e..5caada07fe59 100644
@@ -12,6 +12,7 @@ kdevops_workflow_enable_cxl: False
 kdevops_workflow_enable_pynfs: False
 kdevops_workflow_enable_gitr: False
 kdevops_workflow_enable_ltp: False
+kdevops_workflow_enable_nfstest: false
 kdevops_workflow_enable_selftests: False
 kdevops_nfsd_enable: False
 kdevops_krb5_enable: False
playbooks/roles/gen_nodes/tasks/main.yml +10 -0
index ee175f4de506..a40e2bd92ccd 100644
@@ -215,6 +215,16 @@
   when:
     - is_ltp|bool
 
+- name: Generate a kdevops nodes file for the nfstest workflow
+  tags: hosts
+  ansible.builtin.include_role:
+    name: gen_nodes
+    tasks_from: nfstest
+  when:
+    - kdevops_workflows_dedicated_workflow
+    - kdevops_workflow_enable_nfstest
+    - ansible_nodes_template.stat.exists
+
 - name: Set empty enabled test types list for fstests
   tags: [ 'hosts' ]
   set_fact:
playbooks/roles/gen_nodes/tasks/nfstest.yml new file +28 -0
new file mode 100644
index 000000000000..22ae4e87449c
@@ -0,0 +1,28 @@
+---
+- name: Initialize the enabled nodes list for nfstest
+  ansible.builtin.set_fact:
+    nfstest_enabled_nodes: "{{ nfstest_enabled_test_groups | ansible.builtin.split }}"
+
+- name: Expand the nfstest node list to include -dev nodes
+  ansible.builtin.set_fact:
+    nfstest_enabled_nodes: "{{ nfstest_enabled_nodes + [item + '-dev'] }}"
+  with_items: "{{ nfstest_enabled_test_groups | ansible.builtin.split }}"
+  when:
+    - kdevops_baseline_and_dev|bool
+
+- name: Add the kdevops NFS server to the enabled nodes list
+  ansible.builtin.set_fact:
+    nfstest_enabled_nodes: "{{ nfstest_enabled_nodes + ['nfsd'] }}"
+  when:
+    - kdevops_nfsd_enable|bool
+
+- name: Generate the kdevops nodes file using {{ kdevops_nodes_template }}
+  vars:
+    node_template: "{{ kdevops_nodes_template | basename }}"
+    all_generic_nodes: "{{ generic_nodes }}"
+    nodes: "{{ [kdevops_host_prefix + '-'] | product(nfstest_enabled_nodes) | map('join') | list }}"
+  ansible.builtin.template:
+    src: "{{ node_template }}"
+    dest: "{{ topdir_path }}/{{ kdevops_nodes }}"
+    force: true
+    mode: "u=rw,g=r,o=r"
Signature · 1 line
2.44.0
#2 lore raw

PATCH 3/4 gen_hosts: Add gen_hosts support for the nfstest workflow

In reply to [email protected]

From: Chuck Lever <[email protected]>

Add functionality to generate the Ansible host inventory for the nfstest workflow.

---
 playbooks/roles/gen_hosts/defaults/main.yml   |  1 +
 playbooks/roles/gen_hosts/tasks/main.yml      | 15 +++++++++
 .../roles/gen_hosts/templates/nfstest.j2      | 32 +++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 playbooks/roles/gen_hosts/templates/nfstest.j2
playbooks/roles/gen_hosts/defaults/main.yml +1 -0
index 5cd941c7d0d3..8fc0f2794506 100644
@@ -26,6 +26,7 @@ kdevops_workflow_enable_cxl: False
 kdevops_workflow_enable_pynfs: False
 kdevops_workflow_enable_gitr: False
 kdevops_workflow_enable_ltp: False
+kdevops_workflow_enable_nfstest: false
 
 is_fstests: False
 fstests_fstyp: "bogus"
playbooks/roles/gen_hosts/tasks/main.yml +15 -0
index 86837e748134..a4dd1f5a0fc3 100644
@@ -124,6 +124,21 @@
     - kdevops_workflow_enable_ltp
     - ansible_hosts_template.stat.exists
 
+- name: Generate the Ansible hosts file for dedicated nfstest workflow
+  tags: [ 'hosts' ]
+  vars:
+    nfstest_enabled_hosts: "{{ nfstest_enabled_test_groups | ansible.builtin.split }}"
+  template:
+    src: "{{ kdevops_hosts_template }}"
+    dest: "{{ topdir_path }}/{{ kdevops_hosts }}"
+    force: true
+    trim_blocks: true
+    lstrip_blocks: true
+  when:
+    - kdevops_workflows_dedicated_workflow
+    - kdevops_workflow_enable_nfstest
+    - ansible_hosts_template.stat.exists
+
 - name: Set empty enabled test types list for fstests
   tags: [ 'hosts' ]
   set_fact:
playbooks/roles/gen_hosts/templates/nfstest.j2 new file +32 -0
new file mode 100644
index 000000000000..c00494ca5aff
@@ -0,0 +1,32 @@
+[all]
+{% for s in nfstest_enabled_hosts %}
+{{ kdevops_host_prefix }}-{{ s }}
+{% if kdevops_baseline_and_dev %}
+{{ kdevops_host_prefix }}-{{ s }}-dev
+{% endif %}
+{% endfor %}
+[all:vars]
+ansible_python_interpreter =  "{{ kdevops_python_interpreter }}"
+
+[baseline]
+{% for s in nfstest_enabled_hosts %}
+{{ kdevops_host_prefix }}-{{ s }}
+{% endfor %}
+[baseline:vars]
+ansible_python_interpreter =  "{{ kdevops_python_interpreter }}"
+
+[dev]
+{% if kdevops_baseline_and_dev %}
+  {% for s in nfstest_enabled_hosts %}
+{{ kdevops_host_prefix }}-{{ s }}-dev
+  {% endfor %}
+{% endif %}
+[dev:vars]
+ansible_python_interpreter =  "{{ kdevops_python_interpreter }}"
+
+{% if kdevops_nfsd_enable %}
+[nfsd]
+{{ kdevops_hosts_prefix }}-nfsd
+[nfsd:vars]
+ansible_python_interpreter =  "{{ kdevops_python_interpreter }}"
+{% endif %}
Signature · 1 line
2.44.0
#3 lore raw

PATCH 4/4 roles: Add a playbook to run the nfstest suite

In reply to [email protected]

From: Chuck Lever <[email protected]>

Note that in dedicated workflow mode, each test group has its own set of tasks. The main nfstest role selects the task set to run based on the hostname of the target node.

The nfstest role uses the "free" lock-step strategy so that each target node can get through its tests while the others are running their own tasks. Another possibility that is more natural to Ansible would be to set up a group for each nfstest test group.

---
 playbooks/nfstest.yml                         |   5 +
 playbooks/roles/nfstest/defaults/main.yml     |   5 +
 playbooks/roles/nfstest/tasks/alloc/main.yml  |  14 ++
 playbooks/roles/nfstest/tasks/dio/main.yml    |  28 +++
 .../roles/nfstest/tasks/interop/main.yml      |  56 ++++++
 playbooks/roles/nfstest/tasks/lock/main.yml   |  56 ++++++
 playbooks/roles/nfstest/tasks/main.yml        | 187 ++++++++++++++++++
 playbooks/roles/nfstest/tasks/posix/main.yml  |  56 ++++++
 playbooks/roles/nfstest/tasks/sparse/main.yml |  14 ++
 playbooks/roles/nfstest/tasks/ssc/main.yml    |  28 +++
 playbooks/roles/nfstest/vars/Debian.yml       |   5 +
 playbooks/roles/nfstest/vars/RedHat.yml       |   5 +
 playbooks/roles/nfstest/vars/Suse.yml         |   5 +
 13 files changed, 464 insertions(+)
 create mode 100644 playbooks/nfstest.yml
 create mode 100644 playbooks/roles/nfstest/defaults/main.yml
 create mode 100644 playbooks/roles/nfstest/tasks/alloc/main.yml
 create mode 100644 playbooks/roles/nfstest/tasks/dio/main.yml
 create mode 100644 playbooks/roles/nfstest/tasks/interop/main.yml
 create mode 100644 playbooks/roles/nfstest/tasks/lock/main.yml
 create mode 100644 playbooks/roles/nfstest/tasks/main.yml
 create mode 100644 playbooks/roles/nfstest/tasks/posix/main.yml
 create mode 100644 playbooks/roles/nfstest/tasks/sparse/main.yml
 create mode 100644 playbooks/roles/nfstest/tasks/ssc/main.yml
 create mode 100644 playbooks/roles/nfstest/vars/Debian.yml
 create mode 100644 playbooks/roles/nfstest/vars/RedHat.yml
 create mode 100644 playbooks/roles/nfstest/vars/Suse.yml
playbooks/nfstest.yml new file +5 -0
new file mode 100644
index 000000000000..9d7c28a75843
@@ -0,0 +1,5 @@
+---
+- hosts: all
+  strategy: free
+  roles:
+    - role: nfstest
playbooks/roles/nfstest/defaults/main.yml new file +5 -0
new file mode 100644
index 000000000000..0d4060b5c76e
@@ -0,0 +1,5 @@
+---
+# Our sensible defaults for the nfstest role.
+#
+kdevops_run_nfstest: False
+kdevops_workflows_dedicated_workflow: false
playbooks/roles/nfstest/tasks/alloc/main.yml new file +14 -0
new file mode 100644
index 000000000000..2c4d750388f2
@@ -0,0 +1,14 @@
+---
+- name: Run nfstest_alloc for NFSv4.2
+  ansible.builtin.command:
+    argv:
+      - "nfstest_alloc"
+      - "--createlog"
+      - "--nfsversion=4.2"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: alloc_nfsv42_results
+  changed_when: false
+  failed_when: alloc_nfsv42_results.rc != 0 and alloc_nfsv42_results.rc != 1
+  tags: run_tests
playbooks/roles/nfstest/tasks/dio/main.yml new file +28 -0
new file mode 100644
index 000000000000..705403a93da1
@@ -0,0 +1,28 @@
+---
+- name: Run nfstest_dio for NFSv4.0
+  ansible.builtin.command:
+    argv:
+      - "nfstest_dio"
+      - "--createlog"
+      - "--nfsversion=4.0"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: dio_nfsv40_results
+  changed_when: false
+  failed_when: dio_nfsv40_results.rc != 0 and dio_nfsv40_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_dio for NFSv4.1
+  ansible.builtin.command:
+    argv:
+      - "nfstest_dio"
+      - "--createlog"
+      - "--nfsversion=4.1"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: dio_nfsv41_results
+  changed_when: false
+  failed_when: dio_nfsv41_results.rc != 0 and dio_nfsv41_results.rc != 1
+  tags: run_tests
playbooks/roles/nfstest/tasks/interop/main.yml new file +56 -0

56 lines not on this page · raw message

playbooks/roles/nfstest/tasks/lock/main.yml new file +56 -0

56 lines not on this page · raw message

playbooks/roles/nfstest/tasks/main.yml new file +187 -0

187 lines not on this page · raw message

playbooks/roles/nfstest/tasks/posix/main.yml new file +56 -0

56 lines not on this page · raw message

playbooks/roles/nfstest/tasks/sparse/main.yml new file +14 -0
new file mode 100644
index 000000000000..6defab5311f7
@@ -0,0 +1,14 @@
+---
+- name: Run nfstest_sparse for NFSv4.2
+  ansible.builtin.command:
+    argv:
+      - "nfstest_sparse"
+      - "--createlog"
+      - "--nfsversion=4.2"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: sparse_nfsv42_results
+  changed_when: false
+  failed_when: sparse_nfsv42_results.rc != 0 and sparse_nfsv42_results.rc != 1
+  tags: run_tests
playbooks/roles/nfstest/tasks/ssc/main.yml new file +28 -0
new file mode 100644
index 000000000000..b8e01345c032
@@ -0,0 +1,28 @@
+---
+- name: Run nfstest_ssc intra tests for NFSv4.2
+  ansible.builtin.command:
+    argv:
+      - "nfstest_ssc"
+      - "--createlog"
+      - "--nfsversion=4.2"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=intra"
+  register: ssc_nfsv42_intra_results
+  changed_when: false
+  failed_when: ssc_nfsv42_intra_results.rc != 0 and ssc_nfsv42_intra_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_ssc inter tests for NFSv4.2
+  ansible.builtin.command:
+    argv:
+      - "nfstest_ssc"
+      - "--createlog"
+      - "--nfsversion=4.2"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=inter"
+  register: ssc_nfsv42_inter_results
+  changed_when: false
+  failed_when: ssc_nfsv42_inter_results.rc != 0 and ssc_nfsv42_inter_results.rc != 1
+  tags: run_tests
playbooks/roles/nfstest/vars/Debian.yml new file +5 -0
new file mode 100644
index 000000000000..3acf39071fd3
@@ -0,0 +1,5 @@
+---
+nfstest_packages:
+  - nfs-common
+  - python3-pip
+  - tcpdump
playbooks/roles/nfstest/vars/RedHat.yml new file +5 -0
new file mode 100644
index 000000000000..4fdee14f2b1f
@@ -0,0 +1,5 @@
+---
+nfstest_packages:
+  - nfs-utils
+  - python3-pip
+  - tcpdump
playbooks/roles/nfstest/vars/Suse.yml new file +5 -0
new file mode 100644
index 000000000000..4fdee14f2b1f
@@ -0,0 +1,5 @@
+---
+nfstest_packages:
+  - nfs-utils
+  - python3-pip
+  - tcpdump
Signature · 1 line
2.44.0
#4 lore raw

Re: [PATCH 4/4] roles: Add a playbook to run the nfstest suite

Quoted 36 lines · On Wed, Apr 10, 2024 at 10:50:51AM -0400, [email protected] wrote:
playbooks/roles/nfstest/tasks/main.yml new file +30 -0
new file mode 100644
index 000000000000..6f660c332a75
@@ -0,0 +1,187 @@
+---
+- name: Import optional extra_vars file
+  ansible.builtin.include_vars:
+    file: "{{ item }}"
+  with_first_found:
+    - files:
+        - "../extra_vars.yml"
+        - "../extra_vars.yaml"
+        - "../extra_vars.json"
+      skip: true
+  failed_when: false
+  tags: vars
+
+- name: Set OS-specific variables
+  ansible.builtin.include_vars: "{{ lookup('ansible.builtin.first_found', params) }}"
+  vars:
+    params:
+      files:
+        - '{{ ansible_distribution }}.yml'
+        - '{{ ansible_os_family }}.yml'
+        - default.yml
+      paths:
+        - 'vars'
+
+- name: Install dependencies for nfstest
+  become: true
+  become_flags: 'su - -c'
+  become_method: ansible.builtin.sudo
+  ansible.builtin.package:
+    name: "{{ nfstest_packages }}"

playbooks/roles/nfstest/tasks/main.yml line 40

Quoted 10 lines
playbooks/roles/nfstest/tasks/main.yml new file +10 -0
+    state: present
+  tags: nfstest
+
+# I wish this worked.
+# - name: Install or update pip
+#   become: true
+#   community.general.easy_install:
+#     name: pip
+#     state: latest
+#   tags: nfstest

Why doesn't it? We use pip for non-debian systems when target_linux_install_b4 is set (you specify a MESSAGE-ID to b4 am).

playbooks/roles/nfstest/tasks/main.yml line 117

Quoted 11 lines
playbooks/roles/nfstest/tasks/main.yml new file +11 -0
+- name: Build the nfstest suite on the target node(s)
+# noqa: command-instead-of-shell
+  environment:
+    PYTHONPATH: "{{ nfstest_build_dir }}"
+  ansible.builtin.shell:
+    cmd: "python setup.py build"
+    chdir: "{{ nfstest_build_dir }}"
+  register: build_result
+  failed_when: build_result.rc != 0
+  changed_when: true
+  tags: nfstest

Future consideration: I have been wondering more about how to use 9p for a distro target which may be different than the host, but allow us to use the full host CPU cores / RAM. One idea is to use a docker container with guestfs, but we'd have to curate that world first.

playbooks/roles/nfstest/tasks/main.yml line 146

Quoted 7 lines
playbooks/roles/nfstest/tasks/main.yml new file +7 -0
+- name: Run the selected test group
+  ansible.builtin.include_role:
+    name: nfstest
+    tasks_from: "{{ nfstest_test_group }}/main.yml"
+  when:
+    - kdevops_workflows_dedicated_workflow|bool
+  tags: run_tests

Neat!

Luis

#5 lore raw

Re: [PATCH 4/4] roles: Add a playbook to run the nfstest suite

Quoted 42 lines · Luis Chamberlain
Quoted 41 lines · On Wed, Apr 10, 2024 at 10:50:51AM -0400, [email protected] wrote:
playbooks/roles/nfstest/tasks/main.yml new file +35 -0
new file mode 100644
index 000000000000..6f660c332a75
@@ -0,0 +1,187 @@
+---
+- name: Import optional extra_vars file
+  ansible.builtin.include_vars:
+    file: "{{ item }}"
+  with_first_found:
+    - files:
+        - "../extra_vars.yml"
+        - "../extra_vars.yaml"
+        - "../extra_vars.json"
+      skip: true
+  failed_when: false
+  tags: vars
+
+- name: Set OS-specific variables
+  ansible.builtin.include_vars: "{{ lookup('ansible.builtin.first_found', params) }}"
+  vars:
+    params:
+      files:
+        - '{{ ansible_distribution }}.yml'
+        - '{{ ansible_os_family }}.yml'
+        - default.yml
+      paths:
+        - 'vars'
+
+- name: Install dependencies for nfstest
+  become: true
+  become_flags: 'su - -c'
+  become_method: ansible.builtin.sudo
+  ansible.builtin.package:
+    name: "{{ nfstest_packages }}"
+    state: present
+  tags: nfstest
+
+# I wish this worked.
+# - name: Install or update pip
Quoted 8 lines

playbooks/roles/nfstest/tasks/main.yml line 40

Quoted 5 lines
playbooks/roles/nfstest/tasks/main.yml new file +5 -0
+#   become: true
+#   community.general.easy_install:
+#     name: pip
+#     state: latest
+#   tags: nfstest

Why doesn't it? We use pip for non-debian systems when target_linux_install_b4 is set (you specify a MESSAGE-ID to b4 am).

The community.general.easy_install module is described in several spots around the Internet, but it requires that the distro has actually packaged the easy_install program and it is installed. At the very least, Fedora does not appear to package it.

So, pip works... but easy_install does not appear to be the agnostic way to ensure pip is installed locally. Distros seem to like providing pip via a package.

Quoted 12 lines

playbooks/roles/nfstest/tasks/main.yml line 117

Quoted 11 lines
playbooks/roles/nfstest/tasks/main.yml new file +11 -0
+- name: Build the nfstest suite on the target node(s)
+# noqa: command-instead-of-shell
+  environment:
+    PYTHONPATH: "{{ nfstest_build_dir }}"
+  ansible.builtin.shell:
+    cmd: "python setup.py build"
+    chdir: "{{ nfstest_build_dir }}"
+  register: build_result
+  failed_when: build_result.rc != 0
+  changed_when: true
+  tags: nfstest
Quoted 4 lines

Future consideration: I have been wondering more about how to use 9p for a distro target which may be different than the host, but allow us to use the full host CPU cores / RAM. One idea is to use a docker container with guestfs, but we'd have to curate that world first.

Luckily this build is quick. It's the ltp build that takes forever in a day! Building that suite once would be great. Or maybe I could dive in and see what it would take to build just the portion of ltp that each individual test group uses.

Quoted 9 lines

playbooks/roles/nfstest/tasks/main.yml line 146

Quoted 7 lines
playbooks/roles/nfstest/tasks/main.yml new file +7 -0
+- name: Run the selected test group
+  ansible.builtin.include_role:
+    name: nfstest
+    tasks_from: "{{ nfstest_test_group }}/main.yml"
+  when:
+    - kdevops_workflows_dedicated_workflow|bool
+  tags: run_tests

Neat!

Note this seems to run the tasks in parallel only if strategy=free which is a little janky. With the default lock-step strategy, the included tasks are run serially, one target node at a time.

It appears that the way fstests gets around this is by tailoring the test configuration on each target node. Then the "Run the test group" task just invokes ./check on all the target nodes at once and they each do something different based on the tailored config.

I'm thinking a more natural approach for nfstest would be for Ansible to use a template to build a script on each target host that runs the steps specific to the test group. That can be run by a single task step so Ansible will properly parallelize it.

Signature · 1 line
Chuck Lever
#6 lore raw

Re: [PATCH 4/4] roles: Add a playbook to run the nfstest suite

Quoted 15 lines · Chuck Lever
Quoted 13 lines · Luis Chamberlain

playbooks/roles/nfstest/tasks/main.yml line 40

Quoted 9 lines · On Wed, Apr 10, 2024 at 10:50:51AM -0400, [email protected] wrote:
playbooks/roles/nfstest/tasks/main.yml new file +7 -0
new file mode 100644
+# I wish this worked.
+# - name: Install or update pip
+#   become: true
+#   community.general.easy_install:
+#     name: pip
+#     state: latest
+#   tags: nfstest

Why doesn't it? We use pip for non-debian systems when target_linux_install_b4 is set (you specify a MESSAGE-ID to b4 am).

Quoted 8 lines

The community.general.easy_install module is described in several spots around the Internet, but it requires that the distro has actually packaged the easy_install program and it is installed. At the very least, Fedora does not appear to package it.

So, pip works... but easy_install does not appear to be the agnostic way to ensure pip is installed locally. Distros seem to like providing pip via a package.

I see...

So on a fresh new debian testing system I noticed we will have to install also now:

ansible-galaxy collection install ansible.posix --> due to our ansible.cfg stdout_callback=debug ansible-galaxy collection install community.general --> due to zypper !

Otherwise we get obscure errors.

So ... to keep supporting at least opensuse / SLE and also get regular and not insane long lines for error messages (with stdout_callback=debug) it would seem we may need to start installing collections soon...

I can't find debian packages for these, and I suspect this is just a decision by the anbsible community to trim things down further on the ansible core package. I raise eyebrows to this... but it's the reality we are raced with as ansible has picked up and grown.

So... as rolling distros pick up new ansible I think we may need to have to install collections or:

a) remove the ansible.cfg stdout_callback=debug
b) remove zypper support / opensuse

If we want to keep a) and b), the alternative last I looked was to have the collections spelled out in a requirements.yml file and then before you run playbooks run:

ansible-galaxy install -r requirements.yml

For example it could be:

cat requirements.yml

- name: ansible.posix
- name: community.general

I think the above would solve a) b) and also address your pip stuff above? We'd just need to add this new ansible-galaxy command as part of or our first ansible command we run.

Quoted 17 lines
Quoted 12 lines

playbooks/roles/nfstest/tasks/main.yml line 117

Quoted 11 lines

+- name: Build the nfstest suite on the target node(s)

playbooks/roles/nfstest/tasks/main.yml new file +10 -0
+# noqa: command-instead-of-shell
+  environment:
+    PYTHONPATH: "{{ nfstest_build_dir }}"
+  ansible.builtin.shell:
+    cmd: "python setup.py build"
+    chdir: "{{ nfstest_build_dir }}"
+  register: build_result
+  failed_when: build_result.rc != 0
+  changed_when: true
+  tags: nfstest
Quoted 4 lines

Future consideration: I have been wondering more about how to use 9p for a distro target which may be different than the host, but allow us to use the full host CPU cores / RAM. One idea is to use a docker container with guestfs, but we'd have to curate that world first.

Quoted 4 lines

Luckily this build is quick. It's the ltp build that takes forever in a day! Building that suite once would be great. Or maybe I could dive in and see what it would take to build just the portion of ltp that each individual test group uses.

Sure mirroring is just optional, just figured I'd share my latest brain fart in trying to think of a way to address this to scale. Ideally it would be nice to do this for all the builds we do too, so there is value for this long term too.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

+- name: Run the selected test group

playbooks/roles/nfstest/tasks/main.yml new file +6 -0
+  ansible.builtin.include_role:
+    name: nfstest
+    tasks_from: "{{ nfstest_test_group }}/main.yml"
+  when:
+    - kdevops_workflows_dedicated_workflow|bool
+  tags: run_tests
Quoted 5 lines
Quoted 1 line

Neat!

Note this seems to run the tasks in parallel only if strategy=free which is a little janky. With the default lock-step strategy, the included tasks are run serially, one target node at a time.

I see, because it assumes each guest will run all tasks, and by default it will try to unify in unison running each task serially so they all sing the same tune at the same time.

Quoted 2 lines

It appears that the way fstests gets around this is by tailoring the test configuration on each target node.

Well, so fstests runs 'oscheck' which runs 'check', and at that point its running the same task in parallel up to 30 guests max (-f option in the Makfile for the command ansible-playbook command).

The strategy=free is new to me, seem syou can also set it on the role:

- hosts: all
strategy: free

Too bad the ansible-playbook command line does not have an option to let you specify you want this strategy for the tasks, then the Makefile that uses the nfstests work could just use it. But if the above works for roles then that's resolved.

Also, wonder how run_once could help or not in this case:

https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_strategies.html#running-on-a-single-machine-with-run-once

Quoted 3 lines

Then the "Run the test
group" task just invokes ./check on all the target nodes at once and they each do something different based on the tailored config.

Yes, the "figuring what's my thing to do" is done by the argument passed to oscheck wrapper, which in turn just specifies the different profile to use to call check. oscheck --test-section <foo> ./check -s <foo>

Quoted 4 lines

I'm thinking a more natural approach for nfstest would be for Ansible to use a template to build a script on each target host that runs the steps specific to the test group. That can be run by a single task step so Ansible will properly parallelize it.

Indeed, that a templated script file would do it too!

For selftests we just specify a different argument to the selftest make command, so it's an easy template we can just fit into the ansible command.

Luis

#7 lore raw

Re: [PATCH 4/4] roles: Add a playbook to run the nfstest suite

Quoted 48 lines · Luis Chamberlain
Quoted 15 lines · Chuck Lever
Quoted 13 lines · Luis Chamberlain

playbooks/roles/nfstest/tasks/main.yml line 40

Quoted 9 lines · On Wed, Apr 10, 2024 at 10:50:51AM -0400, [email protected] wrote:
playbooks/roles/nfstest/tasks/main.yml new file +7 -0
new file mode 100644
+# I wish this worked.
+# - name: Install or update pip
+#   become: true
+#   community.general.easy_install:
+#     name: pip
+#     state: latest
+#   tags: nfstest

Why doesn't it? We use pip for non-debian systems when target_linux_install_b4 is set (you specify a MESSAGE-ID to b4 am).

Quoted 8 lines

The community.general.easy_install module is described in several spots around the Internet, but it requires that the distro has actually packaged the easy_install program and it is installed. At the very least, Fedora does not appear to package it.

So, pip works... but easy_install does not appear to be the agnostic way to ensure pip is installed locally. Distros seem to like providing pip via a package.

I see...

So on a fresh new debian testing system I noticed we will have to install also now:

ansible-galaxy collection install ansible.posix --> due to our ansible.cfg stdout_callback=debug ansible-galaxy collection install community.general --> due to zypper !

Otherwise we get obscure errors.

So ... to keep supporting at least opensuse / SLE and also get regular and not insane long lines for error messages (with stdout_callback=debug) it would seem we may need to start installing collections soon...

I can't find debian packages for these, and I suspect this is just a decision by the anbsible community to trim things down further on the ansible core package. I raise eyebrows to this... but it's the reality we are raced with as ansible has picked up and grown.

So... as rolling distros pick up new ansible I think we may need to have to install collections or:

Quoted 8 lines

a) remove the ansible.cfg stdout_callback=debug
b) remove zypper support / opensuse

If we want to keep a) and b), the alternative last I looked was to have the collections spelled out in a requirements.yml file and then before you run playbooks run:

ansible-galaxy install -r requirements.yml

Doesn't using ansible.builtin.package everywhere fix the zypper problem? I can hop on that -- I was waiting for more fall-out from using builtin.package in my new workflows. But it seems to work OK.

Quoted 8 lines

For example it could be:

cat requirements.yml

- name: ansible.posix
- name: community.general

I think the above would solve a) b) and also address your pip stuff above?

I've got community.general on my systems already. "easy_install" is the name of the Ansible module and also a command -- the "easy_install" command is something that distros have to provide.

I'm happy to just remove that commented-out task. It's not a big deal (I think?) to use the packaged version of pip.

Quoted 51 lines

We'd just need to add this new ansible-galaxy command as part of or our first ansible command we run.

Quoted 17 lines
Quoted 12 lines

playbooks/roles/nfstest/tasks/main.yml line 117

Quoted 11 lines

+- name: Build the nfstest suite on the target node(s)

playbooks/roles/nfstest/tasks/main.yml new file +10 -0
+# noqa: command-instead-of-shell
+  environment:
+    PYTHONPATH: "{{ nfstest_build_dir }}"
+  ansible.builtin.shell:
+    cmd: "python setup.py build"
+    chdir: "{{ nfstest_build_dir }}"
+  register: build_result
+  failed_when: build_result.rc != 0
+  changed_when: true
+  tags: nfstest
Quoted 4 lines

Future consideration: I have been wondering more about how to use 9p for a distro target which may be different than the host, but allow us to use the full host CPU cores / RAM. One idea is to use a docker container with guestfs, but we'd have to curate that world first.

Quoted 4 lines

Luckily this build is quick. It's the ltp build that takes forever in a day! Building that suite once would be great. Or maybe I could dive in and see what it would take to build just the portion of ltp that each individual test group uses.

Sure mirroring is just optional, just figured I'd share my latest brain fart in trying to think of a way to address this to scale. Ideally it would be nice to do this for all the builds we do too, so there is value for this long term too.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

+- name: Run the selected test group

playbooks/roles/nfstest/tasks/main.yml new file +6 -0
+  ansible.builtin.include_role:
+    name: nfstest
+    tasks_from: "{{ nfstest_test_group }}/main.yml"
+  when:
+    - kdevops_workflows_dedicated_workflow|bool
+  tags: run_tests
Quoted 5 lines
Quoted 1 line

Neat!

Note this seems to run the tasks in parallel only if strategy=free which is a little janky. With the default lock-step strategy, the included tasks are run serially, one target node at a time.

I see, because it assumes each guest will run all tasks, and by default it will try to unify in unison running each task serially so they all sing the same tune at the same time.

Quoted 2 lines

It appears that the way fstests gets around this is by tailoring the test configuration on each target node.

Quoted 8 lines

Well, so fstests runs 'oscheck' which runs 'check', and at that point its running the same task in parallel up to 30 guests max (-f option in the Makfile for the command ansible-playbook command).

The strategy=free is new to me, seem syou can also set it on the role:

- hosts: all
strategy: free

Yes, that's exactly how I select the "free" strategy for nfstest.

Quoted 8 lines

Too bad the ansible-playbook command line does not have an option to let you specify you want this strategy for the tasks, then the Makefile that uses the nfstests work could just use it. But if the above works for roles then that's resolved.

Also, wonder how run_once could help or not in this case:

https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_strategies.html#running-on-a-single-machine-with-run-once

I looked at run_once... it didn't do what I expected, but maybe I missed something.

Quoted 13 lines
Quoted 3 lines

Then the "Run the test
group" task just invokes ./check on all the target nodes at once and they each do something different based on the tailored config.

Yes, the "figuring what's my thing to do" is done by the argument passed to oscheck wrapper, which in turn just specifies the different profile to use to call check. oscheck --test-section <foo> ./check -s <foo>

Quoted 4 lines

I'm thinking a more natural approach for nfstest would be for Ansible to use a template to build a script on each target host that runs the steps specific to the test group. That can be run by a single task step so Ansible will properly parallelize it.

Quoted 4 lines

Indeed, that a templated script file would do it too!

For selftests we just specify a different argument to the selftest make command, so it's an easy template we can just fit into the ansible command.

Works that way for ltp as well. For nfstest, though, there are several different things to do for each test group, which is why I built a task set.

I'm going to try using a script template instead. That will probably be simpler to understand and maintain.

Signature · 1 line
Chuck Lever
#8 lore raw

Re: [PATCH 4/4] roles: Add a playbook to run the nfstest suite

Quoted 3 lines · Chuck Lever

Doesn't using ansible.builtin.package everywhere fix the zypper problem? I can hop on that -- I was waiting for more fall-out from using builtin.package in my new workflows. But it seems to work OK.

If it does then groovy.

Quoted 3 lines

Works that way for ltp as well. For nfstest, though, there are several different things to do for each test group, which is why I built a task set.

Oh good to know.

Quoted 2 lines

I'm going to try using a script template instead. That will probably be simpler to understand and maintain.

Nice, yeah I think that's a great fit for this case. To be clear then with a silly example. So say we have 5 different test nodes and each one has a different set of test commands to run:

panda    10
ant      2
atom     1
buffalo  20

We'd build a template script, and that would be different per node, panda would run its own set of 10 command, atom 1, etc. One way to go about this is use the node for its template source, we'd have for instance:

template/run-foobar-test-for-panda.sh.j2
template/run-foobar-test-for-ant.sh.j2
...
template/run-foobar-test-for-buffalo.sh.j2

I only ask as its certainly a nice idea and I just realized we don't have any of these different parallelization strategies well documented for new developers, so maybe later we can.

Luis

#9 lore raw

Re: [PATCH 4/4] roles: Add a playbook to run the nfstest suite

In reply to [email protected]
Quoted 349 lines · On Wed, 10 Apr 2024, [email protected] wrote:

From: Chuck Lever <[email protected]>

Note that in dedicated workflow mode, each test group has its own set of tasks. The main nfstest role selects the task set to run based on the hostname of the target node.

The nfstest role uses the "free" lock-step strategy so that each target node can get through its tests while the others are running their own tasks. Another possibility that is more natural to Ansible would be to set up a group for each nfstest test group.

---
 playbooks/nfstest.yml                         |   5 +
 playbooks/roles/nfstest/defaults/main.yml     |   5 +
 playbooks/roles/nfstest/tasks/alloc/main.yml  |  14 ++
 playbooks/roles/nfstest/tasks/dio/main.yml    |  28 +++
 .../roles/nfstest/tasks/interop/main.yml      |  56 ++++++
 playbooks/roles/nfstest/tasks/lock/main.yml   |  56 ++++++
 playbooks/roles/nfstest/tasks/main.yml        | 187 ++++++++++++++++++
 playbooks/roles/nfstest/tasks/posix/main.yml  |  56 ++++++
 playbooks/roles/nfstest/tasks/sparse/main.yml |  14 ++
 playbooks/roles/nfstest/tasks/ssc/main.yml    |  28 +++
 playbooks/roles/nfstest/vars/Debian.yml       |   5 +
 playbooks/roles/nfstest/vars/RedHat.yml       |   5 +
 playbooks/roles/nfstest/vars/Suse.yml         |   5 +
 13 files changed, 464 insertions(+)
 create mode 100644 playbooks/nfstest.yml
 create mode 100644 playbooks/roles/nfstest/defaults/main.yml
 create mode 100644 playbooks/roles/nfstest/tasks/alloc/main.yml
 create mode 100644 playbooks/roles/nfstest/tasks/dio/main.yml
 create mode 100644 playbooks/roles/nfstest/tasks/interop/main.yml
 create mode 100644 playbooks/roles/nfstest/tasks/lock/main.yml
 create mode 100644 playbooks/roles/nfstest/tasks/main.yml
 create mode 100644 playbooks/roles/nfstest/tasks/posix/main.yml
 create mode 100644 playbooks/roles/nfstest/tasks/sparse/main.yml
 create mode 100644 playbooks/roles/nfstest/tasks/ssc/main.yml
 create mode 100644 playbooks/roles/nfstest/vars/Debian.yml
 create mode 100644 playbooks/roles/nfstest/vars/RedHat.yml
 create mode 100644 playbooks/roles/nfstest/vars/Suse.yml
playbooks/nfstest.yml new file +5 -0
new file mode 100644
index 000000000000..9d7c28a75843
@@ -0,0 +1,5 @@
+---
+- hosts: all
+  strategy: free
+  roles:
+    - role: nfstest
playbooks/roles/nfstest/defaults/main.yml new file +5 -0
new file mode 100644
index 000000000000..0d4060b5c76e
@@ -0,0 +1,5 @@
+---
+# Our sensible defaults for the nfstest role.
+#
+kdevops_run_nfstest: False
+kdevops_workflows_dedicated_workflow: false
playbooks/roles/nfstest/tasks/alloc/main.yml new file +14 -0
new file mode 100644
index 000000000000..2c4d750388f2
@@ -0,0 +1,14 @@
+---
+- name: Run nfstest_alloc for NFSv4.2
+  ansible.builtin.command:
+    argv:
+      - "nfstest_alloc"
+      - "--createlog"
+      - "--nfsversion=4.2"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: alloc_nfsv42_results
+  changed_when: false
+  failed_when: alloc_nfsv42_results.rc != 0 and alloc_nfsv42_results.rc != 1
+  tags: run_tests
playbooks/roles/nfstest/tasks/dio/main.yml new file +28 -0
new file mode 100644
index 000000000000..705403a93da1
@@ -0,0 +1,28 @@
+---
+- name: Run nfstest_dio for NFSv4.0
+  ansible.builtin.command:
+    argv:
+      - "nfstest_dio"
+      - "--createlog"
+      - "--nfsversion=4.0"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: dio_nfsv40_results
+  changed_when: false
+  failed_when: dio_nfsv40_results.rc != 0 and dio_nfsv40_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_dio for NFSv4.1
+  ansible.builtin.command:
+    argv:
+      - "nfstest_dio"
+      - "--createlog"
+      - "--nfsversion=4.1"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: dio_nfsv41_results
+  changed_when: false
+  failed_when: dio_nfsv41_results.rc != 0 and dio_nfsv41_results.rc != 1
+  tags: run_tests
playbooks/roles/nfstest/tasks/interop/main.yml new file +56 -0
new file mode 100644
index 000000000000..b35e9c9607fe
@@ -0,0 +1,56 @@
+---
+- name: Run nfstest_interop for NFSv3
+  ansible.builtin.command:
+    argv:
+      - "nfstest_interop"
+      - "--createlog"
+      - "--nfsversion=3"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: interop_nfsv3_results
+  changed_when: false
+  failed_when: interop_nfsv3_results.rc != 0 and interop_nfsv3_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_interop for NFSv4.0
+  ansible.builtin.command:
+    argv:
+      - "nfstest_interop"
+      - "--createlog"
+      - "--nfsversion=4.0"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: interop_nfsv40_results
+  changed_when: false
+  failed_when: interop_nfsv40_results.rc != 0 and interop_nfsv40_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_interop for NFSv4.1
+  ansible.builtin.command:
+    argv:
+      - "nfstest_interop"
+      - "--createlog"
+      - "--nfsversion=4.1"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: interop_nfsv41_results
+  changed_when: false
+  failed_when: interop_nfsv41_results.rc != 0 and interop_nfsv41_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_interop for NFSv4.2
+  ansible.builtin.command:
+    argv:
+      - "nfstest_interop"
+      - "--createlog"
+      - "--nfsversion=4.2"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: interop_nfsv42_results
+  changed_when: false
+  failed_when: interop_nfsv42_results.rc != 0 and interop_nfsv42_results.rc != 1
+  tags: run_tests
playbooks/roles/nfstest/tasks/lock/main.yml new file +56 -0
new file mode 100644
index 000000000000..b658edf965ed
@@ -0,0 +1,56 @@
+---
+- name: Run nfstest_lock for NFSv3
+  ansible.builtin.command:
+    argv:
+      - "nfstest_lock"
+      - "--createlog"
+      - "--nfsversion=3"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: lock_nfsv3_results
+  changed_when: false
+  failed_when: lock_nfsv3_results.rc != 0 and lock_nfsv3_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_lock for NFSv4.0
+  ansible.builtin.command:
+    argv:
+      - "nfstest_lock"
+      - "--createlog"
+      - "--nfsversion=4.0"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: lock_nfsv40_results
+  changed_when: false
+  failed_when: lock_nfsv40_results.rc != 0 and lock_nfsv40_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_lock for NFSv4.1
+  ansible.builtin.command:
+    argv:
+      - "nfstest_lock"
+      - "--createlog"
+      - "--nfsversion=4.1"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: lock_nfsv41_results
+  changed_when: false
+  failed_when: lock_nfsv41_results.rc != 0 and lock_nfsv41_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_lock for NFSv4.2
+  ansible.builtin.command:
+    argv:
+      - "nfstest_lock"
+      - "--createlog"
+      - "--nfsversion=4.2"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: lock_nfsv42_results
+  changed_when: false
+  failed_when: lock_nfsv42_results.rc != 0 and lock_nfsv42_results.rc != 1
+  tags: run_tests
playbooks/roles/nfstest/tasks/main.yml new file +102 -0
new file mode 100644
index 000000000000..6f660c332a75
@@ -0,0 +1,187 @@
+---
+- name: Import optional extra_vars file
+  ansible.builtin.include_vars:
+    file: "{{ item }}"
+  with_first_found:
+    - files:
+        - "../extra_vars.yml"
+        - "../extra_vars.yaml"
+        - "../extra_vars.json"
+      skip: true
+  failed_when: false
+  tags: vars
+
+- name: Set OS-specific variables
+  ansible.builtin.include_vars: "{{ lookup('ansible.builtin.first_found', params) }}"
+  vars:
+    params:
+      files:
+        - '{{ ansible_distribution }}.yml'
+        - '{{ ansible_os_family }}.yml'
+        - default.yml
+      paths:
+        - 'vars'
+
+- name: Install dependencies for nfstest
+  become: true
+  become_flags: 'su - -c'
+  become_method: ansible.builtin.sudo
+  ansible.builtin.package:
+    name: "{{ nfstest_packages }}"
+    state: present
+  tags: nfstest
+
+# I wish this worked.
+# - name: Install or update pip
+#   become: true
+#   community.general.easy_install:
+#     name: pip
+#     state: latest
+#   tags: nfstest
+
+- name: Create the /data mount point on the target nodes
+  ansible.builtin.include_role:
+    name: create_data_partition
+  tags:
+    - data_partition
+    - nfstest
+
+- name: Set the pathname of the build directory
+  ansible.builtin.set_fact:
+    nfstest_build_dir: "{{ data_path }}/nfstest"
+  tags: nfstest
+
+- name: Remove existing nfstest build directory
+  become: true
+  become_flags: 'su - -c'
+  become_method: ansible.builtin.sudo
+  ansible.builtin.file:
+    path: "{{ nfstest_build_dir }}"
+    state: absent
+  tags: nfstest
+
+- name: Set the name of the NFS export for the test group
+  ansible.builtin.set_fact:
+    nfstest_nfs_server_export: "nfstest-{{ ansible_host }}"
+  when:
+    - nfstest_nfs_use_kdevops_nfsd|bool
+  tags: vars
+
+- name: Create the NFS export on the kdevops NFS server
+  ansible.builtin.include_role:
+    name: nfsd_add_export
+  vars: # noqa: var-naming[no-role-prefix]
+    server_host: "{{ nfstest_nfs_server_host }}"
+    export_volname: "{{ nfstest_nfs_server_export }}"
+    export_options: "{{ nfsd_export_options }}"
+    export_fstype: "{{ nfsd_export_fstype }}"
+    export_size: 10g
+  when:
+    - nfstest_nfs_use_kdevops_nfsd|bool
+  tags: nfstest
+
+- name: Create the test mount point on the target node
+  become: true
+  become_flags: 'su - -c'
+  become_method: ansible.builtin.sudo
+  ansible.builtin.file:
+    state: directory
+    path: "{{ nfstest_mnt }}"
+    owner: "root"
+    group: "root"
+    mode: "u=rwx,g=rwx,o=rwx"
+  tags: nfstest
+
+- name: Clone the nfstest source code from {{ nfstest_repo }}
+  ansible.builtin.git:
+    repo: "{{ nfstest_repo }}"
+    dest: "{{ nfstest_build_dir }}"
+    version: "{{ nfstest_repo_commit }}"
+    update: true
+  retries: 3
+  delay: 5

playbooks/roles/nfstest/tasks/main.yml line 112

Quoted 10 lines
playbooks/roles/nfstest/tasks/main.yml new file +10 -0
+  register: clone_result
+  until: not clone_result.failed
+  tags: nfstest
+
+- name: Build the nfstest suite on the target node(s)
+# noqa: command-instead-of-shell
+  environment:
+    PYTHONPATH: "{{ nfstest_build_dir }}"
+  ansible.builtin.shell:
+    cmd: "python setup.py build"

I'm getting this on Fedora:

---8<---

fatal: [fedora-nfstest-alloc]: FAILED! => {
    "changed": true,
    "cmd": "python setup.py build",
    "delta": "0:00:00.009209",
    "end": "2024-04-12 15:24:44.157946",
    "failed_when_result": true,
    "rc": 127,
    "start": "2024-04-12 15:24:44.148737"
}

STDERR:

/bin/sh: line 1: python: command not found

MSG:

non-zero return code
---8<---

I think you probably want to add python-unversioned-command to the list of nfstest_packages.

-Scott

Quoted 228 lines
playbooks/roles/nfstest/tasks/main.yml new file +75 -0
+    chdir: "{{ nfstest_build_dir }}"
+  register: build_result
+  failed_when: build_result.rc != 0
+  changed_when: true
+  tags: nfstest
+
+- name: Install the nfstest suite on the target node(s)
+  become: true
+  become_flags: 'su - -c'
+  become_method: ansible.builtin.sudo
+  ansible.builtin.command:
+    cmd: "pip install ."
+    chdir: "{{ nfstest_build_dir }}"
+  register: install_result
+  failed_when: install_result.rc != 0
+  changed_when: true
+  tags: nfstest
+
+- name: Set the test group for the target node
+  ansible.builtin.set_fact:
+    nfstest_test_group: "{{ ansible_host | regex_replace(kdevops_host_prefix + '-') | regex_replace('-dev') }}"
+  when:
+    - kdevops_workflows_dedicated_workflow|bool
+  tags:
+    - run_tests
+    - copy_results
+
+- name: Run the selected test group
+  ansible.builtin.include_role:
+    name: nfstest
+    tasks_from: "{{ nfstest_test_group }}/main.yml"
+  when:
+    - kdevops_workflows_dedicated_workflow|bool
+  tags: run_tests
+
+- name: Set the pathname of the results directory
+  ansible.builtin.set_fact:
+    nfstest_results_dir: "../workflows/nfstest/results/{{ ansible_kernel }}"
+  when:
+    - kdevops_workflows_dedicated_workflow|bool
+  tags: copy_results
+
+- name: Create the results directory on the control node
+  ansible.builtin.file:
+    path: "{{ nfstest_results_dir }}"
+    state: directory
+    mode: "u=rwx,g=rx,o=rx"
+  delegate_to: localhost
+  when:
+    - kdevops_workflows_dedicated_workflow|bool
+  tags: copy_results
+
+- name: Look for output logs on the target node
+  ansible.builtin.find:
+    paths: "/tmp"
+    patterns: "nfstest*.log"
+    file_type: file
+  register: nfstest_logs
+  when:
+    - kdevops_workflows_dedicated_workflow|bool
+  tags: copy_results
+
+- name: Copy the output logs to the control node
+  ansible.builtin.fetch:
+    src: "{{ item.path }}"
+    dest: "{{ nfstest_results_dir }}/{{ nfstest_test_group }}/"
+    flat: true
+  with_items: "{{ nfstest_logs.files }}"
+  loop_control:
+    label: "Copying {{ item.path | basename }} ..."
+  when:
+    - nfstest_logs.matched > 0
+    - kdevops_workflows_dedicated_workflow|bool
+  changed_when: false
+  tags: copy_results
playbooks/roles/nfstest/tasks/posix/main.yml new file +56 -0
new file mode 100644
index 000000000000..6dd2c4e0b022
@@ -0,0 +1,56 @@
+---
+- name: Run nfstest_posix for NFSv3
+  ansible.builtin.command:
+    argv:
+      - "nfstest_posix"
+      - "--createlog"
+      - "--nfsversion=3"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: posix_nfsv3_results
+  changed_when: false
+  failed_when: posix_nfsv3_results.rc != 0 and posix_nfsv3_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_posix for NFSv4.0
+  ansible.builtin.command:
+    argv:
+      - "nfstest_posix"
+      - "--createlog"
+      - "--nfsversion=4.0"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: posix_nfsv40_results
+  changed_when: false
+  failed_when: posix_nfsv40_results.rc != 0 and posix_nfsv40_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_posix for NFSv4.1
+  ansible.builtin.command:
+    argv:
+      - "nfstest_posix"
+      - "--createlog"
+      - "--nfsversion=4.1"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: posix_nfsv41_results
+  changed_when: false
+  failed_when: posix_nfsv41_results.rc != 0 and posix_nfsv41_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_posix for NFSv4.2
+  ansible.builtin.command:
+    argv:
+      - "nfstest_posix"
+      - "--createlog"
+      - "--nfsversion=4.2"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: posix_nfsv42_results
+  changed_when: false
+  failed_when: posix_nfsv42_results.rc != 0 and posix_nfsv42_results.rc != 1
+  tags: run_tests
playbooks/roles/nfstest/tasks/sparse/main.yml new file +14 -0
new file mode 100644
index 000000000000..6defab5311f7
@@ -0,0 +1,14 @@
+---
+- name: Run nfstest_sparse for NFSv4.2
+  ansible.builtin.command:
+    argv:
+      - "nfstest_sparse"
+      - "--createlog"
+      - "--nfsversion=4.2"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: sparse_nfsv42_results
+  changed_when: false
+  failed_when: sparse_nfsv42_results.rc != 0 and sparse_nfsv42_results.rc != 1
+  tags: run_tests
playbooks/roles/nfstest/tasks/ssc/main.yml new file +28 -0
new file mode 100644
index 000000000000..b8e01345c032
@@ -0,0 +1,28 @@
+---
+- name: Run nfstest_ssc intra tests for NFSv4.2
+  ansible.builtin.command:
+    argv:
+      - "nfstest_ssc"
+      - "--createlog"
+      - "--nfsversion=4.2"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=intra"
+  register: ssc_nfsv42_intra_results
+  changed_when: false
+  failed_when: ssc_nfsv42_intra_results.rc != 0 and ssc_nfsv42_intra_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_ssc inter tests for NFSv4.2
+  ansible.builtin.command:
+    argv:
+      - "nfstest_ssc"
+      - "--createlog"
+      - "--nfsversion=4.2"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=inter"
+  register: ssc_nfsv42_inter_results
+  changed_when: false
+  failed_when: ssc_nfsv42_inter_results.rc != 0 and ssc_nfsv42_inter_results.rc != 1
+  tags: run_tests
playbooks/roles/nfstest/vars/Debian.yml new file +5 -0
new file mode 100644
index 000000000000..3acf39071fd3
@@ -0,0 +1,5 @@
+---
+nfstest_packages:
+  - nfs-common
+  - python3-pip
+  - tcpdump
playbooks/roles/nfstest/vars/RedHat.yml new file +5 -0
new file mode 100644
index 000000000000..4fdee14f2b1f
@@ -0,0 +1,5 @@
+---
+nfstest_packages:
+  - nfs-utils
+  - python3-pip
+  - tcpdump
playbooks/roles/nfstest/vars/Suse.yml new file +5 -0
new file mode 100644
index 000000000000..4fdee14f2b1f
@@ -0,0 +1,5 @@
+---
+nfstest_packages:
+  - nfs-utils
+  - python3-pip
+  - tcpdump
Signature · 1 line
2.44.0
#10 lore raw

Re: [PATCH 4/4] roles: Add a playbook to run the nfstest suite

Quoted 384 lines · Scott Mayhew
Quoted 349 lines · On Wed, 10 Apr 2024, [email protected] wrote:

From: Chuck Lever <[email protected]>

Note that in dedicated workflow mode, each test group has its own set of tasks. The main nfstest role selects the task set to run based on the hostname of the target node.

The nfstest role uses the "free" lock-step strategy so that each target node can get through its tests while the others are running their own tasks. Another possibility that is more natural to Ansible would be to set up a group for each nfstest test group.

---

playbooks/nfstest.yml                         |   5 +
playbooks/roles/nfstest/defaults/main.yml     |   5 +
playbooks/roles/nfstest/tasks/alloc/main.yml  |  14 ++
playbooks/roles/nfstest/tasks/dio/main.yml    |  28 +++
.../roles/nfstest/tasks/interop/main.yml      |  56 ++++++
playbooks/roles/nfstest/tasks/lock/main.yml   |  56 ++++++
playbooks/roles/nfstest/tasks/main.yml        | 187 ++++++++++++++++++
playbooks/roles/nfstest/tasks/posix/main.yml  |  56 ++++++
playbooks/roles/nfstest/tasks/sparse/main.yml |  14 ++
playbooks/roles/nfstest/tasks/ssc/main.yml    |  28 +++
playbooks/roles/nfstest/vars/Debian.yml       |   5 +
playbooks/roles/nfstest/vars/RedHat.yml       |   5 +
playbooks/roles/nfstest/vars/Suse.yml         |   5 +
13 files changed, 464 insertions(+)

create mode 100644 playbooks/nfstest.yml
create mode 100644 playbooks/roles/nfstest/defaults/main.yml create mode 100644 playbooks/roles/nfstest/tasks/alloc/main.yml create mode 100644 playbooks/roles/nfstest/tasks/dio/main.yml create mode 100644 playbooks/roles/nfstest/tasks/interop/main.yml create mode 100644 playbooks/roles/nfstest/tasks/lock/main.yml create mode 100644 playbooks/roles/nfstest/tasks/main.yml create mode 100644 playbooks/roles/nfstest/tasks/posix/main.yml create mode 100644 playbooks/roles/nfstest/tasks/sparse/main.yml create mode 100644 playbooks/roles/nfstest/tasks/ssc/main.yml create mode 100644 playbooks/roles/nfstest/vars/Debian.yml create mode 100644 playbooks/roles/nfstest/vars/RedHat.yml create mode 100644 playbooks/roles/nfstest/vars/Suse.yml

playbooks/nfstest.yml new file +5 -0
new file mode 100644
index 000000000000..9d7c28a75843
@@ -0,0 +1,5 @@
+---
+- hosts: all
+  strategy: free
+  roles:
+    - role: nfstest
playbooks/roles/nfstest/defaults/main.yml new file +5 -0
new file mode 100644
index 000000000000..0d4060b5c76e
@@ -0,0 +1,5 @@
+---
+# Our sensible defaults for the nfstest role.
+#
+kdevops_run_nfstest: False
+kdevops_workflows_dedicated_workflow: false
playbooks/roles/nfstest/tasks/alloc/main.yml new file +14 -0
new file mode 100644
index 000000000000..2c4d750388f2
@@ -0,0 +1,14 @@
+---
+- name: Run nfstest_alloc for NFSv4.2
+  ansible.builtin.command:
+    argv:
+      - "nfstest_alloc"
+      - "--createlog"
+      - "--nfsversion=4.2"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: alloc_nfsv42_results
+  changed_when: false
+  failed_when: alloc_nfsv42_results.rc != 0 and alloc_nfsv42_results.rc != 1
+  tags: run_tests
playbooks/roles/nfstest/tasks/dio/main.yml new file +28 -0
new file mode 100644
index 000000000000..705403a93da1
@@ -0,0 +1,28 @@
+---
+- name: Run nfstest_dio for NFSv4.0
+  ansible.builtin.command:
+    argv:
+      - "nfstest_dio"
+      - "--createlog"
+      - "--nfsversion=4.0"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: dio_nfsv40_results
+  changed_when: false
+  failed_when: dio_nfsv40_results.rc != 0 and dio_nfsv40_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_dio for NFSv4.1
+  ansible.builtin.command:
+    argv:
+      - "nfstest_dio"
+      - "--createlog"
+      - "--nfsversion=4.1"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: dio_nfsv41_results
+  changed_when: false
+  failed_when: dio_nfsv41_results.rc != 0 and dio_nfsv41_results.rc != 1
+  tags: run_tests
playbooks/roles/nfstest/tasks/interop/main.yml new file +56 -0
new file mode 100644
index 000000000000..b35e9c9607fe
@@ -0,0 +1,56 @@
+---
+- name: Run nfstest_interop for NFSv3
+  ansible.builtin.command:
+    argv:
+      - "nfstest_interop"
+      - "--createlog"
+      - "--nfsversion=3"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: interop_nfsv3_results
+  changed_when: false
+  failed_when: interop_nfsv3_results.rc != 0 and interop_nfsv3_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_interop for NFSv4.0
+  ansible.builtin.command:
+    argv:
+      - "nfstest_interop"
+      - "--createlog"
+      - "--nfsversion=4.0"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: interop_nfsv40_results
+  changed_when: false
+  failed_when: interop_nfsv40_results.rc != 0 and interop_nfsv40_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_interop for NFSv4.1
+  ansible.builtin.command:
+    argv:
+      - "nfstest_interop"
+      - "--createlog"
+      - "--nfsversion=4.1"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: interop_nfsv41_results
+  changed_when: false
+  failed_when: interop_nfsv41_results.rc != 0 and interop_nfsv41_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_interop for NFSv4.2
+  ansible.builtin.command:
+    argv:
+      - "nfstest_interop"
+      - "--createlog"
+      - "--nfsversion=4.2"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: interop_nfsv42_results
+  changed_when: false
+  failed_when: interop_nfsv42_results.rc != 0 and interop_nfsv42_results.rc != 1
+  tags: run_tests
playbooks/roles/nfstest/tasks/lock/main.yml new file +56 -0
new file mode 100644
index 000000000000..b658edf965ed
@@ -0,0 +1,56 @@
+---
+- name: Run nfstest_lock for NFSv3
+  ansible.builtin.command:
+    argv:
+      - "nfstest_lock"
+      - "--createlog"
+      - "--nfsversion=3"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: lock_nfsv3_results
+  changed_when: false
+  failed_when: lock_nfsv3_results.rc != 0 and lock_nfsv3_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_lock for NFSv4.0
+  ansible.builtin.command:
+    argv:
+      - "nfstest_lock"
+      - "--createlog"
+      - "--nfsversion=4.0"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: lock_nfsv40_results
+  changed_when: false
+  failed_when: lock_nfsv40_results.rc != 0 and lock_nfsv40_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_lock for NFSv4.1
+  ansible.builtin.command:
+    argv:
+      - "nfstest_lock"
+      - "--createlog"
+      - "--nfsversion=4.1"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: lock_nfsv41_results
+  changed_when: false
+  failed_when: lock_nfsv41_results.rc != 0 and lock_nfsv41_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_lock for NFSv4.2
+  ansible.builtin.command:
+    argv:
+      - "nfstest_lock"
+      - "--createlog"
+      - "--nfsversion=4.2"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: lock_nfsv42_results
+  changed_when: false
+  failed_when: lock_nfsv42_results.rc != 0 and lock_nfsv42_results.rc != 1
+  tags: run_tests
playbooks/roles/nfstest/tasks/main.yml new file +102 -0
new file mode 100644
index 000000000000..6f660c332a75
@@ -0,0 +1,187 @@
+---
+- name: Import optional extra_vars file
+  ansible.builtin.include_vars:
+    file: "{{ item }}"
+  with_first_found:
+    - files:
+        - "../extra_vars.yml"
+        - "../extra_vars.yaml"
+        - "../extra_vars.json"
+      skip: true
+  failed_when: false
+  tags: vars
+
+- name: Set OS-specific variables
+  ansible.builtin.include_vars: "{{ lookup('ansible.builtin.first_found', params) }}"
+  vars:
+    params:
+      files:
+        - '{{ ansible_distribution }}.yml'
+        - '{{ ansible_os_family }}.yml'
+        - default.yml
+      paths:
+        - 'vars'
+
+- name: Install dependencies for nfstest
+  become: true
+  become_flags: 'su - -c'
+  become_method: ansible.builtin.sudo
+  ansible.builtin.package:
+    name: "{{ nfstest_packages }}"
+    state: present
+  tags: nfstest
+
+# I wish this worked.
+# - name: Install or update pip
+#   become: true
+#   community.general.easy_install:
+#     name: pip
+#     state: latest
+#   tags: nfstest
+
+- name: Create the /data mount point on the target nodes
+  ansible.builtin.include_role:
+    name: create_data_partition
+  tags:
+    - data_partition
+    - nfstest
+
+- name: Set the pathname of the build directory
+  ansible.builtin.set_fact:
+    nfstest_build_dir: "{{ data_path }}/nfstest"
+  tags: nfstest
+
+- name: Remove existing nfstest build directory
+  become: true
+  become_flags: 'su - -c'
+  become_method: ansible.builtin.sudo
+  ansible.builtin.file:
+    path: "{{ nfstest_build_dir }}"
+    state: absent
+  tags: nfstest
+
+- name: Set the name of the NFS export for the test group
+  ansible.builtin.set_fact:
+    nfstest_nfs_server_export: "nfstest-{{ ansible_host }}"
+  when:
+    - nfstest_nfs_use_kdevops_nfsd|bool
+  tags: vars
+
+- name: Create the NFS export on the kdevops NFS server
+  ansible.builtin.include_role:
+    name: nfsd_add_export
+  vars: # noqa: var-naming[no-role-prefix]
+    server_host: "{{ nfstest_nfs_server_host }}"
+    export_volname: "{{ nfstest_nfs_server_export }}"
+    export_options: "{{ nfsd_export_options }}"
+    export_fstype: "{{ nfsd_export_fstype }}"
+    export_size: 10g
+  when:
+    - nfstest_nfs_use_kdevops_nfsd|bool
+  tags: nfstest
+
+- name: Create the test mount point on the target node
+  become: true
+  become_flags: 'su - -c'
+  become_method: ansible.builtin.sudo
+  ansible.builtin.file:
+    state: directory
+    path: "{{ nfstest_mnt }}"
+    owner: "root"
+    group: "root"
+    mode: "u=rwx,g=rwx,o=rwx"
+  tags: nfstest
+
+- name: Clone the nfstest source code from {{ nfstest_repo }}
+  ansible.builtin.git:
+    repo: "{{ nfstest_repo }}"
+    dest: "{{ nfstest_build_dir }}"
+    version: "{{ nfstest_repo_commit }}"
+    update: true
+  retries: 3
+  delay: 5

playbooks/roles/nfstest/tasks/main.yml line 112

Quoted 10 lines
playbooks/roles/nfstest/tasks/main.yml new file +10 -0
+  register: clone_result
+  until: not clone_result.failed
+  tags: nfstest
+
+- name: Build the nfstest suite on the target node(s)
+# noqa: command-instead-of-shell
+  environment:
+    PYTHONPATH: "{{ nfstest_build_dir }}"
+  ansible.builtin.shell:
+    cmd: "python setup.py build"

I'm getting this on Fedora:

---8<---

fatal: [fedora-nfstest-alloc]: FAILED! => {
   "changed": true,
   "cmd": "python setup.py build",
   "delta": "0:00:00.009209",
   "end": "2024-04-12 15:24:44.157946",
   "failed_when_result": true,
   "rc": 127,
   "start": "2024-04-12 15:24:44.148737"
}

STDERR:

/bin/sh: line 1: python: command not found

Quoted 7 lines

MSG:

non-zero return code
---8<---

I think you probably want to add python-unversioned-command to the list of nfstest_packages.

Haven't seen that, and I'm testing on Fedora 39. I can add that, though.

Quoted 220 lines

-Scott

Quoted 218 lines
playbooks/roles/nfstest/tasks/main.yml new file +75 -0
+    chdir: "{{ nfstest_build_dir }}"
+  register: build_result
+  failed_when: build_result.rc != 0
+  changed_when: true
+  tags: nfstest
+
+- name: Install the nfstest suite on the target node(s)
+  become: true
+  become_flags: 'su - -c'
+  become_method: ansible.builtin.sudo
+  ansible.builtin.command:
+    cmd: "pip install ."
+    chdir: "{{ nfstest_build_dir }}"
+  register: install_result
+  failed_when: install_result.rc != 0
+  changed_when: true
+  tags: nfstest
+
+- name: Set the test group for the target node
+  ansible.builtin.set_fact:
+    nfstest_test_group: "{{ ansible_host | regex_replace(kdevops_host_prefix + '-') | regex_replace('-dev') }}"
+  when:
+    - kdevops_workflows_dedicated_workflow|bool
+  tags:
+    - run_tests
+    - copy_results
+
+- name: Run the selected test group
+  ansible.builtin.include_role:
+    name: nfstest
+    tasks_from: "{{ nfstest_test_group }}/main.yml"
+  when:
+    - kdevops_workflows_dedicated_workflow|bool
+  tags: run_tests
+
+- name: Set the pathname of the results directory
+  ansible.builtin.set_fact:
+    nfstest_results_dir: "../workflows/nfstest/results/{{ ansible_kernel }}"
+  when:
+    - kdevops_workflows_dedicated_workflow|bool
+  tags: copy_results
+
+- name: Create the results directory on the control node
+  ansible.builtin.file:
+    path: "{{ nfstest_results_dir }}"
+    state: directory
+    mode: "u=rwx,g=rx,o=rx"
+  delegate_to: localhost
+  when:
+    - kdevops_workflows_dedicated_workflow|bool
+  tags: copy_results
+
+- name: Look for output logs on the target node
+  ansible.builtin.find:
+    paths: "/tmp"
+    patterns: "nfstest*.log"
+    file_type: file
+  register: nfstest_logs
+  when:
+    - kdevops_workflows_dedicated_workflow|bool
+  tags: copy_results
+
+- name: Copy the output logs to the control node
+  ansible.builtin.fetch:
+    src: "{{ item.path }}"
+    dest: "{{ nfstest_results_dir }}/{{ nfstest_test_group }}/"
+    flat: true
+  with_items: "{{ nfstest_logs.files }}"
+  loop_control:
+    label: "Copying {{ item.path | basename }} ..."
+  when:
+    - nfstest_logs.matched > 0
+    - kdevops_workflows_dedicated_workflow|bool
+  changed_when: false
+  tags: copy_results
playbooks/roles/nfstest/tasks/posix/main.yml new file +56 -0
new file mode 100644
index 000000000000..6dd2c4e0b022
@@ -0,0 +1,56 @@
+---
+- name: Run nfstest_posix for NFSv3
+  ansible.builtin.command:
+    argv:
+      - "nfstest_posix"
+      - "--createlog"
+      - "--nfsversion=3"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: posix_nfsv3_results
+  changed_when: false
+  failed_when: posix_nfsv3_results.rc != 0 and posix_nfsv3_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_posix for NFSv4.0
+  ansible.builtin.command:
+    argv:
+      - "nfstest_posix"
+      - "--createlog"
+      - "--nfsversion=4.0"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: posix_nfsv40_results
+  changed_when: false
+  failed_when: posix_nfsv40_results.rc != 0 and posix_nfsv40_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_posix for NFSv4.1
+  ansible.builtin.command:
+    argv:
+      - "nfstest_posix"
+      - "--createlog"
+      - "--nfsversion=4.1"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: posix_nfsv41_results
+  changed_when: false
+  failed_when: posix_nfsv41_results.rc != 0 and posix_nfsv41_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_posix for NFSv4.2
+  ansible.builtin.command:
+    argv:
+      - "nfstest_posix"
+      - "--createlog"
+      - "--nfsversion=4.2"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: posix_nfsv42_results
+  changed_when: false
+  failed_when: posix_nfsv42_results.rc != 0 and posix_nfsv42_results.rc != 1
+  tags: run_tests
playbooks/roles/nfstest/tasks/sparse/main.yml new file +14 -0
new file mode 100644
index 000000000000..6defab5311f7
@@ -0,0 +1,14 @@
+---
+- name: Run nfstest_sparse for NFSv4.2
+  ansible.builtin.command:
+    argv:
+      - "nfstest_sparse"
+      - "--createlog"
+      - "--nfsversion=4.2"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=all"
+  register: sparse_nfsv42_results
+  changed_when: false
+  failed_when: sparse_nfsv42_results.rc != 0 and sparse_nfsv42_results.rc != 1
+  tags: run_tests
playbooks/roles/nfstest/tasks/ssc/main.yml new file +28 -0
new file mode 100644
index 000000000000..b8e01345c032
@@ -0,0 +1,28 @@
+---
+- name: Run nfstest_ssc intra tests for NFSv4.2
+  ansible.builtin.command:
+    argv:
+      - "nfstest_ssc"
+      - "--createlog"
+      - "--nfsversion=4.2"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=intra"
+  register: ssc_nfsv42_intra_results
+  changed_when: false
+  failed_when: ssc_nfsv42_intra_results.rc != 0 and ssc_nfsv42_intra_results.rc != 1
+  tags: run_tests
+
+- name: Run nfstest_ssc inter tests for NFSv4.2
+  ansible.builtin.command:
+    argv:
+      - "nfstest_ssc"
+      - "--createlog"
+      - "--nfsversion=4.2"
+      - "--server={{ nfstest_nfs_server_host }}"
+      - "--export=/export/{{ nfstest_nfs_server_export }}"
+      - "--runtest=inter"
+  register: ssc_nfsv42_inter_results
+  changed_when: false
+  failed_when: ssc_nfsv42_inter_results.rc != 0 and ssc_nfsv42_inter_results.rc != 1
+  tags: run_tests
playbooks/roles/nfstest/vars/Debian.yml new file +5 -0
new file mode 100644
index 000000000000..3acf39071fd3
@@ -0,0 +1,5 @@
+---
+nfstest_packages:
+  - nfs-common
+  - python3-pip
+  - tcpdump
playbooks/roles/nfstest/vars/RedHat.yml new file +5 -0
new file mode 100644
index 000000000000..4fdee14f2b1f
@@ -0,0 +1,5 @@
+---
+nfstest_packages:
+  - nfs-utils
+  - python3-pip
+  - tcpdump
playbooks/roles/nfstest/vars/Suse.yml new file +0 -0
new file mode 100644
index 000000000000..4fdee14f2b1f
Quoted 8 lines
Quoted 8 lines
playbooks/roles/nfstest/vars/Suse.yml new file +5 -0
@@ -0,0 +1,5 @@
+---
+nfstest_packages:
+  - nfs-utils
+  - python3-pip
+  - tcpdump
Signature · 1 line
2.44.0

--
Chuck Lever

#11 lore raw
In reply to [email protected]
Quoted 15 lines · On Wed, Apr 10, 2024 at 10:50:48AM -0400, [email protected] wrote:

From: Chuck Lever <[email protected]>

The nfstest suite is a detailed test of NFS functionality for NFS versions 3 and newer, including delegation, attribute cache consistency, sparse files, and server-to-server copy offload.

When configured in dedicated mode, each nfstest suite is run in a separate target node to achieve good parallelism. You can select specific test groups to run via Kconfig options.

This commit introduces the workflow's documentation and Kconfig apparatus to show how this workflow can be configured. Following commits will bring in the kdevops components to get the workflow working.

Quoted 6 lines

The careful reader will note that not every nfstest group is available here. Three groups require the use of a second client, and I haven't figured out how that needs to work. For now, those groups are not included in this series.

Er.

So I'm migrating from (Python-based) stgit 1.5 to (Rust-based) stgit 2.4. The latter uses an email workflow that is a thin shim over "git send-email" which I'm really not used to.

So this series is supposed to be an RFC, not an "I'm about to commit this sucker" series.

Basically we'd like to run Jorge's nfstest suite via a kdevops workflow as part of regular NFSD CI. There are one or two new or questionable things in here that need a smell test.

All review comments are most welcome.

Quoted 429 lines
---
 .gitignore                                    |  1 +
 README.md                                     | 12 ++-
 docs/nfstest.md                               | 21 ++++
 kconfigs/workflows/Kconfig                    | 25 +++++
 scripts/workflows/nfstest/run_kernel_ci.sh    |  1 +
 .../workflows/nfstest/run_kernel_ci_kotd.sh   |  1 +
 scripts/workflows/nfstest/run_loop.sh         | 58 +++++++++++
 workflows/Makefile                            |  5 +
 workflows/nfstest/Kconfig                     | 87 ++++++++++++++++
 workflows/nfstest/Makefile                    | 99 +++++++++++++++++++
 10 files changed, 309 insertions(+), 1 deletion(-)
 create mode 100644 docs/nfstest.md
 create mode 120000 scripts/workflows/nfstest/run_kernel_ci.sh
 create mode 120000 scripts/workflows/nfstest/run_kernel_ci_kotd.sh
 create mode 100755 scripts/workflows/nfstest/run_loop.sh
 create mode 100644 workflows/nfstest/Kconfig
 create mode 100644 workflows/nfstest/Makefile
.gitignore +1 -0
index 5cb41682dd45..3a1ecd48d84f 100644
@@ -62,6 +62,7 @@ workflows/demos/reboot-limit/results/
 
 workflows/gitr/results/
 workflows/ltp/results/
+workflows/nfstest/results/
 
 playbooks/roles/linux-mirror/linux-mirror-systemd/mirrors.yaml
 # We should strive to ignore all and port them to the new mirrors.yaml
README.md +11 -1
index 96e048bc8405..ea6b41004767 100644
@@ -135,7 +135,17 @@ To test a kernel using the ltp suite, enable the ltp workflow and then run:
   * `make ltp`
   * `make ltp-baseline`
 
-For more details see [kdevops gitr docs](docs/gitr.md)
+For more details see [kdevops ltp docs](docs/ltp.md)
+
+### Start running the nfstest suite in 2 commands
+
+To test a kernel using the nfstest suite, enable the nfstest workflow and
+then run:
+
+  * `make nfstest`
+  * `make nfstest-baseline`
+
+For more details see [kdevops nfstest docs](docs/nfstest.md)
 
 ### Runs some kernel selftests in a parallel manner
 
docs/nfstest.md new file +21 -0
new file mode 100644
index 000000000000..b358389c2571
@@ -0,0 +1,21 @@
+# kdevops nfstest suite
+
+kdevops can run Jorge Mora's nfstest suite against an NFS server.
+
+Run `make menuconfig` and select:
+
+  Target workflows -> Dedicated target Linux test workflow ->nfstest
+
+Then configure the test parameters by going to:
+
+  Target workflows -> Configure and run the nfstest suite
+
+Choose the location of the repo that contains the version of nfstest
+you want to use for the test.
+
+Then, run:
+
+  * `make`
+  * `make bringup`
+  * `make nfstest`
+  * `make nfstest-baseline`
kconfigs/workflows/Kconfig +25 -0
index ff6372b7e98f..2fd5bf31347f 100644
@@ -166,6 +166,13 @@ config KDEVOPS_WORKFLOW_DEDICATE_LTP
 	  This will dedicate your configuration to running only the
 	  ltp workflow in separate target nodes per testing group.
 
+config KDEVOPS_WORKFLOW_DEDICATE_NFSTEST
+	bool "nfstest"
+	select KDEVOPS_WORKFLOW_ENABLE_NFSTEST
+	help
+	  This will dedicate your configuration to running only the
+	  nfstest workflow in separate target nodes per testing group.
+
 endchoice
 
 endif
@@ -239,6 +246,14 @@ config KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_LTP
 	  Select this option if you want to provision ltp on a single
 	  target node for by-hand testing.
 
+config KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_NFSTEST
+	bool "nfstest"
+	select KDEVOPS_WORKFLOW_ENABLE_NFSTEST
+	depends on LIBVIRT || TERRAFORM_PRIVATE_NET
+	help
+	  Select this option if you want to provision nfstest on a
+	  single target node for by-hand testing.
+
 endif # !WORKFLOWS_DEDICATED_WORKFLOW
 
 config KDEVOPS_WORKFLOW_ENABLE_FSTESTS
@@ -312,6 +327,16 @@ source "workflows/ltp/Kconfig"
 endmenu
 endif # KDEVOPS_WORKFLOW_ENABLE_GITR
 
+config KDEVOPS_WORKFLOW_ENABLE_NFSTEST
+	bool
+	default y if KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_NFSTEST || KDEVOPS_WORKFLOW_DEDICATE_NFSTEST
+
+if KDEVOPS_WORKFLOW_ENABLE_NFSTEST
+menu "Configure and run the nfstest suite"
+source "workflows/nfstest/Kconfig"
+endmenu
+endif # KDEVOPS_WORKFLOW_ENABLE_NFSTEST
+
 config KDEVOPS_WORKFLOW_GIT_CLONES_KDEVOPS_GIT
 	bool
 	default y if KDEVOPS_WORKFLOW_ENABLE_FSTESTS || KDEVOPS_WORKFLOW_ENABLE_BLKTESTS
scripts/workflows/nfstest/run_kernel_ci.sh new file +1 -0
new file mode 120000
index 000000000000..4fd5dc5e8e13
@@ -0,0 +1 @@
+../generic/run_kernel_ci.sh
\ No newline at end of file
scripts/workflows/nfstest/run_kernel_ci_kotd.sh new file +1 -0
new file mode 120000
index 000000000000..8f94d6ba4f52
@@ -0,0 +1 @@
+../kotd/run_kernel_ci_kotd.sh
\ No newline at end of file
scripts/workflows/nfstest/run_loop.sh new file +58 -0
new file mode 100755
index 000000000000..22f80ca4e04a
@@ -0,0 +1,58 @@
+#!/bin/bash
+# SPDX-License-Identifier: copyleft-next-0.3.1
+
+# Part of kdevops kernel-ci, this is the script which will run the test workflow
+# as many times as indicated up to CONFIG_KERNEL_CI_STEADY_STATE_GOAL
+
+source ${TOPDIR}/.config
+source ${TOPDIR}/scripts/lib.sh
+
+WORKFLOWDIR=${TOPDIR}/workflows/nfstest
+
+COUNT=1
+
+run_loop()
+{
+	while true; do
+		echo "== kernel-ci nfstest test loop $COUNT start: $(date)" > $KERNEL_CI_FAIL_LOG
+		echo "/usr/bin/time -f %E make nfstest-baseline" >> $KERNEL_CI_FAIL_LOG
+		/usr/bin/time -p -o $KERNEL_CI_LOGTIME make nfstest-baseline >> $KERNEL_CI_FAIL_LOG
+		ANSIBLE_CALL_RET=$?
+		echo "End   $COUNT: $(date)" >> $KERNEL_CI_FAIL_LOG
+		cat $KERNEL_CI_LOGTIME >> $KERNEL_CI_FAIL_LOG
+		echo "git status:" >> $KERNEL_CI_FAIL_LOG
+		git status >> $KERNEL_CI_FAIL_LOG
+		echo "Results:" >> $KERNEL_CI_FAIL_LOG
+
+		rm -f $KERNEL_CI_DIFF_LOG
+
+		if [[ "$ANSIBLE_CALL_RET" -ne 0 ]]; then
+			echo "Test  $COUNT: FAILED!" >> $KERNEL_CI_DIFF_LOG
+			echo "== Test loop count $COUNT" >> $KERNEL_CI_DIFF_LOG
+			echo "$(git describe)" >> $KERNEL_CI_DIFF_LOG
+			git diff >> $KERNEL_CI_DIFF_LOG
+			cat $KERNEL_CI_DIFF_LOG >> $KERNEL_CI_FAIL_LOG
+			cat $KERNEL_CI_FAIL_LOG >> $KERNEL_CI_FULL_LOG
+			echo $COUNT > $KERNEL_CI_FAIL_FILE
+			exit 1
+		else
+			echo "Test  $COUNT: OK!" >> $KERNEL_CI_FAIL_LOG
+			echo "----------------------------------------------------------------" >> $KERNEL_CI_FAIL_LOG
+			cat $KERNEL_CI_FAIL_LOG >> $KERNEL_CI_FULL_LOG
+		fi
+
+		# This let's us keep track of which loop count was last successful
+		echo $COUNT > $KERNEL_CI_OK_FILE
+
+		let COUNT=$COUNT+1
+		if [[ "$CONFIG_KERNEL_CI_ENABLE_STEADY_STATE" == "y" &&
+		      "$COUNT" -gt "$CONFIG_KERNEL_CI_STEADY_STATE_GOAL" ]]; then
+			exit 0
+		fi
+		sleep 1
+	done
+}
+
+rm -f $KERNEL_CI_FAIL_FILE $KERNEL_CI_OK_FILE
+echo "= kernel-ci full log" > $KERNEL_CI_FULL_LOG
+run_loop
workflows/Makefile +5 -0
index 7e3e5e351a49..e305f2629abf 100644
@@ -53,6 +53,11 @@ WORKFLOW_ARGS += kdevops_workflow_enable_ltp='True'
 include workflows/ltp/Makefile
 endif # CONFIG_KDEVOPS_WORKFLOW_ENABLE_LTP == y
 
+ifeq (y,$(CONFIG_KDEVOPS_WORKFLOW_ENABLE_NFSTEST))
+WORKFLOW_ARGS += kdevops_workflow_enable_nfstest='True'
+include workflows/nfstest/Makefile
+endif # CONFIG_KDEVOPS_WORKFLOW_ENABLE_NFSTEST == y
+
 ANSIBLE_EXTRA_ARGS += $(WORKFLOW_ARGS)
 ANSIBLE_EXTRA_ARGS_SEPARATED += $(WORKFLOW_ARGS_SEPARATED)
 ANSIBLE_EXTRA_ARGS_DIRECT += $(WORKFLOW_ARGS_DIRECT)
workflows/nfstest/Kconfig new file +87 -0
new file mode 100644
index 000000000000..921ce5fe0a83
@@ -0,0 +1,87 @@
+if KDEVOPS_WORKFLOW_ENABLE_NFSTEST
+
+config NFSTEST_USE_KDEVOPS_NFSD
+	bool "Provision and use the kdevops NFS server"
+	select KDEVOPS_SETUP_NFSD
+	default y
+	help
+	  Select this option to have kdevops provision an additional
+	  target node to be used as the NFS server for testing.
+
+	  Say N if you have a reachable NFS server to test against, and
+	  specify that server's hostname using the
+	  NFSTEST_NFS_SERVER_HOST option.
+
+config NFSTEST_NFS_SERVER_HOST
+	string "Test NFS Server hostname"
+	default ""
+	depends on !NFSTEST_USE_KDEVOPS_NFSD
+	help
+	  The NFS server hostname or address to test against. Tests
+	  expect that an appropriate share is already available for
+	  them to mount and use.
+
+config NFSTEST_MNT
+	string "Where clients mount the file system under test"
+	default "/mnt/t"
+	help
+	  The directory over which to mount the file system under test.
+
+config NFSTEST_REPO
+	string "The nfstest repository"
+	default "git://git.linux-nfs.org/projects/mora/nfstest.git"
+	help
+	  The nfstest repository to clone.
+
+config NFSTEST_REPO_COMMIT
+	string "The version of nfstest to check out"
+	default "v3.2"
+	help
+	  The version of nfstest to be used for the test.
+
+if KDEVOPS_WORKFLOW_DEDICATE_NFSTEST
+
+config NFSTEST_TEST_GROUP_ALLOC
+	bool "Enable the nfstest_alloc testing section"
+	default n
+	help
+	  Provision a target node to test NFSv4.2 space reservation.
+
+config NFSTEST_TEST_GROUP_DIO
+	bool "Enable the nfstest_dio testing section"
+	default n
+	help
+	  Provision target nodes to run direct I/O tests.
+
+config NFSTEST_TEST_GROUP_INTEROP
+	bool "Enable the nfstest_interop testing section"
+	default y
+	help
+	  Provision target nodes to run NFS interoperability tests.
+
+config NFSTEST_TEST_GROUP_LOCK
+	bool "Enable the nfstest_lock testing section"
+	default n
+	help
+	  Provision target nodes to test NFS file locking.
+
+config NFSTEST_TEST_GROUP_POSIX
+	bool "Enable the nfstest_posix testing section"
+	default n
+	help
+	  Provision a target node to run POSIX file access tests.
+
+config NFSTEST_TEST_GROUP_SPARSE
+	bool "Enable the nfstest_sparse testing section"
+	help
+	  Provision a target node to test support for sparse files.
+
+config NFSTEST_TEST_GROUP_SSC
+	bool "Enable the nfstest_ssc testing section"
+	help
+	  Provision target nodes to test the operation of server-side
+	  copy.
+
+endif # KDEVOPS_WORKFLOW_DEDICATE_NFSTEST
+
+endif # KDEVOPS_WORKFLOW_ENABLE_GITR
workflows/nfstest/Makefile new file +99 -0
new file mode 100644
index 000000000000..638ec1fc83dd
@@ -0,0 +1,99 @@
+ifeq (y,$(CONFIG_WORKFLOWS_DEDICATED_WORKFLOW))
+export KDEVOPS_HOSTS_TEMPLATE := nfstest.j2
+endif # CONFIG_WORKFLOWS_DEDICATED_WORKFLOW
+
+ifeq (y,$(CONFIG_NFSTEST_USE_KDEVOPS_NFSD))
+NFSTEST_ARGS += nfstest_nfs_server_host='$(subst ",,$(CONFIG_KDEVOPS_HOSTS_PREFIX))-nfsd'
+NFSTEST_ARGS += nfstest_nfs_use_kdevops_nfsd='true'
+else # CONFIG_NFSTEST_USE_KDEVOPS_NFSD
+NFSTEST_ARGS += nfstest_nfs_server_host='$(subst ",,$(CONFIG_NFSTEST_NFS_SERVER_HOSTNAME))'
+NFSTEST_ARGS += nfstest_nfs_server_export='$(subst ",,$(CONFIG_NFSTEST_NFS_SERVER_EXPORT))'
+NFSTEST_ARGS += nfstest_nfs_use_kdevops_nfsd='false'
+endif # CONFIG_NFSTEST_USE_KDEVOPS_NFSD
+
+NFSTEST_MNT:=$(subst ",,$(CONFIG_NFSTEST_MNT))
+NFSTEST_ARGS += nfstest_mnt=$(NFSTEST_MNT)
+
+NFSTEST_REPO:=$(subst ",,$(CONFIG_NFSTEST_REPO))
+NFSTEST_ARGS += nfstest_repo=$(NFSTEST_REPO)
+
+NFSTEST_REPO_COMMIT:=$(subst ",,$(CONFIG_NFSTEST_REPO_COMMIT))
+NFSTEST_ARGS += nfstest_repo_commit=$(NFSTEST_REPO_COMMIT)
+
+ifeq (y,$(CONFIG_NFSTEST_TEST_GROUP_ALLOC))
+NFSTEST_ENABLED_TEST_GROUPS += alloc
+endif
+ifeq (y,$(CONFIG_NFSTEST_TEST_GROUP_DIO))
+NFSTEST_ENABLED_TEST_GROUPS += dio
+endif
+ifeq (y,$(CONFIG_NFSTEST_TEST_GROUP_INTEROP))
+NFSTEST_ENABLED_TEST_GROUPS += interop
+endif
+ifeq (y,$(CONFIG_NFSTEST_TEST_GROUP_LOCK))
+NFSTEST_ENABLED_TEST_GROUPS += lock
+endif
+ifeq (y,$(CONFIG_NFSTEST_TEST_GROUP_POSIX))
+NFSTEST_ENABLED_TEST_GROUPS += posix
+endif
+ifeq (y,$(CONFIG_NFSTEST_TEST_GROUP_SPARSE))
+NFSTEST_ENABLED_TEST_GROUPS += sparse
+endif
+ifeq (y,$(CONFIG_NFSTEST_TEST_GROUP_SSC))
+NFSTEST_ENABLED_TEST_GROUPS += ssc
+endif
+
+WORKFLOW_ARGS += $(NFSTEST_ARGS)
+WORKFLOW_ARGS_SEPARATED += nfstest_enabled_test_groups='$(subst $(space),+,$(NFSTEST_ENABLED_TEST_GROUPS))'
+
+NFSTEST_KERNEL_CI_LOOP := false
+NFSTEST_KERNEL_CI_LOOP_KOTD := false
+
+ifeq (y,$(CONFIG_KERNEL_CI))
+NFSTEST_KERNEL_CI_LOOP      := scripts/workflows/nfstest/run_kernel_ci.sh
+NFSTEST_KERNEL_CI_LOOP_KOTD := scripts/workflows/nfstest/run_kernel_ci_kotd.sh
+endif # CONFIG_KERNEL_CI
+
+nfstest:
+	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) -l baseline,dev \
+		-f 30 -i hosts playbooks/nfstest.yml \
+		--skip-tags run_tests,copy_results
+
+nfstest-baseline:
+	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+		-f 30 -i hosts -l baseline playbooks/nfstest.yml \
+		--tags vars,run_tests,copy_results \
+		--extra-vars=@./extra_vars.yaml
+
+nfstest-baseline-loop:
+	$(Q)$(NFSTEST_KERNEL_CI_LOOP) baseline
+
+nfstest-baseline-kernelci:
+	$(Q)$(NFSTEST_KERNEL_CI_LOOP_KOTD) baseline
+
+nfstest-dev-baseline:
+	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+		-f 30 -i hosts -l dev playbooks/nfstest.yml \
+		--tags vars,run_tests,copy_results \
+		--extra-vars=@./extra_vars.yaml
+
+nfstest-dev-loop:
+	$(Q)$(NFSTEST_KERNEL_CI_LOOP) dev
+
+nfstest-dev-kernelci:
+	$(Q)$(NFSTEST_KERNEL_CI_LOOP_KOTD) dev
+
+nfstest-dev-reset:
+	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+		-f 30 -i hosts -l dev playbooks/nfstest.yml \
+		--tags vars,reset \
+		--extra-vars=@./extra_vars.yaml
+
+nfstest-help-menu:
+	@echo "nfstest options:"
+	@echo "nfstest                              - Git clone nfstest and install it"
+	@echo "nfstest-{baseline,dev}               - Run selected nfstests on baseline or dev hosts and collect results"
+	@echo "nfstest-{baseline,dev}-loop"         - Run nfstest in a loop until error or steady state
+	@echo "nfstest-{baseline,dev}-kernelci      - Run nfstest kernel-ci loop"
+	@echo ""
+
+HELP_TARGETS += nfstest-help-menu
Signature · 1 line
2.44.0
Signature · 1 line
Chuck Lever
#12 lore raw
In reply to [email protected]

workflows/nfstest/Kconfig line 34

Quoted 5 lines · On Wed, Apr 10, 2024 at 10:50:48AM -0400, [email protected] wrote:
workflows/nfstest/Kconfig new file +5 -0
+config NFSTEST_REPO
+	string "The nfstest repository"
+	default "git://git.linux-nfs.org/projects/mora/nfstest.git"
+	help
+	  The nfstest repository to clone.

Hopefuly commit 7e2b5f04878f ("mirrors: add blktrace mirror and use it") demonstrates that with few changes you can add mirroring support for this [0].

https://github.com/linux-kdevops/kdevops-history/commit/7e2b5f04878fdf4099eebcd54738688139b86aa5

workflows/nfstest/Kconfig line 42

Quoted 7 lines
workflows/nfstest/Kconfig new file +7 -0
+config NFSTEST_REPO_COMMIT
+	string "The version of nfstest to check out"
+	default "v3.2"
+	help
+	  The version of nfstest to be used for the test.
+
+if KDEVOPS_WORKFLOW_DEDICATE_NFSTEST

Condensed:

workflows/nfstest/Kconfig line 85

Quoted 8 lines
workflows/nfstest/Kconfig new file +8 -0
+config NFSTEST_TEST_GROUP_ALLOC
+config NFSTEST_TEST_GROUP_DIO
+config NFSTEST_TEST_GROUP_INTEROP
+config NFSTEST_TEST_GROUP_LOCK
+config NFSTEST_TEST_GROUP_POSIX
+config NFSTEST_TEST_GROUP_SPARSE
+config NFSTEST_TEST_GROUP_SSC
+endif # KDEVOPS_WORKFLOW_DEDICATE_NFSTEST

Nice...

Looks good to me otherwise.

Luis

#13 lore raw
Quoted 11 lines · Luis Chamberlain

workflows/nfstest/Kconfig line 34

Quoted 5 lines · On Wed, Apr 10, 2024 at 10:50:48AM -0400, [email protected] wrote:
workflows/nfstest/Kconfig new file +5 -0
+config NFSTEST_REPO
+	string "The nfstest repository"
+	default "git://git.linux-nfs.org/projects/mora/nfstest.git"
+	help
+	  The nfstest repository to clone.

Hopefuly commit 7e2b5f04878f ("mirrors: add blktrace mirror and use it") demonstrates that with few changes you can add mirroring support for this [0].

Quoted 1 line

https://github.com/linux-kdevops/kdevops-history/commit/7e2b5f04878fdf4099eebcd54738688139b86aa5

Sure! I will add a patch to this series to do that.

Quoted 21 lines

workflows/nfstest/Kconfig line 42

Quoted 7 lines
workflows/nfstest/Kconfig new file +7 -0
+config NFSTEST_REPO_COMMIT
+	string "The version of nfstest to check out"
+	default "v3.2"
+	help
+	  The version of nfstest to be used for the test.
+
+if KDEVOPS_WORKFLOW_DEDICATE_NFSTEST

Condensed:

workflows/nfstest/Kconfig line 85

Quoted 8 lines
workflows/nfstest/Kconfig new file +8 -0
+config NFSTEST_TEST_GROUP_ALLOC
+config NFSTEST_TEST_GROUP_DIO
+config NFSTEST_TEST_GROUP_INTEROP
+config NFSTEST_TEST_GROUP_LOCK
+config NFSTEST_TEST_GROUP_POSIX
+config NFSTEST_TEST_GROUP_SPARSE
+config NFSTEST_TEST_GROUP_SSC
+endif # KDEVOPS_WORKFLOW_DEDICATE_NFSTEST

Nice...

Quoted 1 line

Looks good to me otherwise.

Thanks for the review and comments!

Signature · 1 line
Chuck Lever
#14 lore raw
In reply to [email protected]
Quoted 9 lines · On Wed, 10 Apr 2024, [email protected] wrote:

From: Chuck Lever <[email protected]>

The nfstest suite is a detailed test of NFS functionality for NFS versions 3 and newer, including delegation, attribute cache consistency, sparse files, and server-to-server copy offload.

When configured in dedicated mode, each nfstest suite is run in a separate target node to achieve good parallelism. You can select specific test groups to run via Kconfig options.

I like the idea of running the tests in parallel, but would it be possible to also add an option to spin up a single node and run the tests sequentially? I'm running kdevops via buildbot. I have buildbot set up to monitor various upstream trees and trigger kdevops whenever new commits are pushed. In addition, I have some nightly jobs that run against RHEL 8 & RHEL 9 kernels. I'd like to throw nfstest into the mix, but I'm concerned that if each one of those is spinning up 8+ VMs my hypervisor will be under water. Just a thought.

-Scott

Quoted 441 lines

This commit introduces the workflow's documentation and Kconfig apparatus to show how this workflow can be configured. Following commits will bring in the kdevops components to get the workflow working.

The careful reader will note that not every nfstest group is available here. Three groups require the use of a second client, and I haven't figured out how that needs to work. For now, those groups are not included in this series.

---
 .gitignore                                    |  1 +
 README.md                                     | 12 ++-
 docs/nfstest.md                               | 21 ++++
 kconfigs/workflows/Kconfig                    | 25 +++++
 scripts/workflows/nfstest/run_kernel_ci.sh    |  1 +
 .../workflows/nfstest/run_kernel_ci_kotd.sh   |  1 +
 scripts/workflows/nfstest/run_loop.sh         | 58 +++++++++++
 workflows/Makefile                            |  5 +
 workflows/nfstest/Kconfig                     | 87 ++++++++++++++++
 workflows/nfstest/Makefile                    | 99 +++++++++++++++++++
 10 files changed, 309 insertions(+), 1 deletion(-)
 create mode 100644 docs/nfstest.md
 create mode 120000 scripts/workflows/nfstest/run_kernel_ci.sh
 create mode 120000 scripts/workflows/nfstest/run_kernel_ci_kotd.sh
 create mode 100755 scripts/workflows/nfstest/run_loop.sh
 create mode 100644 workflows/nfstest/Kconfig
 create mode 100644 workflows/nfstest/Makefile
.gitignore +1 -0
index 5cb41682dd45..3a1ecd48d84f 100644
@@ -62,6 +62,7 @@ workflows/demos/reboot-limit/results/
 
 workflows/gitr/results/
 workflows/ltp/results/
+workflows/nfstest/results/
 
 playbooks/roles/linux-mirror/linux-mirror-systemd/mirrors.yaml
 # We should strive to ignore all and port them to the new mirrors.yaml
README.md +11 -1
index 96e048bc8405..ea6b41004767 100644
@@ -135,7 +135,17 @@ To test a kernel using the ltp suite, enable the ltp workflow and then run:
   * `make ltp`
   * `make ltp-baseline`
 
-For more details see [kdevops gitr docs](docs/gitr.md)
+For more details see [kdevops ltp docs](docs/ltp.md)
+
+### Start running the nfstest suite in 2 commands
+
+To test a kernel using the nfstest suite, enable the nfstest workflow and
+then run:
+
+  * `make nfstest`
+  * `make nfstest-baseline`
+
+For more details see [kdevops nfstest docs](docs/nfstest.md)
 
 ### Runs some kernel selftests in a parallel manner
 
docs/nfstest.md new file +21 -0
new file mode 100644
index 000000000000..b358389c2571
@@ -0,0 +1,21 @@
+# kdevops nfstest suite
+
+kdevops can run Jorge Mora's nfstest suite against an NFS server.
+
+Run `make menuconfig` and select:
+
+  Target workflows -> Dedicated target Linux test workflow ->nfstest
+
+Then configure the test parameters by going to:
+
+  Target workflows -> Configure and run the nfstest suite
+
+Choose the location of the repo that contains the version of nfstest
+you want to use for the test.
+
+Then, run:
+
+  * `make`
+  * `make bringup`
+  * `make nfstest`
+  * `make nfstest-baseline`
kconfigs/workflows/Kconfig +25 -0
index ff6372b7e98f..2fd5bf31347f 100644
@@ -166,6 +166,13 @@ config KDEVOPS_WORKFLOW_DEDICATE_LTP
 	  This will dedicate your configuration to running only the
 	  ltp workflow in separate target nodes per testing group.
 
+config KDEVOPS_WORKFLOW_DEDICATE_NFSTEST
+	bool "nfstest"
+	select KDEVOPS_WORKFLOW_ENABLE_NFSTEST
+	help
+	  This will dedicate your configuration to running only the
+	  nfstest workflow in separate target nodes per testing group.
+
 endchoice
 
 endif
@@ -239,6 +246,14 @@ config KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_LTP
 	  Select this option if you want to provision ltp on a single
 	  target node for by-hand testing.
 
+config KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_NFSTEST
+	bool "nfstest"
+	select KDEVOPS_WORKFLOW_ENABLE_NFSTEST
+	depends on LIBVIRT || TERRAFORM_PRIVATE_NET
+	help
+	  Select this option if you want to provision nfstest on a
+	  single target node for by-hand testing.
+
 endif # !WORKFLOWS_DEDICATED_WORKFLOW
 
 config KDEVOPS_WORKFLOW_ENABLE_FSTESTS
@@ -312,6 +327,16 @@ source "workflows/ltp/Kconfig"
 endmenu
 endif # KDEVOPS_WORKFLOW_ENABLE_GITR
 
+config KDEVOPS_WORKFLOW_ENABLE_NFSTEST
+	bool
+	default y if KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_NFSTEST || KDEVOPS_WORKFLOW_DEDICATE_NFSTEST
+
+if KDEVOPS_WORKFLOW_ENABLE_NFSTEST
+menu "Configure and run the nfstest suite"
+source "workflows/nfstest/Kconfig"
+endmenu
+endif # KDEVOPS_WORKFLOW_ENABLE_NFSTEST
+
 config KDEVOPS_WORKFLOW_GIT_CLONES_KDEVOPS_GIT
 	bool
 	default y if KDEVOPS_WORKFLOW_ENABLE_FSTESTS || KDEVOPS_WORKFLOW_ENABLE_BLKTESTS
scripts/workflows/nfstest/run_kernel_ci.sh new file +1 -0
new file mode 120000
index 000000000000..4fd5dc5e8e13
@@ -0,0 +1 @@
+../generic/run_kernel_ci.sh
\ No newline at end of file
scripts/workflows/nfstest/run_kernel_ci_kotd.sh new file +1 -0
new file mode 120000
index 000000000000..8f94d6ba4f52
@@ -0,0 +1 @@
+../kotd/run_kernel_ci_kotd.sh
\ No newline at end of file
scripts/workflows/nfstest/run_loop.sh new file +58 -0
new file mode 100755
index 000000000000..22f80ca4e04a
@@ -0,0 +1,58 @@
+#!/bin/bash
+# SPDX-License-Identifier: copyleft-next-0.3.1
+
+# Part of kdevops kernel-ci, this is the script which will run the test workflow
+# as many times as indicated up to CONFIG_KERNEL_CI_STEADY_STATE_GOAL
+
+source ${TOPDIR}/.config
+source ${TOPDIR}/scripts/lib.sh
+
+WORKFLOWDIR=${TOPDIR}/workflows/nfstest
+
+COUNT=1
+
+run_loop()
+{
+	while true; do
+		echo "== kernel-ci nfstest test loop $COUNT start: $(date)" > $KERNEL_CI_FAIL_LOG
+		echo "/usr/bin/time -f %E make nfstest-baseline" >> $KERNEL_CI_FAIL_LOG
+		/usr/bin/time -p -o $KERNEL_CI_LOGTIME make nfstest-baseline >> $KERNEL_CI_FAIL_LOG
+		ANSIBLE_CALL_RET=$?
+		echo "End   $COUNT: $(date)" >> $KERNEL_CI_FAIL_LOG
+		cat $KERNEL_CI_LOGTIME >> $KERNEL_CI_FAIL_LOG
+		echo "git status:" >> $KERNEL_CI_FAIL_LOG
+		git status >> $KERNEL_CI_FAIL_LOG
+		echo "Results:" >> $KERNEL_CI_FAIL_LOG
+
+		rm -f $KERNEL_CI_DIFF_LOG
+
+		if [[ "$ANSIBLE_CALL_RET" -ne 0 ]]; then
+			echo "Test  $COUNT: FAILED!" >> $KERNEL_CI_DIFF_LOG
+			echo "== Test loop count $COUNT" >> $KERNEL_CI_DIFF_LOG
+			echo "$(git describe)" >> $KERNEL_CI_DIFF_LOG
+			git diff >> $KERNEL_CI_DIFF_LOG
+			cat $KERNEL_CI_DIFF_LOG >> $KERNEL_CI_FAIL_LOG
+			cat $KERNEL_CI_FAIL_LOG >> $KERNEL_CI_FULL_LOG
+			echo $COUNT > $KERNEL_CI_FAIL_FILE
+			exit 1
+		else
+			echo "Test  $COUNT: OK!" >> $KERNEL_CI_FAIL_LOG
+			echo "----------------------------------------------------------------" >> $KERNEL_CI_FAIL_LOG
+			cat $KERNEL_CI_FAIL_LOG >> $KERNEL_CI_FULL_LOG
+		fi
+
+		# This let's us keep track of which loop count was last successful
+		echo $COUNT > $KERNEL_CI_OK_FILE
+
+		let COUNT=$COUNT+1
+		if [[ "$CONFIG_KERNEL_CI_ENABLE_STEADY_STATE" == "y" &&
+		      "$COUNT" -gt "$CONFIG_KERNEL_CI_STEADY_STATE_GOAL" ]]; then
+			exit 0
+		fi
+		sleep 1
+	done
+}
+
+rm -f $KERNEL_CI_FAIL_FILE $KERNEL_CI_OK_FILE
+echo "= kernel-ci full log" > $KERNEL_CI_FULL_LOG
+run_loop
workflows/Makefile +5 -0
index 7e3e5e351a49..e305f2629abf 100644
@@ -53,6 +53,11 @@ WORKFLOW_ARGS += kdevops_workflow_enable_ltp='True'
 include workflows/ltp/Makefile
 endif # CONFIG_KDEVOPS_WORKFLOW_ENABLE_LTP == y
 
+ifeq (y,$(CONFIG_KDEVOPS_WORKFLOW_ENABLE_NFSTEST))
+WORKFLOW_ARGS += kdevops_workflow_enable_nfstest='True'
+include workflows/nfstest/Makefile
+endif # CONFIG_KDEVOPS_WORKFLOW_ENABLE_NFSTEST == y
+
 ANSIBLE_EXTRA_ARGS += $(WORKFLOW_ARGS)
 ANSIBLE_EXTRA_ARGS_SEPARATED += $(WORKFLOW_ARGS_SEPARATED)
 ANSIBLE_EXTRA_ARGS_DIRECT += $(WORKFLOW_ARGS_DIRECT)
workflows/nfstest/Kconfig new file +87 -0
new file mode 100644
index 000000000000..921ce5fe0a83
@@ -0,0 +1,87 @@
+if KDEVOPS_WORKFLOW_ENABLE_NFSTEST
+
+config NFSTEST_USE_KDEVOPS_NFSD
+	bool "Provision and use the kdevops NFS server"
+	select KDEVOPS_SETUP_NFSD
+	default y
+	help
+	  Select this option to have kdevops provision an additional
+	  target node to be used as the NFS server for testing.
+
+	  Say N if you have a reachable NFS server to test against, and
+	  specify that server's hostname using the
+	  NFSTEST_NFS_SERVER_HOST option.
+
+config NFSTEST_NFS_SERVER_HOST
+	string "Test NFS Server hostname"
+	default ""
+	depends on !NFSTEST_USE_KDEVOPS_NFSD
+	help
+	  The NFS server hostname or address to test against. Tests
+	  expect that an appropriate share is already available for
+	  them to mount and use.
+
+config NFSTEST_MNT
+	string "Where clients mount the file system under test"
+	default "/mnt/t"
+	help
+	  The directory over which to mount the file system under test.
+
+config NFSTEST_REPO
+	string "The nfstest repository"
+	default "git://git.linux-nfs.org/projects/mora/nfstest.git"
+	help
+	  The nfstest repository to clone.
+
+config NFSTEST_REPO_COMMIT
+	string "The version of nfstest to check out"
+	default "v3.2"
+	help
+	  The version of nfstest to be used for the test.
+
+if KDEVOPS_WORKFLOW_DEDICATE_NFSTEST
+
+config NFSTEST_TEST_GROUP_ALLOC
+	bool "Enable the nfstest_alloc testing section"
+	default n
+	help
+	  Provision a target node to test NFSv4.2 space reservation.
+
+config NFSTEST_TEST_GROUP_DIO
+	bool "Enable the nfstest_dio testing section"
+	default n
+	help
+	  Provision target nodes to run direct I/O tests.
+
+config NFSTEST_TEST_GROUP_INTEROP
+	bool "Enable the nfstest_interop testing section"
+	default y
+	help
+	  Provision target nodes to run NFS interoperability tests.
+
+config NFSTEST_TEST_GROUP_LOCK
+	bool "Enable the nfstest_lock testing section"
+	default n
+	help
+	  Provision target nodes to test NFS file locking.
+
+config NFSTEST_TEST_GROUP_POSIX
+	bool "Enable the nfstest_posix testing section"
+	default n
+	help
+	  Provision a target node to run POSIX file access tests.
+
+config NFSTEST_TEST_GROUP_SPARSE
+	bool "Enable the nfstest_sparse testing section"
+	help
+	  Provision a target node to test support for sparse files.
+
+config NFSTEST_TEST_GROUP_SSC
+	bool "Enable the nfstest_ssc testing section"
+	help
+	  Provision target nodes to test the operation of server-side
+	  copy.
+
+endif # KDEVOPS_WORKFLOW_DEDICATE_NFSTEST
+
+endif # KDEVOPS_WORKFLOW_ENABLE_GITR
workflows/nfstest/Makefile new file +99 -0
new file mode 100644
index 000000000000..638ec1fc83dd
@@ -0,0 +1,99 @@
+ifeq (y,$(CONFIG_WORKFLOWS_DEDICATED_WORKFLOW))
+export KDEVOPS_HOSTS_TEMPLATE := nfstest.j2
+endif # CONFIG_WORKFLOWS_DEDICATED_WORKFLOW
+
+ifeq (y,$(CONFIG_NFSTEST_USE_KDEVOPS_NFSD))
+NFSTEST_ARGS += nfstest_nfs_server_host='$(subst ",,$(CONFIG_KDEVOPS_HOSTS_PREFIX))-nfsd'
+NFSTEST_ARGS += nfstest_nfs_use_kdevops_nfsd='true'
+else # CONFIG_NFSTEST_USE_KDEVOPS_NFSD
+NFSTEST_ARGS += nfstest_nfs_server_host='$(subst ",,$(CONFIG_NFSTEST_NFS_SERVER_HOSTNAME))'
+NFSTEST_ARGS += nfstest_nfs_server_export='$(subst ",,$(CONFIG_NFSTEST_NFS_SERVER_EXPORT))'
+NFSTEST_ARGS += nfstest_nfs_use_kdevops_nfsd='false'
+endif # CONFIG_NFSTEST_USE_KDEVOPS_NFSD
+
+NFSTEST_MNT:=$(subst ",,$(CONFIG_NFSTEST_MNT))
+NFSTEST_ARGS += nfstest_mnt=$(NFSTEST_MNT)
+
+NFSTEST_REPO:=$(subst ",,$(CONFIG_NFSTEST_REPO))
+NFSTEST_ARGS += nfstest_repo=$(NFSTEST_REPO)
+
+NFSTEST_REPO_COMMIT:=$(subst ",,$(CONFIG_NFSTEST_REPO_COMMIT))
+NFSTEST_ARGS += nfstest_repo_commit=$(NFSTEST_REPO_COMMIT)
+
+ifeq (y,$(CONFIG_NFSTEST_TEST_GROUP_ALLOC))
+NFSTEST_ENABLED_TEST_GROUPS += alloc
+endif
+ifeq (y,$(CONFIG_NFSTEST_TEST_GROUP_DIO))
+NFSTEST_ENABLED_TEST_GROUPS += dio
+endif
+ifeq (y,$(CONFIG_NFSTEST_TEST_GROUP_INTEROP))
+NFSTEST_ENABLED_TEST_GROUPS += interop
+endif
+ifeq (y,$(CONFIG_NFSTEST_TEST_GROUP_LOCK))
+NFSTEST_ENABLED_TEST_GROUPS += lock
+endif
+ifeq (y,$(CONFIG_NFSTEST_TEST_GROUP_POSIX))
+NFSTEST_ENABLED_TEST_GROUPS += posix
+endif
+ifeq (y,$(CONFIG_NFSTEST_TEST_GROUP_SPARSE))
+NFSTEST_ENABLED_TEST_GROUPS += sparse
+endif
+ifeq (y,$(CONFIG_NFSTEST_TEST_GROUP_SSC))
+NFSTEST_ENABLED_TEST_GROUPS += ssc
+endif
+
+WORKFLOW_ARGS += $(NFSTEST_ARGS)
+WORKFLOW_ARGS_SEPARATED += nfstest_enabled_test_groups='$(subst $(space),+,$(NFSTEST_ENABLED_TEST_GROUPS))'
+
+NFSTEST_KERNEL_CI_LOOP := false
+NFSTEST_KERNEL_CI_LOOP_KOTD := false
+
+ifeq (y,$(CONFIG_KERNEL_CI))
+NFSTEST_KERNEL_CI_LOOP      := scripts/workflows/nfstest/run_kernel_ci.sh
+NFSTEST_KERNEL_CI_LOOP_KOTD := scripts/workflows/nfstest/run_kernel_ci_kotd.sh
+endif # CONFIG_KERNEL_CI
+
+nfstest:
+	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) -l baseline,dev \
+		-f 30 -i hosts playbooks/nfstest.yml \
+		--skip-tags run_tests,copy_results
+
+nfstest-baseline:
+	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+		-f 30 -i hosts -l baseline playbooks/nfstest.yml \
+		--tags vars,run_tests,copy_results \
+		--extra-vars=@./extra_vars.yaml
+
+nfstest-baseline-loop:
+	$(Q)$(NFSTEST_KERNEL_CI_LOOP) baseline
+
+nfstest-baseline-kernelci:
+	$(Q)$(NFSTEST_KERNEL_CI_LOOP_KOTD) baseline
+
+nfstest-dev-baseline:
+	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+		-f 30 -i hosts -l dev playbooks/nfstest.yml \
+		--tags vars,run_tests,copy_results \
+		--extra-vars=@./extra_vars.yaml
+
+nfstest-dev-loop:
+	$(Q)$(NFSTEST_KERNEL_CI_LOOP) dev
+
+nfstest-dev-kernelci:
+	$(Q)$(NFSTEST_KERNEL_CI_LOOP_KOTD) dev
+
+nfstest-dev-reset:
+	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+		-f 30 -i hosts -l dev playbooks/nfstest.yml \
+		--tags vars,reset \
+		--extra-vars=@./extra_vars.yaml
+
+nfstest-help-menu:
+	@echo "nfstest options:"
+	@echo "nfstest                              - Git clone nfstest and install it"
+	@echo "nfstest-{baseline,dev}               - Run selected nfstests on baseline or dev hosts and collect results"
+	@echo "nfstest-{baseline,dev}-loop"         - Run nfstest in a loop until error or steady state
+	@echo "nfstest-{baseline,dev}-kernelci      - Run nfstest kernel-ci loop"
+	@echo ""
+
+HELP_TARGETS += nfstest-help-menu
Signature · 1 line
2.44.0
#15 lore raw
Quoted 12 lines · Scott Mayhew
Quoted 6 lines · On Wed, 10 Apr 2024, [email protected] wrote:

From: Chuck Lever <[email protected]>

The nfstest suite is a detailed test of NFS functionality for NFS versions 3 and newer, including delegation, attribute cache consistency, sparse files, and server-to-server copy offload.

Quoted 7 lines
Quoted 3 lines

When configured in dedicated mode, each nfstest suite is run in a separate target node to achieve good parallelism. You can select specific test groups to run via Kconfig options.

I like the idea of running the tests in parallel, but would it be possible to also add an option to spin up a single node and run the tests sequentially?

Yes, that's possible. There are alternatives too.

You might run the nfstest workflow twice; once with one set of a test groups, and then again with a complementary set, for instance.

Quoted 6 lines

I'm running kdevops via buildbot. I have buildbot
set up to monitor various upstream trees and trigger kdevops whenever new commits are pushed. In addition, I have some nightly jobs that run against RHEL 8 & RHEL 9 kernels. I'd like to throw nfstest into the mix, but I'm concerned that if each one of those is spinning up 8+ VMs my hypervisor will be under water. Just a thought.

Well I'd like a way to kick off a full run of all the file system-related workflows... I think adding a "meta workflow" that can do that (perhaps sequentially) would help both of us. Just spit-balling.

--
Chuck Lever

#16 lore raw
Quoted 22 lines · Chuck Lever III
Quoted 11 lines · Scott Mayhew
Quoted 6 lines · On Wed, 10 Apr 2024, [email protected] wrote:

From: Chuck Lever <[email protected]>

The nfstest suite is a detailed test of NFS functionality for NFS versions 3 and newer, including delegation, attribute cache consistency, sparse files, and server-to-server copy offload.

Quoted 7 lines
Quoted 3 lines

When configured in dedicated mode, each nfstest suite is run in a separate target node to achieve good parallelism. You can select specific test groups to run via Kconfig options.

I like the idea of running the tests in parallel, but would it be possible to also add an option to spin up a single node and run the tests sequentially?

Quoted 5 lines

Yes, that's possible. There are alternatives too.

You might run the nfstest workflow twice; once with one set of a test groups, and then again with a complementary set, for instance.

Ansible also has a "fork factor" that you can use
to limit the number of concurrent jobs.

$ ansible-playbook -f 30 -i hosts playbooks/nfstest.yml

permits up to 30 jobs at once. Try reducing that
number...? The default is 5.

--
Chuck Lever