1*2676eb4bSJohn 'Warthog9' Hawley (VMware)#
2*2676eb4bSJohn 'Warthog9' Hawley (VMware)# This config is an example usage of ktest.pl with a vmware guest
3*2676eb4bSJohn 'Warthog9' Hawley (VMware)#
4*2676eb4bSJohn 'Warthog9' Hawley (VMware)# VMware Setup:
5*2676eb4bSJohn 'Warthog9' Hawley (VMware)# -------------
6*2676eb4bSJohn 'Warthog9' Hawley (VMware)# - Edit the Virtual Machine ("Edit virtual machine settings")
7*2676eb4bSJohn 'Warthog9' Hawley (VMware)# - Add a Serial Port
8*2676eb4bSJohn 'Warthog9' Hawley (VMware)#   - You almost certainly want it set "Connect at power on"
9*2676eb4bSJohn 'Warthog9' Hawley (VMware)#   - Select "Use socket (named pipe)"
10*2676eb4bSJohn 'Warthog9' Hawley (VMware)#   - Select a name that you'll recognize, like 'ktestserialpipe'
11*2676eb4bSJohn 'Warthog9' Hawley (VMware)#   - From: Server
12*2676eb4bSJohn 'Warthog9' Hawley (VMware)#   - To: A Virtual Machine
13*2676eb4bSJohn 'Warthog9' Hawley (VMware)#   - Save
14*2676eb4bSJohn 'Warthog9' Hawley (VMware)# - Make sure you note the name, it will be in the base directory of the
15*2676eb4bSJohn 'Warthog9' Hawley (VMware)#   virtual machine (where the "disks" are stored.  The default
16*2676eb4bSJohn 'Warthog9' Hawley (VMware)#   is /var/lib/vmware/<virtual machine name>/<the name you entered above>
17*2676eb4bSJohn 'Warthog9' Hawley (VMware)#
18*2676eb4bSJohn 'Warthog9' Hawley (VMware)# - Make note of the path to the VM
19*2676eb4bSJohn 'Warthog9' Hawley (VMware)# </End VMware setup>
20*2676eb4bSJohn 'Warthog9' Hawley (VMware)#
21*2676eb4bSJohn 'Warthog9' Hawley (VMware)# The guest is called 'Guest' and this would be something that
22*2676eb4bSJohn 'Warthog9' Hawley (VMware)# could be run on the host to test a virtual machine target.
23*2676eb4bSJohn 'Warthog9' Hawley (VMware)
24*2676eb4bSJohn 'Warthog9' Hawley (VMware)MACHINE = Guest
25*2676eb4bSJohn 'Warthog9' Hawley (VMware)
26*2676eb4bSJohn 'Warthog9' Hawley (VMware)# Name of the serial pipe you set in the VMware settings
27*2676eb4bSJohn 'Warthog9' Hawley (VMware)VMWARE_SERIAL_NAME = <the name you entered above>
28*2676eb4bSJohn 'Warthog9' Hawley (VMware)
29*2676eb4bSJohn 'Warthog9' Hawley (VMware)# Define a variable of the name of the VM
30*2676eb4bSJohn 'Warthog9' Hawley (VMware)# Noting this needs to be the name of the kmx file, and usually, the
31*2676eb4bSJohn 'Warthog9' Hawley (VMware)# name of the directory that it's in.  If the directory and name
32*2676eb4bSJohn 'Warthog9' Hawley (VMware)# differ change the VMWARE_VM_DIR accordingly.
33*2676eb4bSJohn 'Warthog9' Hawley (VMware)# Please ommit the .kmx extension
34*2676eb4bSJohn 'Warthog9' Hawley (VMware)VMWARE_VM_NAME = <virtual machine name>
35*2676eb4bSJohn 'Warthog9' Hawley (VMware)
36*2676eb4bSJohn 'Warthog9' Hawley (VMware)# VM dir name.  This is usually the same as the virtual machine's name,
37*2676eb4bSJohn 'Warthog9' Hawley (VMware)# but not always the case.  Change if they differ
38*2676eb4bSJohn 'Warthog9' Hawley (VMware)VMWARE_VM_DIR = ${VMWARE_VM_NAME}
39*2676eb4bSJohn 'Warthog9' Hawley (VMware)
40*2676eb4bSJohn 'Warthog9' Hawley (VMware)# Base directory that the Virtual machine is contained in
41*2676eb4bSJohn 'Warthog9' Hawley (VMware)# /var/lib/vmware is the default on Linux
42*2676eb4bSJohn 'Warthog9' Hawley (VMware)VMWARE_VM_BASE_DIR = /var/lib/vmware/${VMWARE_VM_DIR}
43*2676eb4bSJohn 'Warthog9' Hawley (VMware)
44*2676eb4bSJohn 'Warthog9' Hawley (VMware)# Use ncat to read the unix pipe.  Anything that can read the Unix Pipe
45*2676eb4bSJohn 'Warthog9' Hawley (VMware)# and output it's contents to stdout will work
46*2676eb4bSJohn 'Warthog9' Hawley (VMware)CONSOLE = /usr/bin/ncat -U ${VMWARE_VM_BASE_DIR}/${VMWARE_SERIAL_NAME}
47*2676eb4bSJohn 'Warthog9' Hawley (VMware)
48*2676eb4bSJohn 'Warthog9' Hawley (VMware)# Define what version of Workstation you are using
49*2676eb4bSJohn 'Warthog9' Hawley (VMware)# This is used by vmrun to use the appropriate appripriate pieces to
50*2676eb4bSJohn 'Warthog9' Hawley (VMware)# test this.  In all likelihood you want 'ws' or 'player'
51*2676eb4bSJohn 'Warthog9' Hawley (VMware)# Valid options:
52*2676eb4bSJohn 'Warthog9' Hawley (VMware)# 	ws - Workstation (Windows or Linux host)
53*2676eb4bSJohn 'Warthog9' Hawley (VMware)# 	fusion - Fusion (Mac host)
54*2676eb4bSJohn 'Warthog9' Hawley (VMware)# 	player - Using VMware Player (Windows or Linux host)
55*2676eb4bSJohn 'Warthog9' Hawley (VMware)# Note: vmrun has to run directly on the host machine
56*2676eb4bSJohn 'Warthog9' Hawley (VMware)VMWARE_HOST_TYPE = ws
57*2676eb4bSJohn 'Warthog9' Hawley (VMware)
58*2676eb4bSJohn 'Warthog9' Hawley (VMware)# VMware provides `vmrun` to allow you to do certain things to the virtual machine
59*2676eb4bSJohn 'Warthog9' Hawley (VMware)# This should hard reset the VM and force a boot
60*2676eb4bSJohn 'Warthog9' Hawley (VMware)VMWARE_POWER_CYCLE = /usr/bin/vmrun -T ${VMWARE_HOST_TYPE} reset ${VMWARE_VM_BASE_DIR}/${VMWARE_VM_NAME}.kmx nogui
61*2676eb4bSJohn 'Warthog9' Hawley (VMware)
62*2676eb4bSJohn 'Warthog9' Hawley (VMware)#*************************************#
63*2676eb4bSJohn 'Warthog9' Hawley (VMware)# This part is the same as test.conf  #
64*2676eb4bSJohn 'Warthog9' Hawley (VMware)#*************************************#
65*2676eb4bSJohn 'Warthog9' Hawley (VMware)
66*2676eb4bSJohn 'Warthog9' Hawley (VMware)# The include files will set up the type of test to run. Just set TEST to
67*2676eb4bSJohn 'Warthog9' Hawley (VMware)# which test you want to run.
68*2676eb4bSJohn 'Warthog9' Hawley (VMware)#
69*2676eb4bSJohn 'Warthog9' Hawley (VMware)# TESTS = patchcheck, randconfig, boot, test, config-bisect, bisect, min-config
70*2676eb4bSJohn 'Warthog9' Hawley (VMware)#
71*2676eb4bSJohn 'Warthog9' Hawley (VMware)# See the include/*.conf files that define these tests
72*2676eb4bSJohn 'Warthog9' Hawley (VMware)#
73*2676eb4bSJohn 'Warthog9' Hawley (VMware)TEST := patchcheck
74*2676eb4bSJohn 'Warthog9' Hawley (VMware)
75*2676eb4bSJohn 'Warthog9' Hawley (VMware)# Some tests may have more than one test to run. Define MULTI := 1 to run
76*2676eb4bSJohn 'Warthog9' Hawley (VMware)# the extra tests.
77*2676eb4bSJohn 'Warthog9' Hawley (VMware)MULTI := 0
78*2676eb4bSJohn 'Warthog9' Hawley (VMware)
79*2676eb4bSJohn 'Warthog9' Hawley (VMware)# In case you want to differentiate which type of system you are testing
80*2676eb4bSJohn 'Warthog9' Hawley (VMware)BITS := 64
81*2676eb4bSJohn 'Warthog9' Hawley (VMware)
82*2676eb4bSJohn 'Warthog9' Hawley (VMware)# REBOOT = none, error, fail, empty
83*2676eb4bSJohn 'Warthog9' Hawley (VMware)#  See include/defaults.conf
84*2676eb4bSJohn 'Warthog9' Hawley (VMware)REBOOT := empty
85*2676eb4bSJohn 'Warthog9' Hawley (VMware)
86*2676eb4bSJohn 'Warthog9' Hawley (VMware)
87*2676eb4bSJohn 'Warthog9' Hawley (VMware)# The defaults file will set up various settings that can be used by all
88*2676eb4bSJohn 'Warthog9' Hawley (VMware)# machine configs.
89*2676eb4bSJohn 'Warthog9' Hawley (VMware)INCLUDE include/defaults.conf
90*2676eb4bSJohn 'Warthog9' Hawley (VMware)
91*2676eb4bSJohn 'Warthog9' Hawley (VMware)
92*2676eb4bSJohn 'Warthog9' Hawley (VMware)#*************************************#
93*2676eb4bSJohn 'Warthog9' Hawley (VMware)# Now we are different from test.conf #
94*2676eb4bSJohn 'Warthog9' Hawley (VMware)#*************************************#
95*2676eb4bSJohn 'Warthog9' Hawley (VMware)
96*2676eb4bSJohn 'Warthog9' Hawley (VMware)
97*2676eb4bSJohn 'Warthog9' Hawley (VMware)# The example here assumes that Guest is running a Fedora release
98*2676eb4bSJohn 'Warthog9' Hawley (VMware)# that uses dracut for its initfs. The POST_INSTALL will be executed
99*2676eb4bSJohn 'Warthog9' Hawley (VMware)# after the install of the kernel and modules are complete.
100*2676eb4bSJohn 'Warthog9' Hawley (VMware)#
101*2676eb4bSJohn 'Warthog9' Hawley (VMware)POST_INSTALL = ${SSH} /sbin/dracut -f /boot/initramfs-test.img $KERNEL_VERSION
102*2676eb4bSJohn 'Warthog9' Hawley (VMware)
103*2676eb4bSJohn 'Warthog9' Hawley (VMware)# Guests sometimes get stuck on reboot. We wait 3 seconds after running
104*2676eb4bSJohn 'Warthog9' Hawley (VMware)# the reboot command and then  do a full power-cycle of the guest.
105*2676eb4bSJohn 'Warthog9' Hawley (VMware)# This forces the guest to restart.
106*2676eb4bSJohn 'Warthog9' Hawley (VMware)#
107*2676eb4bSJohn 'Warthog9' Hawley (VMware)POWERCYCLE_AFTER_REBOOT = 3
108*2676eb4bSJohn 'Warthog9' Hawley (VMware)
109*2676eb4bSJohn 'Warthog9' Hawley (VMware)# We do the same after the halt command, but this time we wait 20 seconds.
110*2676eb4bSJohn 'Warthog9' Hawley (VMware)POWEROFF_AFTER_HALT = 20
111*2676eb4bSJohn 'Warthog9' Hawley (VMware)
112*2676eb4bSJohn 'Warthog9' Hawley (VMware)
113*2676eb4bSJohn 'Warthog9' Hawley (VMware)# As the defaults.conf file has a POWER_CYCLE option already defined,
114*2676eb4bSJohn 'Warthog9' Hawley (VMware)# and options can not be defined in the same section more than once
115*2676eb4bSJohn 'Warthog9' Hawley (VMware)# (all DEFAULTS sections are considered the same). We use the
116*2676eb4bSJohn 'Warthog9' Hawley (VMware)# DEFAULTS OVERRIDE to tell ktest.pl to ignore the previous defined
117*2676eb4bSJohn 'Warthog9' Hawley (VMware)# options, for the options set in the OVERRIDE section.
118*2676eb4bSJohn 'Warthog9' Hawley (VMware)#
119*2676eb4bSJohn 'Warthog9' Hawley (VMware)DEFAULTS OVERRIDE
120*2676eb4bSJohn 'Warthog9' Hawley (VMware)
121*2676eb4bSJohn 'Warthog9' Hawley (VMware)# Instead of using the default POWER_CYCLE option defined in
122*2676eb4bSJohn 'Warthog9' Hawley (VMware)# defaults.conf, we use virsh to cycle it. To do so, we destroy
123*2676eb4bSJohn 'Warthog9' Hawley (VMware)# the guest, wait 5 seconds, and then start it up again.
124*2676eb4bSJohn 'Warthog9' Hawley (VMware)# Crude, but effective.
125*2676eb4bSJohn 'Warthog9' Hawley (VMware)#
126*2676eb4bSJohn 'Warthog9' Hawley (VMware)POWER_CYCLE = ${VMWARE_POWER_CYCLE}
127*2676eb4bSJohn 'Warthog9' Hawley (VMware)
128*2676eb4bSJohn 'Warthog9' Hawley (VMware)
129*2676eb4bSJohn 'Warthog9' Hawley (VMware)DEFAULTS
130*2676eb4bSJohn 'Warthog9' Hawley (VMware)
131*2676eb4bSJohn 'Warthog9' Hawley (VMware)# The following files each handle a different test case.
132*2676eb4bSJohn 'Warthog9' Hawley (VMware)# Having them included allows you to set up more than one machine and share
133*2676eb4bSJohn 'Warthog9' Hawley (VMware)# the same tests.
134*2676eb4bSJohn 'Warthog9' Hawley (VMware)INCLUDE include/patchcheck.conf
135*2676eb4bSJohn 'Warthog9' Hawley (VMware)INCLUDE include/tests.conf
136*2676eb4bSJohn 'Warthog9' Hawley (VMware)INCLUDE include/bisect.conf
137*2676eb4bSJohn 'Warthog9' Hawley (VMware)INCLUDE include/min-config.conf
138