forked from kata-containers/tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
266 lines (214 loc) · 6.58 KB
/
Makefile
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
#
# Copyright (c) 2017-2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
ifneq (,$(wildcard /usr/lib/os-release))
include /usr/lib/os-release
else
include /etc/os-release
endif
# The time limit in seconds for each test
TIMEOUT := 120
DOCKER_DEPENDENCY = docker
ifeq (${CI}, true)
ifneq (${TEST_DOCKER}, true)
DOCKER_DEPENDENCY =
endif
endif
PODMAN_DEPENDENCY = podman
ifeq (${CI}, true)
ifneq (${TEST_CGROUPSV2}, true)
PODMAN_DEPENDENCY =
endif
endif
# union for 'make test'
UNION := functional debug-console $(DOCKER_DEPENDENCY) openshift crio docker-compose network \
docker-stability oci netmon kubernetes swarm vm-factory \
entropy ramdisk shimv2 tracing time-drift compatibility vcpus $(PODMAN_DEPENDENCY)
# filter scheme script for docker integration test suites
FILTER_FILE = .ci/filter/filter_docker_test.sh
# skipped docker integration tests for Firecraker
# Firecracker configuration file
FIRECRACKER_CONFIG = .ci/hypervisors/firecracker/configuration_firecracker.yaml
# Cloud hypervisor configuration file
CLH_CONFIG = .ci/hypervisors/clh/configuration_clh.yaml
ifneq ($(wildcard $(FILTER_FILE)),)
SKIP_FIRECRACKER := $(shell bash -c '$(FILTER_FILE) $(FIRECRACKER_CONFIG)')
SKIP_CLH := $(shell bash -c '$(FILTER_FILE) $(CLH_CONFIG)')
endif
# get arch
ARCH := $(shell bash -c '.ci/kata-arch.sh -d')
ARCH_DIR = arch
ARCH_FILE_SUFFIX = -options.mk
ARCH_FILE = $(ARCH_DIR)/$(ARCH)$(ARCH_FILE_SUFFIX)
INSTALL_FILES := $(wildcard .ci/install_*.sh)
INSTALL_TARGETS := $(INSTALL_FILES:.ci/install_%.sh=install-%)
# Load architecture-dependent settings
ifneq ($(wildcard $(ARCH_FILE)),)
include $(ARCH_FILE)
endif
default: checkcommits github-labels
checkcommits:
make -C cmd/checkcommits
github-labels:
make -C cmd/github-labels
spell-check-dictionary:
make -C cmd/check-spelling
check-markdown:
make -C cmd/check-markdown
ginkgo:
ln -sf . vendor/src
GOPATH=$(PWD)/vendor go build ./vendor/github.com/onsi/ginkgo/ginkgo
unlink vendor/src
functional: ginkgo
ifeq (${RUNTIME},)
$(error RUNTIME is not set)
else
./ginkgo -failFast -v -focus "${FOCUS}" -skip "${SKIP}" \
functional/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT}
bash sanity/check_sanity.sh
endif
debug-console:
bash -f ./functional/debug_console/run.sh
docker: ginkgo
ifeq ($(RUNTIME),)
$(error RUNTIME is not set)
endif
ifeq ($(KATA_HYPERVISOR),firecracker)
./ginkgo -failFast -v -focus "${FOCUS}" -skip "${SKIP_FIRECRACKER}" \
./integration/docker/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT} \
-hypervisor=$(KATA_HYPERVISOR)
else ifeq ($(KATA_HYPERVISOR),cloud-hypervisor)
./ginkgo -failFast -v -focus "${FOCUS}" -skip "${SKIP_CLH}" \
./integration/docker/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT} \
-hypervisor=$(KATA_HYPERVISOR)
else ifeq ($(ARCH),$(filter $(ARCH), aarch64 s390x ppc64le))
./ginkgo -failFast -v -focus "${FOCUS}" -skip "${SKIP}" \
./integration/docker/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT}
else ifneq (${FOCUS},)
./ginkgo -failFast -v -focus "${FOCUS}" -skip "${SKIP}" \
./integration/docker/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT}
else ifeq (centos7,$(ID)$(VERSION_ID))
# Run tests sequentially, parallel tests fail randomly in Centos 7
./ginkgo -failFast -v -skip "${SKIP}" \
./integration/docker/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT}
else
# Run tests in parallel, skip tests that need to be run serialized
./ginkgo -failFast -p -stream -v -skip "${SKIP}" -skip "\[Serial Test\]" \
./integration/docker/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT}
# Now run serialized tests
./ginkgo -failFast -v -focus "\[Serial Test\]" -skip "${SKIP}" \
./integration/docker/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT}
bash sanity/check_sanity.sh
endif
crio:
bash .ci/install_bats.sh
RUNTIME=${RUNTIME} ./integration/cri-o/cri-o.sh
docker-compose:
bash .ci/install_bats.sh
cd integration/docker-compose && \
bats docker-compose.bats
docker-stability:
systemctl is-active --quiet docker || sudo systemctl start docker
cd integration/stability && \
export ITERATIONS=2 && export MAX_CONTAINERS=20 && ./soak_parallel_rm.sh
cd integration/stability && ./bind_mount_linux.sh
cd integration/stability && ./hypervisor_stability_kill_test.sh
podman:
bash -f integration/podman/run_podman_tests.sh
kubernetes:
bash -f .ci/install_bats.sh
bash -f integration/kubernetes/run_kubernetes_tests.sh
ksm:
bash -f integration/ksm/ksm_test.sh
sandbox-cgroup:
bash -f integration/sandbox_cgroup/sandbox_cgroup_test.sh
swarm:
systemctl is-active --quiet docker || sudo systemctl start docker
bash -f .ci/install_bats.sh
cd integration/swarm && \
bats swarm.bats
shimv2:
bash integration/containerd/shimv2/shimv2-tests.sh
bash integration/containerd/shimv2/shimv2-factory-tests.sh
cri-containerd:
bash integration/containerd/cri/integration-tests.sh
log-parser:
make -C cmd/log-parser
oci:
systemctl is-active --quiet docker || sudo systemctl start docker
cd integration/oci_calls && \
bash -f oci_call_test.sh
openshift:
bash -f .ci/install_bats.sh
bash -f integration/openshift/run_openshift_tests.sh
pentest:
bash -f pentest/all.sh
vm-factory:
bash -f integration/vm_factory/vm_templating_test.sh
network:
systemctl is-active --quiet docker || sudo systemctl start docker
bash -f .ci/install_bats.sh
bats integration/network/macvlan/macvlan_driver.bats
bats integration/network/ipvlan/ipvlan_driver.bats
bats integration/network/disable_net/net_none.bats
ramdisk:
bash -f integration/ramdisk/ramdisk.sh
entropy:
bash -f .ci/install_bats.sh
bats integration/entropy/entropy_time.bats
netmon:
systemctl is-active --quiet docker || sudo systemctl start docker
bash -f .ci/install_bats.sh
bats integration/netmon/netmon_test.bats
tracing:
bash tracing/tracing-test.sh
time-drift:
bats integration/time_drift/time_drift.bats
compatibility:
bash -f integration/compatibility/run.sh
vcpus:
bash -f integration/vcpus/default_vcpus_test.sh
ipv6:
bash -f integration/ipv6/ipv6.sh
test: ${UNION}
check: checkcommits log-parser
$(INSTALL_TARGETS): install-%: .ci/install_%.sh
@bash -f $<
list-install-targets:
@echo $(INSTALL_TARGETS) | tr " " "\n"
help:
@echo Subsets of the tests can be run using the following specific make targets:
@echo " $(UNION)" | sed 's/ /\n\t/g'
# PHONY in alphabetical order
.PHONY: \
compatibility \
check \
checkcommits \
crio \
debug-console \
docker \
docker-compose \
docker-stability \
entropy \
functional \
ginkgo \
$(INSTALL_TARGETS) \
podman \
ipv6 \
kubernetes \
list-install-targets \
log-parser \
oci \
openshift \
pentest \
sandbox-cgroup \
swarm \
netmon \
network \
ramdisk \
test \
tracing \
vcpus \
vm-factory