History log of /linux-master/tools/testing/ktest/sample.conf
Revision Date Author Comments
# 4e7d2a8f 18-Jan-2023 Steven Rostedt <rostedt@goodmis.org>

ktest.pl: Add RUN_TIMEOUT option with default unlimited

There is a disconnect between the run_command function and the
wait_for_input. The wait_for_input has a default timeout of 2 minutes. But
if that happens, the run_command loop will exit out to the waitpid() of
the executing command. This fails in that it no longer monitors the
command, and also, the ssh to the test box can hang when its finished, as
it's waiting for the pipe it's writing to to flush, but the loop that
reads that pipe has already exited, leaving the command stuck, and the
test hangs.

Instead, make the default "wait_for_input" of the run_command infinite,
and allow the user to override it if they want with a default timeout
option "RUN_TIMEOUT".

But this fixes the hang that happens when the pipe is full and the ssh
session never exits.

Cc: stable@vger.kernel.org
Fixes: 6e98d1b4415fe ("ktest: Add timeout to ssh command")
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 88a51b4f 07-Dec-2022 Steven Rostedt (Google) <rostedt@goodmis.org>

ktest.pl: Add shell commands to variables

Allow variables to execute shell commands. Note, these are processed when
they are first seen while parsing the config file. This is useful if you
have the same config file used for multiple hosts (as they may be in a git
repository).

HOSTNAME := ${shell hostname}
DEFAULTS IF "${HOSTNAME}" == "frodo"

Link: https://lkml.kernel.org/r/20221207212944.277ee850@gandalf.local.home

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>


# f9869002 01-Jul-2020 Steven Rostedt (VMware) <rostedt@goodmis.org>

ktest.pl: Add MAIL_MAX_SIZE to limit the amount of log emailed

Add the ktest config option MAIL_MAX_SIZE that will limit the size of the
log file that is placed into the email on failure.

Link: https://lore.kernel.org/r/20200701231756.790637968@goodmis.org

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>


# d53cdda3 01-Jul-2020 Steven Rostedt (VMware) <rostedt@goodmis.org>

ktest.pl: Define PRE_TEST_DIE to kill the test if the PRE_TEST fails

Currently, if a PRE_TEST is defined and ran, but fails, there's nothing
currently available to make the test fail too. Add a PRE_TEST_DIE option that
when set, if a PRE_TEST is defined and fails, the test will die too.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>


# 791dc9d6 13-Nov-2019 Steven Rostedt (VMware) <rostedt@goodmis.org>

ktest: Make default build option oldconfig not randconfig

For the last time, I screwed up my ktest config file, and the build went
into the default "randconfig", blowing away the .config that I had set up.
The reason for the default randconfig was because when this was first
written, I wanted to do a bunch of randconfigs. But as time progressed,
ktest isn't about randconfig anymore, and because randconfig destroys the
config in the build directory, it's a dangerous default to have. Use
oldconfig as the default.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>


# afbac6c5 30-Sep-2019 Masanari Iida <standby24x7@gmail.com>

ktest: Fix some typos in sample.conf

This patch fixes some spelling typo in sample.conf

Link: http://lkml.kernel.org/r/20190930124925.20250-1-standby24x7@gmail.com

Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>


# d20f6b41 09-May-2019 Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>

ktest: update sample.conf for grub2bls

Update sample.conf for grub2bls

Link: http://lkml.kernel.org/r/20190509213647.6276-7-msys.mizuma@gmail.com

Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>


# 37e16773 18-Apr-2019 Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>

ktest: introduce REBOOT_RETURN_CODE to confirm the result of REBOOT

Unexpected power cycle occurs while the installation of the
kernel.

ssh root@Test sync ... [0 seconds] SUCCESS
ssh root@Test reboot ... [1 second] FAILED!
virsh destroy Test; sleep 5; virsh start Test ... [6 seconds] SUCCESS

That is because REBOOT, the default is "ssh $SSH_USER@$MACHINE
reboot", exits as 255 even if the reboot is successfully done,
like as:

]# ssh root@Test reboot
Connection to Test closed by remote host.
]# echo $?
255
]#

To avoid the unexpected power cycle, introduce a new parameter,
REBOOT_RETURN_CODE to judge whether REBOOT is successfully done
or not.

Link: http://lkml.kernel.org/r/20190418135943.12640-1-msys.mizuma@gmail.com

Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>


# c2d84ddb 07-Apr-2018 Steven Rostedt (VMware) <rostedt@goodmis.org>

ktest.pl: Add MAIL_COMMAND option to define how to send email

Allow the user to override the default way to send email. This will allow
the user to add their own mailer and format for sending email.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>


# be1546b8 06-Apr-2018 Steven Rostedt (VMware) <rostedt@goodmis.org>

ktest.pl: Add MAIL_PATH option to define where to find the mailer

The option MAIL_PATH lets the user decide how to find the mailer they are
using. For example, sendmail is usually located in /usr/sbin but is not
always in the path of non admin users. Have ktest look through the user's
PATH environment variable (adding /usr/sbin) as well, but if that's not good
enough, allow the user to define where to find the mailer.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

squash to mail exec

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>


# eaaa1e28 26-Mar-2018 Tim Tianyang Chen <tianyang.chen@oracle.com>

Ktest: add email options to sample.config

A block of email options is added under the optional config section.

Link: http://lkml.kernel.org/r/1522094884-22718-5-git-send-email-tianyang.chen@oracle.com

Suggested-by: Dhaval Giani <dhaval.giani@oracle.com>
Signed-off-by: Tim Tianyang Chen <tianyang.chen@oracle.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>


# 40667fb5 04-Apr-2018 Steven Rostedt (VMware) <rostedt@goodmis.org>

ktest.pl: Make finding config-bisect.pl dynamic

Just looking for config-bisect.pl in the source tree can be risky,
especially, if the source tree being tested doesn't have config-bisect.pl in
place. Instead, allow the user to set where to find config-bisect.pl with a
new option CONFIG_BISECT_EXEC.

If this option is not set, by default, ktest.pl will look for
config-bisect.pl in the following locations:

`pwd`/config-bisect.pl # where ktest.pl was called from
`dirname /path/to/ktest.pl`/config-bisect.pl # where ktest.pl exists
${BUILD_DIR}/tools/testing/ktest/config-bisect.pl
# where config-bisect.pl exists in the source tree.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>


# 6dd3791d 20-Mar-2018 Steven Rostedt (VMware) <rostedt@goodmis.org>

ktest: Comment about other names than just ktest.conf

ktest.pl will read any file as long as its name is specified as the first
argument on the command line. Comment this fact in sample.conf.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>


# edbd0ede 16-Jul-2017 Scott Wood <swood@redhat.com>

ktest: Clarify config file usage

Simply telling a new user to edit "the config file" without giving any
hints on where that file should go, what it should be named, or where
a template can be found, is not particularly helpful.

Link: http://lkml.kernel.org/r/20170717001630.10518-1-swood@redhat.com

Signed-off-by: Scott Wood <swood@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>


# 3e1d3678 21-Mar-2018 Steven Rostedt (VMware) <rostedt@goodmis.org>

ktest: Add CONNECT_TIMEOUT to change the connection timeout time

Before ktest issues a reboot, it will try to connect to the target machine
to make sure that it is still alive. If the target does not respond within 5
seconds, it will power cycle the box instead of issuing a reboot.

Five seconds may be too short, and ktest may unnecessarially power cycle the
box. I have found 25 seconds seems to be a better timeout for this purpose.
But even 25 may be too arbitrary. Add a CONNECT_TIMEOUT option to let the
user determine the timeout time before rebooting. By default, it has been
raised to 25 seconds.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>


# 23a0e161 19-Sep-2014 Steven Rostedt (Red Hat) <rostedt@goodmis.org>

ktest: Add PATCHCHECK_CHERRY

