From: Daniel Gomez <da.gomez@kernel.org>
To: kdevops@lists.linux.dev, Luis Chamberlain <mcgrof@kernel.org>
Cc: Daniel Gomez <da.gomez@samsung.com>, Daniel Gomez <da.gomez@kernel.org>
Subject: [PATCH 4/5] gen_hosts: blktests: fix hosts names generation
Date: Mon, 12 May 2025 16:36:15 +0200 [thread overview]
Message-ID: <20250512-vagrant-fixes-v1-4-3dcfd0a380ba@samsung.com> (raw)
In-Reply-To: <20250512-vagrant-fixes-v1-0-3dcfd0a380ba@samsung.com>
From: Daniel Gomez <da.gomez@samsung.com>
The user of vars in set_fact tasks makes blktests_enabled_test_type to
expand to a list of chars instead of a list of strings, resulting in a
wrong hosts file generation with every char of a blktests enabled
section (BLKTESTS_SECTION_) a different host.
Pipe the variable generation into a block without using intermediate
variables that generates a list of strings.
Before:
[all]
dgc-[
dgc-'
dgc-b
dgc-l
dgc-o
dgc-c
dgc-k
dgc-'
dgc-,
dgc-
dgc-'
dgc-l
dgc-o
dgc-o
dgc-p
dgc-'
dgc-,
dgc-
dgc-'
dgc-n
dgc-b
dgc-d
dgc-'
{..}
After:
[all]
dgc-block
dgc-loop
{..}
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
playbooks/roles/gen_hosts/tasks/main.yml | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/playbooks/roles/gen_hosts/tasks/main.yml b/playbooks/roles/gen_hosts/tasks/main.yml
index a50355f721606a7da961b54ec29b16875391eca9..aeec3e934c19ab0f16a21bea76956e4c9e937985 100644
--- a/playbooks/roles/gen_hosts/tasks/main.yml
+++ b/playbooks/roles/gen_hosts/tasks/main.yml
@@ -203,13 +203,14 @@
- ansible_hosts_template.stat.exists
- name: Infer enabled blktests test section types
- vars:
- kdevops_config_data: "{{ lookup('file', topdir_path + '/.config') }}"
- config_val: "CONFIG_BLKTESTS_SECTION_"
- config_block_test_types: "{{ kdevops_config_data | regex_findall('^' + config_val + '(.*)=y$', multiline=True) }}"
- config_block_test_type_names: "{{ config_block_test_types | lower }}"
set_fact:
- blktests_enabled_test_types: "{{ config_block_test_type_names }}"
+ blktests_enabled_test_types: >-
+ {{
+ lookup('file', topdir_path + '/.config')
+ | regex_findall('^CONFIG_BLKTESTS_SECTION_(.*)=y$', multiline=True)
+ | map('lower')
+ | list
+ }}
when:
- kdevops_workflows_dedicated_workflow
- kdevops_workflow_enable_blktests
--
2.49.0
next prev parent reply other threads:[~2025-05-12 14:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-12 14:36 [PATCH 0/5] Ansible fixes in different roles Daniel Gomez
2025-05-12 14:36 ` [PATCH 1/5] gen_nodes: remove vagrant tasks Daniel Gomez
2025-05-12 14:36 ` [PATCH 2/5] update_ssh_config_guestfs: fix broken conditionals Daniel Gomez
2025-05-12 14:36 ` [PATCH 3/5] create_partition: fix using atribute append of list object Daniel Gomez
2025-05-12 14:36 ` Daniel Gomez [this message]
2025-05-12 14:36 ` [PATCH 5/5] gen_nodes: blktests: fix hosts names generation Daniel Gomez
2025-05-14 18:32 ` [PATCH 0/5] Ansible fixes in different roles Luis Chamberlain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250512-vagrant-fixes-v1-4-3dcfd0a380ba@samsung.com \
--to=da.gomez@kernel.org \
--cc=da.gomez@samsung.com \
--cc=kdevops@lists.linux.dev \
--cc=mcgrof@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox