summaryrefslogtreecommitdiffstats
path: root/src/VBox/ValidationKit/Makefile.kmk
blob: 4a530d8b790888d641eee93086804178ec562b76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# $Id: Makefile.kmk $
## @file
# VirtualBox Validation Kit.
#

#
# Copyright (C) 2006-2019 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
# The contents of this file may alternatively be used under the terms
# of the Common Development and Distribution License Version 1.0
# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
# VirtualBox OSE distribution, in which case the provisions of the
# CDDL are applicable instead of those of the GPL.
#
# You may elect to license modified versions of this file under the
# terms and conditions of either the GPL or the CDDL or both.
#

SUB_DEPTH = ../../..
include $(KBUILD_PATH)/subheader.kmk

# Make sure our Config.kmk is included.
ifndef VBOX_VALIDATIONKIT_CONFIG_KMK_INCLUDED
 include $(PATH_SUB_CURRENT)/Config.kmk
endif

# Collect install targets
VBOX_VALIDATIONKIT_INSTALLS := $(INSTALLS)

#
# Include sub-makefiles.
#
include $(PATH_SUB_CURRENT)/tests/Makefile.kmk
ifneq ($(KBUILD_HOST),os2)	 # need yasm
 include $(PATH_SUB_CURRENT)/bootsectors/Makefile.kmk
endif
include $(PATH_SUB_CURRENT)/utils/Makefile.kmk
include $(PATH_SUB_CURRENT)/common/Makefile.kmk
include $(PATH_SUB_CURRENT)/testboxscript/Makefile.kmk
include $(PATH_SUB_CURRENT)/testdriver/Makefile.kmk
include $(PATH_SUB_CURRENT)/testmanager/Makefile.kmk

#
# Globals.
#

# The current target is enabled by default.
VBOX_WITH_VALIDATIONKIT_PACKING.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) = 1


#
# Install the test driver framework.
#
INSTALLS += ValidationKit-testdriver
ValidationKit-testdriver_TEMPLATE = VBoxValidationKitR3
ValidationKit-testdriver_INST = $(INST_VALIDATIONKIT)testdriver/
ValidationKit-testdriver_MODE = a+r,u+w
ValidationKit-testdriver_SOURCES := \
	$(PATH_SUB_CURRENT)/testdriver/__init__.py \
	$(PATH_SUB_CURRENT)/testdriver/base.py \
	$(PATH_SUB_CURRENT)/testdriver/btresolver.py \
	$(PATH_SUB_CURRENT)/testdriver/reporter.py \
	$(PATH_SUB_CURRENT)/testdriver/tst-txsclient.py \
	$(PATH_SUB_CURRENT)/testdriver/txsclient.py \
	$(PATH_SUB_CURRENT)/testdriver/vbox.py \
	$(PATH_SUB_CURRENT)/testdriver/vboxcon.py \
	$(PATH_SUB_CURRENT)/testdriver/vboxtestvms.py \
	$(PATH_SUB_CURRENT)/testdriver/vboxwrappers.py \
	$(PATH_SUB_CURRENT)/testdriver/winbase.py \
	$(PATH_SUB_CURRENT)/testdriver/win-vbox-net-uninstall.ps1
ValidationKit-testdriver_EXEC_SOURCES := \
	$(PATH_SUB_CURRENT)/testdriver/vboxinstaller.py
$(PATH_SUB_CURRENT)/testdriver/txsclient.py_VBOX_PYCHECKER_FLAGS = --no-reimport