Add a way to run a patchcheck test on the commits that are in one branch
but not in another. This uses git cherry to find a list of commits to
test each one with.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 4c16b1d6 23-Apr-2014 Steven Rostedt (Red Hat) <rostedt@goodmis.org>

ktest: Update documentation on config_bisect

With the more robust config_bisect, the documentation is out of
date and needs to be updated.

The new rewrite allows for finding missing configs and such, and
is much more robust to use.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 961d9cac 18-Jan-2014 Steven Rostedt (Red Hat) <rostedt@goodmis.org>

ktest: Add BISECT_TRIES to bisect test

For those cases that it takes several tries to hit a bug, it would be
useful for ktest.pl to try a test multiple times before it considers
the test as a pass. To accomplish this, BISECT_TRIES ktest config
option has been added. It is default to one, as most of the time a
bisect only needs to try a test once. But the user can now up this
to make ktest run a given test multiple times. The first failure
that is detected will set a bisect bad. It only repeats on success.

Note, as with all race bugs, there's no guarantee that if it succeeds,
it is really a good bisect. But it helps in case the bug is somewhat
reliable.

You can set BISECT_TRIES to zero, and all tests will be considered
good, unless you also set BISECT_MANUAL.

Suggested-by: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 298a0d1d 03-Dec-2013 Steven Rostedt (Red Hat) <rostedt@goodmis.org>

ktest: Add documentation of CLOSE_CONSOLE_SIGNAL

The sample.conf file needs to document all available options.
With the new CLOSE_CONSOE_SIGNAL option, it too needs to be
document.

Cc: Satoru Takeuchi <satoru.takeuchi@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 4283b169 30-Jan-2013 Steven Rostedt (Red Hat) <rostedt@goodmis.org>

ktest: Add make_warnings_file and process full warnings

Although the patchcheck test checks for warnings in the files that were
changed, this check does not catch warnings that were caused by header
file changes and the warnings appear in C files not touched by the
commit.

Add a new option called WARNINGS_FILE. If this option is set, then the
file it points to is read before bulid, and the file should contain a
list of known warnings. If a warning appears in the build, this file is
checked, and if the warning does not exist in this file, then it fails
the build showing the new warning.

If the WARNINGS_FILE points to a file that does not exist, this will
cause any warning in the build to fail.

A new test is also added called "make_warnings_file". This test will
create do a build and record any warnings it finds into the
WARNINGS_FILE. This test is something that can be run before other tests
to build a warnings file of "known warnings", ie, warnings that were
there before your changes.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 7786954c 11-Dec-2012 Steven Rostedt <srostedt@redhat.com>

ktest: Add native support for syslinux boot loader

I installed Fedora 17 which no longer supports grub v1. I worked
with grub2 for a while, but there's so many issues with it and automated
rebooting, that I decided to switch to syslinux. Instead of using
the REBOOT_SCRIPT and add customized changes to get syslinux booted,
I thought it better to make ktest aware of syslinux and add options
to simplify the use of syslinux on a target test box.

Acked-by: H. Peter Anvin <hpa@zytor.com>
Cc: John 'Warthog9' Hawley <warthog9@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# a15ba913 13-Nov-2012 Steven Rostedt <srostedt@redhat.com>

ktest: Add support for grub2

As only grub or 'script' is supported for rebooting to a new kernel,
and Fedora 17 has dropped support for grub, I decided to add grub2
support as well (I also plan on adding syslinux/extlinux support too).

The options GRUB_FILE and GRUB_REBOOT were added to allow the user
to specify where to find the grub.cfg and what tool to use to reboot
into the next kernel respectively.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 407b95b7 19-Jul-2012 Steven Rostedt <srostedt@redhat.com>

ktest: Add MAX_MONITOR_WAIT option

If the console is constantly outputting content, this can cause ktest
to get stuck waiting on the monitor to settle down.

The option MAX_MONITOR_WAIT is the maximum time (in seconds) for ktest
to wait for the console to flush.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# b0918612 19-Jul-2012 Steven Rostedt <srostedt@redhat.com>

