1a75fececSSteven Rostedt# 2a57419b3SSteven Rostedt# Config file for ktest.pl 3a75fececSSteven Rostedt# 46dd3791dSSteven Rostedt (VMware)# Place your customized version of this, in the working directory that 56dd3791dSSteven Rostedt (VMware)# ktest.pl is run from. By default, ktest.pl will look for a file 66dd3791dSSteven Rostedt (VMware)# called "ktest.conf", but you can name it anything you like and specify 76dd3791dSSteven Rostedt (VMware)# the name of your config file as the first argument of ktest.pl. 8edbd0edeSScott Wood# 9a75fececSSteven Rostedt# Note, all paths must be absolute 10a75fececSSteven Rostedt# 11a75fececSSteven Rostedt 12a57419b3SSteven Rostedt# Options set in the beginning of the file are considered to be 13a57419b3SSteven Rostedt# default options. These options can be overriden by test specific 14a57419b3SSteven Rostedt# options, with the following exceptions: 15a75fececSSteven Rostedt# 16a75fececSSteven Rostedt# LOG_FILE 17a75fececSSteven Rostedt# CLEAR_LOG 18a75fececSSteven Rostedt# POWEROFF_ON_SUCCESS 19a75fececSSteven Rostedt# REBOOT_ON_SUCCESS 20a75fececSSteven Rostedt# 21a57419b3SSteven Rostedt# Test specific options are set after the label: 22a57419b3SSteven Rostedt# 23a57419b3SSteven Rostedt# TEST_START 24a57419b3SSteven Rostedt# 25a57419b3SSteven Rostedt# The options after a TEST_START label are specific to that test. 26a57419b3SSteven Rostedt# Each TEST_START label will set up a new test. If you want to 27a57419b3SSteven Rostedt# perform a test more than once, you can add the ITERATE label 28a57419b3SSteven Rostedt# to it followed by the number of times you want that test 29a57419b3SSteven Rostedt# to iterate. If the ITERATE is left off, the test will only 30a57419b3SSteven Rostedt# be performed once. 31a57419b3SSteven Rostedt# 32a57419b3SSteven Rostedt# TEST_START ITERATE 10 33a57419b3SSteven Rostedt# 34a57419b3SSteven Rostedt# You can skip a test by adding SKIP (before or after the ITERATE 35a57419b3SSteven Rostedt# and number) 36a57419b3SSteven Rostedt# 37a57419b3SSteven Rostedt# TEST_START SKIP 38a57419b3SSteven Rostedt# 39a57419b3SSteven Rostedt# TEST_START SKIP ITERATE 10 40a57419b3SSteven Rostedt# 41a57419b3SSteven Rostedt# TEST_START ITERATE 10 SKIP 42a57419b3SSteven Rostedt# 43a57419b3SSteven Rostedt# The SKIP label causes the options and the test itself to be ignored. 44a57419b3SSteven Rostedt# This is useful to set up several different tests in one config file, and 45a57419b3SSteven Rostedt# only enabling the ones you want to use for a current test run. 46a57419b3SSteven Rostedt# 47a57419b3SSteven Rostedt# You can add default options anywhere in the file as well 48a57419b3SSteven Rostedt# with the DEFAULTS tag. This allows you to have default options 49a57419b3SSteven Rostedt# after the test options to keep the test options at the top 50a57419b3SSteven Rostedt# of the file. You can even place the DEFAULTS tag between 51a57419b3SSteven Rostedt# test cases (but not in the middle of a single test case) 52a57419b3SSteven Rostedt# 53a57419b3SSteven Rostedt# TEST_START 54a57419b3SSteven Rostedt# MIN_CONFIG = /home/test/config-test1 55a57419b3SSteven Rostedt# 56a57419b3SSteven Rostedt# DEFAULTS 57a57419b3SSteven Rostedt# MIN_CONFIG = /home/test/config-default 58a57419b3SSteven Rostedt# 59a57419b3SSteven Rostedt# TEST_START ITERATE 10 60a57419b3SSteven Rostedt# 61a57419b3SSteven Rostedt# The above will run the first test with MIN_CONFIG set to 62a57419b3SSteven Rostedt# /home/test/config-test-1. Then 10 tests will be executed 63a57419b3SSteven Rostedt# with MIN_CONFIG with /home/test/config-default. 64a57419b3SSteven Rostedt# 65a57419b3SSteven Rostedt# You can also disable defaults with the SKIP option 66a57419b3SSteven Rostedt# 67a57419b3SSteven Rostedt# DEFAULTS SKIP 68a57419b3SSteven Rostedt# MIN_CONFIG = /home/test/config-use-sometimes 69a57419b3SSteven Rostedt# 70a57419b3SSteven Rostedt# DEFAULTS 71a57419b3SSteven Rostedt# MIN_CONFIG = /home/test/config-most-times 72a57419b3SSteven Rostedt# 73a57419b3SSteven Rostedt# The above will ignore the first MIN_CONFIG. If you want to 74a57419b3SSteven Rostedt# use the first MIN_CONFIG, remove the SKIP from the first 75a57419b3SSteven Rostedt# DEFAULTS tag and add it to the second. Be careful, options 76a57419b3SSteven Rostedt# may only be declared once per test or default. If you have 77a57419b3SSteven Rostedt# the same option name under the same test or as default 78a57419b3SSteven Rostedt# ktest will fail to execute, and no tests will run. 79a57419b3SSteven Rostedt# 803d1cc414SSteven Rostedt# DEFAULTS OVERRIDE 813d1cc414SSteven Rostedt# 823d1cc414SSteven Rostedt# Options defined in the DEFAULTS section can not be duplicated 833d1cc414SSteven Rostedt# even if they are defined in two different DEFAULT sections. 843d1cc414SSteven Rostedt# This is done to catch mistakes where an option is added but 853d1cc414SSteven Rostedt# the previous option was forgotten about and not commented. 863d1cc414SSteven Rostedt# 873d1cc414SSteven Rostedt# The OVERRIDE keyword can be added to a section to allow this 883d1cc414SSteven Rostedt# section to override other DEFAULT sections values that have 893d1cc414SSteven Rostedt# been defined previously. It will only override options that 903d1cc414SSteven Rostedt# have been defined before its use. Options defined later 913d1cc414SSteven Rostedt# in a non override section will still error. The same option 923d1cc414SSteven Rostedt# can not be defined in the same section even if that section 933d1cc414SSteven Rostedt# is marked OVERRIDE. 943d1cc414SSteven Rostedt# 95ab7a3f52SSteven Rostedt# 96ab7a3f52SSteven Rostedt# 9745d73a5dSSteven Rostedt# Both TEST_START and DEFAULTS sections can also have the IF keyword 9845d73a5dSSteven Rostedt# The value after the IF must evaluate into a 0 or non 0 positive 9945d73a5dSSteven Rostedt# integer, and can use the config variables (explained below). 10045d73a5dSSteven Rostedt# 10145d73a5dSSteven Rostedt# DEFAULTS IF ${IS_X86_32} 10245d73a5dSSteven Rostedt# 10345d73a5dSSteven Rostedt# The above will process the DEFAULTS section if the config 10445d73a5dSSteven Rostedt# variable IS_X86_32 evaluates to a non zero positive integer 10545d73a5dSSteven Rostedt# otherwise if it evaluates to zero, it will act the same 10645d73a5dSSteven Rostedt# as if the SKIP keyword was used. 10745d73a5dSSteven Rostedt# 10845d73a5dSSteven Rostedt# The ELSE keyword can be used directly after a section with 10945d73a5dSSteven Rostedt# a IF statement. 11045d73a5dSSteven Rostedt# 11145d73a5dSSteven Rostedt# TEST_START IF ${RUN_NET_TESTS} 11245d73a5dSSteven Rostedt# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-network 11345d73a5dSSteven Rostedt# 11445d73a5dSSteven Rostedt# ELSE 11545d73a5dSSteven Rostedt# 11645d73a5dSSteven Rostedt# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-normal 11745d73a5dSSteven Rostedt# 11845d73a5dSSteven Rostedt# 11945d73a5dSSteven Rostedt# The ELSE keyword can also contain an IF statement to allow multiple 12045d73a5dSSteven Rostedt# if then else sections. But all the sections must be either 12145d73a5dSSteven Rostedt# DEFAULT or TEST_START, they can not be a mixture. 12245d73a5dSSteven Rostedt# 12345d73a5dSSteven Rostedt# TEST_START IF ${RUN_NET_TESTS} 12445d73a5dSSteven Rostedt# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-network 12545d73a5dSSteven Rostedt# 12645d73a5dSSteven Rostedt# ELSE IF ${RUN_DISK_TESTS} 12745d73a5dSSteven Rostedt# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-tests 12845d73a5dSSteven Rostedt# 12945d73a5dSSteven Rostedt# ELSE IF ${RUN_CPU_TESTS} 13045d73a5dSSteven Rostedt# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-cpu 13145d73a5dSSteven Rostedt# 13245d73a5dSSteven Rostedt# ELSE 13345d73a5dSSteven Rostedt# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-network 13445d73a5dSSteven Rostedt# 135ab7a3f52SSteven Rostedt# The if statement may also have comparisons that will and for 136ab7a3f52SSteven Rostedt# == and !=, strings may be used for both sides. 137ab7a3f52SSteven Rostedt# 138ab7a3f52SSteven Rostedt# BOX_TYPE := x86_32 139ab7a3f52SSteven Rostedt# 140ab7a3f52SSteven Rostedt# DEFAULTS IF ${BOX_TYPE} == x86_32 141ab7a3f52SSteven Rostedt# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-32 142ab7a3f52SSteven Rostedt# ELSE 143ab7a3f52SSteven Rostedt# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-64 144ab7a3f52SSteven Rostedt# 1459900b5dcSSteven Rostedt# The DEFINED keyword can be used by the IF statements too. 1469900b5dcSSteven Rostedt# It returns true if the given config variable or option has been defined 1479900b5dcSSteven Rostedt# or false otherwise. 1489900b5dcSSteven Rostedt# 1499900b5dcSSteven Rostedt# 1509900b5dcSSteven Rostedt# DEFAULTS IF DEFINED USE_CC 1519900b5dcSSteven Rostedt# CC := ${USE_CC} 1529900b5dcSSteven Rostedt# ELSE 1539900b5dcSSteven Rostedt# CC := gcc 1549900b5dcSSteven Rostedt# 1559900b5dcSSteven Rostedt# 1569900b5dcSSteven Rostedt# As well as NOT DEFINED. 1579900b5dcSSteven Rostedt# 1589900b5dcSSteven Rostedt# DEFAULTS IF NOT DEFINED MAKE_CMD 1599900b5dcSSteven Rostedt# MAKE_CMD := make ARCH=x86 1609900b5dcSSteven Rostedt# 1619900b5dcSSteven Rostedt# 1628d735212SSteven Rostedt# And/or ops (&&,||) may also be used to make complex conditionals. 1638d735212SSteven Rostedt# 1648d735212SSteven Rostedt# TEST_START IF (DEFINED ALL_TESTS || ${MYTEST} == boottest) && ${MACHINE} == gandalf 1658d735212SSteven Rostedt# 16611c38b75SJesper Juhl# Notice the use of parentheses. Without any parentheses the above would be 1678d735212SSteven Rostedt# processed the same as: 1688d735212SSteven Rostedt# 1698d735212SSteven Rostedt# TEST_START IF DEFINED ALL_TESTS || (${MYTEST} == boottest && ${MACHINE} == gandalf) 1708d735212SSteven Rostedt# 1718d735212SSteven Rostedt# 1722ed3b161SSteven Rostedt# 1732ed3b161SSteven Rostedt# INCLUDE file 1742ed3b161SSteven Rostedt# 1752ed3b161SSteven Rostedt# The INCLUDE keyword may be used in DEFAULT sections. This will 1762ed3b161SSteven Rostedt# read another config file and process that file as well. The included 1772ed3b161SSteven Rostedt# file can include other files, add new test cases or default 1782ed3b161SSteven Rostedt# statements. Config variables will be passed to these files and changes 1792ed3b161SSteven Rostedt# to config variables will be seen by top level config files. Including 1802ed3b161SSteven Rostedt# a file is processed just like the contents of the file was cut and pasted 1812ed3b161SSteven Rostedt# into the top level file, except, that include files that end with 1822ed3b161SSteven Rostedt# TEST_START sections will have that section ended at the end of 1832ed3b161SSteven Rostedt# the include file. That is, an included file is included followed 1842ed3b161SSteven Rostedt# by another DEFAULT keyword. 1852ed3b161SSteven Rostedt# 1862ed3b161SSteven Rostedt# Unlike other files referenced in this config, the file path does not need 1872ed3b161SSteven Rostedt# to be absolute. If the file does not start with '/', then the directory 1882ed3b161SSteven Rostedt# that the current config file was located in is used. If no config by the 1892ed3b161SSteven Rostedt# given name is found there, then the current directory is searched. 1902ed3b161SSteven Rostedt# 1912ed3b161SSteven Rostedt# INCLUDE myfile 1922ed3b161SSteven Rostedt# DEFAULT 1932ed3b161SSteven Rostedt# 1942ed3b161SSteven Rostedt# is the same as: 1952ed3b161SSteven Rostedt# 1962ed3b161SSteven Rostedt# INCLUDE myfile 1972ed3b161SSteven Rostedt# 1982ed3b161SSteven Rostedt# Note, if the include file does not contain a full path, the file is 1992ed3b161SSteven Rostedt# searched first by the location of the original include file, and then 2002ed3b161SSteven Rostedt# by the location that ktest.pl was executed in. 2012ed3b161SSteven Rostedt# 202a75fececSSteven Rostedt 20377d942ceSSteven Rostedt#### Config variables #### 20477d942ceSSteven Rostedt# 20577d942ceSSteven Rostedt# This config file can also contain "config variables". 20677d942ceSSteven Rostedt# These are assigned with ":=" instead of the ktest option 20777d942ceSSteven Rostedt# assigment "=". 20877d942ceSSteven Rostedt# 20977d942ceSSteven Rostedt# The difference between ktest options and config variables 21077d942ceSSteven Rostedt# is that config variables can be used multiple times, 21177d942ceSSteven Rostedt# where each instance will override the previous instance. 21277d942ceSSteven Rostedt# And that they only live at time of processing this config. 21377d942ceSSteven Rostedt# 21477d942ceSSteven Rostedt# The advantage to config variables are that they can be used 21577d942ceSSteven Rostedt# by any option or any other config variables to define thing 21677d942ceSSteven Rostedt# that you may use over and over again in the options. 21777d942ceSSteven Rostedt# 21877d942ceSSteven Rostedt# For example: 21977d942ceSSteven Rostedt# 22077d942ceSSteven Rostedt# USER := root 22177d942ceSSteven Rostedt# TARGET := mybox 22277d942ceSSteven Rostedt# TEST_CASE := ssh ${USER}@${TARGET} /path/to/my/test 22377d942ceSSteven Rostedt# 22477d942ceSSteven Rostedt# TEST_START 22577d942ceSSteven Rostedt# MIN_CONFIG = config1 22677d942ceSSteven Rostedt# TEST = ${TEST_CASE} 22777d942ceSSteven Rostedt# 22877d942ceSSteven Rostedt# TEST_START 22977d942ceSSteven Rostedt# MIN_CONFIG = config2 23077d942ceSSteven Rostedt# TEST = ${TEST_CASE} 23177d942ceSSteven Rostedt# 23277d942ceSSteven Rostedt# TEST_CASE := ssh ${USER}@${TARGET} /path/to/my/test2 23377d942ceSSteven Rostedt# 23477d942ceSSteven Rostedt# TEST_START 23577d942ceSSteven Rostedt# MIN_CONFIG = config1 23677d942ceSSteven Rostedt# TEST = ${TEST_CASE} 23777d942ceSSteven Rostedt# 23877d942ceSSteven Rostedt# TEST_START 23977d942ceSSteven Rostedt# MIN_CONFIG = config2 24077d942ceSSteven Rostedt# TEST = ${TEST_CASE} 24177d942ceSSteven Rostedt# 24277d942ceSSteven Rostedt# TEST_DIR := /home/me/test 24377d942ceSSteven Rostedt# 24477d942ceSSteven Rostedt# BUILD_DIR = ${TEST_DIR}/linux.git 24577d942ceSSteven Rostedt# OUTPUT_DIR = ${TEST_DIR}/test 24677d942ceSSteven Rostedt# 24777d942ceSSteven Rostedt# Note, the config variables are evaluated immediately, thus 24877d942ceSSteven Rostedt# updating TARGET after TEST_CASE has been assigned does nothing 24977d942ceSSteven Rostedt# to TEST_CASE. 25077d942ceSSteven Rostedt# 25177d942ceSSteven Rostedt# As shown in the example, to evaluate a config variable, you 25277d942ceSSteven Rostedt# use the ${X} convention. Simple $X will not work. 25377d942ceSSteven Rostedt# 25477d942ceSSteven Rostedt# If the config variable does not exist, the ${X} will not 25577d942ceSSteven Rostedt# be evaluated. Thus: 25677d942ceSSteven Rostedt# 25777d942ceSSteven Rostedt# MAKE_CMD = PATH=/mypath:${PATH} make 25877d942ceSSteven Rostedt# 25977d942ceSSteven Rostedt# If PATH is not a config variable, then the ${PATH} in 26077d942ceSSteven Rostedt# the MAKE_CMD option will be evaluated by the shell when 26177d942ceSSteven Rostedt# the MAKE_CMD option is passed into shell processing. 262a57419b3SSteven Rostedt 2632a62512bSSteven Rostedt#### Using options in other options #### 2642a62512bSSteven Rostedt# 2652a62512bSSteven Rostedt# Options that are defined in the config file may also be used 2662a62512bSSteven Rostedt# by other options. All options are evaulated at time of 2672a62512bSSteven Rostedt# use (except that config variables are evaluated at config 2682a62512bSSteven Rostedt# processing time). 2692a62512bSSteven Rostedt# 2702a62512bSSteven Rostedt# If an ktest option is used within another option, instead of 2712a62512bSSteven Rostedt# typing it again in that option you can simply use the option 2722a62512bSSteven Rostedt# just like you can config variables. 2732a62512bSSteven Rostedt# 2742a62512bSSteven Rostedt# MACHINE = mybox 2752a62512bSSteven Rostedt# 2762a62512bSSteven Rostedt# TEST = ssh root@${MACHINE} /path/to/test 2772a62512bSSteven Rostedt# 2782a62512bSSteven Rostedt# The option will be used per test case. Thus: 2792a62512bSSteven Rostedt# 2802a62512bSSteven Rostedt# TEST_TYPE = test 2812a62512bSSteven Rostedt# TEST = ssh root@{MACHINE} 2822a62512bSSteven Rostedt# 2832a62512bSSteven Rostedt# TEST_START 2842a62512bSSteven Rostedt# MACHINE = box1 2852a62512bSSteven Rostedt# 2862a62512bSSteven Rostedt# TEST_START 2872a62512bSSteven Rostedt# MACHINE = box2 2882a62512bSSteven Rostedt# 2892a62512bSSteven Rostedt# For both test cases, MACHINE will be evaluated at the time 2902a62512bSSteven Rostedt# of the test case. The first test will run ssh root@box1 2912a62512bSSteven Rostedt# and the second will run ssh root@box2. 2922a62512bSSteven Rostedt 293a57419b3SSteven Rostedt#### Mandatory Default Options #### 294a57419b3SSteven Rostedt 295a57419b3SSteven Rostedt# These options must be in the default section, although most 296a57419b3SSteven Rostedt# may be overridden by test options. 297a75fececSSteven Rostedt 298a75fececSSteven Rostedt# The machine hostname that you will test 299a75fececSSteven Rostedt#MACHINE = target 300a75fececSSteven Rostedt 301a75fececSSteven Rostedt# The box is expected to have ssh on normal bootup, provide the user 302a75fececSSteven Rostedt# (most likely root, since you need privileged operations) 303a75fececSSteven Rostedt#SSH_USER = root 304a75fececSSteven Rostedt 305a75fececSSteven Rostedt# The directory that contains the Linux source code 306a75fececSSteven Rostedt#BUILD_DIR = /home/test/linux.git 307a75fececSSteven Rostedt 308a75fececSSteven Rostedt# The directory that the objects will be built 309a75fececSSteven Rostedt# (can not be same as BUILD_DIR) 310a75fececSSteven Rostedt#OUTPUT_DIR = /home/test/build/target 311a75fececSSteven Rostedt 312a75fececSSteven Rostedt# The location of the compiled file to copy to the target 313a75fececSSteven Rostedt# (relative to OUTPUT_DIR) 314a75fececSSteven Rostedt#BUILD_TARGET = arch/x86/boot/bzImage 315a75fececSSteven Rostedt 316a75fececSSteven Rostedt# The place to put your image on the test machine 317a75fececSSteven Rostedt#TARGET_IMAGE = /boot/vmlinuz-test 318a75fececSSteven Rostedt 319a75fececSSteven Rostedt# A script or command to reboot the box 320a57419b3SSteven Rostedt# 321a75fececSSteven Rostedt# Here is a digital loggers power switch example 322a75fececSSteven Rostedt#POWER_CYCLE = wget --no-proxy -O /dev/null -q --auth-no-challenge 'http://admin:admin@power/outlet?5=CCL' 323a57419b3SSteven Rostedt# 324a75fececSSteven Rostedt# Here is an example to reboot a virtual box on the current host 325a75fececSSteven Rostedt# with the name "Guest". 326a57419b3SSteven Rostedt#POWER_CYCLE = virsh destroy Guest; sleep 5; virsh start Guest 327a75fececSSteven Rostedt 328a75fececSSteven Rostedt# The script or command that reads the console 329a57419b3SSteven Rostedt# 330a75fececSSteven Rostedt# If you use ttywatch server, something like the following would work. 331a75fececSSteven Rostedt#CONSOLE = nc -d localhost 3001 332a57419b3SSteven Rostedt# 333a75fececSSteven Rostedt# For a virtual machine with guest name "Guest". 334a57419b3SSteven Rostedt#CONSOLE = virsh console Guest 335a75fececSSteven Rostedt 336298a0d1dSSteven Rostedt (Red Hat)# Signal to send to kill console. 337298a0d1dSSteven Rostedt (Red Hat)# ktest.pl will create a child process to monitor the console. 338298a0d1dSSteven Rostedt (Red Hat)# When the console is finished, ktest will kill the child process 339298a0d1dSSteven Rostedt (Red Hat)# with this signal. 340298a0d1dSSteven Rostedt (Red Hat)# (default INT) 341298a0d1dSSteven Rostedt (Red Hat)#CLOSE_CONSOLE_SIGNAL = HUP 342298a0d1dSSteven Rostedt (Red Hat) 343a75fececSSteven Rostedt# Required version ending to differentiate the test 344a75fececSSteven Rostedt# from other linux builds on the system. 345a75fececSSteven Rostedt#LOCALVERSION = -test 346a75fececSSteven Rostedt 347a15ba913SSteven Rostedt# For REBOOT_TYPE = grub2, you must specify where the grub.cfg 348a15ba913SSteven Rostedt# file is. This is the file that is searched to find the menu 349a15ba913SSteven Rostedt# option to boot to with GRUB_REBOOT 350a15ba913SSteven Rostedt#GRUB_FILE = /boot/grub2/grub.cfg 351a15ba913SSteven Rostedt 352a15ba913SSteven Rostedt# The tool for REBOOT_TYPE = grub2 to set the next reboot kernel 353a15ba913SSteven Rostedt# to boot into (one shot mode). 354a15ba913SSteven Rostedt# (default grub2_reboot) 355a15ba913SSteven Rostedt#GRUB_REBOOT = grub2_reboot 356a15ba913SSteven Rostedt 357a75fececSSteven Rostedt# The grub title name for the test kernel to boot 358a15ba913SSteven Rostedt# (Only mandatory if REBOOT_TYPE = grub or grub2) 359a75fececSSteven Rostedt# 360a57419b3SSteven Rostedt# Note, ktest.pl will not update the grub menu.lst, you need to 361a57419b3SSteven Rostedt# manually add an option for the test. ktest.pl will search 362a57419b3SSteven Rostedt# the grub menu.lst for this option to find what kernel to 363a57419b3SSteven Rostedt# reboot into. 364a57419b3SSteven Rostedt# 365a75fececSSteven Rostedt# For example, if in the /boot/grub/menu.lst the test kernel title has: 366a75fececSSteven Rostedt# title Test Kernel 367a57419b3SSteven Rostedt# kernel vmlinuz-test 368a15ba913SSteven Rostedt# 369a15ba913SSteven Rostedt# For grub2, a search of top level "menuentry"s are done. No 370a15ba913SSteven Rostedt# submenu is searched. The menu is found by searching for the 371a15ba913SSteven Rostedt# contents of GRUB_MENU in the line that starts with "menuentry". 372a15ba913SSteven Rostedt# You may want to include the quotes around the option. For example: 373a15ba913SSteven Rostedt# for: menuentry 'Test Kernel' 374a15ba913SSteven Rostedt# do a: GRUB_MENU = 'Test Kernel' 375a15ba913SSteven Rostedt# For customizing, add your entry in /etc/grub.d/40_custom. 376a15ba913SSteven Rostedt# 377a75fececSSteven Rostedt#GRUB_MENU = Test Kernel 378a75fececSSteven Rostedt 3797786954cSSteven Rostedt# For REBOOT_TYPE = syslinux, the name of the syslinux executable 3807786954cSSteven Rostedt# (on the target) to use to set up the next reboot to boot the 3817786954cSSteven Rostedt# test kernel. 3827786954cSSteven Rostedt# (default extlinux) 3837786954cSSteven Rostedt#SYSLINUX = syslinux 3847786954cSSteven Rostedt 3857786954cSSteven Rostedt# For REBOOT_TYPE = syslinux, the path that is passed to to the 3867786954cSSteven Rostedt# syslinux command where syslinux is installed. 3877786954cSSteven Rostedt# (default /boot/extlinux) 3887786954cSSteven Rostedt#SYSLINUX_PATH = /boot/syslinux 3897786954cSSteven Rostedt 3907786954cSSteven Rostedt# For REBOOT_TYPE = syslinux, the syslinux label that references the 3917786954cSSteven Rostedt# test kernel in the syslinux config file. 3927786954cSSteven Rostedt# (default undefined) 3937786954cSSteven Rostedt#SYSLINUX_LABEL = "test-kernel" 3947786954cSSteven Rostedt 395a75fececSSteven Rostedt# A script to reboot the target into the test kernel 39696f6a0dfSSteven Rostedt# This and SWITCH_TO_TEST are about the same, except 39796f6a0dfSSteven Rostedt# SWITCH_TO_TEST is run even for REBOOT_TYPE = grub. 39896f6a0dfSSteven Rostedt# This may be left undefined. 39996f6a0dfSSteven Rostedt# (default undefined) 400a75fececSSteven Rostedt#REBOOT_SCRIPT = 401a75fececSSteven Rostedt 402a75fececSSteven Rostedt#### Optional Config Options (all have defaults) #### 403a75fececSSteven Rostedt 404a57419b3SSteven Rostedt# Start a test setup. If you leave this off, all options 405a57419b3SSteven Rostedt# will be default and the test will run once. 406a57419b3SSteven Rostedt# This is a label and not really an option (it takes no value). 407a57419b3SSteven Rostedt# You can append ITERATE and a number after it to iterate the 408a57419b3SSteven Rostedt# test a number of times, or SKIP to ignore this test. 409a57419b3SSteven Rostedt# 410a57419b3SSteven Rostedt#TEST_START 411a57419b3SSteven Rostedt#TEST_START ITERATE 5 412a57419b3SSteven Rostedt#TEST_START SKIP 413a75fececSSteven Rostedt 414dc895688SSteven Rostedt# Have the following options as default again. Used after tests 415dc895688SSteven Rostedt# have already been defined by TEST_START. Optionally, you can 416dc895688SSteven Rostedt# just define all default options before the first TEST_START 417dc895688SSteven Rostedt# and you do not need this option. 418dc895688SSteven Rostedt# 419dc895688SSteven Rostedt# This is a label and not really an option (it takes no value). 420dc895688SSteven Rostedt# You can append SKIP to this label and the options within this 421dc895688SSteven Rostedt# section will be ignored. 422dc895688SSteven Rostedt# 423dc895688SSteven Rostedt# DEFAULTS 424dc895688SSteven Rostedt# DEFAULTS SKIP 425dc895688SSteven Rostedt 426921ed4c7SSteven Rostedt# If you want to execute some command before the first test runs 427921ed4c7SSteven Rostedt# you can set this option. Note, it can be set as a default option 428921ed4c7SSteven Rostedt# or an option in the first test case. All other test cases will 429921ed4c7SSteven Rostedt# ignore it. If both the default and first test have this option 430921ed4c7SSteven Rostedt# set, then the first test will take precedence. 431921ed4c7SSteven Rostedt# 432921ed4c7SSteven Rostedt# default (undefined) 433921ed4c7SSteven Rostedt#PRE_KTEST = ${SSH} ~/set_up_test 434921ed4c7SSteven Rostedt 435921ed4c7SSteven Rostedt# If you want to execute some command after all the tests have 436921ed4c7SSteven Rostedt# completed, you can set this option. Note, it can be set as a 437921ed4c7SSteven Rostedt# default or any test case can override it. If multiple test cases 438921ed4c7SSteven Rostedt# set this option, then the last test case that set it will take 439921ed4c7SSteven Rostedt# precedence 440921ed4c7SSteven Rostedt# 441921ed4c7SSteven Rostedt# default (undefined) 442921ed4c7SSteven Rostedt#POST_KTEST = ${SSH} ~/dismantle_test 443921ed4c7SSteven Rostedt 444a75fececSSteven Rostedt# The default test type (default test) 445a75fececSSteven Rostedt# The test types may be: 446a75fececSSteven Rostedt# build - only build the kernel, do nothing else 447cd8e368fSSteven Rostedt# install - build and install, but do nothing else (does not reboot) 448cd8e368fSSteven Rostedt# boot - build, install, and boot the kernel 449a75fececSSteven Rostedt# test - build, boot and if TEST is set, run the test script 450a57419b3SSteven Rostedt# (If TEST is not set, it defaults back to boot) 451a75fececSSteven Rostedt# bisect - Perform a bisect on the kernel (see BISECT_TYPE below) 452a75fececSSteven Rostedt# patchcheck - Do a test on a series of commits in git (see PATCHCHECK below) 453a75fececSSteven Rostedt#TEST_TYPE = test 454a75fececSSteven Rostedt 455a57419b3SSteven Rostedt# Test to run if there is a successful boot and TEST_TYPE is test. 456a57419b3SSteven Rostedt# Must exit with 0 on success and non zero on error 457a57419b3SSteven Rostedt# default (undefined) 458a57419b3SSteven Rostedt#TEST = ssh user@machine /root/run_test 459a57419b3SSteven Rostedt 460a57419b3SSteven Rostedt# The build type is any make config type or special command 461a75fececSSteven Rostedt# (default randconfig) 462a75fececSSteven Rostedt# nobuild - skip the clean and build step 463a57419b3SSteven Rostedt# useconfig:/path/to/config - use the given config and run 464a57419b3SSteven Rostedt# oldconfig on it. 465a57419b3SSteven Rostedt# This option is ignored if TEST_TYPE is patchcheck or bisect 466a75fececSSteven Rostedt#BUILD_TYPE = randconfig 467a75fececSSteven Rostedt 468a75fececSSteven Rostedt# The make command (default make) 469a75fececSSteven Rostedt# If you are building a 32bit x86 on a 64 bit host 470a75fececSSteven Rostedt#MAKE_CMD = CC=i386-gcc AS=i386-as make ARCH=i386 471a75fececSSteven Rostedt 472dc895688SSteven Rostedt# Any build options for the make of the kernel (not for other makes, like configs) 473dc895688SSteven Rostedt# (default "") 474dc895688SSteven Rostedt#BUILD_OPTIONS = -j20 475dc895688SSteven Rostedt 476e5c2ec11SSteven Rostedt# If you need to do some special handling before installing 477e5c2ec11SSteven Rostedt# you can add a script with this option. 478e5c2ec11SSteven Rostedt# The environment variable KERNEL_VERSION will be set to the 479e5c2ec11SSteven Rostedt# kernel version that is used. 480e5c2ec11SSteven Rostedt# 481e5c2ec11SSteven Rostedt# default (undefined) 482e5c2ec11SSteven Rostedt#PRE_INSTALL = ssh user@target rm -rf '/lib/modules/*-test*' 483e5c2ec11SSteven Rostedt 4848b37ca8cSSteven Rostedt# If you need an initrd, you can add a script or code here to install 4858b37ca8cSSteven Rostedt# it. The environment variable KERNEL_VERSION will be set to the 486a57419b3SSteven Rostedt# kernel version that is used. Remember to add the initrd line 487a57419b3SSteven Rostedt# to your grub menu.lst file. 488a57419b3SSteven Rostedt# 489a57419b3SSteven Rostedt# Here's a couple of examples to use: 4908b37ca8cSSteven Rostedt#POST_INSTALL = ssh user@target /sbin/mkinitrd --allow-missing -f /boot/initramfs-test.img $KERNEL_VERSION 491a57419b3SSteven Rostedt# 492a57419b3SSteven Rostedt# or on some systems: 493a57419b3SSteven Rostedt#POST_INSTALL = ssh user@target /sbin/dracut -f /boot/initramfs-test.img $KERNEL_VERSION 4948b37ca8cSSteven Rostedt 495e0a8742eSSteven Rostedt# If for some reason you just want to boot the kernel and you do not 496e0a8742eSSteven Rostedt# want the test to install anything new. For example, you may just want 497e0a8742eSSteven Rostedt# to boot test the same kernel over and over and do not want to go through 498e0a8742eSSteven Rostedt# the hassle of installing anything, you can set this option to 1 499e0a8742eSSteven Rostedt# (default 0) 500e0a8742eSSteven Rostedt#NO_INSTALL = 1 501e0a8742eSSteven Rostedt 502921ed4c7SSteven Rostedt# If there is a command that you want to run before the individual test 503921ed4c7SSteven Rostedt# case executes, then you can set this option 504921ed4c7SSteven Rostedt# 505921ed4c7SSteven Rostedt# default (undefined) 506921ed4c7SSteven Rostedt#PRE_TEST = ${SSH} reboot_to_special_kernel 507921ed4c7SSteven Rostedt 508921ed4c7SSteven Rostedt# If there is a command you want to run after the individual test case 509921ed4c7SSteven Rostedt# completes, then you can set this option. 510921ed4c7SSteven Rostedt# 511921ed4c7SSteven Rostedt# default (undefined) 512921ed4c7SSteven Rostedt#POST_TEST = cd ${BUILD_DIR}; git reset --hard 513921ed4c7SSteven Rostedt 5140bd6c1a3SSteven Rostedt# If there is a script that you require to run before the build is done 5150bd6c1a3SSteven Rostedt# you can specify it with PRE_BUILD. 5160bd6c1a3SSteven Rostedt# 5170bd6c1a3SSteven Rostedt# One example may be if you must add a temporary patch to the build to 5180bd6c1a3SSteven Rostedt# fix a unrelated bug to perform a patchcheck test. This will apply the 5190bd6c1a3SSteven Rostedt# patch before each build that is made. Use the POST_BUILD to do a git reset --hard 5200bd6c1a3SSteven Rostedt# to remove the patch. 5210bd6c1a3SSteven Rostedt# 5220bd6c1a3SSteven Rostedt# (default undef) 5230bd6c1a3SSteven Rostedt#PRE_BUILD = cd ${BUILD_DIR} && patch -p1 < /tmp/temp.patch 5240bd6c1a3SSteven Rostedt 5250bd6c1a3SSteven Rostedt# To specify if the test should fail if the PRE_BUILD fails, 5260bd6c1a3SSteven Rostedt# PRE_BUILD_DIE needs to be set to 1. Otherwise the PRE_BUILD 5270bd6c1a3SSteven Rostedt# result is ignored. 5280bd6c1a3SSteven Rostedt# (default 0) 5290bd6c1a3SSteven Rostedt# PRE_BUILD_DIE = 1 5300bd6c1a3SSteven Rostedt 5310bd6c1a3SSteven Rostedt# If there is a script that should run after the build is done 5320bd6c1a3SSteven Rostedt# you can specify it with POST_BUILD. 5330bd6c1a3SSteven Rostedt# 5340bd6c1a3SSteven Rostedt# As the example in PRE_BUILD, POST_BUILD can be used to reset modifications 5350bd6c1a3SSteven Rostedt# made by the PRE_BUILD. 5360bd6c1a3SSteven Rostedt# 5370bd6c1a3SSteven Rostedt# (default undef) 5380bd6c1a3SSteven Rostedt#POST_BUILD = cd ${BUILD_DIR} && git reset --hard 5390bd6c1a3SSteven Rostedt 5400bd6c1a3SSteven Rostedt# To specify if the test should fail if the POST_BUILD fails, 5410bd6c1a3SSteven Rostedt# POST_BUILD_DIE needs to be set to 1. Otherwise the POST_BUILD 5420bd6c1a3SSteven Rostedt# result is ignored. 5430bd6c1a3SSteven Rostedt# (default 0) 5440bd6c1a3SSteven Rostedt#POST_BUILD_DIE = 1 5450bd6c1a3SSteven Rostedt 546a75fececSSteven Rostedt# Way to reboot the box to the test kernel. 5477786954cSSteven Rostedt# Only valid options so far are "grub", "grub2", "syslinux" and "script" 548a75fececSSteven Rostedt# (default grub) 549a75fececSSteven Rostedt# If you specify grub, it will assume grub version 1 550a75fececSSteven Rostedt# and will search in /boot/grub/menu.lst for the title $GRUB_MENU 551a75fececSSteven Rostedt# and select that target to reboot to the kernel. If this is not 552a75fececSSteven Rostedt# your setup, then specify "script" and have a command or script 553a75fececSSteven Rostedt# specified in REBOOT_SCRIPT to boot to the target. 554a57419b3SSteven Rostedt# 555a15ba913SSteven Rostedt# For REBOOT_TYPE = grub2, you must define both GRUB_MENU and 556a15ba913SSteven Rostedt# GRUB_FILE. 557a15ba913SSteven Rostedt# 5587786954cSSteven Rostedt# For REBOOT_TYPE = syslinux, you must define SYSLINUX_LABEL, and 5597786954cSSteven Rostedt# perhaps modify SYSLINUX (default extlinux) and SYSLINUX_PATH 5607786954cSSteven Rostedt# (default /boot/extlinux) 5617786954cSSteven Rostedt# 562a57419b3SSteven Rostedt# The entry in /boot/grub/menu.lst must be entered in manually. 563a57419b3SSteven Rostedt# The test will not modify that file. 564a75fececSSteven Rostedt#REBOOT_TYPE = grub 565a75fececSSteven Rostedt 566bc7c5803SSteven Rostedt# If you are using a machine that doesn't boot with grub, and 567bc7c5803SSteven Rostedt# perhaps gets its kernel from a remote server (tftp), then 568bc7c5803SSteven Rostedt# you can use this option to update the target image with the 569bc7c5803SSteven Rostedt# test image. 570bc7c5803SSteven Rostedt# 571bc7c5803SSteven Rostedt# You could also do the same with POST_INSTALL, but the difference 572bc7c5803SSteven Rostedt# between that option and this option is that POST_INSTALL runs 573bc7c5803SSteven Rostedt# after the install, where this one runs just before a reboot. 574bc7c5803SSteven Rostedt# (default undefined) 575bc7c5803SSteven Rostedt#SWITCH_TO_TEST = cp ${OUTPUT_DIR}/${BUILD_TARGET} ${TARGET_IMAGE} 576bc7c5803SSteven Rostedt 577bc7c5803SSteven Rostedt# If you are using a machine that doesn't boot with grub, and 578bc7c5803SSteven Rostedt# perhaps gets its kernel from a remote server (tftp), then 579bc7c5803SSteven Rostedt# you can use this option to update the target image with the 580bc7c5803SSteven Rostedt# the known good image to reboot safely back into. 581bc7c5803SSteven Rostedt# 582bc7c5803SSteven Rostedt# This option holds a command that will execute before needing 583bc7c5803SSteven Rostedt# to reboot to a good known image. 584bc7c5803SSteven Rostedt# (default undefined) 585bc7c5803SSteven Rostedt#SWITCH_TO_GOOD = ssh ${SSH_USER}/${MACHINE} cp good_image ${TARGET_IMAGE} 586bc7c5803SSteven Rostedt 587a75fececSSteven Rostedt# The min config that is needed to build for the machine 588a57419b3SSteven Rostedt# A nice way to create this is with the following: 589a75fececSSteven Rostedt# 590a57419b3SSteven Rostedt# $ ssh target 591a57419b3SSteven Rostedt# $ lsmod > mymods 592a57419b3SSteven Rostedt# $ scp mymods host:/tmp 593a57419b3SSteven Rostedt# $ exit 594a57419b3SSteven Rostedt# $ cd linux.git 595a57419b3SSteven Rostedt# $ rm .config 596a57419b3SSteven Rostedt# $ make LSMOD=mymods localyesconfig 597a57419b3SSteven Rostedt# $ grep '^CONFIG' .config > /home/test/config-min 598a57419b3SSteven Rostedt# 599a57419b3SSteven Rostedt# If you want even less configs: 600a57419b3SSteven Rostedt# 601a57419b3SSteven Rostedt# log in directly to target (do not ssh) 602a57419b3SSteven Rostedt# 603a57419b3SSteven Rostedt# $ su 604a57419b3SSteven Rostedt# # lsmod | cut -d' ' -f1 | xargs rmmod 605a57419b3SSteven Rostedt# 606a57419b3SSteven Rostedt# repeat the above several times 607a57419b3SSteven Rostedt# 608a57419b3SSteven Rostedt# # lsmod > mymods 609a57419b3SSteven Rostedt# # reboot 610a57419b3SSteven Rostedt# 611a57419b3SSteven Rostedt# May need to reboot to get your network back to copy the mymods 612a57419b3SSteven Rostedt# to the host, and then remove the previous .config and run the 613a57419b3SSteven Rostedt# localyesconfig again. The CONFIG_MIN generated like this will 614a57419b3SSteven Rostedt# not guarantee network activity to the box so the TEST_TYPE of 615a57419b3SSteven Rostedt# test may fail. 616a57419b3SSteven Rostedt# 617a57419b3SSteven Rostedt# You might also want to set: 618a75fececSSteven Rostedt# CONFIG_CMDLINE="<your options here>" 619a75fececSSteven Rostedt# randconfig may set the above and override your real command 620a75fececSSteven Rostedt# line options. 621a57419b3SSteven Rostedt# (default undefined) 622a75fececSSteven Rostedt#MIN_CONFIG = /home/test/config-min 623a75fececSSteven Rostedt 624a75fececSSteven Rostedt# Sometimes there's options that just break the boot and 625a75fececSSteven Rostedt# you do not care about. Here are a few: 626a75fececSSteven Rostedt# # CONFIG_STAGING is not set 627a75fececSSteven Rostedt# Staging drivers are horrible, and can break the build. 628a75fececSSteven Rostedt# # CONFIG_SCSI_DEBUG is not set 629a75fececSSteven Rostedt# SCSI_DEBUG may change your root partition 630a75fececSSteven Rostedt# # CONFIG_KGDB_SERIAL_CONSOLE is not set 631a75fececSSteven Rostedt# KGDB may cause oops waiting for a connection that's not there. 632a75fececSSteven Rostedt# This option points to the file containing config options that will be prepended 633a75fececSSteven Rostedt# to the MIN_CONFIG (or be the MIN_CONFIG if it is not set) 634a57419b3SSteven Rostedt# 635a57419b3SSteven Rostedt# Note, config options in MIN_CONFIG will override these options. 636a57419b3SSteven Rostedt# 637a57419b3SSteven Rostedt# (default undefined) 638a75fececSSteven Rostedt#ADD_CONFIG = /home/test/config-broken 639a75fececSSteven Rostedt 640dc895688SSteven Rostedt# The location on the host where to write temp files 64148920630SSteven Rostedt# (default /tmp/ktest/${MACHINE}) 64248920630SSteven Rostedt#TMP_DIR = /tmp/ktest/${MACHINE} 643dc895688SSteven Rostedt 644dc895688SSteven Rostedt# Optional log file to write the status (recommended) 645dc895688SSteven Rostedt# Note, this is a DEFAULT section only option. 646dc895688SSteven Rostedt# (default undefined) 647dc895688SSteven Rostedt#LOG_FILE = /home/test/logfiles/target.log 648dc895688SSteven Rostedt 649dc895688SSteven Rostedt# Remove old logfile if it exists before starting all tests. 650dc895688SSteven Rostedt# Note, this is a DEFAULT section only option. 651dc895688SSteven Rostedt# (default 0) 652dc895688SSteven Rostedt#CLEAR_LOG = 0 653dc895688SSteven Rostedt 654dc895688SSteven Rostedt# Line to define a successful boot up in console output. 655dc895688SSteven Rostedt# This is what the line contains, not the entire line. If you need 656dc895688SSteven Rostedt# the entire line to match, then use regural expression syntax like: 657dc895688SSteven Rostedt# (do not add any quotes around it) 658dc895688SSteven Rostedt# 659dc895688SSteven Rostedt# SUCCESS_LINE = ^MyBox Login:$ 660dc895688SSteven Rostedt# 661dc895688SSteven Rostedt# (default "login:") 662dc895688SSteven Rostedt#SUCCESS_LINE = login: 663dc895688SSteven Rostedt 6642b803365SSteven Rostedt# To speed up between reboots, defining a line that the 6652b803365SSteven Rostedt# default kernel produces that represents that the default 6662b803365SSteven Rostedt# kernel has successfully booted and can be used to pass 6672b803365SSteven Rostedt# a new test kernel to it. Otherwise ktest.pl will wait till 6682b803365SSteven Rostedt# SLEEP_TIME to continue. 6692b803365SSteven Rostedt# (default undefined) 6702b803365SSteven Rostedt#REBOOT_SUCCESS_LINE = login: 6712b803365SSteven Rostedt 6721c8a617aSSteven Rostedt# In case the console constantly fills the screen, having 6731c8a617aSSteven Rostedt# a specified time to stop the test after success is recommended. 6741c8a617aSSteven Rostedt# (in seconds) 6751c8a617aSSteven Rostedt# (default 10) 6761c8a617aSSteven Rostedt#STOP_AFTER_SUCCESS = 10 6771c8a617aSSteven Rostedt 6781c8a617aSSteven Rostedt# In case the console constantly fills the screen, having 6791c8a617aSSteven Rostedt# a specified time to stop the test after failure is recommended. 6801c8a617aSSteven Rostedt# (in seconds) 6811c8a617aSSteven Rostedt# (default 60) 6821c8a617aSSteven Rostedt#STOP_AFTER_FAILURE = 60 6831c8a617aSSteven Rostedt 6842d01b26aSSteven Rostedt# In case the console constantly fills the screen, having 6852d01b26aSSteven Rostedt# a specified time to stop the test if it never succeeds nor fails 6862d01b26aSSteven Rostedt# is recommended. 6872d01b26aSSteven Rostedt# Note: this is ignored if a success or failure is detected. 6882d01b26aSSteven Rostedt# (in seconds) 6892d01b26aSSteven Rostedt# (default 600, -1 is to never stop) 6902d01b26aSSteven Rostedt#STOP_TEST_AFTER = 600 6912d01b26aSSteven Rostedt 692dc895688SSteven Rostedt# Stop testing if a build fails. If set, the script will end if 693dc895688SSteven Rostedt# a failure is detected, otherwise it will save off the .config, 694dc895688SSteven Rostedt# dmesg and bootlog in a directory called 695dc895688SSteven Rostedt# MACHINE-TEST_TYPE_BUILD_TYPE-fail-yyyymmddhhmmss 696dc895688SSteven Rostedt# if the STORE_FAILURES directory is set. 697dc895688SSteven Rostedt# (default 1) 698dc895688SSteven Rostedt# Note, even if this is set to zero, there are some errors that still 699dc895688SSteven Rostedt# stop the tests. 700dc895688SSteven Rostedt#DIE_ON_FAILURE = 1 701dc895688SSteven Rostedt 702dc895688SSteven Rostedt# Directory to store failure directories on failure. If this is not 703dc895688SSteven Rostedt# set, DIE_ON_FAILURE=0 will not save off the .config, dmesg and 704dc895688SSteven Rostedt# bootlog. This option is ignored if DIE_ON_FAILURE is not set. 705dc895688SSteven Rostedt# (default undefined) 706dc895688SSteven Rostedt#STORE_FAILURES = /home/test/failures 707dc895688SSteven Rostedt 708de5b6e3bSRabin Vincent# Directory to store success directories on success. If this is not 709de5b6e3bSRabin Vincent# set, the .config, dmesg and bootlog will not be saved if a 710de5b6e3bSRabin Vincent# test succeeds. 711de5b6e3bSRabin Vincent# (default undefined) 712de5b6e3bSRabin Vincent#STORE_SUCCESSES = /home/test/successes 713de5b6e3bSRabin Vincent 714dc895688SSteven Rostedt# Build without doing a make mrproper, or removing .config 715dc895688SSteven Rostedt# (default 0) 716dc895688SSteven Rostedt#BUILD_NOCLEAN = 0 717dc895688SSteven Rostedt 718dc895688SSteven Rostedt# As the test reads the console, after it hits the SUCCESS_LINE 719dc895688SSteven Rostedt# the time it waits for the monitor to settle down between reads 720dc895688SSteven Rostedt# can usually be lowered. 721dc895688SSteven Rostedt# (in seconds) (default 1) 722dc895688SSteven Rostedt#BOOTED_TIMEOUT = 1 723dc895688SSteven Rostedt 724dc895688SSteven Rostedt# The timeout in seconds when we consider the box hung after 725dc895688SSteven Rostedt# the console stop producing output. Be sure to leave enough 726dc895688SSteven Rostedt# time here to get pass a reboot. Some machines may not produce 727dc895688SSteven Rostedt# any console output for a long time during a reboot. You do 728dc895688SSteven Rostedt# not want the test to fail just because the system was in 729dc895688SSteven Rostedt# the process of rebooting to the test kernel. 730dc895688SSteven Rostedt# (default 120) 731dc895688SSteven Rostedt#TIMEOUT = 120 732dc895688SSteven Rostedt 7333e1d3678SSteven Rostedt (VMware)# The timeout in seconds when to test if the box can be rebooted 7343e1d3678SSteven Rostedt (VMware)# or not. Before issuing the reboot command, a ssh connection 7353e1d3678SSteven Rostedt (VMware)# is attempted to see if the target machine is still active. 7363e1d3678SSteven Rostedt (VMware)# If the target does not connect within this timeout, a power cycle 7373e1d3678SSteven Rostedt (VMware)# is issued instead of a reboot. 7383e1d3678SSteven Rostedt (VMware)# CONNECT_TIMEOUT = 25 7393e1d3678SSteven Rostedt (VMware) 740dc895688SSteven Rostedt# In between tests, a reboot of the box may occur, and this 741dc895688SSteven Rostedt# is the time to wait for the console after it stops producing 742dc895688SSteven Rostedt# output. Some machines may not produce a large lag on reboot 743dc895688SSteven Rostedt# so this should accommodate it. 744dc895688SSteven Rostedt# The difference between this and TIMEOUT, is that TIMEOUT happens 745dc895688SSteven Rostedt# when rebooting to the test kernel. This sleep time happens 746dc895688SSteven Rostedt# after a test has completed and we are about to start running 747dc895688SSteven Rostedt# another test. If a reboot to the reliable kernel happens, 748dc895688SSteven Rostedt# we wait SLEEP_TIME for the console to stop producing output 749dc895688SSteven Rostedt# before starting the next test. 7502b803365SSteven Rostedt# 7512b803365SSteven Rostedt# You can speed up reboot times even more by setting REBOOT_SUCCESS_LINE. 752dc895688SSteven Rostedt# (default 60) 753dc895688SSteven Rostedt#SLEEP_TIME = 60 754dc895688SSteven Rostedt 755dc895688SSteven Rostedt# The time in between bisects to sleep (in seconds) 756dc895688SSteven Rostedt# (default 60) 757dc895688SSteven Rostedt#BISECT_SLEEP_TIME = 60 758dc895688SSteven Rostedt 759407b95b7SSteven Rostedt# The max wait time (in seconds) for waiting for the console to finish. 760407b95b7SSteven Rostedt# If for some reason, the console is outputting content without 761407b95b7SSteven Rostedt# ever finishing, this will cause ktest to get stuck. This 762407b95b7SSteven Rostedt# option is the max time ktest will wait for the monitor (console) 763407b95b7SSteven Rostedt# to settle down before continuing. 764407b95b7SSteven Rostedt# (default 1800) 765407b95b7SSteven Rostedt#MAX_MONITOR_WAIT 766407b95b7SSteven Rostedt 76727d934b2SSteven Rostedt# The time in between patch checks to sleep (in seconds) 76827d934b2SSteven Rostedt# (default 60) 76927d934b2SSteven Rostedt#PATCHCHECK_SLEEP_TIME = 60 77027d934b2SSteven Rostedt 771dc895688SSteven Rostedt# Reboot the target box on error (default 0) 772dc895688SSteven Rostedt#REBOOT_ON_ERROR = 0 773dc895688SSteven Rostedt 774dc895688SSteven Rostedt# Power off the target on error (ignored if REBOOT_ON_ERROR is set) 775dc895688SSteven Rostedt# Note, this is a DEFAULT section only option. 776dc895688SSteven Rostedt# (default 0) 777dc895688SSteven Rostedt#POWEROFF_ON_ERROR = 0 778dc895688SSteven Rostedt 779dc895688SSteven Rostedt# Power off the target after all tests have completed successfully 780dc895688SSteven Rostedt# Note, this is a DEFAULT section only option. 781dc895688SSteven Rostedt# (default 0) 782dc895688SSteven Rostedt#POWEROFF_ON_SUCCESS = 0 783dc895688SSteven Rostedt 784dc895688SSteven Rostedt# Reboot the target after all test completed successfully (default 1) 785dc895688SSteven Rostedt# (ignored if POWEROFF_ON_SUCCESS is set) 786dc895688SSteven Rostedt#REBOOT_ON_SUCCESS = 1 787dc895688SSteven Rostedt 788dc895688SSteven Rostedt# In case there are isses with rebooting, you can specify this 789dc895688SSteven Rostedt# to always powercycle after this amount of time after calling 790dc895688SSteven Rostedt# reboot. 791dc895688SSteven Rostedt# Note, POWERCYCLE_AFTER_REBOOT = 0 does NOT disable it. It just 792dc895688SSteven Rostedt# makes it powercycle immediately after rebooting. Do not define 793dc895688SSteven Rostedt# it if you do not want it. 794dc895688SSteven Rostedt# (default undefined) 795dc895688SSteven Rostedt#POWERCYCLE_AFTER_REBOOT = 5 796dc895688SSteven Rostedt 797dc895688SSteven Rostedt# In case there's isses with halting, you can specify this 798dc895688SSteven Rostedt# to always poweroff after this amount of time after calling 799dc895688SSteven Rostedt# halt. 800dc895688SSteven Rostedt# Note, POWEROFF_AFTER_HALT = 0 does NOT disable it. It just 801dc895688SSteven Rostedt# makes it poweroff immediately after halting. Do not define 802dc895688SSteven Rostedt# it if you do not want it. 803dc895688SSteven Rostedt# (default undefined) 804dc895688SSteven Rostedt#POWEROFF_AFTER_HALT = 20 805dc895688SSteven Rostedt 806dc895688SSteven Rostedt# A script or command to power off the box (default undefined) 807dc895688SSteven Rostedt# Needed for POWEROFF_ON_ERROR and SUCCESS 808dc895688SSteven Rostedt# 809dc895688SSteven Rostedt# Example for digital loggers power switch: 810dc895688SSteven Rostedt#POWER_OFF = wget --no-proxy -O /dev/null -q --auth-no-challenge 'http://admin:admin@power/outlet?5=OFF' 811dc895688SSteven Rostedt# 812dc895688SSteven Rostedt# Example for a virtual guest call "Guest". 813dc895688SSteven Rostedt#POWER_OFF = virsh destroy Guest 814dc895688SSteven Rostedt 8154283b169SSteven Rostedt (Red Hat)# To have the build fail on "new" warnings, create a file that 8164283b169SSteven Rostedt (Red Hat)# contains a list of all known warnings (they must match exactly 8174283b169SSteven Rostedt (Red Hat)# to the line with 'warning:', 'error:' or 'Error:'. If the option 8184283b169SSteven Rostedt (Red Hat)# WARNINGS_FILE is set, then that file will be read, and if the 8194283b169SSteven Rostedt (Red Hat)# build detects a warning, it will examine this file and if the 8204283b169SSteven Rostedt (Red Hat)# warning does not exist in it, it will fail the build. 8214283b169SSteven Rostedt (Red Hat)# 8224283b169SSteven Rostedt (Red Hat)# Note, if this option is defined to a file that does not exist 8234283b169SSteven Rostedt (Red Hat)# then any warning will fail the build. 8244283b169SSteven Rostedt (Red Hat)# (see make_warnings_file below) 8254283b169SSteven Rostedt (Red Hat)# 8264283b169SSteven Rostedt (Red Hat)# (optional, default undefined) 8274283b169SSteven Rostedt (Red Hat)#WARNINGS_FILE = ${OUTPUT_DIR}/warnings_file 8284283b169SSteven Rostedt (Red Hat) 829d1fbd7e6SSteven Rostedt# The way to execute a command on the target 830d1fbd7e6SSteven Rostedt# (default ssh $SSH_USER@$MACHINE $SSH_COMMAND";) 831d1fbd7e6SSteven Rostedt# The variables SSH_USER, MACHINE and SSH_COMMAND are defined 832d1fbd7e6SSteven Rostedt#SSH_EXEC = ssh $SSH_USER@$MACHINE $SSH_COMMAND"; 833d1fbd7e6SSteven Rostedt 83402ad2617SSteven Rostedt# The way to copy a file to the target (install and modules) 835d1fbd7e6SSteven Rostedt# (default scp $SRC_FILE $SSH_USER@$MACHINE:$DST_FILE) 83602ad2617SSteven Rostedt# The variables SSH_USER, MACHINE are defined by the config 83702ad2617SSteven Rostedt# SRC_FILE and DST_FILE are ktest internal variables and 83802ad2617SSteven Rostedt# should only have '$' and not the '${}' notation. 83902ad2617SSteven Rostedt# (default scp $SRC_FILE ${SSH_USER}@${MACHINE}:$DST_FILE) 84002ad2617SSteven Rostedt#SCP_TO_TARGET = echo skip scp for $SRC_FILE $DST_FILE 84102ad2617SSteven Rostedt 84202ad2617SSteven Rostedt# If install needs to be different than modules, then this 84302ad2617SSteven Rostedt# option will override the SCP_TO_TARGET for installation. 84402ad2617SSteven Rostedt# (default ${SCP_TO_TARGET} ) 84502ad2617SSteven Rostedt#SCP_TO_TARGET_INSTALL = scp $SRC_FILE tftp@tftpserver:$DST_FILE 846d1fbd7e6SSteven Rostedt 847d1fbd7e6SSteven Rostedt# The nice way to reboot the target 848d1fbd7e6SSteven Rostedt# (default ssh $SSH_USER@$MACHINE reboot) 849d1fbd7e6SSteven Rostedt# The variables SSH_USER and MACHINE are defined. 850d1fbd7e6SSteven Rostedt#REBOOT = ssh $SSH_USER@$MACHINE reboot 851d1fbd7e6SSteven Rostedt 852f1a5b962SSteven Rostedt# The way triple faults are detected is by testing the kernel 853f1a5b962SSteven Rostedt# banner. If the kernel banner for the kernel we are testing is 854f1a5b962SSteven Rostedt# found, and then later a kernel banner for another kernel version 855f1a5b962SSteven Rostedt# is found, it is considered that we encountered a triple fault, 856f1a5b962SSteven Rostedt# and there is no panic or callback, but simply a reboot. 857f1a5b962SSteven Rostedt# To disable this (because it did a false positive) set the following 858f1a5b962SSteven Rostedt# to 0. 859f1a5b962SSteven Rostedt# (default 1) 860f1a5b962SSteven Rostedt#DETECT_TRIPLE_FAULT = 0 861f1a5b962SSteven Rostedt 8629cc9e091SSteven Rostedt# All options in the config file should be either used by ktest 8639cc9e091SSteven Rostedt# or could be used within a value of another option. If an option 8649cc9e091SSteven Rostedt# in the config file is not used, ktest will warn about it and ask 8659cc9e091SSteven Rostedt# if you want to continue. 8669cc9e091SSteven Rostedt# 8679cc9e091SSteven Rostedt# If you don't care if there are non-used options, enable this 8689cc9e091SSteven Rostedt# option. Be careful though, a non-used option is usually a sign 8699cc9e091SSteven Rostedt# of an option name being typed incorrectly. 8709cc9e091SSteven Rostedt# (default 0) 8719cc9e091SSteven Rostedt#IGNORE_UNUSED = 1 8729cc9e091SSteven Rostedt 873be405f95SSteven Rostedt# When testing a kernel that happens to have WARNINGs, and call 874be405f95SSteven Rostedt# traces, ktest.pl will detect these and fail a boot or test run 875be405f95SSteven Rostedt# due to warnings. By setting this option, ktest will ignore 876be405f95SSteven Rostedt# call traces, and will not fail a test if the kernel produces 877be405f95SSteven Rostedt# an oops. Use this option with care. 878be405f95SSteven Rostedt# (default 0) 879be405f95SSteven Rostedt#IGNORE_ERRORS = 1 880be405f95SSteven Rostedt 881a75fececSSteven Rostedt#### Per test run options #### 882a57419b3SSteven Rostedt# The following options are only allowed in TEST_START sections. 883a57419b3SSteven Rostedt# They are ignored in the DEFAULTS sections. 884a75fececSSteven Rostedt# 885a57419b3SSteven Rostedt# All of these are optional and undefined by default, although 886a57419b3SSteven Rostedt# some of these options are required for TEST_TYPE of patchcheck 887a57419b3SSteven Rostedt# and bisect. 888a75fececSSteven Rostedt# 889a57419b3SSteven Rostedt# 890a57419b3SSteven Rostedt# CHECKOUT = branch 891a75fececSSteven Rostedt# 892a75fececSSteven Rostedt# If the BUILD_DIR is a git repository, then you can set this option 893a75fececSSteven Rostedt# to checkout the given branch before running the TEST. If you 894a75fececSSteven Rostedt# specify this for the first run, that branch will be used for 895a57419b3SSteven Rostedt# all preceding tests until a new CHECKOUT is set. 896a75fececSSteven Rostedt# 897a57419b3SSteven Rostedt# 8989064af52SSteven Rostedt# TEST_NAME = name 8999064af52SSteven Rostedt# 9009064af52SSteven Rostedt# If you want the test to have a name that is displayed in 9019064af52SSteven Rostedt# the test result banner at the end of the test, then use this 9029064af52SSteven Rostedt# option. This is useful to search for the RESULT keyword and 9039064af52SSteven Rostedt# not have to translate a test number to a test in the config. 904a57419b3SSteven Rostedt# 905a57419b3SSteven Rostedt# For TEST_TYPE = patchcheck 906a75fececSSteven Rostedt# 907a75fececSSteven Rostedt# This expects the BUILD_DIR to be a git repository, and 908a57419b3SSteven Rostedt# will checkout the PATCHCHECK_START commit. 909a75fececSSteven Rostedt# 910a57419b3SSteven Rostedt# The option BUILD_TYPE will be ignored. 911a75fececSSteven Rostedt# 912a57419b3SSteven Rostedt# The MIN_CONFIG will be used for all builds of the patchcheck. The build type 913a57419b3SSteven Rostedt# used for patchcheck is oldconfig. 914a75fececSSteven Rostedt# 915a57419b3SSteven Rostedt# PATCHCHECK_START is required and is the first patch to 916a57419b3SSteven Rostedt# test (the SHA1 of the commit). You may also specify anything 917a57419b3SSteven Rostedt# that git checkout allows (branch name, tage, HEAD~3). 918a57419b3SSteven Rostedt# 919a57419b3SSteven Rostedt# PATCHCHECK_END is the last patch to check (default HEAD) 920a57419b3SSteven Rostedt# 92123a0e161SSteven Rostedt (Red Hat)# PATCHCHECK_CHERRY if set to non zero, then git cherry will be 92223a0e161SSteven Rostedt (Red Hat)# performed against PATCHCHECK_START and PATCHCHECK_END. That is 92323a0e161SSteven Rostedt (Red Hat)# 92423a0e161SSteven Rostedt (Red Hat)# git cherry ${PATCHCHECK_START} ${PATCHCHECK_END} 92523a0e161SSteven Rostedt (Red Hat)# 92623a0e161SSteven Rostedt (Red Hat)# Then the changes found will be tested. 92723a0e161SSteven Rostedt (Red Hat)# 92823a0e161SSteven Rostedt (Red Hat)# Note, PATCHCHECK_CHERRY requires PATCHCHECK_END to be defined. 92923a0e161SSteven Rostedt (Red Hat)# (default 0) 93023a0e161SSteven Rostedt (Red Hat)# 931a57419b3SSteven Rostedt# PATCHCHECK_TYPE is required and is the type of test to run: 932a75fececSSteven Rostedt# build, boot, test. 933a75fececSSteven Rostedt# 934a75fececSSteven Rostedt# Note, the build test will look for warnings, if a warning occurred 9351990207dSSteven Rostedt# in a file that a commit touches, the build will fail, unless 9361990207dSSteven Rostedt# IGNORE_WARNINGS is set for the given commit's sha1 9371990207dSSteven Rostedt# 9381990207dSSteven Rostedt# IGNORE_WARNINGS can be used to disable the failure of patchcheck 9391990207dSSteven Rostedt# on a particuler commit (SHA1). You can add more than one commit 9401990207dSSteven Rostedt# by adding a list of SHA1s that are space delimited. 941a75fececSSteven Rostedt# 942a75fececSSteven Rostedt# If BUILD_NOCLEAN is set, then make mrproper will not be run on 943a75fececSSteven Rostedt# any of the builds, just like all other TEST_TYPE tests. But 944a75fececSSteven Rostedt# what makes patchcheck different from the other tests, is if 945a75fececSSteven Rostedt# BUILD_NOCLEAN is not set, only the first and last patch run 946a75fececSSteven Rostedt# make mrproper. This helps speed up the test. 947a75fececSSteven Rostedt# 948a75fececSSteven Rostedt# Example: 949a57419b3SSteven Rostedt# TEST_START 950a57419b3SSteven Rostedt# TEST_TYPE = patchcheck 951a57419b3SSteven Rostedt# CHECKOUT = mybranch 952a57419b3SSteven Rostedt# PATCHCHECK_TYPE = boot 953a57419b3SSteven Rostedt# PATCHCHECK_START = 747e94ae3d1b4c9bf5380e569f614eb9040b79e7 954d1fbd7e6SSteven Rostedt# PATCHCHECK_END = HEAD~2 9551990207dSSteven Rostedt# IGNORE_WARNINGS = 42f9c6b69b54946ffc0515f57d01dc7f5c0e4712 0c17ca2c7187f431d8ffc79e81addc730f33d128 956a75fececSSteven Rostedt# 957a75fececSSteven Rostedt# 958a57419b3SSteven Rostedt# 959a57419b3SSteven Rostedt# For TEST_TYPE = bisect 960a75fececSSteven Rostedt# 961a75fececSSteven Rostedt# You can specify a git bisect if the BUILD_DIR is a git repository. 962a75fececSSteven Rostedt# The MIN_CONFIG will be used for all builds of the bisect. The build type 963a75fececSSteven Rostedt# used for bisecting is oldconfig. 964a75fececSSteven Rostedt# 965a57419b3SSteven Rostedt# The option BUILD_TYPE will be ignored. 966a57419b3SSteven Rostedt# 967a57419b3SSteven Rostedt# BISECT_TYPE is the type of test to perform: 968a75fececSSteven Rostedt# build - bad fails to build 969a75fececSSteven Rostedt# boot - bad builds but fails to boot 970a75fececSSteven Rostedt# test - bad boots but fails a test 971a75fececSSteven Rostedt# 972a57419b3SSteven Rostedt# BISECT_GOOD is the commit (SHA1) to label as good (accepts all git good commit types) 973a57419b3SSteven Rostedt# BISECT_BAD is the commit to label as bad (accepts all git bad commit types) 974a75fececSSteven Rostedt# 975a75fececSSteven Rostedt# The above three options are required for a bisect operation. 976a75fececSSteven Rostedt# 977a57419b3SSteven Rostedt# BISECT_REPLAY = /path/to/replay/file (optional, default undefined) 978a75fececSSteven Rostedt# 979a75fececSSteven Rostedt# If an operation failed in the bisect that was not expected to 980a75fececSSteven Rostedt# fail. Then the test ends. The state of the BUILD_DIR will be 981a57419b3SSteven Rostedt# left off at where the failure occurred. You can examine the 982a75fececSSteven Rostedt# reason for the failure, and perhaps even find a git commit 983a75fececSSteven Rostedt# that would work to continue with. You can run: 984a75fececSSteven Rostedt# 985a75fececSSteven Rostedt# git bisect log > /path/to/replay/file 986a75fececSSteven Rostedt# 987a57419b3SSteven Rostedt# The adding: 988a75fececSSteven Rostedt# 989a57419b3SSteven Rostedt# BISECT_REPLAY= /path/to/replay/file 990a75fececSSteven Rostedt# 991a57419b3SSteven Rostedt# And running the test again. The test will perform the initial 992a57419b3SSteven Rostedt# git bisect start, git bisect good, and git bisect bad, and 993a57419b3SSteven Rostedt# then it will run git bisect replay on this file, before 994a57419b3SSteven Rostedt# continuing with the bisect. 995a57419b3SSteven Rostedt# 996a57419b3SSteven Rostedt# BISECT_START = commit (optional, default undefined) 997a57419b3SSteven Rostedt# 998a57419b3SSteven Rostedt# As with BISECT_REPLAY, if the test failed on a commit that 999a75fececSSteven Rostedt# just happen to have a bad commit in the middle of the bisect, 1000a57419b3SSteven Rostedt# and you need to skip it. If BISECT_START is defined, it 1001a57419b3SSteven Rostedt# will checkout that commit after doing the initial git bisect start, 1002a57419b3SSteven Rostedt# git bisect good, git bisect bad, and running the git bisect replay 1003a57419b3SSteven Rostedt# if the BISECT_REPLAY is set. 1004a75fececSSteven Rostedt# 1005c23dca7cSSteven Rostedt# BISECT_SKIP = 1 (optional, default 0) 1006c23dca7cSSteven Rostedt# 1007c23dca7cSSteven Rostedt# If BISECT_TYPE is set to test but the build fails, ktest will 1008c23dca7cSSteven Rostedt# simply fail the test and end their. You could use BISECT_REPLAY 1009c23dca7cSSteven Rostedt# and BISECT_START to resume after you found a new starting point, 1010c23dca7cSSteven Rostedt# or you could set BISECT_SKIP to 1. If BISECT_SKIP is set to 1, 1011c23dca7cSSteven Rostedt# when something other than the BISECT_TYPE fails, ktest.pl will 1012c23dca7cSSteven Rostedt# run "git bisect skip" and try again. 1013c23dca7cSSteven Rostedt# 10143410f6fdSSteven Rostedt# BISECT_FILES = <path> (optional, default undefined) 10153410f6fdSSteven Rostedt# 10163410f6fdSSteven Rostedt# To just run the git bisect on a specific path, set BISECT_FILES. 10173410f6fdSSteven Rostedt# For example: 10183410f6fdSSteven Rostedt# 10193410f6fdSSteven Rostedt# BISECT_FILES = arch/x86 kernel/time 10203410f6fdSSteven Rostedt# 10213410f6fdSSteven Rostedt# Will run the bisect with "git bisect start -- arch/x86 kernel/time" 10223410f6fdSSteven Rostedt# 1023a57419b3SSteven Rostedt# BISECT_REVERSE = 1 (optional, default 0) 1024a75fececSSteven Rostedt# 1025a75fececSSteven Rostedt# In those strange instances where it was broken forever 1026a75fececSSteven Rostedt# and you are trying to find where it started to work! 1027a57419b3SSteven Rostedt# Set BISECT_GOOD to the commit that was last known to fail 1028a57419b3SSteven Rostedt# Set BISECT_BAD to the commit that is known to start working. 1029a57419b3SSteven Rostedt# With BISECT_REVERSE = 1, The test will consider failures as 1030a57419b3SSteven Rostedt# good, and success as bad. 1031a75fececSSteven Rostedt# 1032c960bb9fSSteven Rostedt# BISECT_MANUAL = 1 (optional, default 0) 1033c960bb9fSSteven Rostedt# 1034c960bb9fSSteven Rostedt# In case there's a problem with automating the bisect for 1035c960bb9fSSteven Rostedt# whatever reason. (Can't reboot, want to inspect each iteration) 1036c960bb9fSSteven Rostedt# Doing a BISECT_MANUAL will have the test wait for you to 1037c960bb9fSSteven Rostedt# tell it if the test passed or failed after each iteration. 1038c960bb9fSSteven Rostedt# This is basicall the same as running git bisect yourself 1039c960bb9fSSteven Rostedt# but ktest will rebuild and install the kernel for you. 1040c960bb9fSSteven Rostedt# 1041a57419b3SSteven Rostedt# BISECT_CHECK = 1 (optional, default 0) 1042a75fececSSteven Rostedt# 1043a75fececSSteven Rostedt# Just to be sure the good is good and bad is bad, setting 1044a57419b3SSteven Rostedt# BISECT_CHECK to 1 will start the bisect by first checking 1045a57419b3SSteven Rostedt# out BISECT_BAD and makes sure it fails, then it will check 1046a57419b3SSteven Rostedt# out BISECT_GOOD and makes sure it succeeds before starting 1047a57419b3SSteven Rostedt# the bisect (it works for BISECT_REVERSE too). 1048a75fececSSteven Rostedt# 1049a57419b3SSteven Rostedt# You can limit the test to just check BISECT_GOOD or 1050a57419b3SSteven Rostedt# BISECT_BAD with BISECT_CHECK = good or 1051a57419b3SSteven Rostedt# BISECT_CHECK = bad, respectively. 1052a75fececSSteven Rostedt# 1053961d9cacSSteven Rostedt (Red Hat)# BISECT_TRIES = 5 (optional, default 1) 1054961d9cacSSteven Rostedt (Red Hat)# 1055961d9cacSSteven Rostedt (Red Hat)# For those cases that it takes several tries to hit a bug, 1056961d9cacSSteven Rostedt (Red Hat)# the BISECT_TRIES is useful. It is the number of times the 1057961d9cacSSteven Rostedt (Red Hat)# test is ran before it says the kernel is good. The first failure 1058961d9cacSSteven Rostedt (Red Hat)# will stop trying and mark the current SHA1 as bad. 1059961d9cacSSteven Rostedt (Red Hat)# 1060961d9cacSSteven Rostedt (Red Hat)# Note, as with all race bugs, there's no guarantee that if 1061961d9cacSSteven Rostedt (Red Hat)# it succeeds, it is really a good bisect. But it helps in case 1062961d9cacSSteven Rostedt (Red Hat)# the bug is some what reliable. 1063961d9cacSSteven Rostedt (Red Hat)# 1064961d9cacSSteven Rostedt (Red Hat)# You can set BISECT_TRIES to zero, and all tests will be considered 1065961d9cacSSteven Rostedt (Red Hat)# good, unless you also set BISECT_MANUAL. 1066961d9cacSSteven Rostedt (Red Hat)# 1067c5dacb88SSteven Rostedt# BISECT_RET_GOOD = 0 (optional, default undefined) 1068c5dacb88SSteven Rostedt# 1069c5dacb88SSteven Rostedt# In case the specificed test returns something other than just 1070c5dacb88SSteven Rostedt# 0 for good, and non-zero for bad, you can override 0 being 1071c5dacb88SSteven Rostedt# good by defining BISECT_RET_GOOD. 1072c5dacb88SSteven Rostedt# 1073c5dacb88SSteven Rostedt# BISECT_RET_BAD = 1 (optional, default undefined) 1074c5dacb88SSteven Rostedt# 1075c5dacb88SSteven Rostedt# In case the specificed test returns something other than just 1076c5dacb88SSteven Rostedt# 0 for good, and non-zero for bad, you can override non-zero being 1077c5dacb88SSteven Rostedt# bad by defining BISECT_RET_BAD. 1078c5dacb88SSteven Rostedt# 1079c5dacb88SSteven Rostedt# BISECT_RET_ABORT = 255 (optional, default undefined) 1080c5dacb88SSteven Rostedt# 1081c5dacb88SSteven Rostedt# If you need to abort the bisect if the test discovers something 1082c5dacb88SSteven Rostedt# that was wrong, you can define BISECT_RET_ABORT to be the error 1083c5dacb88SSteven Rostedt# code returned by the test in order to abort the bisect. 1084c5dacb88SSteven Rostedt# 1085c5dacb88SSteven Rostedt# BISECT_RET_SKIP = 2 (optional, default undefined) 1086c5dacb88SSteven Rostedt# 1087c5dacb88SSteven Rostedt# If the test detects that the current commit is neither good 1088c5dacb88SSteven Rostedt# nor bad, but something else happened (another bug detected) 1089c5dacb88SSteven Rostedt# you can specify BISECT_RET_SKIP to an error code that the 1090c5dacb88SSteven Rostedt# test returns when it should skip the current commit. 1091c5dacb88SSteven Rostedt# 1092c5dacb88SSteven Rostedt# BISECT_RET_DEFAULT = good (optional, default undefined) 1093c5dacb88SSteven Rostedt# 1094c5dacb88SSteven Rostedt# You can override the default of what to do when the above 1095c5dacb88SSteven Rostedt# options are not hit. This may be one of, "good", "bad", 1096c5dacb88SSteven Rostedt# "abort" or "skip" (without the quotes). 1097c5dacb88SSteven Rostedt# 1098c5dacb88SSteven Rostedt# Note, if you do not define any of the previous BISECT_RET_* 1099c5dacb88SSteven Rostedt# and define BISECT_RET_DEFAULT, all bisects results will do 1100c5dacb88SSteven Rostedt# what the BISECT_RET_DEFAULT has. 1101c5dacb88SSteven Rostedt# 1102c5dacb88SSteven Rostedt# 1103a75fececSSteven Rostedt# Example: 1104a57419b3SSteven Rostedt# TEST_START 1105a57419b3SSteven Rostedt# TEST_TYPE = bisect 1106a57419b3SSteven Rostedt# BISECT_GOOD = v2.6.36 1107a57419b3SSteven Rostedt# BISECT_BAD = b5153163ed580e00c67bdfecb02b2e3843817b3e 1108a57419b3SSteven Rostedt# BISECT_TYPE = build 1109a57419b3SSteven Rostedt# MIN_CONFIG = /home/test/config-bisect 1110d1fbd7e6SSteven Rostedt# 1111d1fbd7e6SSteven Rostedt# 1112d1fbd7e6SSteven Rostedt# 1113d1fbd7e6SSteven Rostedt# For TEST_TYPE = config_bisect 1114d1fbd7e6SSteven Rostedt# 1115d1fbd7e6SSteven Rostedt# In those cases that you have two different configs. One of them 1116d1fbd7e6SSteven Rostedt# work, the other does not, and you do not know what config causes 1117d1fbd7e6SSteven Rostedt# the problem. 1118d1fbd7e6SSteven Rostedt# The TEST_TYPE config_bisect will bisect the bad config looking for 1119d1fbd7e6SSteven Rostedt# what config causes the failure. 1120d1fbd7e6SSteven Rostedt# 1121d1fbd7e6SSteven Rostedt# The way it works is this: 1122d1fbd7e6SSteven Rostedt# 11234c16b1d6SSteven Rostedt (Red Hat)# You can specify a good config with CONFIG_BISECT_GOOD, otherwise it 11244c16b1d6SSteven Rostedt (Red Hat)# will use the MIN_CONFIG, and if that's not specified, it will use 11254c16b1d6SSteven Rostedt (Red Hat)# the config that comes with "make defconfig". 1126d1fbd7e6SSteven Rostedt# 11274c16b1d6SSteven Rostedt (Red Hat)# It runs both the good and bad configs through a make oldconfig to 11284c16b1d6SSteven Rostedt (Red Hat)# make sure that they are set up for the kernel that is checked out. 1129d1fbd7e6SSteven Rostedt# 11304c16b1d6SSteven Rostedt (Red Hat)# It then reads the configs that are set, as well as the ones that are 11314c16b1d6SSteven Rostedt (Red Hat)# not set for both the good and bad configs, and then compares them. 11324c16b1d6SSteven Rostedt (Red Hat)# It will set half of the good configs within the bad config (note, 11334c16b1d6SSteven Rostedt (Red Hat)# "set" means to make the bad config match the good config, a config 11344c16b1d6SSteven Rostedt (Red Hat)# in the good config that is off, will be turned off in the bad 11354c16b1d6SSteven Rostedt (Red Hat)# config. That is considered a "set"). 1136d1fbd7e6SSteven Rostedt# 11374c16b1d6SSteven Rostedt (Red Hat)# It tests this new config and if it works, it becomes the new good 11384c16b1d6SSteven Rostedt (Red Hat)# config, otherwise it becomes the new bad config. It continues this 11394c16b1d6SSteven Rostedt (Red Hat)# process until there's only one config left and it will report that 11404c16b1d6SSteven Rostedt (Red Hat)# config. 1141d1fbd7e6SSteven Rostedt# 11424c16b1d6SSteven Rostedt (Red Hat)# The "bad config" can also be a config that is needed to boot but was 11434c16b1d6SSteven Rostedt (Red Hat)# disabled because it depended on something that wasn't set. 1144d1fbd7e6SSteven Rostedt# 11454c16b1d6SSteven Rostedt (Red Hat)# During this process, it saves the current good and bad configs in 11464c16b1d6SSteven Rostedt (Red Hat)# ${TMP_DIR}/good_config and ${TMP_DIR}/bad_config respectively. 11474c16b1d6SSteven Rostedt (Red Hat)# If you stop the test, you can copy them to a new location to 11484c16b1d6SSteven Rostedt (Red Hat)# reuse them again. 1149d1fbd7e6SSteven Rostedt# 11504c16b1d6SSteven Rostedt (Red Hat)# Although the MIN_CONFIG may be the config it starts with, the 11514c16b1d6SSteven Rostedt (Red Hat)# MIN_CONFIG is ignored. 1152d1fbd7e6SSteven Rostedt# 1153d1fbd7e6SSteven Rostedt# The option BUILD_TYPE will be ignored. 1154d1fbd7e6SSteven Rostedt# 1155d1fbd7e6SSteven Rostedt# CONFIG_BISECT_TYPE is the type of test to perform: 1156d1fbd7e6SSteven Rostedt# build - bad fails to build 1157d1fbd7e6SSteven Rostedt# boot - bad builds but fails to boot 1158d1fbd7e6SSteven Rostedt# test - bad boots but fails a test 1159d1fbd7e6SSteven Rostedt# 1160d1fbd7e6SSteven Rostedt# CONFIG_BISECT is the config that failed to boot 1161d1fbd7e6SSteven Rostedt# 1162c960bb9fSSteven Rostedt# If BISECT_MANUAL is set, it will pause between iterations. 1163c960bb9fSSteven Rostedt# This is useful to use just ktest.pl just for the config bisect. 1164c960bb9fSSteven Rostedt# If you set it to build, it will run the bisect and you can 1165c960bb9fSSteven Rostedt# control what happens in between iterations. It will ask you if 1166c960bb9fSSteven Rostedt# the test succeeded or not and continue the config bisect. 116730f75da5SSteven Rostedt# 116830f75da5SSteven Rostedt# CONFIG_BISECT_GOOD (optional) 116930f75da5SSteven Rostedt# If you have a good config to start with, then you 117030f75da5SSteven Rostedt# can specify it with CONFIG_BISECT_GOOD. Otherwise 11714c16b1d6SSteven Rostedt (Red Hat)# the MIN_CONFIG is the base, if MIN_CONFIG is not set 11724c16b1d6SSteven Rostedt (Red Hat)# It will build a config with "make defconfig" 1173c960bb9fSSteven Rostedt# 1174b0918612SSteven Rostedt# CONFIG_BISECT_CHECK (optional) 1175b0918612SSteven Rostedt# Set this to 1 if you want to confirm that the config ktest 1176b0918612SSteven Rostedt# generates (the bad config with the min config) is still bad. 1177b0918612SSteven Rostedt# It may be that the min config fixes what broke the bad config 1178b0918612SSteven Rostedt# and the test will not return a result. 11794c16b1d6SSteven Rostedt (Red Hat)# Set it to "good" to test only the good config and set it 11804c16b1d6SSteven Rostedt (Red Hat)# to "bad" to only test the bad config. 1181b0918612SSteven Rostedt# 1182d1fbd7e6SSteven Rostedt# Example: 1183d1fbd7e6SSteven Rostedt# TEST_START 1184d1fbd7e6SSteven Rostedt# TEST_TYPE = config_bisect 1185d1fbd7e6SSteven Rostedt# CONFIG_BISECT_TYPE = build 1186d36b6910SAl Viro# CONFIG_BISECT = /home/test/config-bad 1187d1fbd7e6SSteven Rostedt# MIN_CONFIG = /home/test/config-min 1188c960bb9fSSteven Rostedt# BISECT_MANUAL = 1 1189d1fbd7e6SSteven Rostedt# 11904c4ab120SSteven Rostedt# 11914c4ab120SSteven Rostedt# 11924c4ab120SSteven Rostedt# For TEST_TYPE = make_min_config 11934c4ab120SSteven Rostedt# 11944c4ab120SSteven Rostedt# After doing a make localyesconfig, your kernel configuration may 11954c4ab120SSteven Rostedt# not be the most useful minimum configuration. Having a true minimum 11964c4ab120SSteven Rostedt# config that you can use against other configs is very useful if 11974c4ab120SSteven Rostedt# someone else has a config that breaks on your code. By only forcing 11984c4ab120SSteven Rostedt# those configurations that are truly required to boot your machine 11994c4ab120SSteven Rostedt# will give you less of a chance that one of your set configurations 12004c4ab120SSteven Rostedt# will make the bug go away. This will give you a better chance to 12014c4ab120SSteven Rostedt# be able to reproduce the reported bug matching the broken config. 12024c4ab120SSteven Rostedt# 12034c4ab120SSteven Rostedt# Note, this does take some time, and may require you to run the 12044c4ab120SSteven Rostedt# test over night, or perhaps over the weekend. But it also allows 12054c4ab120SSteven Rostedt# you to interrupt it, and gives you the current minimum config 12064c4ab120SSteven Rostedt# that was found till that time. 12074c4ab120SSteven Rostedt# 12084c4ab120SSteven Rostedt# Note, this test automatically assumes a BUILD_TYPE of oldconfig 12094c4ab120SSteven Rostedt# and its test type acts like boot. 12104c4ab120SSteven Rostedt# TODO: add a test version that makes the config do more than just 12114c4ab120SSteven Rostedt# boot, like having network access. 12124c4ab120SSteven Rostedt# 1213b9066f6cSSteven Rostedt# To save time, the test does not just grab any option and test 1214b9066f6cSSteven Rostedt# it. The Kconfig files are examined to determine the dependencies 1215b9066f6cSSteven Rostedt# of the configs. If a config is chosen that depends on another 1216b9066f6cSSteven Rostedt# config, that config will be checked first. By checking the 1217b9066f6cSSteven Rostedt# parents first, we can eliminate whole groups of configs that 1218b9066f6cSSteven Rostedt# may have been enabled. 1219b9066f6cSSteven Rostedt# 1220b9066f6cSSteven Rostedt# For example, if a USB device config is chosen and depends on CONFIG_USB, 1221b9066f6cSSteven Rostedt# the CONFIG_USB will be tested before the device. If CONFIG_USB is 1222b9066f6cSSteven Rostedt# found not to be needed, it, as well as all configs that depend on 1223b9066f6cSSteven Rostedt# it, will be disabled and removed from the current min_config. 1224b9066f6cSSteven Rostedt# 12254c4ab120SSteven Rostedt# OUTPUT_MIN_CONFIG is the path and filename of the file that will 12264c4ab120SSteven Rostedt# be created from the MIN_CONFIG. If you interrupt the test, set 12274c4ab120SSteven Rostedt# this file as your new min config, and use it to continue the test. 12284c4ab120SSteven Rostedt# This file does not need to exist on start of test. 12294c4ab120SSteven Rostedt# This file is not created until a config is found that can be removed. 123035ce5952SSteven Rostedt# If this file exists, you will be prompted if you want to use it 123135ce5952SSteven Rostedt# as the min_config (overriding MIN_CONFIG) if START_MIN_CONFIG 123235ce5952SSteven Rostedt# is not defined. 12334c4ab120SSteven Rostedt# (required field) 12344c4ab120SSteven Rostedt# 12354c4ab120SSteven Rostedt# START_MIN_CONFIG is the config to use to start the test with. 12364c4ab120SSteven Rostedt# you can set this as the same OUTPUT_MIN_CONFIG, but if you do 12374c4ab120SSteven Rostedt# the OUTPUT_MIN_CONFIG file must exist. 12384c4ab120SSteven Rostedt# (default MIN_CONFIG) 12394c4ab120SSteven Rostedt# 12404c4ab120SSteven Rostedt# IGNORE_CONFIG is used to specify a config file that has configs that 12414c4ab120SSteven Rostedt# you already know must be set. Configs are written here that have 12424c4ab120SSteven Rostedt# been tested and proved to be required. It is best to define this 12434c4ab120SSteven Rostedt# file if you intend on interrupting the test and running it where 12444c4ab120SSteven Rostedt# it left off. New configs that it finds will be written to this file 12454c4ab120SSteven Rostedt# and will not be tested again in later runs. 12464c4ab120SSteven Rostedt# (optional) 12474c4ab120SSteven Rostedt# 1248ccc513b6SSteven Rostedt# MIN_CONFIG_TYPE can be either 'boot' or 'test'. With 'boot' it will 1249ccc513b6SSteven Rostedt# test if the created config can just boot the machine. If this is 1250ccc513b6SSteven Rostedt# set to 'test', then the TEST option must be defined and the created 1251ccc513b6SSteven Rostedt# config will not only boot the target, but also make sure that the 1252ccc513b6SSteven Rostedt# config lets the test succeed. This is useful to make sure the final 1253ccc513b6SSteven Rostedt# config that is generated allows network activity (ssh). 1254ccc513b6SSteven Rostedt# (optional) 1255ccc513b6SSteven Rostedt# 125643de3316SSteven Rostedt# USE_OUTPUT_MIN_CONFIG set this to 1 if you do not want to be prompted 125743de3316SSteven Rostedt# about using the OUTPUT_MIN_CONFIG as the MIN_CONFIG as the starting 125843de3316SSteven Rostedt# point. Set it to 0 if you want to always just use the given MIN_CONFIG. 125943de3316SSteven Rostedt# If it is not defined, it will prompt you to pick which config 126043de3316SSteven Rostedt# to start with (MIN_CONFIG or OUTPUT_MIN_CONFIG). 126143de3316SSteven Rostedt# 12624c4ab120SSteven Rostedt# Example: 12634c4ab120SSteven Rostedt# 12644c4ab120SSteven Rostedt# TEST_TYPE = make_min_config 12654c4ab120SSteven Rostedt# OUTPUT_MIN_CONFIG = /path/to/config-new-min 12664c4ab120SSteven Rostedt# START_MIN_CONFIG = /path/to/config-min 12674c4ab120SSteven Rostedt# IGNORE_CONFIG = /path/to/config-tested 1268ccc513b6SSteven Rostedt# MIN_CONFIG_TYPE = test 1269ccc513b6SSteven Rostedt# TEST = ssh ${USER}@${MACHINE} echo hi 12704c4ab120SSteven Rostedt# 12714283b169SSteven Rostedt (Red Hat)# 12724283b169SSteven Rostedt (Red Hat)# 12734283b169SSteven Rostedt (Red Hat)# 12744283b169SSteven Rostedt (Red Hat)# For TEST_TYPE = make_warnings_file 12754283b169SSteven Rostedt (Red Hat)# 12764283b169SSteven Rostedt (Red Hat)# If you want the build to fail when a new warning is discovered 12774283b169SSteven Rostedt (Red Hat)# you set the WARNINGS_FILE to point to a file of known warnings. 12784283b169SSteven Rostedt (Red Hat)# 12794283b169SSteven Rostedt (Red Hat)# The test "make_warnings_file" will let you create a new warnings 12804283b169SSteven Rostedt (Red Hat)# file before you run other tests, like patchcheck. 12814283b169SSteven Rostedt (Red Hat)# 12824283b169SSteven Rostedt (Red Hat)# What this test does is to run just a build, you still need to 12834283b169SSteven Rostedt (Red Hat)# specify BUILD_TYPE to tell the test what type of config to use. 12844283b169SSteven Rostedt (Red Hat)# A BUILD_TYPE of nobuild will fail this test. 12854283b169SSteven Rostedt (Red Hat)# 12864283b169SSteven Rostedt (Red Hat)# The test will do the build and scan for all warnings. Any warning 12874283b169SSteven Rostedt (Red Hat)# it discovers will be saved in the WARNINGS_FILE (required) option. 12884283b169SSteven Rostedt (Red Hat)# 12894283b169SSteven Rostedt (Red Hat)# It is recommended (but not necessary) to make sure BUILD_NOCLEAN is 12904283b169SSteven Rostedt (Red Hat)# off, so that a full build is done (make mrproper is performed). 12914283b169SSteven Rostedt (Red Hat)# That way, all warnings will be captured. 12924283b169SSteven Rostedt (Red Hat)# 12934283b169SSteven Rostedt (Red Hat)# Example: 12944283b169SSteven Rostedt (Red Hat)# 12954283b169SSteven Rostedt (Red Hat)# TEST_TYPE = make_warnings_file 12964283b169SSteven Rostedt (Red Hat)# WARNINGS_FILE = ${OUTPUT_DIR} 12974283b169SSteven Rostedt (Red Hat)# BUILD_TYPE = useconfig:oldconfig 12984283b169SSteven Rostedt (Red Hat)# CHECKOUT = v3.8 12994283b169SSteven Rostedt (Red Hat)# BUILD_NOCLEAN = 0 13004283b169SSteven Rostedt (Red Hat)# 1301