1407 lines · 49.9 KB · Text
RawDownload
## Config file for ktest.pl## Place your customized version of this, in the working directory that# ktest.pl is run from. By default, ktest.pl will look for a file# called "ktest.conf", but you can name it anything you like and specify# the name of your config file as the first argument of 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 overridden 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# assignment "=".## 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.## Shell commands can also be inserted with the ${shell <command>}# expression. Note, this is case sensitive, thus ${SHELL <command>}# will not work.## HOSTNAME := ${shell hostname}# DEFAULTS IF "${HOSTNAME}" == "frodo"# #### Using options in other options ###### Options that are defined in the config file may also be used# by other options. All options are evaluated 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 or grub2bls 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 or grub2bls)## 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.## For grub2bls, a search of "title"s are done. The menu is found# by searching for the contents of GRUB_MENU in the line that starts# with "title".##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) #### # Email options for receiving notifications. Users must setup# the specified mailer prior to using this feature.## (default undefined)#MAILTO =## Supported mailers: sendmail, mail, mailx# (default sendmail)#MAILER = sendmail## The executable to run# (default: for sendmail "/usr/sbin/sendmail", otherwise equals ${MAILER})#MAIL_EXEC = /usr/sbin/sendmail## The command used to send mail, which uses the above options# can be modified. By default if the mailer is "sendmail" then#  MAIL_COMMAND = echo \'Subject: $SUBJECT\n\n$MESSAGE\' | $MAIL_PATH/$MAILER -t $MAILTO# For mail or mailx:#  MAIL_COMMAND = "$MAIL_PATH/$MAILER -s \'$SUBJECT\' $MAILTO <<< \'$MESSAGE\'# ktest.pl will do the substitution for MAIL_PATH, MAILER, MAILTO at the time#    it sends the mail if "$FOO" format is used. If "${FOO}" format is used,#    then the substitutions will occur at the time the config file is read.#    But note, MAIL_PATH and MAILER require being set by the config file if#     ${MAIL_PATH} or ${MAILER} are used, but not if $MAIL_PATH or $MAILER are.#MAIL_COMMAND = echo \'Subject: $SUBJECT\n\n$MESSAGE\' | $MAIL_PATH/$MAILER -t $MAILTO## Errors are defined as those would terminate the script# (default 1)#EMAIL_ON_ERROR = 1# (default 1)#EMAIL_WHEN_FINISHED = 1# (default 0)#EMAIL_WHEN_STARTED = 1## Users can cancel the test by Ctrl^C# (default 0)#EMAIL_WHEN_CANCELED = 1## If a test ends with an error and EMAIL_ON_ERROR is set as well# as a LOG_FILE is defined, then the log of the failing test will# be included in the email that is sent.# It is possible that the log may be very large, in which case,# only the last amount of the log should be sent. To limit how# much of the log is sent, set MAIL_MAX_SIZE. This will be the# size in bytes of the last portion of the log of the failed# test file. That is, if this is set to 100000, then only the# last 100 thousand bytes of the log file will be included in# the email.# (default undef)#MAIL_MAX_SIZE = 1000000 # 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## To specify if the test should fail if PRE_KTEST fails,# PRE_KTEST_DIE needs to be set to 1. Otherwise the PRE_KTEST# result is ignored.

Lines 1–500 of 1407.