Steven Rostedt (Red Hat)ktest: Add BISECT_TRIES to bisect test961d9ca12 years agoHistory
1289 lines · 45.5 KB · Text
RawDownload
## Config file for ktest.pl## Note, all paths must be absolute# # Options set in the beginning of the file are considered to be# default options. These options can be overriden by test specific# options, with the following exceptions:##  LOG_FILE#  CLEAR_LOG#  POWEROFF_ON_SUCCESS#  REBOOT_ON_SUCCESS## Test specific options are set after the label:## TEST_START## The options after a TEST_START label are specific to that test.# Each TEST_START label will set up a new test. If you want to# perform a test more than once, you can add the ITERATE label# to it followed by the number of times you want that test# to iterate. If the ITERATE is left off, the test will only# be performed once.## TEST_START ITERATE 10## You can skip a test by adding SKIP (before or after the ITERATE# and number)## TEST_START SKIP## TEST_START SKIP ITERATE 10## TEST_START ITERATE 10 SKIP## The SKIP label causes the options and the test itself to be ignored.# This is useful to set up several different tests in one config file, and# only enabling the ones you want to use for a current test run.## You can add default options anywhere in the file as well# with the DEFAULTS tag. This allows you to have default options# after the test options to keep the test options at the top# of the file. You can even place the DEFAULTS tag between# test cases (but not in the middle of a single test case)## TEST_START# MIN_CONFIG = /home/test/config-test1## DEFAULTS# MIN_CONFIG = /home/test/config-default## TEST_START ITERATE 10## The above will run the first test with MIN_CONFIG set to# /home/test/config-test-1. Then 10 tests will be executed# with MIN_CONFIG with /home/test/config-default.## You can also disable defaults with the SKIP option## DEFAULTS SKIP# MIN_CONFIG = /home/test/config-use-sometimes## DEFAULTS# MIN_CONFIG = /home/test/config-most-times## The above will ignore the first MIN_CONFIG. If you want to# use the first MIN_CONFIG, remove the SKIP from the first# DEFAULTS tag and add it to the second. Be careful, options# may only be declared once per test or default. If you have# the same option name under the same test or as default# ktest will fail to execute, and no tests will run.## DEFAULTS OVERRIDE## Options defined in the DEFAULTS section can not be duplicated# even if they are defined in two different DEFAULT sections.# This is done to catch mistakes where an option is added but# the previous option was forgotten about and not commented.## The OVERRIDE keyword can be added to a section to allow this# section to override other DEFAULT sections values that have# been defined previously. It will only override options that# have been defined before its use. Options defined later# in a non override section will still error. The same option# can not be defined in the same section even if that section# is marked OVERRIDE.#### Both TEST_START and DEFAULTS sections can also have the IF keyword# The value after the IF must evaluate into a 0 or non 0 positive# integer, and can use the config variables (explained below).## DEFAULTS IF ${IS_X86_32}## The above will process the DEFAULTS section if the config# variable IS_X86_32 evaluates to a non zero positive integer# otherwise if it evaluates to zero, it will act the same# as if the SKIP keyword was used.## The ELSE keyword can be used directly after a section with# a IF statement.## TEST_START IF ${RUN_NET_TESTS}# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-network## ELSE## BUILD_TYPE = useconfig:${CONFIG_DIR}/config-normal### The ELSE keyword can also contain an IF statement to allow multiple# if then else sections. But all the sections must be either# DEFAULT or TEST_START, they can not be a mixture.## TEST_START IF ${RUN_NET_TESTS}# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-network## ELSE IF ${RUN_DISK_TESTS}# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-tests## ELSE IF ${RUN_CPU_TESTS}# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-cpu## ELSE# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-network## The if statement may also have comparisons that will and for# == and !=, strings may be used for both sides.## BOX_TYPE := x86_32## DEFAULTS IF ${BOX_TYPE} == x86_32# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-32# ELSE# BUILD_TYPE = useconfig:${CONFIG_DIR}/config-64## The DEFINED keyword can be used by the IF statements too.# It returns true if the given config variable or option has been defined# or false otherwise.## # DEFAULTS IF DEFINED USE_CC# CC := ${USE_CC}# ELSE# CC := gcc### As well as NOT DEFINED.## DEFAULTS IF NOT DEFINED MAKE_CMD# MAKE_CMD := make ARCH=x86### And/or ops (&&,||) may also be used to make complex conditionals.## TEST_START IF (DEFINED ALL_TESTS || ${MYTEST} == boottest) && ${MACHINE} == gandalf## Notice the use of parentheses. Without any parentheses the above would be# processed the same as:## TEST_START IF DEFINED ALL_TESTS || (${MYTEST} == boottest && ${MACHINE} == gandalf)#### INCLUDE file## The INCLUDE keyword may be used in DEFAULT sections. This will# read another config file and process that file as well. The included# file can include other files, add new test cases or default# statements. Config variables will be passed to these files and changes# to config variables will be seen by top level config files. Including# a file is processed just like the contents of the file was cut and pasted# into the top level file, except, that include files that end with# TEST_START sections will have that section ended at the end of# the include file. That is, an included file is included followed# by another DEFAULT keyword.## Unlike other files referenced in this config, the file path does not need# to be absolute. If the file does not start with '/', then the directory# that the current config file was located in is used. If no config by the# given name is found there, then the current directory is searched.## INCLUDE myfile# DEFAULT## is the same as:## INCLUDE myfile## Note, if the include file does not contain a full path, the file is# searched first by the location of the original include file, and then# by the location that ktest.pl was executed in.# #### Config variables ###### This config file can also contain "config variables".# These are assigned with ":=" instead of the ktest option# assigment "=".## The difference between ktest options and config variables# is that config variables can be used multiple times,# where each instance will override the previous instance.# And that they only live at time of processing this config.## The advantage to config variables are that they can be used# by any option or any other config variables to define thing# that you may use over and over again in the options.## For example:## USER      := root# TARGET    := mybox# TEST_CASE := ssh ${USER}@${TARGET} /path/to/my/test## TEST_START# MIN_CONFIG = config1# TEST = ${TEST_CASE}## TEST_START# MIN_CONFIG = config2# TEST = ${TEST_CASE}## TEST_CASE := ssh ${USER}@${TARGET} /path/to/my/test2## TEST_START# MIN_CONFIG = config1# TEST = ${TEST_CASE}## TEST_START# MIN_CONFIG = config2# TEST = ${TEST_CASE}## TEST_DIR := /home/me/test## BUILD_DIR = ${TEST_DIR}/linux.git# OUTPUT_DIR = ${TEST_DIR}/test## Note, the config variables are evaluated immediately, thus# updating TARGET after TEST_CASE has been assigned does nothing# to TEST_CASE.## As shown in the example, to evaluate a config variable, you# use the ${X} convention. Simple $X will not work.## If the config variable does not exist, the ${X} will not# be evaluated. Thus:## MAKE_CMD = PATH=/mypath:${PATH} make## If PATH is not a config variable, then the ${PATH} in# the MAKE_CMD option will be evaluated by the shell when# the MAKE_CMD option is passed into shell processing. #### Using options in other options ###### Options that are defined in the config file may also be used# by other options. All options are evaulated at time of# use (except that config variables are evaluated at config# processing time).## If an ktest option is used within another option, instead of# typing it again in that option you can simply use the option# just like you can config variables.## MACHINE = mybox## TEST = ssh root@${MACHINE} /path/to/test## The option will be used per test case. Thus:## TEST_TYPE = test# TEST = ssh root@{MACHINE}## TEST_START# MACHINE = box1## TEST_START# MACHINE = box2## For both test cases, MACHINE will be evaluated at the time# of the test case. The first test will run ssh root@box1# and the second will run ssh root@box2. #### Mandatory Default Options #### # These options must be in the default section, although most# may be overridden by test options. # The machine hostname that you will test#MACHINE = target # The box is expected to have ssh on normal bootup, provide the user#  (most likely root, since you need privileged operations)#SSH_USER = root # The directory that contains the Linux source code#BUILD_DIR = /home/test/linux.git # The directory that the objects will be built# (can not be same as BUILD_DIR)#OUTPUT_DIR = /home/test/build/target # The location of the compiled file to copy to the target# (relative to OUTPUT_DIR)#BUILD_TARGET = arch/x86/boot/bzImage # The place to put your image on the test machine#TARGET_IMAGE = /boot/vmlinuz-test # A script or command to reboot the box## Here is a digital loggers power switch example#POWER_CYCLE = wget --no-proxy -O /dev/null -q  --auth-no-challenge 'http://admin:admin@power/outlet?5=CCL'## Here is an example to reboot a virtual box on the current host# with the name "Guest".#POWER_CYCLE = virsh destroy Guest; sleep 5; virsh start Guest # The script or command that reads the console##  If you use ttywatch server, something like the following would work.#CONSOLE = nc -d localhost 3001## For a virtual machine with guest name "Guest".#CONSOLE =  virsh console Guest # Signal to send to kill console.# ktest.pl will create a child process to monitor the console.# When the console is finished, ktest will kill the child process# with this signal.# (default INT)#CLOSE_CONSOLE_SIGNAL = HUP # Required version ending to differentiate the test# from other linux builds on the system.#LOCALVERSION = -test # For REBOOT_TYPE = grub2, you must specify where the grub.cfg# file is. This is the file that is searched to find the menu# option to boot to with GRUB_REBOOT#GRUB_FILE = /boot/grub2/grub.cfg # The tool for REBOOT_TYPE = grub2 to set the next reboot kernel# to boot into (one shot mode).# (default grub2_reboot)#GRUB_REBOOT = grub2_reboot # The grub title name for the test kernel to boot# (Only mandatory if REBOOT_TYPE = grub or grub2)## Note, ktest.pl will not update the grub menu.lst, you need to# manually add an option for the test. ktest.pl will search# the grub menu.lst for this option to find what kernel to# reboot into.## For example, if in the /boot/grub/menu.lst the test kernel title has:# title Test Kernel# kernel vmlinuz-test## For grub2, a search of top level "menuentry"s are done. No# submenu is searched. The menu is found by searching for the# contents of GRUB_MENU in the line that starts with "menuentry".# You may want to include the quotes around the option. For example:# for: menuentry 'Test Kernel'# do a: GRUB_MENU = 'Test Kernel'# For customizing, add your entry in /etc/grub.d/40_custom.##GRUB_MENU = Test Kernel # For REBOOT_TYPE = syslinux, the name of the syslinux executable# (on the target) to use to set up the next reboot to boot the# test kernel.# (default extlinux)#SYSLINUX = syslinux # For REBOOT_TYPE = syslinux, the path that is passed to to the# syslinux command where syslinux is installed.# (default /boot/extlinux)#SYSLINUX_PATH = /boot/syslinux # For REBOOT_TYPE = syslinux, the syslinux label that references the# test kernel in the syslinux config file.# (default undefined)#SYSLINUX_LABEL = "test-kernel" # A script to reboot the target into the test kernel# This and SWITCH_TO_TEST are about the same, except# SWITCH_TO_TEST is run even for REBOOT_TYPE = grub.# This may be left undefined.# (default undefined)#REBOOT_SCRIPT = #### Optional Config Options (all have defaults) #### # Start a test setup. If you leave this off, all options# will be default and the test will run once.# This is a label and not really an option (it takes no value).# You can append ITERATE and a number after it to iterate the# test a number of times, or SKIP to ignore this test.##TEST_START#TEST_START ITERATE 5#TEST_START SKIP # Have the following options as default again. Used after tests# have already been defined by TEST_START. Optionally, you can# just define all default options before the first TEST_START# and you do not need this option.## This is a label and not really an option (it takes no value).# You can append SKIP to this label and the options within this# section will be ignored.## DEFAULTS# DEFAULTS SKIP # If you want to execute some command before the first test runs# you can set this option. Note, it can be set as a default option# or an option in the first test case. All other test cases will# ignore it. If both the default and first test have this option# set, then the first test will take precedence.## default (undefined)#PRE_KTEST = ${SSH} ~/set_up_test # If you want to execute some command after all the tests have# completed, you can set this option. Note, it can be set as a# default or any test case can override it. If multiple test cases# set this option, then the last test case that set it will take# precedence## default (undefined)#POST_KTEST = ${SSH} ~/dismantle_test # The default test type (default test)# The test types may be:#   build   - only build the kernel, do nothing else#   install - build and install, but do nothing else (does not reboot)#   boot    - build, install, and boot the kernel#   test    - build, boot and if TEST is set, run the test script#          (If TEST is not set, it defaults back to boot)#   bisect - Perform a bisect on the kernel (see BISECT_TYPE below)#   patchcheck - Do a test on a series of commits in git (see PATCHCHECK below)#TEST_TYPE = test # Test to run if there is a successful boot and TEST_TYPE is test.# Must exit with 0 on success and non zero on error# default (undefined)#TEST = ssh user@machine /root/run_test # The build type is any make config type or special command#  (default randconfig)#   nobuild - skip the clean and build step#   useconfig:/path/to/config - use the given config and run#              oldconfig on it.# This option is ignored if TEST_TYPE is patchcheck or bisect#BUILD_TYPE = randconfig # The make command (default make)# If you are building a 32bit x86 on a 64 bit host#MAKE_CMD = CC=i386-gcc AS=i386-as make ARCH=i386 # Any build options for the make of the kernel (not for other makes, like configs)# (default "")#BUILD_OPTIONS = -j20 # If you need to do some special handling before installing# you can add a script with this option.# The environment variable KERNEL_VERSION will be set to the# kernel version that is used.## default (undefined)#PRE_INSTALL = ssh user@target rm -rf '/lib/modules/*-test*' # If you need an initrd, you can add a script or code here to install# it. The environment variable KERNEL_VERSION will be set to the# kernel version that is used. Remember to add the initrd line# to your grub menu.lst file.## Here's a couple of examples to use:#POST_INSTALL = ssh user@target /sbin/mkinitrd --allow-missing -f /boot/initramfs-test.img $KERNEL_VERSION## or on some systems:#POST_INSTALL = ssh user@target /sbin/dracut -f /boot/initramfs-test.img $KERNEL_VERSION # If for some reason you just want to boot the kernel and you do not# want the test to install anything new. For example, you may just want# to boot test the same kernel over and over and do not want to go through# the hassle of installing anything, you can set this option to 1# (default 0)#NO_INSTALL = 1 # If there is a command that you want to run before the individual test# case executes, then you can set this option## default (undefined)

Lines 1–500 of 1289.