ktest: Add CONFIG_BISECT_CHECK option

The config-bisect can take a bad config and bisect it down to find out
what config actually breaks the config. But as all tests will apply a
minconfig (defined by a user) to apply before booting, it is possible
that the minconfig could actually make the bad config work (minconfigs
can disable configs). The end result is that the config bisect test will
not find a config that breaks. This can be rather frustrating to the
user.

The CONFIG_BISECT_CHECK option, when set to 1, will make sure that the
bad config (with the minconfig applied) still fails before trying to
bisect.

And yes, I did get burned by this.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# e5c2ec11 19-Jul-2012 Steven Rostedt <srostedt@redhat.com>

ktest: Add PRE_INSTALL option

Add the PRE_INSTALL option that will allow a user to specify a shell
command to be executed before the install operation executes.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 921ed4c7 19-Jul-2012 Steven Rostedt <srostedt@redhat.com>

ktest: Add PRE/POST_KTEST and TEST options

In order to let the user add commands before and after ktest runs, the
PRE_KTEST and POST_KTEST options are defined. They hold shell commands
that will execute befor ktest runs its first test, as well as when it
completed its last test.

The PRE_TEST and POST_TEST will be run befor and after (respectively)
for a given test. They can either be global (done for all tests) or
defined by a single test.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 11c38b75 16-Apr-2012 Jesper Juhl <jj@chaosbits.net>

ktest: Change singular "paranthesis" to plural "parentheses"

Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 43de3316 21-May-2012 Steven Rostedt <srostedt@redhat.com>

ktest: Add USE_OUTPUT_MIN_CONFIG to avoid prompt on make_min_config

If the file that OUTPUT_MIN_CONFIG exists then ktest.pl will prompt the
user and ask them if the OUTPUT_MIN_CONFIG should be used as the
starting point for make_min_config instead of MIN_CONFIG.

This is usually the case, and to allow the user to do so, which is
helpful if the user is creating different min configs based on tests,
and they know one is a superset of another test, they can set
USE_OUTPUT_MIN_CONFIG to one, which will prevent kest.pl from prompting
to use the OUTPUT_MIN_CONFIG and it will just use it.

If USE_OUTPUT_MIN_CONIFG is set to zero, then ktest.pl will continue to
use MIN_CONFIG instead.

The default is that USE_OUTPUT_MIN_CONFIG is undefined.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# ccc513b6 21-May-2012 Steven Rostedt <srostedt@redhat.com>

ktest: Add MIN_CONFIG_TYPE to allow making a minum .config that has network

Add a MIN_CONFIG_TYPE that can be set to 'test' or 'boot'. The default
is 'boot' which is what make_min_config has done previously: makes a
config file that is the minimum needed to boot the target.

But when MIN_CONFIG_TYPE is set to 'test', not only must the target
boot, but it must also successfully run the TEST. This allows the
creation of a config file that is the minimum to boot and also
perform ssh to the target, or anything else a developer wants.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 02ad2617 21-Mar-2012 Steven Rostedt <srostedt@redhat.com>

ktest: Add SCP_TO_TARGET_INSTALL option

Currently the option used to scp both the modules to the target as well
as the kernel image are the same (SCP_TO_TARGET). But some embedded
boards may require them to be different. The modules may need to be put
directly on the board, but the kernel image may need to go to a
tftpserver.

Add the option SCP_TO_TARGET_INSTALL that will allow the user to change
the config so that they may have the modules and image got to different
machines.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# be405f95 04-Jan-2012 Steven Rostedt <srostedt@redhat.com>

ktest: Add INGORE_ERRORS to ignore warnings in boot up

When testing a kernel that has warnings, ktest.pl will fail the test
when it sees the warning. If you need to test the the kernel and want
to ignore the errors that are produced, the option IGNORE_ERRORS has
been added. When IGNORE_ERRORS is set to something other than 0, it will
ignore call traces due to WARN_ON().

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 96f6a0df 22-Dec-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Still do reboot even for REBOOT_TYPE = script