#
# Packing target.
#
ifndef VBOX_WITHOUT_VALIDATIONKIT_ZIP

 VBOX_VALIDATIONKIT_INSTALLS := $(filter-out $(VBOX_VALIDATIONKIT_INSTALLS), $(INSTALLS))

 #
 # VBoxValidationKit.zip.
 # TODO: Don't pack the python stuff multiple times?  Lazy works for now.
 #
 PACKING += $(PATH_OUT)/VBoxValidationKit.zip
 $(PATH_OUT)/VBoxValidationKit.zip: \
 		$(VBOX_PATH_VALIDATIONKIT)/VBoxValidationKit.iso \
 		$(VBOX_PATH_VALIDATIONKIT)/ \
               $$(foreach inst, $$(VBOX_VALIDATIONKIT_INSTALLS), \
			$$(filter $(PATH_STAGE)/$(INST_VALIDATIONKIT)%, $$($$(inst)_2_STAGE_TARGETS)))
	$(call MSG_L1,Packing the Test Suite $@)
	$(QUIET)$(RM) -f $@
	$(foreach os, darwin freebsd linux os2 solaris win,$(foreach arch, x86 amd64 \
	,$(if-expr defined(VBOX_WITH_VALIDATIONKIT_PACKING.$(os).$(arch))\
		,$(NLTAB)$(QUIET)$(REDIRECT) -C $(PATH_OUT_BASE)/$(os).$(arch)/$(KBUILD_TYPE)/ \
			-- $(VBOX_ZIP) -r9 $@ $(INST_VALIDATIONKIT) -x '*.pyc',)))

 #
 # VBoxTestBoxScript.zip - For setting up the testboxes.
 #
 PACKING += $(PATH_OUT)/VBoxTestBoxScript.zip
 $(PATH_OUT)/VBoxTestBoxScript.zip: \
 		$$(testboxscript_2_STAGE_TARGETS) \
 		$$(testboxscript-common_2_STAGE_TARGETS) \
 		$$(TestBoxHelper_2_STAGE_TARGETS)
	$(call MSG_L1,Packing the TestBox Script files to $@)
	$(QUIET)$(RM) -f $@
	$(foreach os, darwin freebsd linux os2 solaris win,$(foreach arch, x86 amd64 \
	,$(if-expr defined(VBOX_WITH_VALIDATIONKIT_PACKING.$(os).$(arch))\
		,$(NLTAB)$(QUIET)$(REDIRECT) -C $(PATH_OUT_BASE)/$(os).$(arch)/$(KBUILD_TYPE)/ \
			-- $(VBOX_ZIP) -r9X $@ $(INST_TESTBOXSCRIPT) -x '*.pyc',)))

endif # !VBOX_WITHOUT_VALIDATIONKIT_ZIP


#
# Automatically lint python code during build.
#
if defined(VBOX_WITH_PYLINT) && !defined(VBOX_WITHOUT_AUTO_PYLINT)
 OTHERS      += $(PATH_TARGET)/pylint.run
 OTHER_CLEAN += $(PATH_TARGET)/pylint.run
 $(PATH_TARGET)/pylint.run: \
 		$$(filter-out %/testboxscript.o, $$(VBOX_VALIDATIONKIT_PYLINT_TARGETS)) \
		$$(VBOX_VALIDATIONKIT_PYUNITTEST_TARGETS)
	$(QUIET)$(APPEND) -t "$@"
endif

$(evalcall def_vbox_validationkit_process_python_sources,FORCE)
$(evalcall def_vbox_validationkit_process_js_sources,FORCE)
include $(FILE_KBUILD_SUB_FOOTER)




#
# Construct the file spec for creating the Validation Kit guest iso.
#
VBOX_VALIDATIONKIT_FILESPEC = \
	valkit.txt=$(VBOX_PATH_VALIDATIONKIT_SRC)/docs/valkit.txt \
	$(VBOX_PATH_VALIDATIONKIT)/vboxtxs-readme.txt
ifneq ($(KBUILD_HOST),os2)
 VBOX_VALIDATIONKIT_FILESPEC += \
	$(VBOX_PATH_VALIDATIONKIT)/bootsectors/bootsector-pae.img \
	$(VBOX_PATH_VALIDATIONKIT)/bootsectors/bootsector-shutdown.img
endif

# Generate VBOX_PATH_VALIDATIONKIT.os.arch variables.
$(foreach os, darwin freebsd linux os2 solaris win,$(foreach arch, x86 amd64, \
	$(eval VBOX_PATH_VALIDATIONKIT.$(os).$(arch) = $(PATH_OUT_BASE)/$(os).$(arch)/$(KBUILD_TYPE)/$(INST_VALIDATIONKIT)$(os)/$(arch)) \
))

