xref: /OK3568_Linux_fs/kernel/tools/testing/ktest/sample.conf (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun#
2*4882a593Smuzhiyun# Config file for ktest.pl
3*4882a593Smuzhiyun#
4*4882a593Smuzhiyun# Place your customized version of this, in the working directory that
5*4882a593Smuzhiyun# ktest.pl is run from. By default, ktest.pl will look for a file
6*4882a593Smuzhiyun# called "ktest.conf", but you can name it anything you like and specify
7*4882a593Smuzhiyun# the name of your config file as the first argument of ktest.pl.
8*4882a593Smuzhiyun#
9*4882a593Smuzhiyun# Note, all paths must be absolute
10*4882a593Smuzhiyun#
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun# Options set in the beginning of the file are considered to be
13*4882a593Smuzhiyun# default options. These options can be overridden by test specific
14*4882a593Smuzhiyun# options, with the following exceptions:
15*4882a593Smuzhiyun#
16*4882a593Smuzhiyun#  LOG_FILE
17*4882a593Smuzhiyun#  CLEAR_LOG
18*4882a593Smuzhiyun#  POWEROFF_ON_SUCCESS
19*4882a593Smuzhiyun#  REBOOT_ON_SUCCESS
20*4882a593Smuzhiyun#
21*4882a593Smuzhiyun# Test specific options are set after the label:
22*4882a593Smuzhiyun#
23*4882a593Smuzhiyun# TEST_START
24*4882a593Smuzhiyun#
25*4882a593Smuzhiyun# The options after a TEST_START label are specific to that test.
26*4882a593Smuzhiyun# Each TEST_START label will set up a new test. If you want to
27*4882a593Smuzhiyun# perform a test more than once, you can add the ITERATE label
28*4882a593Smuzhiyun# to it followed by the number of times you want that test
29*4882a593Smuzhiyun# to iterate. If the ITERATE is left off, the test will only
30*4882a593Smuzhiyun# be performed once.
31*4882a593Smuzhiyun#
32*4882a593Smuzhiyun# TEST_START ITERATE 10
33*4882a593Smuzhiyun#
34*4882a593Smuzhiyun# You can skip a test by adding SKIP (before or after the ITERATE
35*4882a593Smuzhiyun# and number)
36*4882a593Smuzhiyun#
37*4882a593Smuzhiyun# TEST_START SKIP
38*4882a593Smuzhiyun#
39*4882a593Smuzhiyun# TEST_START SKIP ITERATE 10
40*4882a593Smuzhiyun#
41*4882a593Smuzhiyun# TEST_START ITERATE 10 SKIP
42*4882a593Smuzhiyun#
43*4882a593Smuzhiyun# The SKIP label causes the options and the test itself to be ignored.
44*4882a593Smuzhiyun# This is useful to set up several different tests in one config file, and
45*4882a593Smuzhiyun# only enabling the ones you want to use for a current test run.
46*4882a593Smuzhiyun#
47*4882a593Smuzhiyun# You can add default options anywhere in the file as well
48*4882a593Smuzhiyun# with the DEFAULTS tag. This allows you to have default options
49*4882a593Smuzhiyun# after the test options to keep the test options at the top
50*4882a593Smuzhiyun# of the file. You can even place the DEFAULTS tag between
51*4882a593Smuzhiyun# test cases (but not in the middle of a single test case)
52*4882a593Smuzhiyun#
53*4882a593Smuzhiyun# TEST_START
54*4882a593Smuzhiyun# MIN_CONFIG = /home/test/config-test1
55*4882a593Smuzhiyun#
56*4882a593Smuzhiyun# DEFAULTS
57*4882a593Smuzhiyun# MIN_CONFIG = /home/test/config-default
58*4882a593Smuzhiyun#
59*4882a593Smuzhiyun# TEST_START ITERATE 10
60*4882a593Smuzhiyun#
61*4882a593Smuzhiyun# The above will run the first test with MIN_CONFIG set to
62*4882a593Smuzhiyun# /home/test/config-test-1. Then 10 tests will be executed
63*4882a593Smuzhiyun# with MIN_CONFIG with /home/test/config-default.
64*4882a593Smuzhiyun#
65*4882a593Smuzhiyun# You can also disable defaults with the SKIP option
66*4882a593Smuzhiyun#
67*4882a593Smuzhiyun# DEFAULTS SKIP
68*4882a593Smuzhiyun# MIN_CONFIG = /home/test/config-use-sometimes
69*4882a593Smuzhiyun#
70*4882a593Smuzhiyun# DEFAULTS
71*4882a593Smuzhiyun# MIN_CONFIG = /home/test/config-most-times
72*4882a593Smuzhiyun#
73*4882a593Smuzhiyun# The above will ignore the first MIN_CONFIG. If you want to
74*4882a593Smuzhiyun# use the first MIN_CONFIG, remove the SKIP from the first
75*4882a593Smuzhiyun# DEFAULTS tag and add it to the second. Be careful, options
76*4882a593Smuzhiyun# may only be declared once per test or default. If you have
77*4882a593Smuzhiyun# the same option name under the same test or as default
78*4882a593Smuzhiyun# ktest will fail to execute, and no tests will run.
79*4882a593Smuzhiyun#
80*4882a593Smuzhiyun# DEFAULTS OVERRIDE
81*4882a593Smuzhiyun#
82*4882a593Smuzhiyun# Options defined in the DEFAULTS section can not be duplicated
83*4882a593Smuzhiyun# even if they are defined in two different DEFAULT sections.
84*4882a593Smuzhiyun# This is done to catch mistakes where an option is added but
85*4882a593Smuzhiyun# the previous option was forgotten about and not commented.
86*4882a593Smuzhiyun#
87*4882a593Smuzhiyun# The OVERRIDE keyword can be added to a section to allow this
88*4882a593Smuzhiyun# section to override other DEFAULT sections values that have
89*4882a593Smuzhiyun# been defined previously. It will only override options that
90*4882a593Smuzhiyun# have been defined before its use. Options defined later
91*4882a593Smuzhiyun# in a non override section will still error. The same option
92*4882a593Smuzhiyun# can not be defined in the same section even if that section
93*4882a593Smuzhiyun# is marked OVERRIDE.
94*4882a593Smuzhiyun#
95*4882a593Smuzhiyun#
96*4882a593Smuzhiyun#
97*4882a593Smuzhiyun# Both TEST_START and DEFAULTS sections can also have the IF keyword
98*4882a593Smuzhiyun# The value after the IF must evaluate into a 0 or non 0 positive
99*4882a593Smuzhiyun# integer, and can use the config variables (explained below).
100*4882a593Smuzhiyun#
101*4882a593Smuzhiyun# DEFAULTS IF ${IS_X86_32}
102*4882a593Smuzhiyun#
103*4882a593Smuzhiyun# The above will process the DEFAULTS section if the config
104*4882a593Smuzhiyun# variable IS_X86_32 evaluates to a non zero positive integer
105*4882a593Smuzhiyun# otherwise if it evaluates to zero, it will act the same
106*4882a593Smuzhiyun# as if the SKIP keyword was used.
107*4882a593Smuzhiyun#
108*4882a593Smuzhiyun# The ELSE keyword can be used directly after a section with
109*4882a593Smuzhiyun# a IF statement.
110*4882a593Smuzhiyun#
111*4882a593Smuzhiyun# TEST_START IF ${RUN_NET_TESTS}
112*4882a593Smuzhiyun# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-network
113*4882a593Smuzhiyun#
114*4882a593Smuzhiyun# ELSE
115*4882a593Smuzhiyun#
116*4882a593Smuzhiyun# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-normal
117*4882a593Smuzhiyun#
118*4882a593Smuzhiyun#
119*4882a593Smuzhiyun# The ELSE keyword can also contain an IF statement to allow multiple
120*4882a593Smuzhiyun# if then else sections. But all the sections must be either
121*4882a593Smuzhiyun# DEFAULT or TEST_START, they can not be a mixture.
122*4882a593Smuzhiyun#
123*4882a593Smuzhiyun# TEST_START IF ${RUN_NET_TESTS}
124*4882a593Smuzhiyun# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-network
125*4882a593Smuzhiyun#
126*4882a593Smuzhiyun# ELSE IF ${RUN_DISK_TESTS}
127*4882a593Smuzhiyun# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-tests
128*4882a593Smuzhiyun#
129*4882a593Smuzhiyun# ELSE IF ${RUN_CPU_TESTS}
130*4882a593Smuzhiyun# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-cpu
131*4882a593Smuzhiyun#
132*4882a593Smuzhiyun# ELSE
133*4882a593Smuzhiyun# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-network
134*4882a593Smuzhiyun#
135*4882a593Smuzhiyun# The if statement may also have comparisons that will and for
136*4882a593Smuzhiyun# == and !=, strings may be used for both sides.
137*4882a593Smuzhiyun#
138*4882a593Smuzhiyun# BOX_TYPE := x86_32
139*4882a593Smuzhiyun#
140*4882a593Smuzhiyun# DEFAULTS IF ${BOX_TYPE} == x86_32
141*4882a593Smuzhiyun# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-32
142*4882a593Smuzhiyun# ELSE
143*4882a593Smuzhiyun# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-64
144*4882a593Smuzhiyun#
145*4882a593Smuzhiyun# The DEFINED keyword can be used by the IF statements too.
146*4882a593Smuzhiyun# It returns true if the given config variable or option has been defined
147*4882a593Smuzhiyun# or false otherwise.
148*4882a593Smuzhiyun#
149*4882a593Smuzhiyun#
150*4882a593Smuzhiyun# DEFAULTS IF DEFINED USE_CC
151*4882a593Smuzhiyun# CC := ${USE_CC}
152*4882a593Smuzhiyun# ELSE
153*4882a593Smuzhiyun# CC := gcc
154*4882a593Smuzhiyun#
155*4882a593Smuzhiyun#
156*4882a593Smuzhiyun# As well as NOT DEFINED.
157*4882a593Smuzhiyun#
158*4882a593Smuzhiyun# DEFAULTS IF NOT DEFINED MAKE_CMD
159*4882a593Smuzhiyun# MAKE_CMD := make ARCH=x86
160*4882a593Smuzhiyun#
161*4882a593Smuzhiyun#
162*4882a593Smuzhiyun# And/or ops (&&,||) may also be used to make complex conditionals.
163*4882a593Smuzhiyun#
164*4882a593Smuzhiyun# TEST_START IF (DEFINED ALL_TESTS || ${MYTEST} == boottest) && ${MACHINE} == gandalf
165*4882a593Smuzhiyun#
166*4882a593Smuzhiyun# Notice the use of parentheses. Without any parentheses the above would be
167*4882a593Smuzhiyun# processed the same as:
168*4882a593Smuzhiyun#
169*4882a593Smuzhiyun# TEST_START IF DEFINED ALL_TESTS || (${MYTEST} == boottest && ${MACHINE} == gandalf)
170*4882a593Smuzhiyun#
171*4882a593Smuzhiyun#
172*4882a593Smuzhiyun#
173*4882a593Smuzhiyun# INCLUDE file
174*4882a593Smuzhiyun#
175*4882a593Smuzhiyun# The INCLUDE keyword may be used in DEFAULT sections. This will
176*4882a593Smuzhiyun# read another config file and process that file as well. The included
177*4882a593Smuzhiyun# file can include other files, add new test cases or default
178*4882a593Smuzhiyun# statements. Config variables will be passed to these files and changes
179*4882a593Smuzhiyun# to config variables will be seen by top level config files. Including
180*4882a593Smuzhiyun# a file is processed just like the contents of the file was cut and pasted
181*4882a593Smuzhiyun# into the top level file, except, that include files that end with
182*4882a593Smuzhiyun# TEST_START sections will have that section ended at the end of
183*4882a593Smuzhiyun# the include file. That is, an included file is included followed
184*4882a593Smuzhiyun# by another DEFAULT keyword.
185*4882a593Smuzhiyun#
186*4882a593Smuzhiyun# Unlike other files referenced in this config, the file path does not need
187*4882a593Smuzhiyun# to be absolute. If the file does not start with '/', then the directory
188*4882a593Smuzhiyun# that the current config file was located in is used. If no config by the
189*4882a593Smuzhiyun# given name is found there, then the current directory is searched.
190*4882a593Smuzhiyun#
191*4882a593Smuzhiyun# INCLUDE myfile
192*4882a593Smuzhiyun# DEFAULT
193*4882a593Smuzhiyun#
194*4882a593Smuzhiyun# is the same as:
195*4882a593Smuzhiyun#
196*4882a593Smuzhiyun# INCLUDE myfile
197*4882a593Smuzhiyun#
198*4882a593Smuzhiyun# Note, if the include file does not contain a full path, the file is
199*4882a593Smuzhiyun# searched first by the location of the original include file, and then
200*4882a593Smuzhiyun# by the location that ktest.pl was executed in.
201*4882a593Smuzhiyun#
202*4882a593Smuzhiyun
203*4882a593Smuzhiyun#### Config variables ####
204*4882a593Smuzhiyun#
205*4882a593Smuzhiyun# This config file can also contain "config variables".
206*4882a593Smuzhiyun# These are assigned with ":=" instead of the ktest option
207*4882a593Smuzhiyun# assignment "=".
208*4882a593Smuzhiyun#
209*4882a593Smuzhiyun# The difference between ktest options and config variables
210*4882a593Smuzhiyun# is that config variables can be used multiple times,
211*4882a593Smuzhiyun# where each instance will override the previous instance.
212*4882a593Smuzhiyun# And that they only live at time of processing this config.
213*4882a593Smuzhiyun#
214*4882a593Smuzhiyun# The advantage to config variables are that they can be used
215*4882a593Smuzhiyun# by any option or any other config variables to define thing
216*4882a593Smuzhiyun# that you may use over and over again in the options.
217*4882a593Smuzhiyun#
218*4882a593Smuzhiyun# For example:
219*4882a593Smuzhiyun#
220*4882a593Smuzhiyun# USER      := root
221*4882a593Smuzhiyun# TARGET    := mybox
222*4882a593Smuzhiyun# TEST_CASE := ssh ${USER}@${TARGET} /path/to/my/test
223*4882a593Smuzhiyun#
224*4882a593Smuzhiyun# TEST_START
225*4882a593Smuzhiyun# MIN_CONFIG = config1
226*4882a593Smuzhiyun# TEST = ${TEST_CASE}
227*4882a593Smuzhiyun#
228*4882a593Smuzhiyun# TEST_START
229*4882a593Smuzhiyun# MIN_CONFIG = config2
230*4882a593Smuzhiyun# TEST = ${TEST_CASE}
231*4882a593Smuzhiyun#
232*4882a593Smuzhiyun# TEST_CASE := ssh ${USER}@${TARGET} /path/to/my/test2
233*4882a593Smuzhiyun#
234*4882a593Smuzhiyun# TEST_START
235*4882a593Smuzhiyun# MIN_CONFIG = config1
236*4882a593Smuzhiyun# TEST = ${TEST_CASE}
237*4882a593Smuzhiyun#
238*4882a593Smuzhiyun# TEST_START
239*4882a593Smuzhiyun# MIN_CONFIG = config2
240*4882a593Smuzhiyun# TEST = ${TEST_CASE}
241*4882a593Smuzhiyun#
242*4882a593Smuzhiyun# TEST_DIR := /home/me/test
243*4882a593Smuzhiyun#
244*4882a593Smuzhiyun# BUILD_DIR = ${TEST_DIR}/linux.git
245*4882a593Smuzhiyun# OUTPUT_DIR = ${TEST_DIR}/test
246*4882a593Smuzhiyun#
247*4882a593Smuzhiyun# Note, the config variables are evaluated immediately, thus
248*4882a593Smuzhiyun# updating TARGET after TEST_CASE has been assigned does nothing
249*4882a593Smuzhiyun# to TEST_CASE.
250*4882a593Smuzhiyun#
251*4882a593Smuzhiyun# As shown in the example, to evaluate a config variable, you
252*4882a593Smuzhiyun# use the ${X} convention. Simple $X will not work.
253*4882a593Smuzhiyun#
254*4882a593Smuzhiyun# If the config variable does not exist, the ${X} will not
255*4882a593Smuzhiyun# be evaluated. Thus:
256*4882a593Smuzhiyun#
257*4882a593Smuzhiyun# MAKE_CMD = PATH=/mypath:${PATH} make
258*4882a593Smuzhiyun#
259*4882a593Smuzhiyun# If PATH is not a config variable, then the ${PATH} in
260*4882a593Smuzhiyun# the MAKE_CMD option will be evaluated by the shell when
261*4882a593Smuzhiyun# the MAKE_CMD option is passed into shell processing.
262*4882a593Smuzhiyun
263*4882a593Smuzhiyun#### Using options in other options ####
264*4882a593Smuzhiyun#
265*4882a593Smuzhiyun# Options that are defined in the config file may also be used
266*4882a593Smuzhiyun# by other options. All options are evaluated at time of
267*4882a593Smuzhiyun# use (except that config variables are evaluated at config
268*4882a593Smuzhiyun# processing time).
269*4882a593Smuzhiyun#
270*4882a593Smuzhiyun# If an ktest option is used within another option, instead of
271*4882a593Smuzhiyun# typing it again in that option you can simply use the option
272*4882a593Smuzhiyun# just like you can config variables.
273*4882a593Smuzhiyun#
274*4882a593Smuzhiyun# MACHINE = mybox
275*4882a593Smuzhiyun#
276*4882a593Smuzhiyun# TEST = ssh root@${MACHINE} /path/to/test
277*4882a593Smuzhiyun#
278*4882a593Smuzhiyun# The option will be used per test case. Thus:
279*4882a593Smuzhiyun#
280*4882a593Smuzhiyun# TEST_TYPE = test
281*4882a593Smuzhiyun# TEST = ssh root@{MACHINE}
282*4882a593Smuzhiyun#
283*4882a593Smuzhiyun# TEST_START
284*4882a593Smuzhiyun# MACHINE = box1
285*4882a593Smuzhiyun#
286*4882a593Smuzhiyun# TEST_START
287*4882a593Smuzhiyun# MACHINE = box2
288*4882a593Smuzhiyun#
289*4882a593Smuzhiyun# For both test cases, MACHINE will be evaluated at the time
290*4882a593Smuzhiyun# of the test case. The first test will run ssh root@box1
291*4882a593Smuzhiyun# and the second will run ssh root@box2.
292*4882a593Smuzhiyun
293*4882a593Smuzhiyun#### Mandatory Default Options ####
294*4882a593Smuzhiyun
295*4882a593Smuzhiyun# These options must be in the default section, although most
296*4882a593Smuzhiyun# may be overridden by test options.
297*4882a593Smuzhiyun
298*4882a593Smuzhiyun# The machine hostname that you will test
299*4882a593Smuzhiyun#MACHINE = target
300*4882a593Smuzhiyun
301*4882a593Smuzhiyun# The box is expected to have ssh on normal bootup, provide the user
302*4882a593Smuzhiyun#  (most likely root, since you need privileged operations)
303*4882a593Smuzhiyun#SSH_USER = root
304*4882a593Smuzhiyun
305*4882a593Smuzhiyun# The directory that contains the Linux source code
306*4882a593Smuzhiyun#BUILD_DIR = /home/test/linux.git
307*4882a593Smuzhiyun
308*4882a593Smuzhiyun# The directory that the objects will be built
309*4882a593Smuzhiyun# (can not be same as BUILD_DIR)
310*4882a593Smuzhiyun#OUTPUT_DIR = /home/test/build/target
311*4882a593Smuzhiyun
312*4882a593Smuzhiyun# The location of the compiled file to copy to the target
313*4882a593Smuzhiyun# (relative to OUTPUT_DIR)
314*4882a593Smuzhiyun#BUILD_TARGET = arch/x86/boot/bzImage
315*4882a593Smuzhiyun
316*4882a593Smuzhiyun# The place to put your image on the test machine
317*4882a593Smuzhiyun#TARGET_IMAGE = /boot/vmlinuz-test
318*4882a593Smuzhiyun
319*4882a593Smuzhiyun# A script or command to reboot the box
320*4882a593Smuzhiyun#
321*4882a593Smuzhiyun# Here is a digital loggers power switch example
322*4882a593Smuzhiyun#POWER_CYCLE = wget --no-proxy -O /dev/null -q  --auth-no-challenge 'http://admin:admin@power/outlet?5=CCL'
323*4882a593Smuzhiyun#
324*4882a593Smuzhiyun# Here is an example to reboot a virtual box on the current host
325*4882a593Smuzhiyun# with the name "Guest".
326*4882a593Smuzhiyun#POWER_CYCLE = virsh destroy Guest; sleep 5; virsh start Guest
327*4882a593Smuzhiyun
328*4882a593Smuzhiyun# The script or command that reads the console
329*4882a593Smuzhiyun#
330*4882a593Smuzhiyun#  If you use ttywatch server, something like the following would work.
331*4882a593Smuzhiyun#CONSOLE = nc -d localhost 3001
332*4882a593Smuzhiyun#
333*4882a593Smuzhiyun# For a virtual machine with guest name "Guest".
334*4882a593Smuzhiyun#CONSOLE =  virsh console Guest
335*4882a593Smuzhiyun
336*4882a593Smuzhiyun# Signal to send to kill console.
337*4882a593Smuzhiyun# ktest.pl will create a child process to monitor the console.
338*4882a593Smuzhiyun# When the console is finished, ktest will kill the child process
339*4882a593Smuzhiyun# with this signal.
340*4882a593Smuzhiyun# (default INT)
341*4882a593Smuzhiyun#CLOSE_CONSOLE_SIGNAL = HUP
342*4882a593Smuzhiyun
343*4882a593Smuzhiyun# Required version ending to differentiate the test
344*4882a593Smuzhiyun# from other linux builds on the system.
345*4882a593Smuzhiyun#LOCALVERSION = -test
346*4882a593Smuzhiyun
347*4882a593Smuzhiyun# For REBOOT_TYPE = grub2, you must specify where the grub.cfg
348*4882a593Smuzhiyun# file is. This is the file that is searched to find the menu
349*4882a593Smuzhiyun# option to boot to with GRUB_REBOOT
350*4882a593Smuzhiyun#GRUB_FILE = /boot/grub2/grub.cfg
351*4882a593Smuzhiyun
352*4882a593Smuzhiyun# The tool for REBOOT_TYPE = grub2 or grub2bls to set the next reboot kernel
353*4882a593Smuzhiyun# to boot into (one shot mode).
354*4882a593Smuzhiyun# (default grub2_reboot)
355*4882a593Smuzhiyun#GRUB_REBOOT = grub2_reboot
356*4882a593Smuzhiyun
357*4882a593Smuzhiyun# The grub title name for the test kernel to boot
358*4882a593Smuzhiyun# (Only mandatory if REBOOT_TYPE = grub or grub2 or grub2bls)
359*4882a593Smuzhiyun#
360*4882a593Smuzhiyun# Note, ktest.pl will not update the grub menu.lst, you need to
361*4882a593Smuzhiyun# manually add an option for the test. ktest.pl will search
362*4882a593Smuzhiyun# the grub menu.lst for this option to find what kernel to
363*4882a593Smuzhiyun# reboot into.
364*4882a593Smuzhiyun#
365*4882a593Smuzhiyun# For example, if in the /boot/grub/menu.lst the test kernel title has:
366*4882a593Smuzhiyun# title Test Kernel
367*4882a593Smuzhiyun# kernel vmlinuz-test
368*4882a593Smuzhiyun#
369*4882a593Smuzhiyun# For grub2, a search of top level "menuentry"s are done. No
370*4882a593Smuzhiyun# submenu is searched. The menu is found by searching for the
371*4882a593Smuzhiyun# contents of GRUB_MENU in the line that starts with "menuentry".
372*4882a593Smuzhiyun# You may want to include the quotes around the option. For example:
373*4882a593Smuzhiyun# for: menuentry 'Test Kernel'
374*4882a593Smuzhiyun# do a: GRUB_MENU = 'Test Kernel'
375*4882a593Smuzhiyun# For customizing, add your entry in /etc/grub.d/40_custom.
376*4882a593Smuzhiyun#
377*4882a593Smuzhiyun# For grub2bls, a search of "title"s are done. The menu is found
378*4882a593Smuzhiyun# by searching for the contents of GRUB_MENU in the line that starts
379*4882a593Smuzhiyun# with "title".
380*4882a593Smuzhiyun#
381*4882a593Smuzhiyun#GRUB_MENU = Test Kernel
382*4882a593Smuzhiyun
383*4882a593Smuzhiyun# For REBOOT_TYPE = syslinux, the name of the syslinux executable
384*4882a593Smuzhiyun# (on the target) to use to set up the next reboot to boot the
385*4882a593Smuzhiyun# test kernel.
386*4882a593Smuzhiyun# (default extlinux)
387*4882a593Smuzhiyun#SYSLINUX = syslinux
388*4882a593Smuzhiyun
389*4882a593Smuzhiyun# For REBOOT_TYPE = syslinux, the path that is passed to to the
390*4882a593Smuzhiyun# syslinux command where syslinux is installed.
391*4882a593Smuzhiyun# (default /boot/extlinux)
392*4882a593Smuzhiyun#SYSLINUX_PATH = /boot/syslinux
393*4882a593Smuzhiyun
394*4882a593Smuzhiyun# For REBOOT_TYPE = syslinux, the syslinux label that references the
395*4882a593Smuzhiyun# test kernel in the syslinux config file.
396*4882a593Smuzhiyun# (default undefined)
397*4882a593Smuzhiyun#SYSLINUX_LABEL = "test-kernel"
398*4882a593Smuzhiyun
399*4882a593Smuzhiyun# A script to reboot the target into the test kernel
400*4882a593Smuzhiyun# This and SWITCH_TO_TEST are about the same, except
401*4882a593Smuzhiyun# SWITCH_TO_TEST is run even for REBOOT_TYPE = grub.
402*4882a593Smuzhiyun# This may be left undefined.
403*4882a593Smuzhiyun# (default undefined)
404*4882a593Smuzhiyun#REBOOT_SCRIPT =
405*4882a593Smuzhiyun
406*4882a593Smuzhiyun#### Optional Config Options (all have defaults) ####
407*4882a593Smuzhiyun
408*4882a593Smuzhiyun# Email options for receiving notifications. Users must setup
409*4882a593Smuzhiyun# the specified mailer prior to using this feature.
410*4882a593Smuzhiyun#
411*4882a593Smuzhiyun# (default undefined)
412*4882a593Smuzhiyun#MAILTO =
413*4882a593Smuzhiyun#
414*4882a593Smuzhiyun# Supported mailers: sendmail, mail, mailx
415*4882a593Smuzhiyun# (default sendmail)
416*4882a593Smuzhiyun#MAILER = sendmail
417*4882a593Smuzhiyun#
418*4882a593Smuzhiyun# The executable to run
419*4882a593Smuzhiyun# (default: for sendmail "/usr/sbin/sendmail", otherwise equals ${MAILER})
420*4882a593Smuzhiyun#MAIL_EXEC = /usr/sbin/sendmail
421*4882a593Smuzhiyun#
422*4882a593Smuzhiyun# The command used to send mail, which uses the above options
423*4882a593Smuzhiyun# can be modified. By default if the mailer is "sendmail" then
424*4882a593Smuzhiyun#  MAIL_COMMAND = echo \'Subject: $SUBJECT\n\n$MESSAGE\' | $MAIL_PATH/$MAILER -t $MAILTO
425*4882a593Smuzhiyun# For mail or mailx:
426*4882a593Smuzhiyun#  MAIL_COMMAND = "$MAIL_PATH/$MAILER -s \'$SUBJECT\' $MAILTO <<< \'$MESSAGE\'
427*4882a593Smuzhiyun# ktest.pl will do the substitution for MAIL_PATH, MAILER, MAILTO at the time
428*4882a593Smuzhiyun#    it sends the mail if "$FOO" format is used. If "${FOO}" format is used,
429*4882a593Smuzhiyun#    then the substitutions will occur at the time the config file is read.
430*4882a593Smuzhiyun#    But note, MAIL_PATH and MAILER require being set by the config file if
431*4882a593Smuzhiyun#     ${MAIL_PATH} or ${MAILER} are used, but not if $MAIL_PATH or $MAILER are.
432*4882a593Smuzhiyun#MAIL_COMMAND = echo \'Subject: $SUBJECT\n\n$MESSAGE\' | $MAIL_PATH/$MAILER -t $MAILTO
433*4882a593Smuzhiyun#
434*4882a593Smuzhiyun# Errors are defined as those would terminate the script
435*4882a593Smuzhiyun# (default 1)
436*4882a593Smuzhiyun#EMAIL_ON_ERROR = 1
437*4882a593Smuzhiyun# (default 1)
438*4882a593Smuzhiyun#EMAIL_WHEN_FINISHED = 1
439*4882a593Smuzhiyun# (default 0)
440*4882a593Smuzhiyun#EMAIL_WHEN_STARTED = 1
441*4882a593Smuzhiyun#
442*4882a593Smuzhiyun# Users can cancel the test by Ctrl^C
443*4882a593Smuzhiyun# (default 0)
444*4882a593Smuzhiyun#EMAIL_WHEN_CANCELED = 1
445*4882a593Smuzhiyun#
446*4882a593Smuzhiyun# If a test ends with an error and EMAIL_ON_ERROR is set as well
447*4882a593Smuzhiyun# as a LOG_FILE is defined, then the log of the failing test will
448*4882a593Smuzhiyun# be included in the email that is sent.
449*4882a593Smuzhiyun# It is possible that the log may be very large, in which case,
450*4882a593Smuzhiyun# only the last amount of the log should be sent. To limit how
451*4882a593Smuzhiyun# much of the log is sent, set MAIL_MAX_SIZE. This will be the
452*4882a593Smuzhiyun# size in bytes of the last portion of the log of the failed
453*4882a593Smuzhiyun# test file. That is, if this is set to 100000, then only the
454*4882a593Smuzhiyun# last 100 thousand bytes of the log file will be included in
455*4882a593Smuzhiyun# the email.
456*4882a593Smuzhiyun# (default undef)
457*4882a593Smuzhiyun#MAIL_MAX_SIZE = 1000000
458*4882a593Smuzhiyun
459*4882a593Smuzhiyun# Start a test setup. If you leave this off, all options
460*4882a593Smuzhiyun# will be default and the test will run once.
461*4882a593Smuzhiyun# This is a label and not really an option (it takes no value).
462*4882a593Smuzhiyun# You can append ITERATE and a number after it to iterate the
463*4882a593Smuzhiyun# test a number of times, or SKIP to ignore this test.
464*4882a593Smuzhiyun#
465*4882a593Smuzhiyun#TEST_START
466*4882a593Smuzhiyun#TEST_START ITERATE 5
467*4882a593Smuzhiyun#TEST_START SKIP
468*4882a593Smuzhiyun
469*4882a593Smuzhiyun# Have the following options as default again. Used after tests
470*4882a593Smuzhiyun# have already been defined by TEST_START. Optionally, you can
471*4882a593Smuzhiyun# just define all default options before the first TEST_START
472*4882a593Smuzhiyun# and you do not need this option.
473*4882a593Smuzhiyun#
474*4882a593Smuzhiyun# This is a label and not really an option (it takes no value).
475*4882a593Smuzhiyun# You can append SKIP to this label and the options within this
476*4882a593Smuzhiyun# section will be ignored.
477*4882a593Smuzhiyun#
478*4882a593Smuzhiyun# DEFAULTS
479*4882a593Smuzhiyun# DEFAULTS SKIP
480*4882a593Smuzhiyun
481*4882a593Smuzhiyun# If you want to execute some command before the first test runs
482*4882a593Smuzhiyun# you can set this option. Note, it can be set as a default option
483*4882a593Smuzhiyun# or an option in the first test case. All other test cases will
484*4882a593Smuzhiyun# ignore it. If both the default and first test have this option
485*4882a593Smuzhiyun# set, then the first test will take precedence.
486*4882a593Smuzhiyun#
487*4882a593Smuzhiyun# default (undefined)
488*4882a593Smuzhiyun#PRE_KTEST = ${SSH} ~/set_up_test
489*4882a593Smuzhiyun
490*4882a593Smuzhiyun# If you want to execute some command after all the tests have
491*4882a593Smuzhiyun# completed, you can set this option. Note, it can be set as a
492*4882a593Smuzhiyun# default or any test case can override it. If multiple test cases
493*4882a593Smuzhiyun# set this option, then the last test case that set it will take
494*4882a593Smuzhiyun# precedence
495*4882a593Smuzhiyun#
496*4882a593Smuzhiyun# default (undefined)
497*4882a593Smuzhiyun#POST_KTEST = ${SSH} ~/dismantle_test
498*4882a593Smuzhiyun
499*4882a593Smuzhiyun# If you want to remove the kernel entry in Boot Loader Specification (BLS)
500*4882a593Smuzhiyun# environment, use kernel-install command.
501*4882a593Smuzhiyun# Here's the example:
502*4882a593Smuzhiyun#POST_KTEST = ssh root@Test "/usr/bin/kernel-install remove $KERNEL_VERSION"
503*4882a593Smuzhiyun
504*4882a593Smuzhiyun# The default test type (default test)
505*4882a593Smuzhiyun# The test types may be:
506*4882a593Smuzhiyun#   build   - only build the kernel, do nothing else
507*4882a593Smuzhiyun#   install - build and install, but do nothing else (does not reboot)
508*4882a593Smuzhiyun#   boot    - build, install, and boot the kernel
509*4882a593Smuzhiyun#   test    - build, boot and if TEST is set, run the test script
510*4882a593Smuzhiyun#          (If TEST is not set, it defaults back to boot)
511*4882a593Smuzhiyun#   bisect - Perform a bisect on the kernel (see BISECT_TYPE below)
512*4882a593Smuzhiyun#   patchcheck - Do a test on a series of commits in git (see PATCHCHECK below)
513*4882a593Smuzhiyun#TEST_TYPE = test
514*4882a593Smuzhiyun
515*4882a593Smuzhiyun# Test to run if there is a successful boot and TEST_TYPE is test.
516*4882a593Smuzhiyun# Must exit with 0 on success and non zero on error
517*4882a593Smuzhiyun# default (undefined)
518*4882a593Smuzhiyun#TEST = ssh user@machine /root/run_test
519*4882a593Smuzhiyun
520*4882a593Smuzhiyun# The build type is any make config type or special command
521*4882a593Smuzhiyun#  (default oldconfig)
522*4882a593Smuzhiyun#   nobuild - skip the clean and build step
523*4882a593Smuzhiyun#   useconfig:/path/to/config - use the given config and run
524*4882a593Smuzhiyun#              oldconfig on it.
525*4882a593Smuzhiyun# This option is ignored if TEST_TYPE is patchcheck or bisect
526*4882a593Smuzhiyun#BUILD_TYPE = randconfig
527*4882a593Smuzhiyun
528*4882a593Smuzhiyun# The make command (default make)
529*4882a593Smuzhiyun# If you are building a 32bit x86 on a 64 bit host
530*4882a593Smuzhiyun#MAKE_CMD = CC=i386-gcc AS=i386-as make ARCH=i386
531*4882a593Smuzhiyun
532*4882a593Smuzhiyun# Any build options for the make of the kernel (not for other makes, like configs)
533*4882a593Smuzhiyun# (default "")
534*4882a593Smuzhiyun#BUILD_OPTIONS = -j20
535*4882a593Smuzhiyun
536*4882a593Smuzhiyun# If you need to do some special handling before installing
537*4882a593Smuzhiyun# you can add a script with this option.
538*4882a593Smuzhiyun# The environment variable KERNEL_VERSION will be set to the
539*4882a593Smuzhiyun# kernel version that is used.
540*4882a593Smuzhiyun#
541*4882a593Smuzhiyun# default (undefined)
542*4882a593Smuzhiyun#PRE_INSTALL = ssh user@target rm -rf '/lib/modules/*-test*'
543*4882a593Smuzhiyun
544*4882a593Smuzhiyun# If you need an initrd, you can add a script or code here to install
545*4882a593Smuzhiyun# it. The environment variable KERNEL_VERSION will be set to the
546*4882a593Smuzhiyun# kernel version that is used. Remember to add the initrd line
547*4882a593Smuzhiyun# to your grub menu.lst file.
548*4882a593Smuzhiyun#
549*4882a593Smuzhiyun# Here's a couple of examples to use:
550*4882a593Smuzhiyun#POST_INSTALL = ssh user@target /sbin/mkinitrd --allow-missing -f /boot/initramfs-test.img $KERNEL_VERSION
551*4882a593Smuzhiyun#
552*4882a593Smuzhiyun# or on some systems:
553*4882a593Smuzhiyun#POST_INSTALL = ssh user@target /sbin/dracut -f /boot/initramfs-test.img $KERNEL_VERSION
554*4882a593Smuzhiyun
555*4882a593Smuzhiyun# If you want to add the kernel entry in Boot Loader Specification (BLS)
556*4882a593Smuzhiyun# environment, use kernel-install command.
557*4882a593Smuzhiyun# Here's the example:
558*4882a593Smuzhiyun#POST_INSTALL = ssh root@Test "/usr/bin/kernel-install add $KERNEL_VERSION /boot/vmlinuz-$KERNEL_VERSION"
559*4882a593Smuzhiyun
560*4882a593Smuzhiyun# If for some reason you just want to boot the kernel and you do not
561*4882a593Smuzhiyun# want the test to install anything new. For example, you may just want
562*4882a593Smuzhiyun# to boot test the same kernel over and over and do not want to go through
563*4882a593Smuzhiyun# the hassle of installing anything, you can set this option to 1
564*4882a593Smuzhiyun# (default 0)
565*4882a593Smuzhiyun#NO_INSTALL = 1
566*4882a593Smuzhiyun
567*4882a593Smuzhiyun# If there is a command that you want to run before the individual test
568*4882a593Smuzhiyun# case executes, then you can set this option
569*4882a593Smuzhiyun#
570*4882a593Smuzhiyun# default (undefined)
571*4882a593Smuzhiyun#PRE_TEST = ${SSH} reboot_to_special_kernel
572*4882a593Smuzhiyun
573*4882a593Smuzhiyun# To kill the entire test if PRE_TEST is defined but fails set this
574*4882a593Smuzhiyun# to 1.
575*4882a593Smuzhiyun# (default 0)
576*4882a593Smuzhiyun#PRE_TEST_DIE = 1
577*4882a593Smuzhiyun
578*4882a593Smuzhiyun# If there is a command you want to run after the individual test case
579*4882a593Smuzhiyun# completes, then you can set this option.
580*4882a593Smuzhiyun#
581*4882a593Smuzhiyun# default (undefined)
582*4882a593Smuzhiyun#POST_TEST = cd ${BUILD_DIR}; git reset --hard
583*4882a593Smuzhiyun
584*4882a593Smuzhiyun# If there is a script that you require to run before the build is done
585*4882a593Smuzhiyun# you can specify it with PRE_BUILD.
586*4882a593Smuzhiyun#
587*4882a593Smuzhiyun# One example may be if you must add a temporary patch to the build to
588*4882a593Smuzhiyun# fix a unrelated bug to perform a patchcheck test. This will apply the
589*4882a593Smuzhiyun# patch before each build that is made. Use the POST_BUILD to do a git reset --hard
590*4882a593Smuzhiyun# to remove the patch.
591*4882a593Smuzhiyun#
592*4882a593Smuzhiyun# (default undef)
593*4882a593Smuzhiyun#PRE_BUILD = cd ${BUILD_DIR} && patch -p1 < /tmp/temp.patch
594*4882a593Smuzhiyun
595*4882a593Smuzhiyun# To specify if the test should fail if the PRE_BUILD fails,
596*4882a593Smuzhiyun# PRE_BUILD_DIE needs to be set to 1. Otherwise the PRE_BUILD
597*4882a593Smuzhiyun# result is ignored.
598*4882a593Smuzhiyun# (default 0)
599*4882a593Smuzhiyun# PRE_BUILD_DIE = 1
600*4882a593Smuzhiyun
601*4882a593Smuzhiyun# If there is a script that should run after the build is done
602*4882a593Smuzhiyun# you can specify it with POST_BUILD.
603*4882a593Smuzhiyun#
604*4882a593Smuzhiyun# As the example in PRE_BUILD, POST_BUILD can be used to reset modifications
605*4882a593Smuzhiyun# made by the PRE_BUILD.
606*4882a593Smuzhiyun#
607*4882a593Smuzhiyun# (default undef)
608*4882a593Smuzhiyun#POST_BUILD = cd ${BUILD_DIR} && git reset --hard
609*4882a593Smuzhiyun
610*4882a593Smuzhiyun# To specify if the test should fail if the POST_BUILD fails,
611*4882a593Smuzhiyun# POST_BUILD_DIE needs to be set to 1. Otherwise the POST_BUILD
612*4882a593Smuzhiyun# result is ignored.
613*4882a593Smuzhiyun# (default 0)
614*4882a593Smuzhiyun#POST_BUILD_DIE = 1
615*4882a593Smuzhiyun
616*4882a593Smuzhiyun# Way to reboot the box to the test kernel.
617*4882a593Smuzhiyun# Only valid options so far are "grub", "grub2", "syslinux" and "script"
618*4882a593Smuzhiyun# (default grub)
619*4882a593Smuzhiyun# If you specify grub, it will assume grub version 1
620*4882a593Smuzhiyun# and will search in /boot/grub/menu.lst for the title $GRUB_MENU
621*4882a593Smuzhiyun# and select that target to reboot to the kernel. If this is not
622*4882a593Smuzhiyun# your setup, then specify "script" and have a command or script
623*4882a593Smuzhiyun# specified in REBOOT_SCRIPT to boot to the target.
624*4882a593Smuzhiyun#
625*4882a593Smuzhiyun# For REBOOT_TYPE = grub2, you must define both GRUB_MENU and
626*4882a593Smuzhiyun# GRUB_FILE.
627*4882a593Smuzhiyun#
628*4882a593Smuzhiyun# For REBOOT_TYPE = grub2bls, you must define GRUB_MENU.
629*4882a593Smuzhiyun#
630*4882a593Smuzhiyun# For REBOOT_TYPE = syslinux, you must define SYSLINUX_LABEL, and
631*4882a593Smuzhiyun# perhaps modify SYSLINUX (default extlinux) and SYSLINUX_PATH
632*4882a593Smuzhiyun# (default /boot/extlinux)
633*4882a593Smuzhiyun#
634*4882a593Smuzhiyun# The entry in /boot/grub/menu.lst must be entered in manually.
635*4882a593Smuzhiyun# The test will not modify that file.
636*4882a593Smuzhiyun#REBOOT_TYPE = grub
637*4882a593Smuzhiyun
638*4882a593Smuzhiyun# If you are using a machine that doesn't boot with grub, and
639*4882a593Smuzhiyun# perhaps gets its kernel from a remote server (tftp), then
640*4882a593Smuzhiyun# you can use this option to update the target image with the
641*4882a593Smuzhiyun# test image.
642*4882a593Smuzhiyun#
643*4882a593Smuzhiyun# You could also do the same with POST_INSTALL, but the difference
644*4882a593Smuzhiyun# between that option and this option is that POST_INSTALL runs
645*4882a593Smuzhiyun# after the install, where this one runs just before a reboot.
646*4882a593Smuzhiyun# (default undefined)
647*4882a593Smuzhiyun#SWITCH_TO_TEST = cp ${OUTPUT_DIR}/${BUILD_TARGET} ${TARGET_IMAGE}
648*4882a593Smuzhiyun
649*4882a593Smuzhiyun# If you are using a machine that doesn't boot with grub, and
650*4882a593Smuzhiyun# perhaps gets its kernel from a remote server (tftp), then
651*4882a593Smuzhiyun# you can use this option to update the target image with the
652*4882a593Smuzhiyun# the known good image to reboot safely back into.
653*4882a593Smuzhiyun#
654*4882a593Smuzhiyun# This option holds a command that will execute before needing
655*4882a593Smuzhiyun# to reboot to a good known image.
656*4882a593Smuzhiyun# (default undefined)
657*4882a593Smuzhiyun#SWITCH_TO_GOOD = ssh ${SSH_USER}/${MACHINE} cp good_image ${TARGET_IMAGE}
658*4882a593Smuzhiyun
659*4882a593Smuzhiyun# The min config that is needed to build for the machine
660*4882a593Smuzhiyun# A nice way to create this is with the following:
661*4882a593Smuzhiyun#
662*4882a593Smuzhiyun#   $ ssh target
663*4882a593Smuzhiyun#   $ lsmod > mymods
664*4882a593Smuzhiyun#   $ scp mymods host:/tmp
665*4882a593Smuzhiyun#   $ exit
666*4882a593Smuzhiyun#   $ cd linux.git
667*4882a593Smuzhiyun#   $ rm .config
668*4882a593Smuzhiyun#   $ make LSMOD=mymods localyesconfig
669*4882a593Smuzhiyun#   $ grep '^CONFIG' .config > /home/test/config-min
670*4882a593Smuzhiyun#
671*4882a593Smuzhiyun# If you want even less configs:
672*4882a593Smuzhiyun#
673*4882a593Smuzhiyun#   log in directly to target (do not ssh)
674*4882a593Smuzhiyun#
675*4882a593Smuzhiyun#   $ su
676*4882a593Smuzhiyun#   # lsmod | cut -d' ' -f1 | xargs rmmod
677*4882a593Smuzhiyun#
678*4882a593Smuzhiyun#   repeat the above several times
679*4882a593Smuzhiyun#
680*4882a593Smuzhiyun#   # lsmod > mymods
681*4882a593Smuzhiyun#   # reboot
682*4882a593Smuzhiyun#
683*4882a593Smuzhiyun# May need to reboot to get your network back to copy the mymods
684*4882a593Smuzhiyun# to the host, and then remove the previous .config and run the
685*4882a593Smuzhiyun# localyesconfig again. The CONFIG_MIN generated like this will
686*4882a593Smuzhiyun# not guarantee network activity to the box so the TEST_TYPE of
687*4882a593Smuzhiyun# test may fail.
688*4882a593Smuzhiyun#
689*4882a593Smuzhiyun# You might also want to set:
690*4882a593Smuzhiyun#   CONFIG_CMDLINE="<your options here>"
691*4882a593Smuzhiyun#  randconfig may set the above and override your real command
692*4882a593Smuzhiyun#  line options.
693*4882a593Smuzhiyun# (default undefined)
694*4882a593Smuzhiyun#MIN_CONFIG = /home/test/config-min
695*4882a593Smuzhiyun
696*4882a593Smuzhiyun# Sometimes there's options that just break the boot and
697*4882a593Smuzhiyun# you do not care about. Here are a few:
698*4882a593Smuzhiyun#   # CONFIG_STAGING is not set
699*4882a593Smuzhiyun#  Staging drivers are horrible, and can break the build.
700*4882a593Smuzhiyun#   # CONFIG_SCSI_DEBUG is not set
701*4882a593Smuzhiyun#  SCSI_DEBUG may change your root partition
702*4882a593Smuzhiyun#   # CONFIG_KGDB_SERIAL_CONSOLE is not set
703*4882a593Smuzhiyun#  KGDB may cause oops waiting for a connection that's not there.
704*4882a593Smuzhiyun# This option points to the file containing config options that will be prepended
705*4882a593Smuzhiyun# to the MIN_CONFIG (or be the MIN_CONFIG if it is not set)
706*4882a593Smuzhiyun#
707*4882a593Smuzhiyun# Note, config options in MIN_CONFIG will override these options.
708*4882a593Smuzhiyun#
709*4882a593Smuzhiyun# (default undefined)
710*4882a593Smuzhiyun#ADD_CONFIG = /home/test/config-broken
711*4882a593Smuzhiyun
712*4882a593Smuzhiyun# The location on the host where to write temp files
713*4882a593Smuzhiyun# (default /tmp/ktest/${MACHINE})
714*4882a593Smuzhiyun#TMP_DIR = /tmp/ktest/${MACHINE}
715*4882a593Smuzhiyun
716*4882a593Smuzhiyun# Optional log file to write the status (recommended)
717*4882a593Smuzhiyun#  Note, this is a DEFAULT section only option.
718*4882a593Smuzhiyun# (default undefined)
719*4882a593Smuzhiyun#LOG_FILE = /home/test/logfiles/target.log
720*4882a593Smuzhiyun
721*4882a593Smuzhiyun# Remove old logfile if it exists before starting all tests.
722*4882a593Smuzhiyun#  Note, this is a DEFAULT section only option.
723*4882a593Smuzhiyun# (default 0)
724*4882a593Smuzhiyun#CLEAR_LOG = 0
725*4882a593Smuzhiyun
726*4882a593Smuzhiyun# Line to define a successful boot up in console output.
727*4882a593Smuzhiyun# This is what the line contains, not the entire line. If you need
728*4882a593Smuzhiyun# the entire line to match, then use regular expression syntax like:
729*4882a593Smuzhiyun#  (do not add any quotes around it)
730*4882a593Smuzhiyun#
731*4882a593Smuzhiyun#  SUCCESS_LINE = ^MyBox Login:$
732*4882a593Smuzhiyun#
733*4882a593Smuzhiyun# (default "login:")
734*4882a593Smuzhiyun#SUCCESS_LINE = login:
735*4882a593Smuzhiyun
736*4882a593Smuzhiyun# To speed up between reboots, defining a line that the
737*4882a593Smuzhiyun# default kernel produces that represents that the default
738*4882a593Smuzhiyun# kernel has successfully booted and can be used to pass
739*4882a593Smuzhiyun# a new test kernel to it. Otherwise ktest.pl will wait till
740*4882a593Smuzhiyun# SLEEP_TIME to continue.
741*4882a593Smuzhiyun# (default undefined)
742*4882a593Smuzhiyun#REBOOT_SUCCESS_LINE = login:
743*4882a593Smuzhiyun
744*4882a593Smuzhiyun# In case the console constantly fills the screen, having
745*4882a593Smuzhiyun# a specified time to stop the test after success is recommended.
746*4882a593Smuzhiyun# (in seconds)
747*4882a593Smuzhiyun# (default 10)
748*4882a593Smuzhiyun#STOP_AFTER_SUCCESS = 10
749*4882a593Smuzhiyun
750*4882a593Smuzhiyun# In case the console constantly fills the screen, having
751*4882a593Smuzhiyun# a specified time to stop the test after failure is recommended.
752*4882a593Smuzhiyun# (in seconds)
753*4882a593Smuzhiyun# (default 60)
754*4882a593Smuzhiyun#STOP_AFTER_FAILURE = 60
755*4882a593Smuzhiyun
756*4882a593Smuzhiyun# In case the console constantly fills the screen, having
757*4882a593Smuzhiyun# a specified time to stop the test if it never succeeds nor fails
758*4882a593Smuzhiyun# is recommended.
759*4882a593Smuzhiyun# Note: this is ignored if a success or failure is detected.
760*4882a593Smuzhiyun# (in seconds)
761*4882a593Smuzhiyun# (default 600, -1 is to never stop)
762*4882a593Smuzhiyun#STOP_TEST_AFTER = 600
763*4882a593Smuzhiyun
764*4882a593Smuzhiyun# Stop testing if a build fails. If set, the script will end if
765*4882a593Smuzhiyun# a failure is detected, otherwise it will save off the .config,
766*4882a593Smuzhiyun# dmesg and bootlog in a directory called
767*4882a593Smuzhiyun# MACHINE-TEST_TYPE_BUILD_TYPE-fail-yyyymmddhhmmss
768*4882a593Smuzhiyun# if the STORE_FAILURES directory is set.
769*4882a593Smuzhiyun# (default 1)
770*4882a593Smuzhiyun# Note, even if this is set to zero, there are some errors that still
771*4882a593Smuzhiyun# stop the tests.
772*4882a593Smuzhiyun#DIE_ON_FAILURE = 1
773*4882a593Smuzhiyun
774*4882a593Smuzhiyun# Directory to store failure directories on failure. If this is not
775*4882a593Smuzhiyun# set, DIE_ON_FAILURE=0 will not save off the .config, dmesg and
776*4882a593Smuzhiyun# bootlog. This option is ignored if DIE_ON_FAILURE is not set.
777*4882a593Smuzhiyun# (default undefined)
778*4882a593Smuzhiyun#STORE_FAILURES = /home/test/failures
779*4882a593Smuzhiyun
780*4882a593Smuzhiyun# Directory to store success directories on success. If this is not
781*4882a593Smuzhiyun# set, the .config, dmesg and bootlog will not be saved if a
782*4882a593Smuzhiyun# test succeeds.
783*4882a593Smuzhiyun# (default undefined)
784*4882a593Smuzhiyun#STORE_SUCCESSES = /home/test/successes
785*4882a593Smuzhiyun
786*4882a593Smuzhiyun# Build without doing a make mrproper, or removing .config
787*4882a593Smuzhiyun# (default 0)
788*4882a593Smuzhiyun#BUILD_NOCLEAN = 0
789*4882a593Smuzhiyun
790*4882a593Smuzhiyun# As the test reads the console, after it hits the SUCCESS_LINE
791*4882a593Smuzhiyun# the time it waits for the monitor to settle down between reads
792*4882a593Smuzhiyun# can usually be lowered.
793*4882a593Smuzhiyun# (in seconds) (default 1)
794*4882a593Smuzhiyun#BOOTED_TIMEOUT = 1
795*4882a593Smuzhiyun
796*4882a593Smuzhiyun# The timeout in seconds when we consider the box hung after
797*4882a593Smuzhiyun# the console stop producing output. Be sure to leave enough
798*4882a593Smuzhiyun# time here to get pass a reboot. Some machines may not produce
799*4882a593Smuzhiyun# any console output for a long time during a reboot. You do
800*4882a593Smuzhiyun# not want the test to fail just because the system was in
801*4882a593Smuzhiyun# the process of rebooting to the test kernel.
802*4882a593Smuzhiyun# (default 120)
803*4882a593Smuzhiyun#TIMEOUT = 120
804*4882a593Smuzhiyun
805*4882a593Smuzhiyun# The timeout in seconds when to test if the box can be rebooted
806*4882a593Smuzhiyun# or not. Before issuing the reboot command, a ssh connection
807*4882a593Smuzhiyun# is attempted to see if the target machine is still active.
808*4882a593Smuzhiyun# If the target does not connect within this timeout, a power cycle
809*4882a593Smuzhiyun# is issued instead of a reboot.
810*4882a593Smuzhiyun# CONNECT_TIMEOUT = 25
811*4882a593Smuzhiyun
812*4882a593Smuzhiyun# In between tests, a reboot of the box may occur, and this
813*4882a593Smuzhiyun# is the time to wait for the console after it stops producing
814*4882a593Smuzhiyun# output. Some machines may not produce a large lag on reboot
815*4882a593Smuzhiyun# so this should accommodate it.
816*4882a593Smuzhiyun# The difference between this and TIMEOUT, is that TIMEOUT happens
817*4882a593Smuzhiyun# when rebooting to the test kernel. This sleep time happens
818*4882a593Smuzhiyun# after a test has completed and we are about to start running
819*4882a593Smuzhiyun# another test. If a reboot to the reliable kernel happens,
820*4882a593Smuzhiyun# we wait SLEEP_TIME for the console to stop producing output
821*4882a593Smuzhiyun# before starting the next test.
822*4882a593Smuzhiyun#
823*4882a593Smuzhiyun# You can speed up reboot times even more by setting REBOOT_SUCCESS_LINE.
824*4882a593Smuzhiyun# (default 60)
825*4882a593Smuzhiyun#SLEEP_TIME = 60
826*4882a593Smuzhiyun
827*4882a593Smuzhiyun# The time in between bisects to sleep (in seconds)
828*4882a593Smuzhiyun# (default 60)
829*4882a593Smuzhiyun#BISECT_SLEEP_TIME = 60
830*4882a593Smuzhiyun
831*4882a593Smuzhiyun# The max wait time (in seconds) for waiting for the console to finish.
832*4882a593Smuzhiyun# If for some reason, the console is outputting content without
833*4882a593Smuzhiyun# ever finishing, this will cause ktest to get stuck. This
834*4882a593Smuzhiyun# option is the max time ktest will wait for the monitor (console)
835*4882a593Smuzhiyun# to settle down before continuing.
836*4882a593Smuzhiyun# (default 1800)
837*4882a593Smuzhiyun#MAX_MONITOR_WAIT
838*4882a593Smuzhiyun
839*4882a593Smuzhiyun# The time in between patch checks to sleep (in seconds)
840*4882a593Smuzhiyun# (default 60)
841*4882a593Smuzhiyun#PATCHCHECK_SLEEP_TIME = 60
842*4882a593Smuzhiyun
843*4882a593Smuzhiyun# Reboot the target box on error (default 0)
844*4882a593Smuzhiyun#REBOOT_ON_ERROR = 0
845*4882a593Smuzhiyun
846*4882a593Smuzhiyun# Power off the target on error (ignored if REBOOT_ON_ERROR is set)
847*4882a593Smuzhiyun#  Note, this is a DEFAULT section only option.
848*4882a593Smuzhiyun# (default 0)
849*4882a593Smuzhiyun#POWEROFF_ON_ERROR = 0
850*4882a593Smuzhiyun
851*4882a593Smuzhiyun# Power off the target after all tests have completed successfully
852*4882a593Smuzhiyun#  Note, this is a DEFAULT section only option.
853*4882a593Smuzhiyun# (default 0)
854*4882a593Smuzhiyun#POWEROFF_ON_SUCCESS = 0
855*4882a593Smuzhiyun
856*4882a593Smuzhiyun# Reboot the target after all test completed successfully (default 1)
857*4882a593Smuzhiyun# (ignored if POWEROFF_ON_SUCCESS is set)
858*4882a593Smuzhiyun#REBOOT_ON_SUCCESS = 1
859*4882a593Smuzhiyun
860*4882a593Smuzhiyun# In case there are issues with rebooting, you can specify this
861*4882a593Smuzhiyun# to always powercycle after this amount of time after calling
862*4882a593Smuzhiyun# reboot.
863*4882a593Smuzhiyun# Note, POWERCYCLE_AFTER_REBOOT = 0 does NOT disable it. It just
864*4882a593Smuzhiyun# makes it powercycle immediately after rebooting. Do not define
865*4882a593Smuzhiyun# it if you do not want it.
866*4882a593Smuzhiyun# (default undefined)
867*4882a593Smuzhiyun#POWERCYCLE_AFTER_REBOOT = 5
868*4882a593Smuzhiyun
869*4882a593Smuzhiyun# In case there's issues with halting, you can specify this
870*4882a593Smuzhiyun# to always poweroff after this amount of time after calling
871*4882a593Smuzhiyun# halt.
872*4882a593Smuzhiyun# Note, POWEROFF_AFTER_HALT = 0 does NOT disable it. It just
873*4882a593Smuzhiyun# makes it poweroff immediately after halting. Do not define
874*4882a593Smuzhiyun# it if you do not want it.
875*4882a593Smuzhiyun# (default undefined)
876*4882a593Smuzhiyun#POWEROFF_AFTER_HALT = 20
877*4882a593Smuzhiyun
878*4882a593Smuzhiyun# A script or command to power off the box (default undefined)
879*4882a593Smuzhiyun# Needed for POWEROFF_ON_ERROR and SUCCESS
880*4882a593Smuzhiyun#
881*4882a593Smuzhiyun# Example for digital loggers power switch:
882*4882a593Smuzhiyun#POWER_OFF = wget --no-proxy -O /dev/null -q  --auth-no-challenge 'http://admin:admin@power/outlet?5=OFF'
883*4882a593Smuzhiyun#
884*4882a593Smuzhiyun# Example for a virtual guest call "Guest".
885*4882a593Smuzhiyun#POWER_OFF = virsh destroy Guest
886*4882a593Smuzhiyun
887*4882a593Smuzhiyun# To have the build fail on "new" warnings, create a file that
888*4882a593Smuzhiyun# contains a list of all known warnings (they must match exactly
889*4882a593Smuzhiyun# to the line with 'warning:', 'error:' or 'Error:'. If the option
890*4882a593Smuzhiyun# WARNINGS_FILE is set, then that file will be read, and if the
891*4882a593Smuzhiyun# build detects a warning, it will examine this file and if the
892*4882a593Smuzhiyun# warning does not exist in it, it will fail the build.
893*4882a593Smuzhiyun#
894*4882a593Smuzhiyun# Note, if this option is defined to a file that does not exist
895*4882a593Smuzhiyun# then any warning will fail the build.
896*4882a593Smuzhiyun#  (see make_warnings_file below)
897*4882a593Smuzhiyun#
898*4882a593Smuzhiyun# (optional, default undefined)
899*4882a593Smuzhiyun#WARNINGS_FILE = ${OUTPUT_DIR}/warnings_file
900*4882a593Smuzhiyun
901*4882a593Smuzhiyun# The way to execute a command on the target
902*4882a593Smuzhiyun# (default ssh $SSH_USER@$MACHINE $SSH_COMMAND";)
903*4882a593Smuzhiyun# The variables SSH_USER, MACHINE and SSH_COMMAND are defined
904*4882a593Smuzhiyun#SSH_EXEC = ssh $SSH_USER@$MACHINE $SSH_COMMAND";
905*4882a593Smuzhiyun
906*4882a593Smuzhiyun# The way to copy a file to the target (install and modules)
907*4882a593Smuzhiyun# (default scp $SRC_FILE $SSH_USER@$MACHINE:$DST_FILE)
908*4882a593Smuzhiyun# The variables SSH_USER, MACHINE are defined by the config
909*4882a593Smuzhiyun# SRC_FILE and DST_FILE are ktest internal variables and
910*4882a593Smuzhiyun# should only have '$' and not the '${}' notation.
911*4882a593Smuzhiyun# (default scp $SRC_FILE ${SSH_USER}@${MACHINE}:$DST_FILE)
912*4882a593Smuzhiyun#SCP_TO_TARGET = echo skip scp for $SRC_FILE $DST_FILE
913*4882a593Smuzhiyun
914*4882a593Smuzhiyun# If install needs to be different than modules, then this
915*4882a593Smuzhiyun# option will override the SCP_TO_TARGET for installation.
916*4882a593Smuzhiyun# (default ${SCP_TO_TARGET} )
917*4882a593Smuzhiyun#SCP_TO_TARGET_INSTALL = scp $SRC_FILE tftp@tftpserver:$DST_FILE
918*4882a593Smuzhiyun
919*4882a593Smuzhiyun# The nice way to reboot the target
920*4882a593Smuzhiyun# (default ssh $SSH_USER@$MACHINE reboot)
921*4882a593Smuzhiyun# The variables SSH_USER and MACHINE are defined.
922*4882a593Smuzhiyun#REBOOT = ssh $SSH_USER@$MACHINE reboot
923*4882a593Smuzhiyun
924*4882a593Smuzhiyun# The return code of REBOOT
925*4882a593Smuzhiyun# (default 255)
926*4882a593Smuzhiyun#REBOOT_RETURN_CODE = 255
927*4882a593Smuzhiyun
928*4882a593Smuzhiyun# The way triple faults are detected is by testing the kernel
929*4882a593Smuzhiyun# banner. If the kernel banner for the kernel we are testing is
930*4882a593Smuzhiyun# found, and then later a kernel banner for another kernel version
931*4882a593Smuzhiyun# is found, it is considered that we encountered a triple fault,
932*4882a593Smuzhiyun# and there is no panic or callback, but simply a reboot.
933*4882a593Smuzhiyun# To disable this (because it did a false positive) set the following
934*4882a593Smuzhiyun# to 0.
935*4882a593Smuzhiyun# (default 1)
936*4882a593Smuzhiyun#DETECT_TRIPLE_FAULT = 0
937*4882a593Smuzhiyun
938*4882a593Smuzhiyun# All options in the config file should be either used by ktest
939*4882a593Smuzhiyun# or could be used within a value of another option. If an option
940*4882a593Smuzhiyun# in the config file is not used, ktest will warn about it and ask
941*4882a593Smuzhiyun# if you want to continue.
942*4882a593Smuzhiyun#
943*4882a593Smuzhiyun# If you don't care if there are non-used options, enable this
944*4882a593Smuzhiyun# option. Be careful though, a non-used option is usually a sign
945*4882a593Smuzhiyun# of an option name being typed incorrectly.
946*4882a593Smuzhiyun# (default 0)
947*4882a593Smuzhiyun#IGNORE_UNUSED = 1
948*4882a593Smuzhiyun
949*4882a593Smuzhiyun# When testing a kernel that happens to have WARNINGs, and call
950*4882a593Smuzhiyun# traces, ktest.pl will detect these and fail a boot or test run
951*4882a593Smuzhiyun# due to warnings. By setting this option, ktest will ignore
952*4882a593Smuzhiyun# call traces, and will not fail a test if the kernel produces
953*4882a593Smuzhiyun# an oops. Use this option with care.
954*4882a593Smuzhiyun# (default 0)
955*4882a593Smuzhiyun#IGNORE_ERRORS = 1
956*4882a593Smuzhiyun
957*4882a593Smuzhiyun#### Per test run options ####
958*4882a593Smuzhiyun# The following options are only allowed in TEST_START sections.
959*4882a593Smuzhiyun# They are ignored in the DEFAULTS sections.
960*4882a593Smuzhiyun#
961*4882a593Smuzhiyun# All of these are optional and undefined by default, although
962*4882a593Smuzhiyun#  some of these options are required for TEST_TYPE of patchcheck
963*4882a593Smuzhiyun#  and bisect.
964*4882a593Smuzhiyun#
965*4882a593Smuzhiyun#
966*4882a593Smuzhiyun# CHECKOUT = branch
967*4882a593Smuzhiyun#
968*4882a593Smuzhiyun#  If the BUILD_DIR is a git repository, then you can set this option
969*4882a593Smuzhiyun#  to checkout the given branch before running the TEST. If you
970*4882a593Smuzhiyun#  specify this for the first run, that branch will be used for
971*4882a593Smuzhiyun#  all preceding tests until a new CHECKOUT is set.
972*4882a593Smuzhiyun#
973*4882a593Smuzhiyun#
974*4882a593Smuzhiyun# TEST_NAME = name
975*4882a593Smuzhiyun#
976*4882a593Smuzhiyun#  If you want the test to have a name that is displayed in
977*4882a593Smuzhiyun#  the test result banner at the end of the test, then use this
978*4882a593Smuzhiyun#  option. This is useful to search for the RESULT keyword and
979*4882a593Smuzhiyun#  not have to translate a test number to a test in the config.
980*4882a593Smuzhiyun#
981*4882a593Smuzhiyun# For TEST_TYPE = patchcheck
982*4882a593Smuzhiyun#
983*4882a593Smuzhiyun#  This expects the BUILD_DIR to be a git repository, and
984*4882a593Smuzhiyun#  will checkout the PATCHCHECK_START commit.
985*4882a593Smuzhiyun#
986*4882a593Smuzhiyun#  The option BUILD_TYPE will be ignored.
987*4882a593Smuzhiyun#
988*4882a593Smuzhiyun#  The MIN_CONFIG will be used for all builds of the patchcheck. The build type
989*4882a593Smuzhiyun#  used for patchcheck is oldconfig.
990*4882a593Smuzhiyun#
991*4882a593Smuzhiyun#  PATCHCHECK_START is required and is the first patch to
992*4882a593Smuzhiyun#   test (the SHA1 of the commit). You may also specify anything
993*4882a593Smuzhiyun#   that git checkout allows (branch name, tag, HEAD~3).
994*4882a593Smuzhiyun#
995*4882a593Smuzhiyun#  PATCHCHECK_END is the last patch to check (default HEAD)
996*4882a593Smuzhiyun#
997*4882a593Smuzhiyun#  PATCHCHECK_CHERRY if set to non zero, then git cherry will be
998*4882a593Smuzhiyun#      performed against PATCHCHECK_START and PATCHCHECK_END. That is
999*4882a593Smuzhiyun#
1000*4882a593Smuzhiyun#      git cherry ${PATCHCHECK_START} ${PATCHCHECK_END}
1001*4882a593Smuzhiyun#
1002*4882a593Smuzhiyun#      Then the changes found will be tested.
1003*4882a593Smuzhiyun#
1004*4882a593Smuzhiyun#      Note, PATCHCHECK_CHERRY requires PATCHCHECK_END to be defined.
1005*4882a593Smuzhiyun#      (default 0)
1006*4882a593Smuzhiyun#
1007*4882a593Smuzhiyun#  PATCHCHECK_TYPE is required and is the type of test to run:
1008*4882a593Smuzhiyun#      build, boot, test.
1009*4882a593Smuzhiyun#
1010*4882a593Smuzhiyun#   Note, the build test will look for warnings, if a warning occurred
1011*4882a593Smuzhiyun#     in a file that a commit touches, the build will fail, unless
1012*4882a593Smuzhiyun#     IGNORE_WARNINGS is set for the given commit's sha1
1013*4882a593Smuzhiyun#
1014*4882a593Smuzhiyun#   IGNORE_WARNINGS can be used to disable the failure of patchcheck
1015*4882a593Smuzhiyun#     on a particular commit (SHA1). You can add more than one commit
1016*4882a593Smuzhiyun#     by adding a list of SHA1s that are space delimited.
1017*4882a593Smuzhiyun#
1018*4882a593Smuzhiyun#   If BUILD_NOCLEAN is set, then make mrproper will not be run on
1019*4882a593Smuzhiyun#   any of the builds, just like all other TEST_TYPE tests. But
1020*4882a593Smuzhiyun#   what makes patchcheck different from the other tests, is if
1021*4882a593Smuzhiyun#   BUILD_NOCLEAN is not set, only the first and last patch run
1022*4882a593Smuzhiyun#   make mrproper. This helps speed up the test.
1023*4882a593Smuzhiyun#
1024*4882a593Smuzhiyun# Example:
1025*4882a593Smuzhiyun#   TEST_START
1026*4882a593Smuzhiyun#   TEST_TYPE = patchcheck
1027*4882a593Smuzhiyun#   CHECKOUT = mybranch
1028*4882a593Smuzhiyun#   PATCHCHECK_TYPE = boot
1029*4882a593Smuzhiyun#   PATCHCHECK_START = 747e94ae3d1b4c9bf5380e569f614eb9040b79e7
1030*4882a593Smuzhiyun#   PATCHCHECK_END = HEAD~2
1031*4882a593Smuzhiyun#   IGNORE_WARNINGS = 42f9c6b69b54946ffc0515f57d01dc7f5c0e4712 0c17ca2c7187f431d8ffc79e81addc730f33d128
1032*4882a593Smuzhiyun#
1033*4882a593Smuzhiyun#
1034*4882a593Smuzhiyun#
1035*4882a593Smuzhiyun# For TEST_TYPE = bisect
1036*4882a593Smuzhiyun#
1037*4882a593Smuzhiyun#  You can specify a git bisect if the BUILD_DIR is a git repository.
1038*4882a593Smuzhiyun#  The MIN_CONFIG will be used for all builds of the bisect. The build type
1039*4882a593Smuzhiyun#  used for bisecting is oldconfig.
1040*4882a593Smuzhiyun#
1041*4882a593Smuzhiyun#  The option BUILD_TYPE will be ignored.
1042*4882a593Smuzhiyun#
1043*4882a593Smuzhiyun#  BISECT_TYPE is the type of test to perform:
1044*4882a593Smuzhiyun#	build	- bad fails to build
1045*4882a593Smuzhiyun#	boot	- bad builds but fails to boot
1046*4882a593Smuzhiyun#	test	- bad boots but fails a test
1047*4882a593Smuzhiyun#
1048*4882a593Smuzhiyun# BISECT_GOOD is the commit (SHA1) to label as good (accepts all git good commit types)
1049*4882a593Smuzhiyun# BISECT_BAD is the commit to label as bad (accepts all git bad commit types)
1050*4882a593Smuzhiyun#
1051*4882a593Smuzhiyun# The above three options are required for a bisect operation.
1052*4882a593Smuzhiyun#
1053*4882a593Smuzhiyun# BISECT_REPLAY = /path/to/replay/file (optional, default undefined)
1054*4882a593Smuzhiyun#
1055*4882a593Smuzhiyun#   If an operation failed in the bisect that was not expected to
1056*4882a593Smuzhiyun#   fail. Then the test ends. The state of the BUILD_DIR will be
1057*4882a593Smuzhiyun#   left off at where the failure occurred. You can examine the
1058*4882a593Smuzhiyun#   reason for the failure, and perhaps even find a git commit
1059*4882a593Smuzhiyun#   that would work to continue with. You can run:
1060*4882a593Smuzhiyun#
1061*4882a593Smuzhiyun#   git bisect log > /path/to/replay/file
1062*4882a593Smuzhiyun#
1063*4882a593Smuzhiyun#   The adding:
1064*4882a593Smuzhiyun#
1065*4882a593Smuzhiyun#    BISECT_REPLAY= /path/to/replay/file
1066*4882a593Smuzhiyun#
1067*4882a593Smuzhiyun#   And running the test again. The test will perform the initial
1068*4882a593Smuzhiyun#    git bisect start, git bisect good, and git bisect bad, and
1069*4882a593Smuzhiyun#    then it will run git bisect replay on this file, before
1070*4882a593Smuzhiyun#    continuing with the bisect.
1071*4882a593Smuzhiyun#
1072*4882a593Smuzhiyun# BISECT_START = commit (optional, default undefined)
1073*4882a593Smuzhiyun#
1074*4882a593Smuzhiyun#   As with BISECT_REPLAY, if the test failed on a commit that
1075*4882a593Smuzhiyun#   just happen to have a bad commit in the middle of the bisect,
1076*4882a593Smuzhiyun#   and you need to skip it. If BISECT_START is defined, it
1077*4882a593Smuzhiyun#   will checkout that commit after doing the initial git bisect start,
1078*4882a593Smuzhiyun#   git bisect good, git bisect bad, and running the git bisect replay
1079*4882a593Smuzhiyun#   if the BISECT_REPLAY is set.
1080*4882a593Smuzhiyun#
1081*4882a593Smuzhiyun# BISECT_SKIP = 1 (optional, default 0)
1082*4882a593Smuzhiyun#
1083*4882a593Smuzhiyun#   If BISECT_TYPE is set to test but the build fails, ktest will
1084*4882a593Smuzhiyun#   simply fail the test and end their. You could use BISECT_REPLAY
1085*4882a593Smuzhiyun#   and BISECT_START to resume after you found a new starting point,
1086*4882a593Smuzhiyun#   or you could set BISECT_SKIP to 1. If BISECT_SKIP is set to 1,
1087*4882a593Smuzhiyun#   when something other than the BISECT_TYPE fails, ktest.pl will
1088*4882a593Smuzhiyun#   run "git bisect skip" and try again.
1089*4882a593Smuzhiyun#
1090*4882a593Smuzhiyun# BISECT_FILES = <path> (optional, default undefined)
1091*4882a593Smuzhiyun#
1092*4882a593Smuzhiyun#   To just run the git bisect on a specific path, set BISECT_FILES.
1093*4882a593Smuzhiyun#   For example:
1094*4882a593Smuzhiyun#
1095*4882a593Smuzhiyun#     BISECT_FILES = arch/x86 kernel/time
1096*4882a593Smuzhiyun#
1097*4882a593Smuzhiyun#   Will run the bisect with "git bisect start -- arch/x86 kernel/time"
1098*4882a593Smuzhiyun#
1099*4882a593Smuzhiyun# BISECT_REVERSE = 1 (optional, default 0)
1100*4882a593Smuzhiyun#
1101*4882a593Smuzhiyun#   In those strange instances where it was broken forever
1102*4882a593Smuzhiyun#   and you are trying to find where it started to work!
1103*4882a593Smuzhiyun#   Set BISECT_GOOD to the commit that was last known to fail
1104*4882a593Smuzhiyun#   Set BISECT_BAD to the commit that is known to start working.
1105*4882a593Smuzhiyun#   With BISECT_REVERSE = 1, The test will consider failures as
1106*4882a593Smuzhiyun#   good, and success as bad.
1107*4882a593Smuzhiyun#
1108*4882a593Smuzhiyun# BISECT_MANUAL = 1 (optional, default 0)
1109*4882a593Smuzhiyun#
1110*4882a593Smuzhiyun#   In case there's a problem with automating the bisect for
1111*4882a593Smuzhiyun#   whatever reason. (Can't reboot, want to inspect each iteration)
1112*4882a593Smuzhiyun#   Doing a BISECT_MANUAL will have the test wait for you to
1113*4882a593Smuzhiyun#   tell it if the test passed or failed after each iteration.
1114*4882a593Smuzhiyun#   This is basically the same as running git bisect yourself
1115*4882a593Smuzhiyun#   but ktest will rebuild and install the kernel for you.
1116*4882a593Smuzhiyun#
1117*4882a593Smuzhiyun# BISECT_CHECK = 1 (optional, default 0)
1118*4882a593Smuzhiyun#
1119*4882a593Smuzhiyun#   Just to be sure the good is good and bad is bad, setting
1120*4882a593Smuzhiyun#   BISECT_CHECK to 1 will start the bisect by first checking
1121*4882a593Smuzhiyun#   out BISECT_BAD and makes sure it fails, then it will check
1122*4882a593Smuzhiyun#   out BISECT_GOOD and makes sure it succeeds before starting
1123*4882a593Smuzhiyun#   the bisect (it works for BISECT_REVERSE too).
1124*4882a593Smuzhiyun#
1125*4882a593Smuzhiyun#   You can limit the test to just check BISECT_GOOD or
1126*4882a593Smuzhiyun#   BISECT_BAD with BISECT_CHECK = good or
1127*4882a593Smuzhiyun#   BISECT_CHECK = bad, respectively.
1128*4882a593Smuzhiyun#
1129*4882a593Smuzhiyun# BISECT_TRIES = 5 (optional, default 1)
1130*4882a593Smuzhiyun#
1131*4882a593Smuzhiyun#   For those cases that it takes several tries to hit a bug,
1132*4882a593Smuzhiyun#   the BISECT_TRIES is useful. It is the number of times the
1133*4882a593Smuzhiyun#   test is ran before it says the kernel is good. The first failure
1134*4882a593Smuzhiyun#   will stop trying and mark the current SHA1 as bad.
1135*4882a593Smuzhiyun#
1136*4882a593Smuzhiyun#   Note, as with all race bugs, there's no guarantee that if
1137*4882a593Smuzhiyun#   it succeeds, it is really a good bisect. But it helps in case
1138*4882a593Smuzhiyun#   the bug is some what reliable.
1139*4882a593Smuzhiyun#
1140*4882a593Smuzhiyun#   You can set BISECT_TRIES to zero, and all tests will be considered
1141*4882a593Smuzhiyun#   good, unless you also set BISECT_MANUAL.
1142*4882a593Smuzhiyun#
1143*4882a593Smuzhiyun# BISECT_RET_GOOD = 0 (optional, default undefined)
1144*4882a593Smuzhiyun#
1145*4882a593Smuzhiyun#   In case the specificed test returns something other than just
1146*4882a593Smuzhiyun#   0 for good, and non-zero for bad, you can override 0 being
1147*4882a593Smuzhiyun#   good by defining BISECT_RET_GOOD.
1148*4882a593Smuzhiyun#
1149*4882a593Smuzhiyun# BISECT_RET_BAD = 1 (optional, default undefined)
1150*4882a593Smuzhiyun#
1151*4882a593Smuzhiyun#   In case the specificed test returns something other than just
1152*4882a593Smuzhiyun#   0 for good, and non-zero for bad, you can override non-zero being
1153*4882a593Smuzhiyun#   bad by defining BISECT_RET_BAD.
1154*4882a593Smuzhiyun#
1155*4882a593Smuzhiyun# BISECT_RET_ABORT = 255 (optional, default undefined)
1156*4882a593Smuzhiyun#
1157*4882a593Smuzhiyun#   If you need to abort the bisect if the test discovers something
1158*4882a593Smuzhiyun#   that was wrong, you can define BISECT_RET_ABORT to be the error
1159*4882a593Smuzhiyun#   code returned by the test in order to abort the bisect.
1160*4882a593Smuzhiyun#
1161*4882a593Smuzhiyun# BISECT_RET_SKIP = 2 (optional, default undefined)
1162*4882a593Smuzhiyun#
1163*4882a593Smuzhiyun#   If the test detects that the current commit is neither good
1164*4882a593Smuzhiyun#   nor bad, but something else happened (another bug detected)
1165*4882a593Smuzhiyun#   you can specify BISECT_RET_SKIP to an error code that the
1166*4882a593Smuzhiyun#   test returns when it should skip the current commit.
1167*4882a593Smuzhiyun#
1168*4882a593Smuzhiyun# BISECT_RET_DEFAULT = good (optional, default undefined)
1169*4882a593Smuzhiyun#
1170*4882a593Smuzhiyun#   You can override the default of what to do when the above
1171*4882a593Smuzhiyun#   options are not hit. This may be one of, "good", "bad",
1172*4882a593Smuzhiyun#   "abort" or "skip" (without the quotes).
1173*4882a593Smuzhiyun#
1174*4882a593Smuzhiyun#   Note, if you do not define any of the previous BISECT_RET_*
1175*4882a593Smuzhiyun#   and define BISECT_RET_DEFAULT, all bisects results will do
1176*4882a593Smuzhiyun#   what the BISECT_RET_DEFAULT has.
1177*4882a593Smuzhiyun#
1178*4882a593Smuzhiyun#
1179*4882a593Smuzhiyun# Example:
1180*4882a593Smuzhiyun#   TEST_START
1181*4882a593Smuzhiyun#   TEST_TYPE = bisect
1182*4882a593Smuzhiyun#   BISECT_GOOD = v2.6.36
1183*4882a593Smuzhiyun#   BISECT_BAD = b5153163ed580e00c67bdfecb02b2e3843817b3e
1184*4882a593Smuzhiyun#   BISECT_TYPE = build
1185*4882a593Smuzhiyun#   MIN_CONFIG = /home/test/config-bisect
1186*4882a593Smuzhiyun#
1187*4882a593Smuzhiyun#
1188*4882a593Smuzhiyun#
1189*4882a593Smuzhiyun# For TEST_TYPE = config_bisect
1190*4882a593Smuzhiyun#
1191*4882a593Smuzhiyun#  In those cases that you have two different configs. One of them
1192*4882a593Smuzhiyun#  work, the other does not, and you do not know what config causes
1193*4882a593Smuzhiyun#  the problem.
1194*4882a593Smuzhiyun#  The TEST_TYPE config_bisect will bisect the bad config looking for
1195*4882a593Smuzhiyun#  what config causes the failure.
1196*4882a593Smuzhiyun#
1197*4882a593Smuzhiyun#  The way it works is this:
1198*4882a593Smuzhiyun#
1199*4882a593Smuzhiyun#   You can specify a good config with CONFIG_BISECT_GOOD, otherwise it
1200*4882a593Smuzhiyun#   will use the MIN_CONFIG, and if that's not specified, it will use
1201*4882a593Smuzhiyun#   the config that comes with "make defconfig".
1202*4882a593Smuzhiyun#
1203*4882a593Smuzhiyun#   It runs both the good and bad configs through a make oldconfig to
1204*4882a593Smuzhiyun#   make sure that they are set up for the kernel that is checked out.
1205*4882a593Smuzhiyun#
1206*4882a593Smuzhiyun#   It then reads the configs that are set, as well as the ones that are
1207*4882a593Smuzhiyun#   not set for both the good and bad configs, and then compares them.
1208*4882a593Smuzhiyun#   It will set half of the good configs within the bad config (note,
1209*4882a593Smuzhiyun#   "set" means to make the bad config match the good config, a config
1210*4882a593Smuzhiyun#   in the good config that is off, will be turned off in the bad
1211*4882a593Smuzhiyun#   config. That is considered a "set").
1212*4882a593Smuzhiyun#
1213*4882a593Smuzhiyun#   It tests this new config and if it works, it becomes the new good
1214*4882a593Smuzhiyun#   config, otherwise it becomes the new bad config. It continues this
1215*4882a593Smuzhiyun#   process until there's only one config left and it will report that
1216*4882a593Smuzhiyun#   config.
1217*4882a593Smuzhiyun#
1218*4882a593Smuzhiyun#   The "bad config" can also be a config that is needed to boot but was
1219*4882a593Smuzhiyun#   disabled because it depended on something that wasn't set.
1220*4882a593Smuzhiyun#
1221*4882a593Smuzhiyun#   During this process, it saves the current good and bad configs in
1222*4882a593Smuzhiyun#   ${TMP_DIR}/good_config and ${TMP_DIR}/bad_config respectively.
1223*4882a593Smuzhiyun#   If you stop the test, you can copy them to a new location to
1224*4882a593Smuzhiyun#   reuse them again.
1225*4882a593Smuzhiyun#
1226*4882a593Smuzhiyun#   Although the MIN_CONFIG may be the config it starts with, the
1227*4882a593Smuzhiyun#   MIN_CONFIG is ignored.
1228*4882a593Smuzhiyun#
1229*4882a593Smuzhiyun#  The option BUILD_TYPE will be ignored.
1230*4882a593Smuzhiyun#
1231*4882a593Smuzhiyun#  CONFIG_BISECT_TYPE is the type of test to perform:
1232*4882a593Smuzhiyun#	build	- bad fails to build
1233*4882a593Smuzhiyun#	boot	- bad builds but fails to boot
1234*4882a593Smuzhiyun#	test	- bad boots but fails a test
1235*4882a593Smuzhiyun#
1236*4882a593Smuzhiyun#  CONFIG_BISECT is the config that failed to boot
1237*4882a593Smuzhiyun#
1238*4882a593Smuzhiyun#  If BISECT_MANUAL is set, it will pause between iterations.
1239*4882a593Smuzhiyun#  This is useful to use just ktest.pl just for the config bisect.
1240*4882a593Smuzhiyun#  If you set it to build, it will run the bisect and you can
1241*4882a593Smuzhiyun#  control what happens in between iterations. It will ask you if
1242*4882a593Smuzhiyun#  the test succeeded or not and continue the config bisect.
1243*4882a593Smuzhiyun#
1244*4882a593Smuzhiyun# CONFIG_BISECT_GOOD (optional)
1245*4882a593Smuzhiyun#  If you have a good config to start with, then you
1246*4882a593Smuzhiyun#  can specify it with CONFIG_BISECT_GOOD. Otherwise
1247*4882a593Smuzhiyun#  the MIN_CONFIG is the base, if MIN_CONFIG is not set
1248*4882a593Smuzhiyun#  It will build a config with "make defconfig"
1249*4882a593Smuzhiyun#
1250*4882a593Smuzhiyun# CONFIG_BISECT_CHECK (optional)
1251*4882a593Smuzhiyun#  Set this to 1 if you want to confirm that the config ktest
1252*4882a593Smuzhiyun#  generates (the bad config with the min config) is still bad.
1253*4882a593Smuzhiyun#  It may be that the min config fixes what broke the bad config
1254*4882a593Smuzhiyun#  and the test will not return a result.
1255*4882a593Smuzhiyun#  Set it to "good" to test only the good config and set it
1256*4882a593Smuzhiyun#  to "bad" to only test the bad config.
1257*4882a593Smuzhiyun#
1258*4882a593Smuzhiyun# CONFIG_BISECT_EXEC (optional)
1259*4882a593Smuzhiyun#  The config bisect is a separate program that comes with ktest.pl.
1260*4882a593Smuzhiyun#  By default, it will look for:
1261*4882a593Smuzhiyun#    `pwd`/config-bisect.pl # the location ktest.pl was executed from.
1262*4882a593Smuzhiyun#  If it does not find it there, it will look for:
1263*4882a593Smuzhiyun#    `dirname <ktest.pl>`/config-bisect.pl # The directory that holds ktest.pl
1264*4882a593Smuzhiyun#  If it does not find it there, it will look for:
1265*4882a593Smuzhiyun#    ${BUILD_DIR}/tools/testing/ktest/config-bisect.pl
1266*4882a593Smuzhiyun#  Setting CONFIG_BISECT_EXEC will override where it looks.
1267*4882a593Smuzhiyun#
1268*4882a593Smuzhiyun# Example:
1269*4882a593Smuzhiyun#   TEST_START
1270*4882a593Smuzhiyun#   TEST_TYPE = config_bisect
1271*4882a593Smuzhiyun#   CONFIG_BISECT_TYPE = build
1272*4882a593Smuzhiyun#   CONFIG_BISECT = /home/test/config-bad
1273*4882a593Smuzhiyun#   MIN_CONFIG = /home/test/config-min
1274*4882a593Smuzhiyun#   BISECT_MANUAL = 1
1275*4882a593Smuzhiyun#
1276*4882a593Smuzhiyun#
1277*4882a593Smuzhiyun#
1278*4882a593Smuzhiyun# For TEST_TYPE = make_min_config
1279*4882a593Smuzhiyun#
1280*4882a593Smuzhiyun#  After doing a make localyesconfig, your kernel configuration may
1281*4882a593Smuzhiyun#  not be the most useful minimum configuration. Having a true minimum
1282*4882a593Smuzhiyun#  config that you can use against other configs is very useful if
1283*4882a593Smuzhiyun#  someone else has a config that breaks on your code. By only forcing
1284*4882a593Smuzhiyun#  those configurations that are truly required to boot your machine
1285*4882a593Smuzhiyun#  will give you less of a chance that one of your set configurations
1286*4882a593Smuzhiyun#  will make the bug go away. This will give you a better chance to
1287*4882a593Smuzhiyun#  be able to reproduce the reported bug matching the broken config.
1288*4882a593Smuzhiyun#
1289*4882a593Smuzhiyun#  Note, this does take some time, and may require you to run the
1290*4882a593Smuzhiyun#  test over night, or perhaps over the weekend. But it also allows
1291*4882a593Smuzhiyun#  you to interrupt it, and gives you the current minimum config
1292*4882a593Smuzhiyun#  that was found till that time.
1293*4882a593Smuzhiyun#
1294*4882a593Smuzhiyun#  Note, this test automatically assumes a BUILD_TYPE of oldconfig
1295*4882a593Smuzhiyun#  and its test type acts like boot.
1296*4882a593Smuzhiyun#  TODO: add a test version that makes the config do more than just
1297*4882a593Smuzhiyun#   boot, like having network access.
1298*4882a593Smuzhiyun#
1299*4882a593Smuzhiyun#  To save time, the test does not just grab any option and test
1300*4882a593Smuzhiyun#  it. The Kconfig files are examined to determine the dependencies
1301*4882a593Smuzhiyun#  of the configs. If a config is chosen that depends on another
1302*4882a593Smuzhiyun#  config, that config will be checked first. By checking the
1303*4882a593Smuzhiyun#  parents first, we can eliminate whole groups of configs that
1304*4882a593Smuzhiyun#  may have been enabled.
1305*4882a593Smuzhiyun#
1306*4882a593Smuzhiyun#  For example, if a USB device config is chosen and depends on CONFIG_USB,
1307*4882a593Smuzhiyun#  the CONFIG_USB will be tested before the device. If CONFIG_USB is
1308*4882a593Smuzhiyun#  found not to be needed, it, as well as all configs that depend on
1309*4882a593Smuzhiyun#  it, will be disabled and removed from the current min_config.
1310*4882a593Smuzhiyun#
1311*4882a593Smuzhiyun#  OUTPUT_MIN_CONFIG is the path and filename of the file that will
1312*4882a593Smuzhiyun#   be created from the MIN_CONFIG. If you interrupt the test, set
1313*4882a593Smuzhiyun#   this file as your new min config, and use it to continue the test.
1314*4882a593Smuzhiyun#   This file does not need to exist on start of test.
1315*4882a593Smuzhiyun#   This file is not created until a config is found that can be removed.
1316*4882a593Smuzhiyun#   If this file exists, you will be prompted if you want to use it
1317*4882a593Smuzhiyun#   as the min_config (overriding MIN_CONFIG) if START_MIN_CONFIG
1318*4882a593Smuzhiyun#   is not defined.
1319*4882a593Smuzhiyun#   (required field)
1320*4882a593Smuzhiyun#
1321*4882a593Smuzhiyun#  START_MIN_CONFIG is the config to use to start the test with.
1322*4882a593Smuzhiyun#   you can set this as the same OUTPUT_MIN_CONFIG, but if you do
1323*4882a593Smuzhiyun#   the OUTPUT_MIN_CONFIG file must exist.
1324*4882a593Smuzhiyun#   (default MIN_CONFIG)
1325*4882a593Smuzhiyun#
1326*4882a593Smuzhiyun#  IGNORE_CONFIG is used to specify a config file that has configs that
1327*4882a593Smuzhiyun#   you already know must be set. Configs are written here that have
1328*4882a593Smuzhiyun#   been tested and proved to be required. It is best to define this
1329*4882a593Smuzhiyun#   file if you intend on interrupting the test and running it where
1330*4882a593Smuzhiyun#   it left off. New configs that it finds will be written to this file
1331*4882a593Smuzhiyun#   and will not be tested again in later runs.
1332*4882a593Smuzhiyun#   (optional)
1333*4882a593Smuzhiyun#
1334*4882a593Smuzhiyun#  MIN_CONFIG_TYPE can be either 'boot' or 'test'. With 'boot' it will
1335*4882a593Smuzhiyun#   test if the created config can just boot the machine. If this is
1336*4882a593Smuzhiyun#   set to 'test', then the TEST option must be defined and the created
1337*4882a593Smuzhiyun#   config will not only boot the target, but also make sure that the
1338*4882a593Smuzhiyun#   config lets the test succeed. This is useful to make sure the final
1339*4882a593Smuzhiyun#   config that is generated allows network activity (ssh).
1340*4882a593Smuzhiyun#   (optional)
1341*4882a593Smuzhiyun#
1342*4882a593Smuzhiyun#  USE_OUTPUT_MIN_CONFIG set this to 1 if you do not want to be prompted
1343*4882a593Smuzhiyun#   about using the OUTPUT_MIN_CONFIG as the MIN_CONFIG as the starting
1344*4882a593Smuzhiyun#   point. Set it to 0 if you want to always just use the given MIN_CONFIG.
1345*4882a593Smuzhiyun#   If it is not defined, it will prompt you to pick which config
1346*4882a593Smuzhiyun#   to start with (MIN_CONFIG or OUTPUT_MIN_CONFIG).
1347*4882a593Smuzhiyun#
1348*4882a593Smuzhiyun# Example:
1349*4882a593Smuzhiyun#
1350*4882a593Smuzhiyun#  TEST_TYPE = make_min_config
1351*4882a593Smuzhiyun#  OUTPUT_MIN_CONFIG = /path/to/config-new-min
1352*4882a593Smuzhiyun#  START_MIN_CONFIG = /path/to/config-min
1353*4882a593Smuzhiyun#  IGNORE_CONFIG = /path/to/config-tested
1354*4882a593Smuzhiyun#  MIN_CONFIG_TYPE = test
1355*4882a593Smuzhiyun#  TEST = ssh ${USER}@${MACHINE} echo hi
1356*4882a593Smuzhiyun#
1357*4882a593Smuzhiyun#
1358*4882a593Smuzhiyun#
1359*4882a593Smuzhiyun#
1360*4882a593Smuzhiyun# For TEST_TYPE = make_warnings_file
1361*4882a593Smuzhiyun#
1362*4882a593Smuzhiyun# If you want the build to fail when a new warning is discovered
1363*4882a593Smuzhiyun# you set the WARNINGS_FILE to point to a file of known warnings.
1364*4882a593Smuzhiyun#
1365*4882a593Smuzhiyun# The test "make_warnings_file" will let you create a new warnings
1366*4882a593Smuzhiyun# file before you run other tests, like patchcheck.
1367*4882a593Smuzhiyun#
1368*4882a593Smuzhiyun# What this test does is to run just a build, you still need to
1369*4882a593Smuzhiyun# specify BUILD_TYPE to tell the test what type of config to use.
1370*4882a593Smuzhiyun# A BUILD_TYPE of nobuild will fail this test.
1371*4882a593Smuzhiyun#
1372*4882a593Smuzhiyun# The test will do the build and scan for all warnings. Any warning
1373*4882a593Smuzhiyun# it discovers will be saved in the WARNINGS_FILE (required) option.
1374*4882a593Smuzhiyun#
1375*4882a593Smuzhiyun# It is recommended (but not necessary) to make sure BUILD_NOCLEAN is
1376*4882a593Smuzhiyun# off, so that a full build is done (make mrproper is performed).
1377*4882a593Smuzhiyun# That way, all warnings will be captured.
1378*4882a593Smuzhiyun#
1379*4882a593Smuzhiyun# Example:
1380*4882a593Smuzhiyun#
1381*4882a593Smuzhiyun#  TEST_TYPE = make_warnings_file
1382*4882a593Smuzhiyun#  WARNINGS_FILE = ${OUTPUT_DIR}
1383*4882a593Smuzhiyun#  BUILD_TYPE = useconfig:oldconfig
1384*4882a593Smuzhiyun#  CHECKOUT = v3.8
1385*4882a593Smuzhiyun#  BUILD_NOCLEAN = 0
1386*4882a593Smuzhiyun#
1387