xref: /openbmc/linux/tools/testing/ktest/examples/include/bisect.conf (revision e5451c8f8330e03ad3cfa16048b4daf961af434f)
1*6d76f469SSteven Rostedt#
2*6d76f469SSteven Rostedt# This example shows the bisect tests (git bisect and config bisect)
3*6d76f469SSteven Rostedt#
4*6d76f469SSteven Rostedt
5*6d76f469SSteven Rostedt
6*6d76f469SSteven Rostedt# The config that includes this file may define a RUN_TEST
7*6d76f469SSteven Rostedt# variable that will tell this config what test to run.
8*6d76f469SSteven Rostedt# (what to set the TEST option to).
9*6d76f469SSteven Rostedt#
10*6d76f469SSteven RostedtDEFAULTS IF NOT DEFINED RUN_TEST
11*6d76f469SSteven Rostedt# Requires that hackbench is in the PATH
12*6d76f469SSteven RostedtRUN_TEST := ${SSH} hackbench 50
13*6d76f469SSteven Rostedt
14*6d76f469SSteven Rostedt
15*6d76f469SSteven Rostedt# Set TEST to 'bisect' to do a normal git bisect. You need
16*6d76f469SSteven Rostedt# to modify the options below to make it bisect the exact
17*6d76f469SSteven Rostedt# commits you are interested in.
18*6d76f469SSteven Rostedt#
19*6d76f469SSteven RostedtTEST_START IF ${TEST} == bisect
20*6d76f469SSteven RostedtTEST_TYPE = bisect
21*6d76f469SSteven Rostedt# You must set the commit that was considered good (git bisect good)
22*6d76f469SSteven RostedtBISECT_GOOD = v3.3
23*6d76f469SSteven Rostedt# You must set the commit that was considered bad (git bisect bad)
24*6d76f469SSteven RostedtBISECT_BAD = HEAD
25*6d76f469SSteven Rostedt# It's best to specify the branch to checkout before starting the bisect.
26*6d76f469SSteven RostedtCHECKOUT = origin/master
27*6d76f469SSteven Rostedt# This can be build, boot, or test. Here we are doing a bisect
28*6d76f469SSteven Rostedt# that requires to run a test to know if the bisect was good or bad.
29*6d76f469SSteven Rostedt# The test should exit with 0 on good, non-zero for bad. But see
30*6d76f469SSteven Rostedt# the BISECT_RET_* options in samples.conf to override this.
31*6d76f469SSteven RostedtBISECT_TYPE = test
32*6d76f469SSteven RostedtTEST = ${RUN_TEST}
33*6d76f469SSteven Rostedt# It is usually a good idea to confirm that the GOOD and the BAD
34*6d76f469SSteven Rostedt# commits are truly good and bad respectively. Having BISECT_CHECK
35*6d76f469SSteven Rostedt# set to 1 will check both that the good commit works and the bad
36*6d76f469SSteven Rostedt# commit fails. If you only want to check one or the other,
37*6d76f469SSteven Rostedt# set BISECT_CHECK to 'good' or to 'bad'.
38*6d76f469SSteven RostedtBISECT_CHECK = 1
39*6d76f469SSteven Rostedt#BISECT_CHECK = good
40*6d76f469SSteven Rostedt#BISECT_CHECK = bad
41*6d76f469SSteven Rostedt
42*6d76f469SSteven Rostedt# Usually it's a good idea to specify the exact config you
43*6d76f469SSteven Rostedt# want to use throughout the entire bisect. Here we placed
44*6d76f469SSteven Rostedt# it in the directory we called ktest.pl from and named it
45*6d76f469SSteven Rostedt# 'config-bisect'.
46*6d76f469SSteven RostedtMIN_CONFIG = ${THIS_DIR}/config-bisect
47*6d76f469SSteven Rostedt# By default, if we are doing a BISECT_TYPE = test run but the
48*6d76f469SSteven Rostedt# build or boot fails, ktest.pl will do a 'git bisect skip'.
49*6d76f469SSteven Rostedt# Uncomment the below option to make ktest stop testing on such
50*6d76f469SSteven Rostedt# an error.
51*6d76f469SSteven Rostedt#BISECT_SKIP = 0
52*6d76f469SSteven Rostedt# Now if you had BISECT_SKIP = 0 and the test fails, you can
53*6d76f469SSteven Rostedt# examine what happened and then do 'git bisect log > /tmp/replay'
54*6d76f469SSteven Rostedt# Set BISECT_REPLAY to /tmp/replay and ktest.pl will run the
55*6d76f469SSteven Rostedt# 'git bisect replay /tmp/replay' before continuing the bisect test.
56*6d76f469SSteven Rostedt#BISECT_REPLAY = /tmp/replay
57*6d76f469SSteven Rostedt# If you used BISECT_REPLAY after the bisect test failed, you may
58*6d76f469SSteven Rostedt# not want to continue the bisect on that commit that failed.
59*6d76f469SSteven Rostedt# By setting BISECT_START to a new commit. ktest.pl will checkout
60*6d76f469SSteven Rostedt# that commit after it has performed the 'git bisect replay' but
61*6d76f469SSteven Rostedt# before it continues running the bisect test.
62*6d76f469SSteven Rostedt#BISECT_START = 2545eb6198e7e1ec50daa0cfc64a4cdfecf24ec9
63*6d76f469SSteven Rostedt
64*6d76f469SSteven Rostedt# Now if you don't trust ktest.pl to make the decisions for you, then
65*6d76f469SSteven Rostedt# set BISECT_MANUAL to 1. This will cause ktest.pl not to decide
66*6d76f469SSteven Rostedt# if the commit was good or bad. Instead, it will ask you to tell
67*6d76f469SSteven Rostedt# it if the current commit was good. In the mean time, you could
68*6d76f469SSteven Rostedt# take the result, load it on any machine you want. Run several tests,
69*6d76f469SSteven Rostedt# or whatever you feel like. Then, when you are happy, you can tell
70*6d76f469SSteven Rostedt# ktest if you think it was good or not and ktest.pl will continue
71*6d76f469SSteven Rostedt# the git bisect. You can even change what commit it is currently at.
72*6d76f469SSteven Rostedt#BISECT_MANUAL = 1
73*6d76f469SSteven Rostedt
74*6d76f469SSteven Rostedt
75*6d76f469SSteven Rostedt# One of the unique tests that ktest does is the config bisect.
76*6d76f469SSteven Rostedt# Currently (which hopefully will be fixed soon), the bad config
77*6d76f469SSteven Rostedt# must be a superset of the good config. This is because it only
78*6d76f469SSteven Rostedt# searches for a config that causes the target to fail. If the
79*6d76f469SSteven Rostedt# good config is not a subset of the bad config, or if the target
80*6d76f469SSteven Rostedt# fails because of a lack of a config, then it will not find
81*6d76f469SSteven Rostedt# the config for you.
82*6d76f469SSteven RostedtTEST_START IF ${TEST} == config-bisect
83*6d76f469SSteven RostedtTEST_TYPE = config_bisect
84*6d76f469SSteven Rostedt# set to build, boot, test
85*6d76f469SSteven RostedtCONFIG_BISECT_TYPE = boot
86*6d76f469SSteven Rostedt# Set the config that is considered bad.
87*6d76f469SSteven RostedtCONFIG_BISECT = ${THIS_DIR}/config-bad
88*6d76f469SSteven Rostedt# This config is optional. By default it uses the
89*6d76f469SSteven Rostedt# MIN_CONFIG as the good config.
90*6d76f469SSteven RostedtCONFIG_BISECT_GOOD = ${THIS_DIR}/config-good
91