The REBOOT_TYPE may be either grub or script, if it is script
it is expected that a REBOOT_SCRIPT is defined.

With the SWITCH_TO_TEST which is the complement of SWITCH_TO_GOOD,
which does basically the same thing as REBOOT_SCRIPT and but for
both grub and script, the REBOOT_SCRIPT does not need to be mandatory
anymore.

Do not require the REBOOT_SCRIPT and always run the reboot code
for both grub and script.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# d36b6910 29-Dec-2011 Al Viro <viro@zeniv.linux.org.uk>

misc latin1 to utf8 conversions

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 9cc9e091 22-Dec-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Detect typos in option names

It becomes quite annoying when you go to run a test and then
realize that you typed an option name wrong, and the test starts
doing the default action and not what you expected it to do.

It is even more annoying when you wake up the next day after
running the test over night when you discover this.

By testing if all options specified in a config file are
used by either ktest or were used in one of the option's values
we can see if there are any dangling options that were not used.
In such a case, show the user the options that were not used
and ask them if they want to continue or not.

The option IGNORE_UNUSED was also added to allow the user to
override this feature.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# bc7c5803 22-Dec-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add options SWITCH_TO_GOOD and SWITCH_TO_TEST

For machines that do no use grub, it may be needed to update an
external image (tftp) before doing a reboot into either the
test image or the known good image.

The option SWITCH_TO_GOOD is added, where if it is defined, the
command that is specified as its value will be executed before
doing a reboot into a known good image.

The option SWITCH_TO_TEST is added, where if it is defined, the
command that is specified as its value will be executed before
doing a reboot into the test image.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# c5dacb88 21-Dec-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Allow overriding bisect test results

When running the ktest git bisect test, if the BISECT_TYPE is "test",
the bisect is determined to be good or bad based off of the error
code of the test that is run. Currently, if the test returns 0,
it is considered a pass (good), a non-zero is considered a fail (bad).

But it has been requested to add more options, and also change
the meanings of the error codes of the test. For example, one may
want the test to detect if the commit is not good or bad,
(maybe the bisect came to a point where the code in question
does not exist). The test could report an error code that should tell
ktest to skip the commit.

Also, a test could detect that something is horribly wrong and the
biscet should just be aborted.

The new options:

BISECT_RET_GOOD
BISECT_RET_BAD
BISECT_RET_SKIP
BISECT_RET_ABORT
BISECT_RET_DEFAULT

have been added. The first 4 take an integer value that will
represent if the test should be considered a pass, fail, neither
good nor bad, or abort respectively.

The BISECT_RET_DEFAULT will bo whatever is not defined by the
above codes. If only BISECT_RET_DEFAULT is defined, then all tests
will do the default.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# de5b6e3b 18-Nov-2011 Rabin Vincent <rabin@rab.in>

ktest: Allow success logs to be stored

Add a STORE_SUCCESSES option, to allow success logs to be stored, for
example to double-check or otherwise post-process the test logs.

Link: http://lkml.kernel.org/r/1321616131-21352-3-git-send-email-rabin@rab.in

Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 8d735212 17-Oct-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add processing of complex conditionals

The IF statements for DEFAULTS and TEST_START sections now handle
complex statements (&&,||)

Example:

TEST_START IF (DEFINED ALL_TESTS || ${MYTEST} == boottest) && ${MACHINE} == gandalf

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 9900b5dc 30-Sep-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add DEFINED keyword for IF statements

Have IF statements process if a config variable or option has been
defined or not. Can use NOT DEFINED in the case for telling if
a variable or option has not been defined.

DEFAULTS IF NOT DEFINED SSH_USER
SSH_USER = root

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 3d1cc414 30-Sep-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add OVERRIDE keyword to DEFAULTS section

The OVERRIDE keyword will allow options defined in the given
DEFAULTS section to override options defined in previous DEFAULT
sections.

Normally, options will error if they were previous defined.
The OVERRIDE keyword allows options that have been previously
defined to be changed in the given section.

