[PATCH 2/6] blktests: add monitoring framework integration

Daniel Gomez <[email protected]>
Newsgroups dev.linux.lists.kdevops
Message-ID <[email protected]>
From: Daniel Gomez <[email protected]>

Add monitoring support to blktests workflow following fstests pattern:
- Start monitoring before tests, stop and collect data after
- Use import_tasks for proper variable scoping with modular structure
- Add vars tag to Makefile targets for variable loading
- Set blktests-specific monitoring results path
- Update documentation to include blktests support

Enables system monitoring during block device testing.
Works with the new modular monitoring architecture.

Generated-by: Claude AI
Signed-off-by: Daniel Gomez <[email protected]>
---
 docs/monitoring.md                                |  1 +
 playbooks/roles/blktests/tasks/main.yml           | 14 ++++++++++++++
 playbooks/roles/monitoring/tasks/common/setup.yml |  1 +
 workflows/blktests/Makefile                       |  8 ++++----
 4 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/docs/monitoring.md b/docs/monitoring.md
index 7102db5d..1e05bbd5 100644
--- a/docs/monitoring.md
+++ b/docs/monitoring.md
@@ -49,6 +49,7 @@ make menuconfig
 ### Currently Supported Workflows
 
 - **fstests**: Filesystem testing framework
+- **blktests**: Block layer testing framework
 
 ### How Workflows Integrate Monitoring
 
diff --git a/playbooks/roles/blktests/tasks/main.yml b/playbooks/roles/blktests/tasks/main.yml
index f4e53e9c..1f9838e5 100644
--- a/playbooks/roles/blktests/tasks/main.yml
+++ b/playbooks/roles/blktests/tasks/main.yml
@@ -265,6 +265,13 @@
     - kdevops_run_blktests|bool
   run_once: true
 
+# Start monitoring services before running tests
+- ansible.builtin.import_tasks: ../../monitoring/tasks/monitor_run.yml
+  when:
+    - kdevops_run_blktests|bool
+    - enable_monitoring|default(false)|bool
+  tags: ["blktests", "run_tests", "monitoring", "monitor_run"]
+
 - name: Enable low-level messages on console
   become: true
   become_flags: "su - -c"
@@ -386,6 +393,13 @@
     - kdevops_run_blktests|bool
   run_once: true
 
+# Stop monitoring services and collect data after running tests
+- ansible.builtin.import_tasks: ../../monitoring/tasks/monitor_collect.yml
+  when:
+    - kdevops_run_blktests|bool
+    - enable_monitoring|default(false)|bool
+  tags: ["blktests", "run_tests", "monitoring", "monitor_collect"]
+
 - name: Clean up our localhost results/last-run directory
   ansible.builtin.file:
     path: "{{ blktests_results_target }}/{{ item }}"
diff --git a/playbooks/roles/monitoring/tasks/common/setup.yml b/playbooks/roles/monitoring/tasks/common/setup.yml
index e3e8501d..22a43a80 100644
--- a/playbooks/roles/monitoring/tasks/common/setup.yml
+++ b/playbooks/roles/monitoring/tasks/common/setup.yml
@@ -9,6 +9,7 @@
       monitor_folio_migration: {{ monitor_folio_migration | default(false) }}
       enable_monitoring: {{ enable_monitoring | default(false) }}
       kdevops_run_fstests: {{ kdevops_run_fstests | default(false) }}
+      kdevops_run_blktests: {{ kdevops_run_blktests | default(false) }}
 
 - name: Set workflow-appropriate monitoring results path
   ansible.builtin.set_fact:
diff --git a/workflows/blktests/Makefile b/workflows/blktests/Makefile
index 12c0d933..6acb3a71 100644
--- a/workflows/blktests/Makefile
+++ b/workflows/blktests/Makefile
@@ -65,7 +65,7 @@ blktests-baseline:
 	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
 		--limit 'baseline' \
 		playbooks/blktests.yml \
-		--tags run_tests,copy_results \
+		--tags vars,run_tests,copy_results \
 		--extra-vars '{ $(BLKTESTS_DYNAMIC_RUNTIME_VARS) }' \
 		--extra-vars=@./extra_vars.yaml $(LIMIT_HOSTS)
 
@@ -74,7 +74,7 @@ blktests-baseline-skip-kdevops-update:
 	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
 		--limit 'baseline' \
 		playbooks/blktests.yml \
-		--tags run_tests,copy_results --skip-tags git_update \
+		--tags vars,run_tests,copy_results --skip-tags git_update \
 		--extra-vars '{ $(BLKTESTS_DYNAMIC_RUNTIME_VARS) }' \
 		--extra-vars=@./extra_vars.yaml $(LIMIT_HOSTS)
 
@@ -82,7 +82,7 @@ blktests-baseline-run-oscheck-only:
 	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
 		--limit 'baseline' \
 		playbooks/blktests.yml \
-		--tags run_tests,copy_results \
+		--tags vars,run_tests,copy_results \
 		--skip-tags git_update,reboot,clean_results \
 		--extra-vars '{ $(BLKTESTS_DYNAMIC_RUNTIME_VARS) }' \
 		--extra-vars=@./extra_vars.yaml $(LIMIT_HOSTS)
@@ -91,7 +91,7 @@ blktests-dev:
 	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
 		--limit 'dev' \
 		playbooks/blktests.yml \
-		--tags run_tests,copy_results \
+		--tags vars,run_tests,copy_results \
 		--extra-vars '{ $(BLKTESTS_DYNAMIC_RUNTIME_VARS) }' \
 		--extra-vars=@./extra_vars.yaml $(LIMIT_HOSTS)
 

-- 
2.50.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.