[PATCH 2/3] fio-tets: add DECLARE_HOSTS support

Luis Chamberlain <[email protected]> Wed, 19 Nov 2025 19:15:25 -0800
Newsgroups dev.linux.lists.kdevops
Message-ID <[email protected]>
Declared hosts support enables testing on bare metal servers,
pre-provisioned VMs, or any pre-existing infrastructure with SSH access.
The fio-tests workflow can now be used with declared hosts for both
single filesystem and multi-filesystem testing scenarios. The
implementation removes the KDEVOPS_USE_DECLARED_HOSTS restriction and
extends the declared-hosts template to properly handle fio-tests
multi-filesystem sections.

Signed-off-by: Luis Chamberlain <[email protected]>
---
 kconfigs/workflows/Kconfig                    |  1 -
 .../templates/workflows/declared-hosts.j2     | 41 +++++++++++++++++++
 2 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/kconfigs/workflows/Kconfig b/kconfigs/workflows/Kconfig
index 1b583094..a1ea4944 100644
--- a/kconfigs/workflows/Kconfig
+++ b/kconfigs/workflows/Kconfig
@@ -219,7 +219,6 @@ config KDEVOPS_WORKFLOW_DEDICATE_MMTESTS
 
 config KDEVOPS_WORKFLOW_DEDICATE_FIO_TESTS
 	bool "fio-tests"
-	depends on !KDEVOPS_USE_DECLARED_HOSTS
 	select KDEVOPS_WORKFLOW_ENABLE_FIO_TESTS
 	help
 	  This will dedicate your configuration to running only the
diff --git a/playbooks/roles/gen_hosts/templates/workflows/declared-hosts.j2 b/playbooks/roles/gen_hosts/templates/workflows/declared-hosts.j2
index 7d7975c7..f0517c45 100644
--- a/playbooks/roles/gen_hosts/templates/workflows/declared-hosts.j2
+++ b/playbooks/roles/gen_hosts/templates/workflows/declared-hosts.j2
@@ -78,6 +78,21 @@ ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
 [fio_tests:vars]
 ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
 
+{# Add per-section groups for multi-filesystem testing #}
+{% if fio_tests_multi_filesystem|default(false)|bool %}
+{% for host in parsed_hosts %}
+{% set section = host | regex_replace('^.*-fio-tests-', '') | regex_replace('-dev$', '') %}
+{% if section != host %}
+[fio_tests_{{ section | replace('-', '_') }}]
+{{ host }}
+
+[fio_tests_{{ section | replace('-', '_') }}:vars]
+ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
+
+{% endif %}
+{% endfor %}
+{% endif %}
+
 {% elif kdevops_workflow_enable_fstests %}
 [fstests]
 {% for host in parsed_hosts %}
@@ -230,6 +245,32 @@ ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
 {% endfor %}
 {% endif %}
 
+{# For non-dedicated workflows (mix mode), add fio-tests group if enabled #}
+{% if kdevops_workflow_enable_fio_tests %}
+[fio_tests]
+{% for host in parsed_hosts %}
+{{ host }}
+{% endfor %}
+
+[fio_tests:vars]
+ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
+
+{# Add per-section groups for multi-filesystem testing #}
+{% if fio_tests_multi_filesystem|default(false)|bool %}
+{% for host in parsed_hosts %}
+{% set section = host | regex_replace('^.*-fio-tests-', '') | regex_replace('-dev$', '') %}
+{% if section != host %}
+[fio_tests_{{ section | replace('-', '_') }}]
+{{ host }}
+
+[fio_tests_{{ section | replace('-', '_') }}:vars]
+ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
+
+{% endif %}
+{% endfor %}
+{% endif %}
+{% endif %}
+
 {% endif %}
 
 [service]
-- 
2.51.0