Skip to content

Commit 6fcbbdd

Browse files
committed
reboot-limit: convert CONFIG_KERNEL_CI to internal loop feature
Convert reboot-limit workflow to use internal loop configuration instead of the global CONFIG_KERNEL_CI feature: - Remove CONFIG_KERNEL_CI selects from reboot-limit Kconfig - Add internal REBOOT_LIMIT_ENABLE_LOOP configuration - Add REBOOT_LIMIT_LOOP_STEADY_STATE_GOAL for loop count control - Add REBOOT_LIMIT_LOOP_STEADY_STATE_INCREMENTAL for resumable loops - Update Makefile to use internal variables instead of kernel-ci - Update run_loop.sh to use reboot-limit specific configs - Rename targets from -kernelci to -kotd (kernel-of-the-day) - Remove kernel-ci script symlinks and add loop scripts - Update help menu to reflect new target names This makes reboot-limit self-contained with its own loop testing configuration rather than relying on the global kernel-ci feature that's being removed. Generated-by: Claude AI Signed-off-by: Luis Chamberlain <[email protected]>
1 parent 2bb1fed commit 6fcbbdd

File tree

6 files changed

+85
-29
lines changed

6 files changed

+85
-29
lines changed

scripts/workflows/demos/reboot-limit/run_kernel_ci.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

scripts/workflows/demos/reboot-limit/run_kernel_ci_kotd.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

scripts/workflows/demos/reboot-limit/run_loop.sh

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
#!/bin/bash
22
# SPDX-License-Identifier: copyleft-next-0.3.1
33

4-
# Part of kdevops kernel-ci, this is the script which will run the test workflow
5-
# as many times as indicated up to CONFIG_KERNEL_CI_STEADY_STATE_GOAL
4+
# Part of kdevops reboot-limit loop testing, this script will run the test workflow
5+
# as many times as indicated up to CONFIG_REBOOT_LIMIT_LOOP_STEADY_STATE_GOAL
66

77
source ${TOPDIR}/.config
88
source ${TOPDIR}/scripts/lib.sh
99

10-
COUNT=1
10+
# Check if we're resuming from a previous run
11+
if [[ "$CONFIG_REBOOT_LIMIT_LOOP_STEADY_STATE_INCREMENTAL" == "y" && -f $KERNEL_CI_OK_FILE ]]; then
12+
COUNT=$(cat $KERNEL_CI_OK_FILE)
13+
let COUNT=$COUNT+1
14+
else
15+
COUNT=1
16+
rm -f $KERNEL_CI_OK_FILE
17+
fi
1118

1219
run_loop()
1320
{
1421
while true; do
15-
echo "== kernel-ci reboot-limit test loop $COUNT start: $(date)" > $KERNEL_CI_FAIL_LOG
22+
echo "== reboot-limit test loop $COUNT start: $(date)" > $KERNEL_CI_FAIL_LOG
1623
echo "/usr/bin/time -f %E make reboot-limit-baseline" >> $KERNEL_CI_FAIL_LOG
1724
/usr/bin/time -p -o $KERNEL_CI_LOGTIME make reboot-limit-baseline >> $KERNEL_CI_FAIL_LOG
1825
ANSIBLE_CALL_RET=$?
@@ -43,14 +50,14 @@ run_loop()
4350
echo $COUNT > $KERNEL_CI_OK_FILE
4451

4552
let COUNT=$COUNT+1
46-
if [[ "$CONFIG_KERNEL_CI_ENABLE_STEADY_STATE" == "y" &&
47-
"$COUNT" -gt "$CONFIG_KERNEL_CI_STEADY_STATE_GOAL" ]]; then
53+
if [[ "$CONFIG_REBOOT_LIMIT_ENABLE_LOOP" == "y" &&
54+
"$COUNT" -gt "$CONFIG_REBOOT_LIMIT_LOOP_STEADY_STATE_GOAL" ]]; then
4855
exit 0
4956
fi
5057
sleep 1
5158
done
5259
}
5360