Note, the same option can not be defined in the same DEFAULT section
even if that section is marked as OVERRIDE.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 2ed3b161 30-Sep-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add INCLUDE keyword to include other config files

Have the reading of the config file allow reading of other config
files using the INCLUDE keyword. This allows multiple config files
to share config options.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# ab7a3f52 30-Sep-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Let IF keyword take comparisons

Allow ==, !=, <=, >=, <, and > to be used in IF statements
to compare if a section should be processed or not.

For example:

BITS := 32

DEFAULTS IF ${BITS} == 32
MIN_CONFIG = ${CONFIG_DIR}/config-32
ELSE
MIN_CONFIG = ${CONFIG_DIR}/config-64

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 45d73a5d 30-Sep-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add IF and ELSE to config sections

Add IF keyword to sections within the config. Also added an ELSE
keyword that allows different config options to be set for a given
section.

For example:

TYPE := 1
STATUS := 0

DEFAULTS IF ${TYPE}
[...]
ELSE IF ${STATUS}
[...]
ELSE
[...]

The above will process the first section as $TYPE is true. If it
was false, it would process the last section as $STATUS is false.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 2b803365 30-Sep-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add option REBOOT_SUCCESS_LINE to stop waiting after a reboot

When ktest.pl reboots, it will usuall wait SLEEP_TIME seconds of idle
console before starting the next test. By setting the
REBOOT_SUCCESS_LINE, ktest will not wait SLEEP_TIME when it detects the
line while rebooting to a new kernel.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# e0a8742e 30-Sep-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add NO_INSTALL option to not install for a test

There's cases where running the same kernel over and over again
is useful, and being able to not install the same kernel can
save time between tests.

Add a NO_INSTALL option that tells ktest.pl to not install the
new kernel.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# cd8e368f 18-Aug-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add TEST_TYPE install option

In testing one of my boxes, I found that I only wanted to build and
install the kernel. I wanted to manually reboot the box and test it.
Adding a TEST_TYPE option "install" allows this to happen.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 35ce5952 15-Jul-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add prompt to use OUTPUT_MIN_CONFIG

If the defined OUTPUT_MIN_CONFIG in the make_min_config test exists,
then give a prompt to ask the user if they want to use that config
instead, as it is very often the case, especially when the test has been
interrupted. The OUTPUT_MIN_CONFIG is usually the config that one wants
to use to continue the test where they left off.

But if START_MIN_CONFIG is defined (thus the MIN_CONFIG is not the
default), then do not prompt, as it will be annoying if the user has
this as one of many tests, and the test pauses waiting for input, while
the user is sleeping.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# b9066f6c 15-Jul-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Use Kconfig dependencies to shorten time to make min_config

To save time, the test does not just grab any option and test
it. The Kconfig files are examined to determine the dependencies
of the configs. If a config is chosen that depends on another
config, that config will be checked first. By checking the
parents first, we can eliminate whole groups of configs that
may have been enabled.

For example, if a USB device config is chosen and depends on
CONFIG_USB, the CONFIG_USB will be tested before the device.
If CONFIG_USB is found not to be needed, it, as well as all
configs that depend on it, will be disabled and removed from
the current min_config.

Note, the code from streamline_config (make localmodconfig)
was copied and used to find the dependencies in the Kconfig file.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 4c4ab120 15-Jul-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add test type make_min_config

After doing a make localyesconfig, your kernel configuration may
not be the most useful minimum configuration. Having a true minimum
config that you can use against other configs is very useful if
someone else has a config that breaks on your code. By only forcing
those configurations that are truly required to boot your machine
will give you less of a chance that one of your set configurations
will make the bug go away. This will give you a better chance to
be able to reproduce the reported bug matching the broken config.

Note, this does take some time, and may require you to run the
test over night, or perhaps over the weekend. But it also allows
you to interrupt it, and gives you the current minimum config
that was found till that time.

Note, this test automatically assumes a BUILD_TYPE of oldconfig
and its test type acts like boot.