# Common files first.
define def_vbox_validationkit_common_files
 ifdef VBOX_WITH_VALIDATIONKIT_PACKING.$(os).$(arch)
  VBOX_VALIDATIONKIT_FILESPEC += \
      	$$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/exceptionsR3$(TMP_SUFF_EXE) \
      	$$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/cpu-alloc-all-mem$(TMP_SUFF_EXE) \
      	$$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/cpu-numa$(TMP_SUFF_EXE) \
      	$$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/NetPerf$(TMP_SUFF_EXE) \
      	$$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/LoadGenerator$(TMP_SUFF_EXE) \
      	$$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/loadgeneratorR0.r0 \
      	$$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/TestExecService$(TMP_SUFF_EXE) \
      	$$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/vts_rm$(TMP_SUFF_EXE) \
      	$$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/vts_shutdown$(TMP_SUFF_EXE) \
      	$$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/vts_tar$(TMP_SUFF_EXE) \
      	$$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/xmmsaving$(TMP_SUFF_EXE)
 endif
endef

TMP_SUFF_EXE=.exe
$(foreach os, os2 win,$(foreach arch, x86 amd64, \
	$(eval $(def_vbox_validationkit_common_files)) \
))
TMP_SUFF_EXE=
$(foreach os, darwin freebsd linux solaris,$(foreach arch, x86 amd64, \
	$(eval $(def_vbox_validationkit_common_files)) \
))

# OS specific files - Linux
ifdef VBOX_WITH_VALIDATIONKIT_PACKING.linux.x86
 VBOX_VALIDATIONKIT_FILESPEC += \
 	$(VBOX_PATH_VALIDATIONKIT.linux.x86)/UsbTest \
 	$(VBOX_PATH_VALIDATIONKIT.linux.x86)/SerialTest
endif
ifdef VBOX_WITH_VALIDATIONKIT_PACKING.linux.amd64
 VBOX_VALIDATIONKIT_FILESPEC += \
 	$(VBOX_PATH_VALIDATIONKIT.linux.amd64)/UsbTest \
 	$(VBOX_PATH_VALIDATIONKIT.linux.amd64)/SerialTest
endif
ifdef VBOX_WITH_VALIDATIONKIT_PACKING.linux.x86
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.linux.x86)/../vboxtxs)
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.linux.x86)/../vboxtxs-nat)
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.linux.x86)/../vboxtxs.service)

else ifdef VBOX_WITH_VALIDATIONKIT_PACKING.linux.amd64
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.linux.amd64)/../vboxtxs)
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.linux.amd64)/../vboxtxs-nat)
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.linux.amd64)/../vboxtxs.service)
endif

# OS specific files - OS/2
ifdef VBOX_WITH_VALIDATIONKIT_PACKING.os2.x86
 VBOX_VALIDATIONKIT_FILESPEC += \
 	$(VBOX_PATH_VALIDATIONKIT.os2.x86)/libc06.dll \
 	$(VBOX_PATH_VALIDATIONKIT.os2.x86)/libc061.dll \
 	$(VBOX_PATH_VALIDATIONKIT.os2.x86)/libc062.dll \
 	$(VBOX_PATH_VALIDATIONKIT.os2.x86)/libc063.dll \
 	$(VBOX_PATH_VALIDATIONKIT.os2.x86)/libc064.dll \
 	$(VBOX_PATH_VALIDATIONKIT.os2.x86)/libc065.dll \
 	$(VBOX_PATH_VALIDATIONKIT.os2.x86)/libc066.dll
endif

# OS specific files - Solaris
ifdef VBOX_WITH_VALIDATIONKIT_PACKING.solaris.x86
 VBOX_VALIDATIONKIT_FILESPEC += \
 	$(VBOX_PATH_VALIDATIONKIT.solaris.x86)/SerialTest
endif
ifdef VBOX_WITH_VALIDATIONKIT_PACKING.solaris.amd64
 VBOX_VALIDATIONKIT_FILESPEC += \
 	$(VBOX_PATH_VALIDATIONKIT.solaris.amd64)/SerialTest
endif
ifdef VBOX_WITH_VALIDATIONKIT_PACKING.solaris.x86
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.solaris.x86)/../vboxtxs.sh)
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.solaris.x86)/../vboxtxs.xml)
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.solaris.x86)/../vboxtxs-sol10.xml)
else ifdef VBOX_WITH_VALIDATIONKIT_PACKING.solaris.amd64
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.solaris.amd64)/../vboxtxs.sh)
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.solaris.amd64)/../vboxtxs.xml)
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.solaris.amd64)/../vboxtxs-sol10.xml)
endif

