Skip to content

Commit cbff820

Browse files
committed
reboot-limit: fix COUNT parameter to properly override reboot count
The COUNT parameter was not being passed to ansible-playbook, causing it to always use the configured value from extra_vars.yaml instead of the runtime override. Fix by: - Adding $(KDEVOPS_EXTRA_VARS) dependency to ensure extra_vars.yaml exists - Passing reboot_limit_max as an additional --extra-vars parameter which overrides the value from extra_vars.yaml This ensures that `make reboot-limit-tests COUNT=2` properly limits the test to 2 reboots instead of using the configured maximum. Generated-by: Claude AI Reviewed-by: Chuck Lever <[email protected]> Signed-off-by: Luis Chamberlain <[email protected]>
1 parent 8f8062c commit cbff820

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

workflows/demos/reboot-limit/Makefile

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,11 @@ endif # CONFIG_REBOOT_LIMIT_ENABLE_LOOP
107107
#
108108
# The playbook reboot-limit.yml is used to run all tasks defined except those
109109
# with tags "run_tests" or "copy_results".
110-
reboot-limit:
110+
reboot-limit: $(KDEVOPS_EXTRA_VARS)
111111
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
112112
playbooks/reboot-limit.yml \
113-
--skip-tags run_tests,copy_results
113+
--skip-tags run_tests,copy_results \
114+
--extra-vars="reboot_limit_max=$(REBOOT_LIMIT_MAX)"
114115

115116
# kdevops supports generic workflows such as the enabling you to then use the
116117
# /data/ partition to git clone linux, compile linux, install it and reboot
@@ -137,17 +138,19 @@ reboot-limit:
137138
# tags "first_run" first and then "run_tests" and "copy_results". We always
138139
# use the vars tag to ensure we get variables defined which we construct on the
139140
# fly.
140-
reboot-limit-baseline:
141+
reboot-limit-baseline: $(KDEVOPS_EXTRA_VARS)
141142
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
142143
--limit 'baseline' \
143144
playbooks/reboot-limit.yml \
144145
--tags vars,first_run,reset \
145-
--extra-vars=@./extra_vars.yaml
146+
--extra-vars=@./extra_vars.yaml \
147+
--extra-vars="reboot_limit_max=$(REBOOT_LIMIT_MAX)"
146148
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
147149
--limit 'baseline' \
148150
playbooks/reboot-limit.yml \
149151
--tags vars,run_tests,copy_results \
150-
--extra-vars=@./extra_vars.yaml
152+
--extra-vars=@./extra_vars.yaml \
153+
--extra-vars="reboot_limit_max=$(REBOOT_LIMIT_MAX)"
151154

152155
# Once you know the baseline works, you may want to run the baseline in a loop
153156
# up to the number of times you define. We define this goal in kdevops as
@@ -172,17 +175,19 @@ reboot-limit-baseline-reset:
172175
reboot-limit-tests: reboot-limit-baseline reboot-limit-dev
173176

174177
# Below are the corresponding dev targets
175-
reboot-limit-dev:
178+
reboot-limit-dev: $(KDEVOPS_EXTRA_VARS)
176179
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
177180
--limit 'dev' \
178181
playbooks/reboot-limit.yml \
179182
--tags vars,first_run,reset \
180-
--extra-vars=@./extra_vars.yaml
183+
--extra-vars=@./extra_vars.yaml \
184+
--extra-vars="reboot_limit_max=$(REBOOT_LIMIT_MAX)"
181185
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
182186
--limit 'dev' \
183187
playbooks/reboot-limit.yml \
184188
--tags vars,run_tests,copy_results \
185-
--extra-vars=@./extra_vars.yaml
189+
--extra-vars=@./extra_vars.yaml \
190+
--extra-vars="reboot_limit_max=$(REBOOT_LIMIT_MAX)"
186191

187192
reboot-limit-dev-loop:
188193
$(Q)$(REBOOT_LIMIT_LOOP) dev

0 commit comments

Comments
 (0)