TODO: add a test version that makes the config do more than just
boot, like having network access.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 1990207d 14-Jun-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add IGNORE_WARNINGS to ignore warnings in some patches

Doing a patchcheck test, there may be warnings that gcc produces which
may be OK, and the test should not fail on that commit. By adding a
IGNORE_WARNINGS option to list a space delimited SHA1s that are ignored
lets the user avoid having the test fail on certain commits.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 48920630 14-Jun-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Have the testing tmp dir include machine name

As multiple tests may be executed by the same server, have the test
machine name add uniqueness to the value of the temp directory.
Otherwise the temp directories may overwrite each other's tests.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 0bd6c1a3 14-Jun-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add POST/PRE_BUILD options

There are some cases that a patch may be needed to apply to the kernel
in patchcheck or bisect tests. Adding a PRE_BUILD option to apply the
patch and POST_BUILD to remove it, allows for this to be done easily.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 9064af52 13-Jun-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add TEST_NAME option

Searching through several tests, it gets confusing which test result
is for which test. By adding the TEST_NAME option, the user can tell
which test result belongs to which test.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 30f75da5 13-Jun-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add CONFIG_BISECT_GOOD option

Currently the config_bisect compares the min config with the
CONFIG_BISECT config. There may be another config that we know
is good that we want to ignore configs on. By passing in this
config it will ignore the options that are set in the good config.

Note: This only ignores the config, it does not (yet) handle
options that are different between the two configs. If the good
config has "SLAB" set and the bad config has "SLUB" it will not
find the bug if the bug had to do with changing these two options.

This is something that I intend to implement in the future.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# f1a5b962 13-Jun-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add detection of triple faults

When a triple fault happens in a test, no call trace nor panic
is displayed. Instead, the system reboots to the good kernel.
Since the good kernel may display a boot prompt that matches the
success string, ktest may think that the test succeeded, when it
did not.

Detecting triple faults is tricky because it is hard to generalize
what a reboot looks like. The best that we can come up with for now
is to examine the Linux banner. If we detect that the Linux banner
matches the test we want to test, then look to see if we hit another
Linux banner with a different kernel is booted. This can be assumed
to be a triple fault.

We can't just check for two Linux banners because things like
early printk may cause the Linux banner to be displayed twice. Checking
for different kernel versions should be the safe bet.

If this for some reason detects a false triple boot. A new ktest
config option is also created:

DETECT_TRIPLE_FAULT

This can be set to 0 to disable this checking.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 2a62512b 20-May-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Allow options to be used by other options

There are cases where one ktest option may be used within another
ktest option. Allow them to be reused just like config variables
but there are evaluated at time of test not config processing time.

Thus having something like:

MAKE_CMD = make ARCH=${ARCH}

TEST_START
ARCH = powerpc

TEST_START
ARCH = arm

Will have the arch defined for each test iteration.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 77d942ce 20-May-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Create variables for the ktest config files

I found that I constantly reuse information for each test case.
It would be nice to just define a variable to reuse.

For example I may have:

TEST_START
[...]
TEST = ssh root@mybox /path/to/my/script

TEST_START
[...]
TEST = ssh root@mybox /path/to/my/script

[etc]

The issue is, I may wont to change that script or one of the other
fields. Then I need to update each line individually.

With the addition of config variables (variables only used during parsing
the config) we can simplify the config files. These variables can
also be defined multiple times and each time the new value will
overwrite the old value.

The convention to use a config variable over a ktest option is to use :=
instead of =.

Now we could do:

USER := root
TARGET := mybox
TEST_SCRIPT := /path/to/my/script
TEST_CASE := ${USER}@${TARGET} ${TEST_SCRIPT}

TEST_START
[...]
TEST = ${TEST_CASE}

TEST_START
[...]
TEST = ${TEST_CASE}

[etc]

Now we just need to update the variables at the top.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 27d934b2 20-May-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Reboot after each patchcheck run

