* [PATCH 2/4] gen_nodes: Add support for the nfstest workflow
2024-04-10 14:50 [PATCH 1/4] workflows: Workflow stub for Jorge Mora's nfstest suite cel
@ 2024-04-10 14:50 ` cel
2024-04-10 14:50 ` [PATCH 3/4] gen_hosts: Add gen_hosts " cel
` (4 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: cel @ 2024-04-10 14:50 UTC (permalink / raw)
To: kdevops; +Cc: Chuck Lever
From: Chuck Lever <chuck.lever@oracle.com>
Add functionality to provision target nodes for the nfstest
workflow.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
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
diff --git a/playbooks/roles/gen_nodes/defaults/main.yml b/playbooks/roles/gen_nodes/defaults/main.yml
index d03306baec6e..5caada07fe59 100644
--- a/playbooks/roles/gen_nodes/defaults/main.yml
+++ b/playbooks/roles/gen_nodes/defaults/main.yml
@@ -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
diff --git a/playbooks/roles/gen_nodes/tasks/main.yml b/playbooks/roles/gen_nodes/tasks/main.yml
index ee175f4de506..a40e2bd92ccd 100644
--- a/playbooks/roles/gen_nodes/tasks/main.yml
+++ b/playbooks/roles/gen_nodes/tasks/main.yml
@@ -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:
diff --git a/playbooks/roles/gen_nodes/tasks/nfstest.yml b/playbooks/roles/gen_nodes/tasks/nfstest.yml
new file mode 100644
index 000000000000..22ae4e87449c
--- /dev/null
+++ b/playbooks/roles/gen_nodes/tasks/nfstest.yml
@@ -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"
--
2.44.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 3/4] gen_hosts: Add gen_hosts support for the nfstest workflow
2024-04-10 14:50 [PATCH 1/4] workflows: Workflow stub for Jorge Mora's nfstest suite cel
2024-04-10 14:50 ` [PATCH 2/4] gen_nodes: Add support for the nfstest workflow cel
@ 2024-04-10 14:50 ` cel
2024-04-10 14:50 ` [PATCH 4/4] roles: Add a playbook to run the nfstest suite cel
` (3 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: cel @ 2024-04-10 14:50 UTC (permalink / raw)
To: kdevops; +Cc: Chuck Lever
From: Chuck Lever <chuck.lever@oracle.com>
Add functionality to generate the Ansible host inventory for the
nfstest workflow.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
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
diff --git a/playbooks/roles/gen_hosts/defaults/main.yml b/playbooks/roles/gen_hosts/defaults/main.yml
index 5cd941c7d0d3..8fc0f2794506 100644
--- a/playbooks/roles/gen_hosts/defaults/main.yml
+++ b/playbooks/roles/gen_hosts/defaults/main.yml
@@ -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"
diff --git a/playbooks/roles/gen_hosts/tasks/main.yml b/playbooks/roles/gen_hosts/tasks/main.yml
index 86837e748134..a4dd1f5a0fc3 100644
--- a/playbooks/roles/gen_hosts/tasks/main.yml
+++ b/playbooks/roles/gen_hosts/tasks/main.yml
@@ -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:
diff --git a/playbooks/roles/gen_hosts/templates/nfstest.j2 b/playbooks/roles/gen_hosts/templates/nfstest.j2
new file mode 100644
index 000000000000..c00494ca5aff
--- /dev/null
+++ b/playbooks/roles/gen_hosts/templates/nfstest.j2
@@ -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 %}
--
2.44.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 4/4] roles: Add a playbook to run the nfstest suite
2024-04-10 14:50 [PATCH 1/4] workflows: Workflow stub for Jorge Mora's nfstest suite cel
2024-04-10 14:50 ` [PATCH 2/4] gen_nodes: Add support for the nfstest workflow cel
2024-04-10 14:50 ` [PATCH 3/4] gen_hosts: Add gen_hosts " cel
@ 2024-04-10 14:50 ` cel
2024-04-11 17:49 ` Luis Chamberlain
2024-04-12 15:34 ` Scott Mayhew
2024-04-10 14:56 ` [PATCH 1/4] workflows: Workflow stub for Jorge Mora's " Chuck Lever
` (2 subsequent siblings)
5 siblings, 2 replies; 17+ messages in thread
From: cel @ 2024-04-10 14:50 UTC (permalink / raw)
To: kdevops; +Cc: Chuck Lever
From: Chuck Lever <chuck.lever@oracle.com>
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.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
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
diff --git a/playbooks/nfstest.yml b/playbooks/nfstest.yml
new file mode 100644
index 000000000000..9d7c28a75843
--- /dev/null
+++ b/playbooks/nfstest.yml
@@ -0,0 +1,5 @@
+---
+- hosts: all
+ strategy: free
+ roles:
+ - role: nfstest
diff --git a/playbooks/roles/nfstest/defaults/main.yml b/playbooks/roles/nfstest/defaults/main.yml
new file mode 100644
index 000000000000..0d4060b5c76e
--- /dev/null
+++ b/playbooks/roles/nfstest/defaults/main.yml
@@ -0,0 +1,5 @@
+---
+# Our sensible defaults for the nfstest role.
+#
+kdevops_run_nfstest: False
+kdevops_workflows_dedicated_workflow: false
diff --git a/playbooks/roles/nfstest/tasks/alloc/main.yml b/playbooks/roles/nfstest/tasks/alloc/main.yml
new file mode 100644
index 000000000000..2c4d750388f2
--- /dev/null
+++ b/playbooks/roles/nfstest/tasks/alloc/main.yml
@@ -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
diff --git a/playbooks/roles/nfstest/tasks/dio/main.yml b/playbooks/roles/nfstest/tasks/dio/main.yml
new file mode 100644
index 000000000000..705403a93da1
--- /dev/null
+++ b/playbooks/roles/nfstest/tasks/dio/main.yml
@@ -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
diff --git a/playbooks/roles/nfstest/tasks/interop/main.yml b/playbooks/roles/nfstest/tasks/interop/main.yml
new file mode 100644
index 000000000000..b35e9c9607fe
--- /dev/null
+++ b/playbooks/roles/nfstest/tasks/interop/main.yml
@@ -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
diff --git a/playbooks/roles/nfstest/tasks/lock/main.yml b/playbooks/roles/nfstest/tasks/lock/main.yml
new file mode 100644
index 000000000000..b658edf965ed
--- /dev/null
+++ b/playbooks/roles/nfstest/tasks/lock/main.yml
@@ -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
diff --git a/playbooks/roles/nfstest/tasks/main.yml b/playbooks/roles/nfstest/tasks/main.yml
new file mode 100644
index 000000000000..6f660c332a75
--- /dev/null
+++ b/playbooks/roles/nfstest/tasks/main.yml
@@ -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
+ 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"
+ 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
diff --git a/playbooks/roles/nfstest/tasks/posix/main.yml b/playbooks/roles/nfstest/tasks/posix/main.yml
new file mode 100644
index 000000000000..6dd2c4e0b022
--- /dev/null
+++ b/playbooks/roles/nfstest/tasks/posix/main.yml
@@ -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
diff --git a/playbooks/roles/nfstest/tasks/sparse/main.yml b/playbooks/roles/nfstest/tasks/sparse/main.yml
new file mode 100644
index 000000000000..6defab5311f7
--- /dev/null
+++ b/playbooks/roles/nfstest/tasks/sparse/main.yml
@@ -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
diff --git a/playbooks/roles/nfstest/tasks/ssc/main.yml b/playbooks/roles/nfstest/tasks/ssc/main.yml
new file mode 100644
index 000000000000..b8e01345c032
--- /dev/null
+++ b/playbooks/roles/nfstest/tasks/ssc/main.yml
@@ -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
diff --git a/playbooks/roles/nfstest/vars/Debian.yml b/playbooks/roles/nfstest/vars/Debian.yml
new file mode 100644
index 000000000000..3acf39071fd3
--- /dev/null
+++ b/playbooks/roles/nfstest/vars/Debian.yml
@@ -0,0 +1,5 @@
+---
+nfstest_packages:
+ - nfs-common
+ - python3-pip
+ - tcpdump
diff --git a/playbooks/roles/nfstest/vars/RedHat.yml b/playbooks/roles/nfstest/vars/RedHat.yml
new file mode 100644
index 000000000000..4fdee14f2b1f
--- /dev/null
+++ b/playbooks/roles/nfstest/vars/RedHat.yml
@@ -0,0 +1,5 @@
+---
+nfstest_packages:
+ - nfs-utils
+ - python3-pip
+ - tcpdump
diff --git a/playbooks/roles/nfstest/vars/Suse.yml b/playbooks/roles/nfstest/vars/Suse.yml
new file mode 100644
index 000000000000..4fdee14f2b1f
--- /dev/null
+++ b/playbooks/roles/nfstest/vars/Suse.yml
@@ -0,0 +1,5 @@
+---
+nfstest_packages:
+ - nfs-utils
+ - python3-pip
+ - tcpdump
--
2.44.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH 4/4] roles: Add a playbook to run the nfstest suite
2024-04-10 14:50 ` [PATCH 4/4] roles: Add a playbook to run the nfstest suite cel
@ 2024-04-11 17:49 ` Luis Chamberlain
2024-04-11 18:05 ` Chuck Lever
2024-04-12 15:34 ` Scott Mayhew
1 sibling, 1 reply; 17+ messages in thread
From: Luis Chamberlain @ 2024-04-11 17:49 UTC (permalink / raw)
To: cel; +Cc: kdevops, Chuck Lever
On Wed, Apr 10, 2024 at 10:50:51AM -0400, cel@kernel.org wrote:
> diff --git a/playbooks/roles/nfstest/tasks/main.yml b/playbooks/roles/nfstest/tasks/main.yml
> new file mode 100644
> index 000000000000..6f660c332a75
> --- /dev/null
> +++ b/playbooks/roles/nfstest/tasks/main.yml
> @@ -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
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).
> +- 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.
> +- 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
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 4/4] roles: Add a playbook to run the nfstest suite
2024-04-11 17:49 ` Luis Chamberlain
@ 2024-04-11 18:05 ` Chuck Lever
2024-04-11 18:51 ` Luis Chamberlain
0 siblings, 1 reply; 17+ messages in thread
From: Chuck Lever @ 2024-04-11 18:05 UTC (permalink / raw)
To: Luis Chamberlain; +Cc: cel, kdevops
On Thu, Apr 11, 2024 at 10:49:08AM -0700, Luis Chamberlain wrote:
> On Wed, Apr 10, 2024 at 10:50:51AM -0400, cel@kernel.org wrote:
> > diff --git a/playbooks/roles/nfstest/tasks/main.yml b/playbooks/roles/nfstest/tasks/main.yml
> > new file mode 100644
> > index 000000000000..6f660c332a75
> > --- /dev/null
> > +++ b/playbooks/roles/nfstest/tasks/main.yml
> > @@ -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
>
> 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.
> > +- 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.
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.
> > +- 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.
--
Chuck Lever
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 4/4] roles: Add a playbook to run the nfstest suite
2024-04-11 18:05 ` Chuck Lever
@ 2024-04-11 18:51 ` Luis Chamberlain
2024-04-11 19:25 ` Chuck Lever
0 siblings, 1 reply; 17+ messages in thread
From: Luis Chamberlain @ 2024-04-11 18:51 UTC (permalink / raw)
To: Chuck Lever; +Cc: cel, kdevops
On Thu, Apr 11, 2024 at 02:05:06PM -0400, Chuck Lever wrote:
> On Thu, Apr 11, 2024 at 10:49:08AM -0700, Luis Chamberlain wrote:
> > On Wed, Apr 10, 2024 at 10:50:51AM -0400, cel@kernel.org wrote:
> > > diff --git a/playbooks/roles/nfstest/tasks/main.yml b/playbooks/roles/nfstest/tasks/main.yml
> > > 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).
>
> 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.
> > > +- 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.
>
> 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.
> > > +- 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.
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.
> 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
> 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>
> 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
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 4/4] roles: Add a playbook to run the nfstest suite
2024-04-11 18:51 ` Luis Chamberlain
@ 2024-04-11 19:25 ` Chuck Lever
2024-04-11 19:55 ` Luis Chamberlain
0 siblings, 1 reply; 17+ messages in thread
From: Chuck Lever @ 2024-04-11 19:25 UTC (permalink / raw)
To: Luis Chamberlain; +Cc: cel, kdevops
On Thu, Apr 11, 2024 at 11:51:06AM -0700, Luis Chamberlain wrote:
> On Thu, Apr 11, 2024 at 02:05:06PM -0400, Chuck Lever wrote:
> > On Thu, Apr 11, 2024 at 10:49:08AM -0700, Luis Chamberlain wrote:
> > > On Wed, Apr 10, 2024 at 10:50:51AM -0400, cel@kernel.org wrote:
> > > > diff --git a/playbooks/roles/nfstest/tasks/main.yml b/playbooks/roles/nfstest/tasks/main.yml
> > > > 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).
> >
> > 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
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.
> 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.
> We'd just need to add this new ansible-galaxy command as part of or our
> first ansible command we run.
> > > > +- 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.
> >
> > 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.
> > > > +- 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.
>
> 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.
>
> > 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
Yes, that's exactly how I select the "free" strategy for nfstest.
> 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.
> > 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>
>
> > 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.
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.
--
Chuck Lever
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 4/4] roles: Add a playbook to run the nfstest suite
2024-04-11 19:25 ` Chuck Lever
@ 2024-04-11 19:55 ` Luis Chamberlain
0 siblings, 0 replies; 17+ messages in thread
From: Luis Chamberlain @ 2024-04-11 19:55 UTC (permalink / raw)
To: Chuck Lever; +Cc: cel, kdevops
On Thu, Apr 11, 2024 at 03:25:47PM -0400, Chuck Lever wrote:
> 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.
> 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.
> 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
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 4/4] roles: Add a playbook to run the nfstest suite
2024-04-10 14:50 ` [PATCH 4/4] roles: Add a playbook to run the nfstest suite cel
2024-04-11 17:49 ` Luis Chamberlain
@ 2024-04-12 15:34 ` Scott Mayhew
2024-04-12 15:36 ` Chuck Lever III
1 sibling, 1 reply; 17+ messages in thread
From: Scott Mayhew @ 2024-04-12 15:34 UTC (permalink / raw)
To: cel; +Cc: kdevops, Chuck Lever
On Wed, 10 Apr 2024, cel@kernel.org wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
>
> 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.
>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> 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
>
> diff --git a/playbooks/nfstest.yml b/playbooks/nfstest.yml
> new file mode 100644
> index 000000000000..9d7c28a75843
> --- /dev/null
> +++ b/playbooks/nfstest.yml
> @@ -0,0 +1,5 @@
> +---
> +- hosts: all
> + strategy: free
> + roles:
> + - role: nfstest
> diff --git a/playbooks/roles/nfstest/defaults/main.yml b/playbooks/roles/nfstest/defaults/main.yml
> new file mode 100644
> index 000000000000..0d4060b5c76e
> --- /dev/null
> +++ b/playbooks/roles/nfstest/defaults/main.yml
> @@ -0,0 +1,5 @@
> +---
> +# Our sensible defaults for the nfstest role.
> +#
> +kdevops_run_nfstest: False
> +kdevops_workflows_dedicated_workflow: false
> diff --git a/playbooks/roles/nfstest/tasks/alloc/main.yml b/playbooks/roles/nfstest/tasks/alloc/main.yml
> new file mode 100644
> index 000000000000..2c4d750388f2
> --- /dev/null
> +++ b/playbooks/roles/nfstest/tasks/alloc/main.yml
> @@ -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
> diff --git a/playbooks/roles/nfstest/tasks/dio/main.yml b/playbooks/roles/nfstest/tasks/dio/main.yml
> new file mode 100644
> index 000000000000..705403a93da1
> --- /dev/null
> +++ b/playbooks/roles/nfstest/tasks/dio/main.yml
> @@ -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
> diff --git a/playbooks/roles/nfstest/tasks/interop/main.yml b/playbooks/roles/nfstest/tasks/interop/main.yml
> new file mode 100644
> index 000000000000..b35e9c9607fe
> --- /dev/null
> +++ b/playbooks/roles/nfstest/tasks/interop/main.yml
> @@ -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
> diff --git a/playbooks/roles/nfstest/tasks/lock/main.yml b/playbooks/roles/nfstest/tasks/lock/main.yml
> new file mode 100644
> index 000000000000..b658edf965ed
> --- /dev/null
> +++ b/playbooks/roles/nfstest/tasks/lock/main.yml
> @@ -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
> diff --git a/playbooks/roles/nfstest/tasks/main.yml b/playbooks/roles/nfstest/tasks/main.yml
> new file mode 100644
> index 000000000000..6f660c332a75
> --- /dev/null
> +++ b/playbooks/roles/nfstest/tasks/main.yml
> @@ -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
> + 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
> + 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
> diff --git a/playbooks/roles/nfstest/tasks/posix/main.yml b/playbooks/roles/nfstest/tasks/posix/main.yml
> new file mode 100644
> index 000000000000..6dd2c4e0b022
> --- /dev/null
> +++ b/playbooks/roles/nfstest/tasks/posix/main.yml
> @@ -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
> diff --git a/playbooks/roles/nfstest/tasks/sparse/main.yml b/playbooks/roles/nfstest/tasks/sparse/main.yml
> new file mode 100644
> index 000000000000..6defab5311f7
> --- /dev/null
> +++ b/playbooks/roles/nfstest/tasks/sparse/main.yml
> @@ -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
> diff --git a/playbooks/roles/nfstest/tasks/ssc/main.yml b/playbooks/roles/nfstest/tasks/ssc/main.yml
> new file mode 100644
> index 000000000000..b8e01345c032
> --- /dev/null
> +++ b/playbooks/roles/nfstest/tasks/ssc/main.yml
> @@ -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
> diff --git a/playbooks/roles/nfstest/vars/Debian.yml b/playbooks/roles/nfstest/vars/Debian.yml
> new file mode 100644
> index 000000000000..3acf39071fd3
> --- /dev/null
> +++ b/playbooks/roles/nfstest/vars/Debian.yml
> @@ -0,0 +1,5 @@
> +---
> +nfstest_packages:
> + - nfs-common
> + - python3-pip
> + - tcpdump
> diff --git a/playbooks/roles/nfstest/vars/RedHat.yml b/playbooks/roles/nfstest/vars/RedHat.yml
> new file mode 100644
> index 000000000000..4fdee14f2b1f
> --- /dev/null
> +++ b/playbooks/roles/nfstest/vars/RedHat.yml
> @@ -0,0 +1,5 @@
> +---
> +nfstest_packages:
> + - nfs-utils
> + - python3-pip
> + - tcpdump
> diff --git a/playbooks/roles/nfstest/vars/Suse.yml b/playbooks/roles/nfstest/vars/Suse.yml
> new file mode 100644
> index 000000000000..4fdee14f2b1f
> --- /dev/null
> +++ b/playbooks/roles/nfstest/vars/Suse.yml
> @@ -0,0 +1,5 @@
> +---
> +nfstest_packages:
> + - nfs-utils
> + - python3-pip
> + - tcpdump
> --
> 2.44.0
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 4/4] roles: Add a playbook to run the nfstest suite
2024-04-12 15:34 ` Scott Mayhew
@ 2024-04-12 15:36 ` Chuck Lever III
0 siblings, 0 replies; 17+ messages in thread
From: Chuck Lever III @ 2024-04-12 15:36 UTC (permalink / raw)
To: Scott Mayhew; +Cc: Chuck Lever, kdevops@lists.linux.dev
> On Apr 12, 2024, at 11:34 AM, Scott Mayhew <smayhew@redhat.com> wrote:
>
> On Wed, 10 Apr 2024, cel@kernel.org wrote:
>
>> From: Chuck Lever <chuck.lever@oracle.com>
>>
>> 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.
>>
>> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
>> ---
>> 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
>>
>> diff --git a/playbooks/nfstest.yml b/playbooks/nfstest.yml
>> new file mode 100644
>> index 000000000000..9d7c28a75843
>> --- /dev/null
>> +++ b/playbooks/nfstest.yml
>> @@ -0,0 +1,5 @@
>> +---
>> +- hosts: all
>> + strategy: free
>> + roles:
>> + - role: nfstest
>> diff --git a/playbooks/roles/nfstest/defaults/main.yml b/playbooks/roles/nfstest/defaults/main.yml
>> new file mode 100644
>> index 000000000000..0d4060b5c76e
>> --- /dev/null
>> +++ b/playbooks/roles/nfstest/defaults/main.yml
>> @@ -0,0 +1,5 @@
>> +---
>> +# Our sensible defaults for the nfstest role.
>> +#
>> +kdevops_run_nfstest: False
>> +kdevops_workflows_dedicated_workflow: false
>> diff --git a/playbooks/roles/nfstest/tasks/alloc/main.yml b/playbooks/roles/nfstest/tasks/alloc/main.yml
>> new file mode 100644
>> index 000000000000..2c4d750388f2
>> --- /dev/null
>> +++ b/playbooks/roles/nfstest/tasks/alloc/main.yml
>> @@ -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
>> diff --git a/playbooks/roles/nfstest/tasks/dio/main.yml b/playbooks/roles/nfstest/tasks/dio/main.yml
>> new file mode 100644
>> index 000000000000..705403a93da1
>> --- /dev/null
>> +++ b/playbooks/roles/nfstest/tasks/dio/main.yml
>> @@ -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
>> diff --git a/playbooks/roles/nfstest/tasks/interop/main.yml b/playbooks/roles/nfstest/tasks/interop/main.yml
>> new file mode 100644
>> index 000000000000..b35e9c9607fe
>> --- /dev/null
>> +++ b/playbooks/roles/nfstest/tasks/interop/main.yml
>> @@ -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
>> diff --git a/playbooks/roles/nfstest/tasks/lock/main.yml b/playbooks/roles/nfstest/tasks/lock/main.yml
>> new file mode 100644
>> index 000000000000..b658edf965ed
>> --- /dev/null
>> +++ b/playbooks/roles/nfstest/tasks/lock/main.yml
>> @@ -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
>> diff --git a/playbooks/roles/nfstest/tasks/main.yml b/playbooks/roles/nfstest/tasks/main.yml
>> new file mode 100644
>> index 000000000000..6f660c332a75
>> --- /dev/null
>> +++ b/playbooks/roles/nfstest/tasks/main.yml
>> @@ -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
>> + 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.
Haven't seen that, and I'm testing on Fedora 39. I can add that, though.
> -Scott
>
>> + 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
>> diff --git a/playbooks/roles/nfstest/tasks/posix/main.yml b/playbooks/roles/nfstest/tasks/posix/main.yml
>> new file mode 100644
>> index 000000000000..6dd2c4e0b022
>> --- /dev/null
>> +++ b/playbooks/roles/nfstest/tasks/posix/main.yml
>> @@ -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
>> diff --git a/playbooks/roles/nfstest/tasks/sparse/main.yml b/playbooks/roles/nfstest/tasks/sparse/main.yml
>> new file mode 100644
>> index 000000000000..6defab5311f7
>> --- /dev/null
>> +++ b/playbooks/roles/nfstest/tasks/sparse/main.yml
>> @@ -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
>> diff --git a/playbooks/roles/nfstest/tasks/ssc/main.yml b/playbooks/roles/nfstest/tasks/ssc/main.yml
>> new file mode 100644
>> index 000000000000..b8e01345c032
>> --- /dev/null
>> +++ b/playbooks/roles/nfstest/tasks/ssc/main.yml
>> @@ -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
>> diff --git a/playbooks/roles/nfstest/vars/Debian.yml b/playbooks/roles/nfstest/vars/Debian.yml
>> new file mode 100644
>> index 000000000000..3acf39071fd3
>> --- /dev/null
>> +++ b/playbooks/roles/nfstest/vars/Debian.yml
>> @@ -0,0 +1,5 @@
>> +---
>> +nfstest_packages:
>> + - nfs-common
>> + - python3-pip
>> + - tcpdump
>> diff --git a/playbooks/roles/nfstest/vars/RedHat.yml b/playbooks/roles/nfstest/vars/RedHat.yml
>> new file mode 100644
>> index 000000000000..4fdee14f2b1f
>> --- /dev/null
>> +++ b/playbooks/roles/nfstest/vars/RedHat.yml
>> @@ -0,0 +1,5 @@
>> +---
>> +nfstest_packages:
>> + - nfs-utils
>> + - python3-pip
>> + - tcpdump
>> diff --git a/playbooks/roles/nfstest/vars/Suse.yml b/playbooks/roles/nfstest/vars/Suse.yml
>> new file mode 100644
>> index 000000000000..4fdee14f2b1f
>> --- /dev/null
>> +++ b/playbooks/roles/nfstest/vars/Suse.yml
>> @@ -0,0 +1,5 @@
>> +---
>> +nfstest_packages:
>> + - nfs-utils
>> + - python3-pip
>> + - tcpdump
>> --
>> 2.44.0
--
Chuck Lever
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/4] workflows: Workflow stub for Jorge Mora's nfstest suite
2024-04-10 14:50 [PATCH 1/4] workflows: Workflow stub for Jorge Mora's nfstest suite cel
` (2 preceding siblings ...)
2024-04-10 14:50 ` [PATCH 4/4] roles: Add a playbook to run the nfstest suite cel
@ 2024-04-10 14:56 ` Chuck Lever
2024-04-11 16:43 ` Luis Chamberlain
2024-04-12 15:45 ` Scott Mayhew
5 siblings, 0 replies; 17+ messages in thread
From: Chuck Lever @ 2024-04-10 14:56 UTC (permalink / raw)
To: cel; +Cc: kdevops
On Wed, Apr 10, 2024 at 10:50:48AM -0400, cel@kernel.org wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
>
> 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.
>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
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.
> ---
> .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
>
> diff --git a/.gitignore b/.gitignore
> index 5cb41682dd45..3a1ecd48d84f 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -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
> diff --git a/README.md b/README.md
> index 96e048bc8405..ea6b41004767 100644
> --- a/README.md
> +++ b/README.md
> @@ -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
>
> diff --git a/docs/nfstest.md b/docs/nfstest.md
> new file mode 100644
> index 000000000000..b358389c2571
> --- /dev/null
> +++ b/docs/nfstest.md
> @@ -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`
> diff --git a/kconfigs/workflows/Kconfig b/kconfigs/workflows/Kconfig
> index ff6372b7e98f..2fd5bf31347f 100644
> --- a/kconfigs/workflows/Kconfig
> +++ b/kconfigs/workflows/Kconfig
> @@ -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
> diff --git a/scripts/workflows/nfstest/run_kernel_ci.sh b/scripts/workflows/nfstest/run_kernel_ci.sh
> new file mode 120000
> index 000000000000..4fd5dc5e8e13
> --- /dev/null
> +++ b/scripts/workflows/nfstest/run_kernel_ci.sh
> @@ -0,0 +1 @@
> +../generic/run_kernel_ci.sh
> \ No newline at end of file
> diff --git a/scripts/workflows/nfstest/run_kernel_ci_kotd.sh b/scripts/workflows/nfstest/run_kernel_ci_kotd.sh
> new file mode 120000
> index 000000000000..8f94d6ba4f52
> --- /dev/null
> +++ b/scripts/workflows/nfstest/run_kernel_ci_kotd.sh
> @@ -0,0 +1 @@
> +../kotd/run_kernel_ci_kotd.sh
> \ No newline at end of file
> diff --git a/scripts/workflows/nfstest/run_loop.sh b/scripts/workflows/nfstest/run_loop.sh
> new file mode 100755
> index 000000000000..22f80ca4e04a
> --- /dev/null
> +++ b/scripts/workflows/nfstest/run_loop.sh
> @@ -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
> diff --git a/workflows/Makefile b/workflows/Makefile
> index 7e3e5e351a49..e305f2629abf 100644
> --- a/workflows/Makefile
> +++ b/workflows/Makefile
> @@ -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)
> diff --git a/workflows/nfstest/Kconfig b/workflows/nfstest/Kconfig
> new file mode 100644
> index 000000000000..921ce5fe0a83
> --- /dev/null
> +++ b/workflows/nfstest/Kconfig
> @@ -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
> diff --git a/workflows/nfstest/Makefile b/workflows/nfstest/Makefile
> new file mode 100644
> index 000000000000..638ec1fc83dd
> --- /dev/null
> +++ b/workflows/nfstest/Makefile
> @@ -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
> --
> 2.44.0
>
>
--
Chuck Lever
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 1/4] workflows: Workflow stub for Jorge Mora's nfstest suite
2024-04-10 14:50 [PATCH 1/4] workflows: Workflow stub for Jorge Mora's nfstest suite cel
` (3 preceding siblings ...)
2024-04-10 14:56 ` [PATCH 1/4] workflows: Workflow stub for Jorge Mora's " Chuck Lever
@ 2024-04-11 16:43 ` Luis Chamberlain
2024-04-11 17:41 ` Chuck Lever
2024-04-12 15:45 ` Scott Mayhew
5 siblings, 1 reply; 17+ messages in thread
From: Luis Chamberlain @ 2024-04-11 16:43 UTC (permalink / raw)
To: cel; +Cc: kdevops, Chuck Lever
On Wed, Apr 10, 2024 at 10:50:48AM -0400, cel@kernel.org wrote:
> +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
> +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:
> +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
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 1/4] workflows: Workflow stub for Jorge Mora's nfstest suite
2024-04-11 16:43 ` Luis Chamberlain
@ 2024-04-11 17:41 ` Chuck Lever
0 siblings, 0 replies; 17+ messages in thread
From: Chuck Lever @ 2024-04-11 17:41 UTC (permalink / raw)
To: Luis Chamberlain; +Cc: cel, kdevops
On Thu, Apr 11, 2024 at 09:43:41AM -0700, Luis Chamberlain wrote:
> On Wed, Apr 10, 2024 at 10:50:48AM -0400, cel@kernel.org wrote:
> > +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
Sure! I will add a patch to this series to do that.
> > +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:
>
> > +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.
Thanks for the review and comments!
--
Chuck Lever
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/4] workflows: Workflow stub for Jorge Mora's nfstest suite
2024-04-10 14:50 [PATCH 1/4] workflows: Workflow stub for Jorge Mora's nfstest suite cel
` (4 preceding siblings ...)
2024-04-11 16:43 ` Luis Chamberlain
@ 2024-04-12 15:45 ` Scott Mayhew
2024-04-12 15:50 ` Chuck Lever III
5 siblings, 1 reply; 17+ messages in thread
From: Scott Mayhew @ 2024-04-12 15:45 UTC (permalink / raw)
To: cel; +Cc: kdevops, Chuck Lever
On Wed, 10 Apr 2024, cel@kernel.org wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
>
> 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
>
> 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.
>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> .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
>
> diff --git a/.gitignore b/.gitignore
> index 5cb41682dd45..3a1ecd48d84f 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -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
> diff --git a/README.md b/README.md
> index 96e048bc8405..ea6b41004767 100644
> --- a/README.md
> +++ b/README.md
> @@ -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
>
> diff --git a/docs/nfstest.md b/docs/nfstest.md
> new file mode 100644
> index 000000000000..b358389c2571
> --- /dev/null
> +++ b/docs/nfstest.md
> @@ -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`
> diff --git a/kconfigs/workflows/Kconfig b/kconfigs/workflows/Kconfig
> index ff6372b7e98f..2fd5bf31347f 100644
> --- a/kconfigs/workflows/Kconfig
> +++ b/kconfigs/workflows/Kconfig
> @@ -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
> diff --git a/scripts/workflows/nfstest/run_kernel_ci.sh b/scripts/workflows/nfstest/run_kernel_ci.sh
> new file mode 120000
> index 000000000000..4fd5dc5e8e13
> --- /dev/null
> +++ b/scripts/workflows/nfstest/run_kernel_ci.sh
> @@ -0,0 +1 @@
> +../generic/run_kernel_ci.sh
> \ No newline at end of file
> diff --git a/scripts/workflows/nfstest/run_kernel_ci_kotd.sh b/scripts/workflows/nfstest/run_kernel_ci_kotd.sh
> new file mode 120000
> index 000000000000..8f94d6ba4f52
> --- /dev/null
> +++ b/scripts/workflows/nfstest/run_kernel_ci_kotd.sh
> @@ -0,0 +1 @@
> +../kotd/run_kernel_ci_kotd.sh
> \ No newline at end of file
> diff --git a/scripts/workflows/nfstest/run_loop.sh b/scripts/workflows/nfstest/run_loop.sh
> new file mode 100755
> index 000000000000..22f80ca4e04a
> --- /dev/null
> +++ b/scripts/workflows/nfstest/run_loop.sh
> @@ -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
> diff --git a/workflows/Makefile b/workflows/Makefile
> index 7e3e5e351a49..e305f2629abf 100644
> --- a/workflows/Makefile
> +++ b/workflows/Makefile
> @@ -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)
> diff --git a/workflows/nfstest/Kconfig b/workflows/nfstest/Kconfig
> new file mode 100644
> index 000000000000..921ce5fe0a83
> --- /dev/null
> +++ b/workflows/nfstest/Kconfig
> @@ -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
> diff --git a/workflows/nfstest/Makefile b/workflows/nfstest/Makefile
> new file mode 100644
> index 000000000000..638ec1fc83dd
> --- /dev/null
> +++ b/workflows/nfstest/Makefile
> @@ -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
> --
> 2.44.0
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 1/4] workflows: Workflow stub for Jorge Mora's nfstest suite
2024-04-12 15:45 ` Scott Mayhew
@ 2024-04-12 15:50 ` Chuck Lever III
2024-04-12 19:03 ` Chuck Lever III
0 siblings, 1 reply; 17+ messages in thread
From: Chuck Lever III @ 2024-04-12 15:50 UTC (permalink / raw)
To: Scott Mayhew; +Cc: Chuck Lever, kdevops@lists.linux.dev
> On Apr 12, 2024, at 11:45 AM, Scott Mayhew <smayhew@redhat.com> wrote:
>
> On Wed, 10 Apr 2024, cel@kernel.org wrote:
>
>> From: Chuck Lever <chuck.lever@oracle.com>
>>
>> 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?
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.
> 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
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/4] workflows: Workflow stub for Jorge Mora's nfstest suite
2024-04-12 15:50 ` Chuck Lever III
@ 2024-04-12 19:03 ` Chuck Lever III
0 siblings, 0 replies; 17+ messages in thread
From: Chuck Lever III @ 2024-04-12 19:03 UTC (permalink / raw)
To: Scott Mayhew; +Cc: Chuck Lever, kdevops@lists.linux.dev
> On Apr 12, 2024, at 11:50 AM, Chuck Lever III <chuck.lever@oracle.com> wrote:
>
>> On Apr 12, 2024, at 11:45 AM, Scott Mayhew <smayhew@redhat.com> wrote:
>>
>> On Wed, 10 Apr 2024, cel@kernel.org wrote:
>>
>>> From: Chuck Lever <chuck.lever@oracle.com>
>>>
>>> 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?
>
> 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
^ permalink raw reply [flat|nested] 17+ messages in thread