18c2ecf20Sopenharmony_ci# 28c2ecf20Sopenharmony_ci# This config is an example usage of ktest.pl with a kvm guest 38c2ecf20Sopenharmony_ci# 48c2ecf20Sopenharmony_ci# The guest is called 'Guest' and this would be something that 58c2ecf20Sopenharmony_ci# could be run on the host to test a virtual machine target. 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ciMACHINE = Guest 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci# Use virsh to read the serial console of the guest 118c2ecf20Sopenharmony_ciCONSOLE = virsh console ${MACHINE} 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci# Use SIGKILL to terminate virsh console. We can't kill virsh console 148c2ecf20Sopenharmony_ci# by the default signal, SIGINT. 158c2ecf20Sopenharmony_ciCLOSE_CONSOLE_SIGNAL = KILL 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci#*************************************# 188c2ecf20Sopenharmony_ci# This part is the same as test.conf # 198c2ecf20Sopenharmony_ci#*************************************# 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci# The include files will set up the type of test to run. Just set TEST to 228c2ecf20Sopenharmony_ci# which test you want to run. 238c2ecf20Sopenharmony_ci# 248c2ecf20Sopenharmony_ci# TESTS = patchcheck, randconfig, boot, test, config-bisect, bisect, min-config 258c2ecf20Sopenharmony_ci# 268c2ecf20Sopenharmony_ci# See the include/*.conf files that define these tests 278c2ecf20Sopenharmony_ci# 288c2ecf20Sopenharmony_ciTEST := patchcheck 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci# Some tests may have more than one test to run. Define MULTI := 1 to run 318c2ecf20Sopenharmony_ci# the extra tests. 328c2ecf20Sopenharmony_ciMULTI := 0 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci# In case you want to differentiate which type of system you are testing 358c2ecf20Sopenharmony_ciBITS := 64 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci# REBOOT = none, error, fail, empty 388c2ecf20Sopenharmony_ci# See include/defaults.conf 398c2ecf20Sopenharmony_ciREBOOT := empty 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ci# The defaults file will set up various settings that can be used by all 438c2ecf20Sopenharmony_ci# machine configs. 448c2ecf20Sopenharmony_ciINCLUDE include/defaults.conf 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ci#*************************************# 488c2ecf20Sopenharmony_ci# Now we are different from test.conf # 498c2ecf20Sopenharmony_ci#*************************************# 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci# The example here assumes that Guest is running a Fedora release 538c2ecf20Sopenharmony_ci# that uses dracut for its initfs. The POST_INSTALL will be executed 548c2ecf20Sopenharmony_ci# after the install of the kernel and modules are complete. 558c2ecf20Sopenharmony_ci# 568c2ecf20Sopenharmony_ciPOST_INSTALL = ${SSH} /sbin/dracut -f /boot/initramfs-test.img $KERNEL_VERSION 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci# Guests sometimes get stuck on reboot. We wait 3 seconds after running 598c2ecf20Sopenharmony_ci# the reboot command and then do a full power-cycle of the guest. 608c2ecf20Sopenharmony_ci# This forces the guest to restart. 618c2ecf20Sopenharmony_ci# 628c2ecf20Sopenharmony_ciPOWERCYCLE_AFTER_REBOOT = 3 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci# We do the same after the halt command, but this time we wait 20 seconds. 658c2ecf20Sopenharmony_ciPOWEROFF_AFTER_HALT = 20 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_ci# As the defaults.conf file has a POWER_CYCLE option already defined, 698c2ecf20Sopenharmony_ci# and options can not be defined in the same section more than once 708c2ecf20Sopenharmony_ci# (all DEFAULTS sections are considered the same). We use the 718c2ecf20Sopenharmony_ci# DEFAULTS OVERRIDE to tell ktest.pl to ignore the previous defined 728c2ecf20Sopenharmony_ci# options, for the options set in the OVERRIDE section. 738c2ecf20Sopenharmony_ci# 748c2ecf20Sopenharmony_ciDEFAULTS OVERRIDE 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_ci# Instead of using the default POWER_CYCLE option defined in 778c2ecf20Sopenharmony_ci# defaults.conf, we use virsh to cycle it. To do so, we destroy 788c2ecf20Sopenharmony_ci# the guest, wait 5 seconds, and then start it up again. 798c2ecf20Sopenharmony_ci# Crude, but effective. 808c2ecf20Sopenharmony_ci# 818c2ecf20Sopenharmony_ciPOWER_CYCLE = virsh destroy ${MACHINE}; sleep 5; virsh start ${MACHINE} 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_ciDEFAULTS 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ci# The following files each handle a different test case. 878c2ecf20Sopenharmony_ci# Having them included allows you to set up more than one machine and share 888c2ecf20Sopenharmony_ci# the same tests. 898c2ecf20Sopenharmony_ciINCLUDE include/patchcheck.conf 908c2ecf20Sopenharmony_ciINCLUDE include/tests.conf 918c2ecf20Sopenharmony_ciINCLUDE include/bisect.conf 928c2ecf20Sopenharmony_ciINCLUDE include/min-config.conf 93