xref: /OK3568_Linux_fs/kernel/tools/testing/ktest/examples/kvm.conf (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun#
2*4882a593Smuzhiyun# This config is an example usage of ktest.pl with a kvm guest
3*4882a593Smuzhiyun#
4*4882a593Smuzhiyun# The guest is called 'Guest' and this would be something that
5*4882a593Smuzhiyun# could be run on the host to test a virtual machine target.
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunMACHINE = Guest
8*4882a593Smuzhiyun
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun# Use virsh to read the serial console of the guest
11*4882a593SmuzhiyunCONSOLE =  virsh console ${MACHINE}
12*4882a593Smuzhiyun
13*4882a593Smuzhiyun# Use SIGKILL to terminate virsh console. We can't kill virsh console
14*4882a593Smuzhiyun# by the default signal, SIGINT.
15*4882a593SmuzhiyunCLOSE_CONSOLE_SIGNAL = KILL
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun#*************************************#
18*4882a593Smuzhiyun# This part is the same as test.conf  #
19*4882a593Smuzhiyun#*************************************#
20*4882a593Smuzhiyun
21*4882a593Smuzhiyun# The include files will set up the type of test to run. Just set TEST to
22*4882a593Smuzhiyun# which test you want to run.
23*4882a593Smuzhiyun#
24*4882a593Smuzhiyun# TESTS = patchcheck, randconfig, boot, test, config-bisect, bisect, min-config
25*4882a593Smuzhiyun#
26*4882a593Smuzhiyun# See the include/*.conf files that define these tests
27*4882a593Smuzhiyun#
28*4882a593SmuzhiyunTEST := patchcheck
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun# Some tests may have more than one test to run. Define MULTI := 1 to run
31*4882a593Smuzhiyun# the extra tests.
32*4882a593SmuzhiyunMULTI := 0
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun# In case you want to differentiate which type of system you are testing
35*4882a593SmuzhiyunBITS := 64
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun# REBOOT = none, error, fail, empty
38*4882a593Smuzhiyun#  See include/defaults.conf
39*4882a593SmuzhiyunREBOOT := empty
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun
42*4882a593Smuzhiyun# The defaults file will set up various settings that can be used by all
43*4882a593Smuzhiyun# machine configs.
44*4882a593SmuzhiyunINCLUDE include/defaults.conf
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun#*************************************#
48*4882a593Smuzhiyun# Now we are different from test.conf #
49*4882a593Smuzhiyun#*************************************#
50*4882a593Smuzhiyun
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun# The example here assumes that Guest is running a Fedora release
53*4882a593Smuzhiyun# that uses dracut for its initfs. The POST_INSTALL will be executed
54*4882a593Smuzhiyun# after the install of the kernel and modules are complete.
55*4882a593Smuzhiyun#
56*4882a593SmuzhiyunPOST_INSTALL = ${SSH} /sbin/dracut -f /boot/initramfs-test.img $KERNEL_VERSION
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun# Guests sometimes get stuck on reboot. We wait 3 seconds after running
59*4882a593Smuzhiyun# the reboot command and then  do a full power-cycle of the guest.
60*4882a593Smuzhiyun# This forces the guest to restart.
61*4882a593Smuzhiyun#
62*4882a593SmuzhiyunPOWERCYCLE_AFTER_REBOOT = 3
63*4882a593Smuzhiyun
64*4882a593Smuzhiyun# We do the same after the halt command, but this time we wait 20 seconds.
65*4882a593SmuzhiyunPOWEROFF_AFTER_HALT = 20
66*4882a593Smuzhiyun
67*4882a593Smuzhiyun
68*4882a593Smuzhiyun# As the defaults.conf file has a POWER_CYCLE option already defined,
69*4882a593Smuzhiyun# and options can not be defined in the same section more than once
70*4882a593Smuzhiyun# (all DEFAULTS sections are considered the same). We use the
71*4882a593Smuzhiyun# DEFAULTS OVERRIDE to tell ktest.pl to ignore the previous defined
72*4882a593Smuzhiyun# options, for the options set in the OVERRIDE section.
73*4882a593Smuzhiyun#
74*4882a593SmuzhiyunDEFAULTS OVERRIDE
75*4882a593Smuzhiyun
76*4882a593Smuzhiyun# Instead of using the default POWER_CYCLE option defined in
77*4882a593Smuzhiyun# defaults.conf, we use virsh to cycle it. To do so, we destroy
78*4882a593Smuzhiyun# the guest, wait 5 seconds, and then start it up again.
79*4882a593Smuzhiyun# Crude, but effective.
80*4882a593Smuzhiyun#
81*4882a593SmuzhiyunPOWER_CYCLE = virsh destroy ${MACHINE}; sleep 5; virsh start ${MACHINE}
82*4882a593Smuzhiyun
83*4882a593Smuzhiyun
84*4882a593SmuzhiyunDEFAULTS
85*4882a593Smuzhiyun
86*4882a593Smuzhiyun# The following files each handle a different test case.
87*4882a593Smuzhiyun# Having them included allows you to set up more than one machine and share
88*4882a593Smuzhiyun# the same tests.
89*4882a593SmuzhiyunINCLUDE include/patchcheck.conf
90*4882a593SmuzhiyunINCLUDE include/tests.conf
91*4882a593SmuzhiyunINCLUDE include/bisect.conf
92*4882a593SmuzhiyunINCLUDE include/min-config.conf
93