The patches being checked may not leave the kernel in a state
that the next run will allow the new kernel to be copied to the
machine. Reboot to a known good kernel before continuing to the
next kernel to test.

Added option PATCHCHECK_SLEEP_TIME for the max time to sleep between
patchcheck reboots.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 2d01b26a 08-Mar-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add STOP_TEST_AFTER to stop the test after a period of time

Currently, if a test causes constant output but never reaches a
boot prompt, or crashes, the test will never stop. Add STOP_TEST_AFTER
to create a variable that will stop (and fail) the test after it has run
for this amount of time. The default is 10 minutes. Setting this
variable to -1 will disable it.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 3410f6fd 08-Mar-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add BISECT_FILES to run git bisect on paths

Add the config option BISECT_FILES that allows the user to
specify what path in the kernel to run the git bisect on.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# c23dca7c 08-Mar-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add BISECT_SKIP

If a during a git bisect, ktest fails on something other than
what it is testing (if BISECT_TYPE is test but it fails on build),
if BISECT_SKIP is set, then it will do a "git bisect skip" instead
of just failing the bisect and letting the user find a good commit
to test.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# c960bb9f 08-Mar-2011 Steven Rostedt <srostedt@redhat.com>

ktest: Add manual bisect

For both git bisect and config bisect, if BISECT_MANUAL is set to 1,
then bisect will stop between iterations and ask the user for the
result. The actual result is ignored. This makes it possible to
use ktest.pl for bisecting configs and git and let the user examine
the results themselves and enter their own results.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 1c8a617a 08-Nov-2010 Steven Rostedt <srostedt@redhat.com>

ktest: Added force stop after success and failure

Added the options STOP_AFTER_SUCCESS and STOP_AFTER_FAILURE to
allow the user to give a time (in seconds) to stop the monitor
after a stack trace or login has been detected. Sometimes the
kernel constantly prints out to the console and this may cause
the test to run indefinitely.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# d1fbd7e6 08-Nov-2010 Steven Rostedt <srostedt@redhat.com>

ktest: Updated the sample.conf for the latest options

Added documentation for SSH_EXEC, SCP_TO_TARGET, REBOOT,
and CONFIG_BISECT and friends.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# dc895688 02-Nov-2010 Steven Rostedt <srostedt@redhat.com>

ktest: Update the sample config file with more documentation

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# a57419b3 02-Nov-2010 Steven Rostedt <srostedt@redhat.com>

ktest: New TEST_START instead of using [], and use real SHA1s

Change the config to use TEST_START where the options after a
TEST_START automatically get the [] as it is read and they do
not need to exist in the config file;

TEST_START
MIN_CONFIG = myconfig

is the same as

MIN_CONFIG[1] = myconfig

The benefit is that you no longer need to keep track of test numbers
with tests.

Also process the commit ids that are passed to the options
to get the actually SHA1 so it is no longer relative to the branch.
Ie, saying HEAD will get the current SHA1 and then that will
be used, and will work even if another branch is checked out.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 576f627c 02-Nov-2010 Steven Rostedt <srostedt@redhat.com>

ktest: Add poweroff after halt and powercycle after reboot

Added the options POWEROFF_AFTER_HALT to handle boxes that do not
really shut off after a halt is called.

Added POWERCYCLE_AFTER_REBOOT to force a power cycle for boxes that
don't reboot but get stuck during the reboot.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 8b37ca8c 02-Nov-2010 Steven Rostedt <srostedt@redhat.com>

ktest: Add POST_INSTALL to allow initrds to be created

Add a POST_INSTALL option that runs after the build and install
but before rebooting to the test kernel. This alls the user to
run a script that will install an initrd (or anything else that may
be special) before booting.

An environment variable KERNEL_VERSION is set.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# a75fecec 02-Nov-2010 Steven Rostedt <srostedt@redhat.com>

ktest: Added sample.conf, new %default option format

Added sample.conf as a nice document to show new users.

Use a %default hash to separate out the options that are default
and allow us to complain about options being set twice.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>