54-
rm -f $KERNEL_CI_FAIL_FILE $KERNEL_CI_OK_FILE
55-
echo "= kernel-ci full log" > $KERNEL_CI_FULL_LOG
61+
rm -f $KERNEL_CI_FAIL_FILE
62+
echo "= reboot-limit loop full log" > $KERNEL_CI_FULL_LOG
5663
run_loop
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: copyleft-next-0.3.1
3+
4+
# Part of kdevops reboot-limit loop testing with kernel-of-the-day
5+
# This script would normally update to the latest kernel before running the loop,
6+
# but since CONFIG_KERNEL_CI is being removed, this is now just a placeholder
7+
# that runs the regular loop.
8+
9+
if [[ "$TOPDIR" == "" ]]; then
10+
TOPDIR=$PWD
11+
fi
12+
13+
source ${TOPDIR}/.config
14+
source ${TOPDIR}/scripts/lib.sh
15+
16+
TARGET_HOSTS="baseline"
17+
if [[ "$1" != "" ]]; then
18+
TARGET_HOSTS=$1
19+
fi
20+
21+
echo "Note: kernel-of-the-day updates are not yet implemented for reboot-limit"
22+
echo "Running regular reboot-limit loop instead..."
23+
24+
# For now, just run the regular loop
25+
${TOPDIR}/scripts/workflows/demos/reboot-limit/run_loop.sh

workflows/demos/reboot-limit/Kconfig

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ config WORKFLOWS_REBOOT_LIMIT
44
select KDEVOPS_TRY_INSTALL_KDEV_TOOLS
55
select KDEVOPS_DEVCONFIG_ENABLE_CONSOLE
66
select KDEVOPS_DEVCONFIG_ENABLE_SYSTEMD_WATCHDOG
7-
select KERNEL_CI
8-
select KERNEL_CI_ENABLE_STEADY_STATE
97
help
108
If you are doing kernel tests which includes a reboot, along the way,
119
or if you do a reboot after a series of tests, you may want to first
@@ -71,6 +69,33 @@ config REBOOT_LIMIT_WATCHDOG_CHECK_TIME
7169

7270
endif
7371

72+
config REBOOT_LIMIT_ENABLE_LOOP
73+
bool "Enable loop testing for reboot-limit"
74+
default y
75+
help
76+
Enable this to run reboot-limit tests in a loop until a failure
77+
is found or steady state is reached.
78+
79+
if REBOOT_LIMIT_ENABLE_LOOP
80+
81+
config REBOOT_LIMIT_LOOP_STEADY_STATE_GOAL
82+
int "Steady-state goal for reboot-limit loop testing"
83+
default 100
84+
help
85+
The maximum number of successful test loops to run before
86+
declaring steady state achieved. Each loop runs REBOOT_LIMIT_BOOT_MAX
87+
reboots, so the total number of reboots is this value multiplied
88+
by REBOOT_LIMIT_BOOT_MAX.
89+
90+
config REBOOT_LIMIT_LOOP_STEADY_STATE_INCREMENTAL
91+
bool "Use incremental steady-state counting"
92+
default y
93+
help
94+
Enable this so that the loop will resume from the last success
95+
counter after failures rather than resetting to zero.
96+
97+
endif # REBOOT_LIMIT_ENABLE_LOOP
98+
7499
config REBOOT_LIMIT_BOOT_COUNT_CRASH_ENABLE
75100
bool "Force a crash after certain period of reboots"
76101
help

workflows/demos/reboot-limit/Makefile

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ endif
7070
# the extra_vars.yaml file.
7171
WORKFLOW_ARGS += $(REBOOT_LIMIT_ARGS)
7272

73-
# The default is our workflow does not have kernel-ci enabled
74-
REBOOT_LIMIT_KERNEL_CI_LOOP := false
75-
REBOOT_LIMIT_KERNEL_CI_LOOP_KOTD := false
73+
# The default is our workflow does not have loop testing enabled
74+
REBOOT_LIMIT_LOOP := false
75+
REBOOT_LIMIT_LOOP_KOTD := false
7676