# OS specific files - Windows
ifdef VBOX_WITH_VALIDATIONKIT_PACKING.win.x86
 VBOX_VALIDATIONKIT_FILESPEC += \
 	$(VBOX_PATH_VALIDATIONKIT.win.x86)/ntSetFreq.exe \
 	$(VBOX_PATH_VALIDATIONKIT.win.x86)/ntTimeSources.exe \
 	$(VBOX_PATH_VALIDATIONKIT.win.x86)/SerialTest.exe
    ifdef VBOX_WITH_AUDIO_VALIDATIONKIT
     	VBOX_VALIDATIONKIT_FILESPEC += \
     	$(VBOX_PATH_VALIDATIONKIT.win.x86)/ntPlayToneWaveX.exe
    endif
endif
ifdef VBOX_WITH_VALIDATIONKIT_PACKING.win.amd64
 VBOX_VALIDATIONKIT_FILESPEC += \
 	$(VBOX_PATH_VALIDATIONKIT.win.amd64)/ntSetFreq.exe \
 	$(VBOX_PATH_VALIDATIONKIT.win.amd64)/ntTimeSources.exe \
 	$(VBOX_PATH_VALIDATIONKIT.win.amd64)/SerialTest.exe
    ifdef VBOX_WITH_AUDIO_VALIDATIONKIT
     	VBOX_VALIDATIONKIT_FILESPEC += \
     	$(VBOX_PATH_VALIDATIONKIT.win.amd64)/ntPlayToneWaveX.exe
    endif
endif
ifdef VBOX_WITH_VALIDATIONKIT_PACKING.win.x86
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.win.x86)/../vboxtxs.cmd)
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.win.x86)/../vboxtxs.reg)
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.win.x86)/../vboxtxs-nat.cmd)
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.win.x86)/../vboxtxs-nat.reg)
else ifdef VBOX_WITH_VALIDATIONKIT_PACKING.win.amd64
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.win.amd64)/../vboxtxs.cmd)
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.win.amd64)/../vboxtxs.reg)
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.win.amd64)/../vboxtxs-nat.cmd)
 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.win.amd64)/../vboxtxs-nat.reg)
endif


#
# Build the Validation Kit guest ISO.
#
$(VBOX_PATH_VALIDATIONKIT)/VBoxValidationKit.iso: \
		$(filter-out %=deleteme=, $(subst =,=deleteme= , $(VBOX_VALIDATIONKIT_FILESPEC))) \
		$(VBOX_SVN_REV_KMK) \
		$(VBOX_PATH_VALIDATIONKIT_SRC)/Makefile.kmk \
               | $(if-expr defined(VBOX_USE_RTISOMAKER),$(VBOX_RTISOMAKER),)
	$(call MSG_TOOL,RTIsoMaker,,$@)
	$(QUIET)$(MKDIR) -p $(@D)
ifneq ($(KBUILD_TARGET),os2)
	$(QUIET)$(ECHO) VBOX_VALIDATIONKIT_FILESPEC $(VBOX_VALIDATIONKIT_FILESPEC)
endif
	$(VBOX_RTISOMAKER) \
		--output $@ \
		--iso-level 3 \
		--rock-ridge \
		--joliet \
		--rational-attribs \
               --random-order-verification 2048 \
		$(foreach spec,$(VBOX_VALIDATIONKIT_FILESPEC) \
			,$(if $(findstring =,$(spec)), $(spec), /$(lastword $(subst /$(INST_VALIDATIONKIT), ,$(spec))=$(spec))) ) \
		$(foreach spec,$(filter-out %.txt %.dll %.xml %.reg %.img, $(VBOX_VALIDATIONKIT_FILESPEC)) \
			,--chmod=a+x:/$(lastword $(if $(findstring =,$(spec)), \
				        	   $(subst =, $(SP), $(spec)), \
						   $(subst /$(INST_VALIDATIONKIT), ,$(spec))))) \
		--volume-id "VBOXVALK_$(VBOX_SVN_REV)_$(VBOX_VERSION_STRING_RAW)" \
               --name-setup joliet \
		--volume-id "VBoxValK $(VBOX_SVN_REV)"

# Alias for creating the iso.
.PHONY: validationkit-iso
validationkit-iso: $(VBOX_PATH_VALIDATIONKIT)/VBoxValidationKit.iso