77-
# If kdevops was configured to enable kernel-ci we define our scripts
78-
ifeq (y,$(CONFIG_KERNEL_CI))
79-
REBOOT_LIMIT_KERNEL_CI_LOOP := scripts/workflows/demos/reboot-limit/run_kernel_ci.sh
80-
REBOOT_LIMIT_KERNEL_CI_LOOP_KOTD := scripts/workflows/demos/reboot-limit/run_kernel_ci_kotd.sh
81-
endif # CONFIG_KERNEL_CI
77+
# If reboot-limit was configured to enable loop testing we define our scripts
78+
ifeq (y,$(CONFIG_REBOOT_LIMIT_ENABLE_LOOP))
79+
REBOOT_LIMIT_LOOP := scripts/workflows/demos/reboot-limit/run_loop.sh
80+
REBOOT_LIMIT_LOOP_KOTD := scripts/workflows/demos/reboot-limit/run_loop_kotd.sh
81+
endif # CONFIG_REBOOT_LIMIT_ENABLE_LOOP
8282

8383
# By default KDEVOPS_HOSTS_TEMPLATE is defined to be hosts.in, if you want an
8484
# alternative you can define one, or even have a dynamic one. For an example
@@ -146,14 +146,14 @@ reboot-limit-baseline:
146146

147147
# Once you know the baseline works, you may want to run the baseline in a loop
148148
# up to the number of times you define. We define this goal in kdevops as
149-
# the CONFIG_KERNEL_CI_STEADY_STATE_GOAL.
149+
# the CONFIG_REBOOT_LIMIT_LOOP_STEADY_STATE_GOAL.
150150
reboot-limit-baseline-loop:
151-
$(Q)$(REBOOT_LIMIT_KERNEL_CI_LOOP) baseline
151+
$(Q)$(REBOOT_LIMIT_LOOP) baseline
152152

153-
# The kdevops kernel-ci target will try to upgrade your kernel to the latest
153+
# The kdevops kotd (kernel-of-the-day) target will try to upgrade your kernel to the latest
154154
# and then run the baseline-loop.
155-
reboot-limit-baseline-kernelci:
156-
$(Q)$(REBOOT_LIMIT_KERNEL_CI_LOOP_KOTD) baseline
155+
reboot-limit-baseline-kotd:
156+
$(Q)$(REBOOT_LIMIT_LOOP_KOTD) baseline
157157

158158
# Resets the boot counters so we start from scratch
159159
reboot-limit-baseline-reset:
@@ -177,10 +177,10 @@ reboot-limit-dev-baseline:
177177
--extra-vars=@./extra_vars.yaml
178178

179179
reboot-limit-dev-loop:
180-
$(Q)$(REBOOT_LIMIT_KERNEL_CI_LOOP) dev
180+
$(Q)$(REBOOT_LIMIT_LOOP) dev
181181

182-
reboot-limit-dev-kernelci:
183-
$(Q)$(REBOOT_LIMIT_KERNEL_CI_LOOP_KOTD) dev
182+
reboot-limit-dev-kotd:
183+
$(Q)$(REBOOT_LIMIT_LOOP_KOTD) dev
184184

185185
reboot-limit-dev-reset:
186186
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
@@ -195,7 +195,8 @@ reboot-limit-help-menu:
195195
@echo "reboot-limit-baseline - Run the reboot-linit test on baseline hosts and collect results"
196196
@echo "reboot-limit-baseline-reset - Reset the test boot counter for baseline"
197197
@echo "reboot-limit-dev - Run the reboot-limti test on dev hosts and collect results"
198-
@echo "reboot-limit-baseline-kernelci - Run the reboot-limit kernel-ci loop"
198+
@echo "reboot-limit-baseline-loop - Run the reboot-limit test in a loop until failure or steady state"
199+
@echo "reboot-limit-baseline-kotd - Run the reboot-limit kotd (kernel-of-the-day) loop"
199200
@echo ""
200201

201202
HELP_TARGETS += reboot-limit-help-menu

0 commit comments

Comments
 (0)