forked from kata-containers/tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·161 lines (148 loc) · 5.94 KB
/
run.sh
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
#!/bin/bash
#
# Copyright (c) 2017-2020 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# This script will execute the Kata Containers Test Suite.
set -e
cidir=$(dirname "$0")
source "${cidir}/lib.sh"
source "/etc/os-release" || source "/usr/lib/os-release"
export RUNTIME="containerd-shim-kata-v2"
export CI_JOB="${CI_JOB:-default}"
# Kata *MUST BE* able to run using a read-only rootfs image
if [ "$(uname -m)" == "x86_64" ]; then
rootfs_img="$(grep "^image = " \
/usr/share/defaults/kata-containers/configuration.toml \
/etc/kata-containers/configuration.toml 2> /dev/null \
| cut -d= -f2 | tr -d '"' | tr -d ' ' || true)"
if [ -n "${rootfs_img}" ] && [ -w "${rootfs_img}" ]; then
echo "INFO: making rootfs image read-only"
sudo mount --bind -r "${rootfs_img}" "${rootfs_img}"
fi
fi
case "${CI_JOB}" in
"BAREMETAL-PMEM"|"PMEM")
echo "INFO: Running pmem integration test"
sudo -E PATH="$PATH" CRI_RUNTIME="containerd" bash -c "make pmem"
;;
"BAREMETAL-QAT"|"QAT")
echo "INFO: Running QAT integration test"
sudo -E PATH="$PATH" CRI_RUNTIME="containerd" bash -c "make qat"
;;
"CRI_CONTAINERD"|"CRI_CONTAINERD_K8S"|"CRI_CONTAINERD_K8S_DEVMAPPER"|"CC_CRI_CONTAINERD"|"CC_CRI_CONTAINERD_CLOUD_HYPERVISOR")
echo "INFO: Running stability test"
sudo -E PATH="$PATH" CRI_RUNTIME="containerd" bash -c "make stability"
echo "INFO: Containerd checks"
sudo -E PATH="$PATH" bash -c "make cri-containerd"
echo "INFO: Running nydus test"
sudo -E PATH="$PATH" CRI_RUNTIME="containerd" bash -c "make nydus"
[[ "${CI_JOB}" =~ K8S ]] && \
sudo -E PATH="$PATH" CRI_RUNTIME="containerd" bash -c "make kubernetes"
echo "INFO: Running vcpus test"
sudo -E PATH="$PATH" CRI_RUNTIME="containerd" bash -c "make vcpus"
echo "INFO: Skipping pmem test: Issue: https://github.com/kata-containers/tests/issues/3223"
echo "INFO: Running stability test with sandbox_cgroup_only"
export TEST_SANDBOX_CGROUP_ONLY=true
sudo -E PATH="$PATH" CRI_RUNTIME="containerd" bash -c "make stability"
# echo "INFO: Running pmem integration test"
# sudo -E PATH="$PATH" CRI_RUNTIME="containerd" bash -c "make pmem"
echo "INFO: Running ksm test"
sudo -E PATH="$PATH" CRI_RUNTIME="containerd" bash -c "make ksm"
echo "INFO: Running kata-monitor test"
sudo -E PATH="$PATH" CRI_RUNTIME="containerd" bash -c "make monitor"
echo "INFO: Running tracing test"
sudo -E PATH="$PATH" bash -c "make tracing"
if [[ "${CI_JOB}" =~ CC_CRI_CONTAINERD ]]; then
echo "INFO: Running Confidential Container tests"
sudo -E PATH="$PATH" CRI_RUNTIME="containerd" bash -c "make cc-containerd"
fi
echo "INFO: Running runk test"
sudo -E PATH="$PATH" CRI_RUNTIME="containerd" bash -c "make runk"
;;
"CRIO_K8S")
echo "INFO: Running kubernetes tests"
sudo -E PATH="$PATH" bash -c "make kubernetes"
echo "INFO: Running rootless tests"
sudo -E PATH="$PATH" bash -c "make rootless"
echo "INFO: Running kata-monitor test"
sudo -E PATH="$PATH" bash -c "make monitor"
;;
"CRIO_K8S_COMPLETE")
echo "INFO: Running kubernetes tests (minimal) with CRI-O"
sudo -E PATH="$PATH" bash -c "make kubernetes-e2e"
;;
"CRIO_K8S_MINIMAL")
echo "INFO: Running kubernetes tests (minimal) with CRI-O"
sudo -E PATH="$PATH" bash -c "make kubernetes-e2e"
;;
"CLOUD-HYPERVISOR-K8S-CRIO")
echo "INFO: Running kubernetes tests"
sudo -E PATH="$PATH" bash -c "make kubernetes"
;;
"CLOUD-HYPERVISOR-K8S-CONTAINERD"|"CLOUD-HYPERVISOR-K8S-CONTAINERD-DEVMAPPER")
echo "INFO: Containerd checks"
sudo -E PATH="$PATH" bash -c "make cri-containerd"
echo "INFO: Running kubernetes tests with containerd"
sudo -E PATH="$PATH" CRI_RUNTIME="containerd" bash -c "make kubernetes"
;;
"EXTERNAL_CLOUD_HYPERVISOR")
echo "INFO:n Running tests on Cloud Hypervisor PR"
sudo -E PATH="$PATH" bash -c "make cri-containerd"
;;
"EXTERNAL_CRIO")
echo "INFO: Running tests on cri-o PR"
sudo -E PATH="$PATH" bash -c "make kubernetes"
sudo -E PATH="$PATH" bash -c "make kubernetes-e2e"
sudo -E PATH="$PATH" bash -c "make crio"
;;
"FIRECRACKER")
echo "INFO: Running Kubernetes tests with Jailed Firecracker"
sudo -E PATH="$PATH" bash -c "make kubernetes"
;;
"VFIO")
echo "INFO: Running VFIO functional tests"
sudo -E PATH="$PATH" CRI_RUNTIME="containerd" bash -c "make vfio"
;;
"METRICS")
export RUNTIME="kata-runtime"
export CTR_RUNTIME="io.containerd.kata.v2"
export config_path="/usr/share/defaults/kata-containers"
tests_repo="github.com/kata-containers/tests"
echo "INFO: Running qemu metrics tests"
export KATA_HYPERVISOR="qemu"
sudo -E ln -sf "${config_path}/configuration-qemu.toml" "${config_path}/configuration.toml"
sudo -E PATH="$PATH" ".ci/run_metrics_PR_ci.sh"
echo "INFO: Install cloud hypervisor"
export KATA_HYPERVISOR="cloud-hypervisor"
pushd "${GOPATH}/src/${tests_repo}"
sudo -E PATH="$PATH" ".ci/install_cloud_hypervisor.sh"
popd
echo "INFO: Use cloud hypervisor configuration"
sudo -E ln -sf "${config_path}/configuration-clh.toml" "${config_path}/configuration.toml"
echo "INFO: Running cloud hypervisor metrics tests"
sudo -E PATH="$PATH" ".ci/run_metrics_PR_ci.sh"
;;
"VIRTIOFS_EXPERIMENTAL")
sudo -E PATH="$PATH" bash -c "make filesystem"
;;
"DRAGONBALL")
# TODO: currently runtime-rs binary doesn't support nydus, so disable nydus testing.
# Please refer to the issue: https://github.com/kata-containers/kata-containers/issues/4690
# echo "INFO: Running nydus test"
# sudo -E PATH="$PATH" CRI_RUNTIME="containerd" bash -c "make nydus"
echo "INFO: Running stability test"
sudo -E PATH="$PATH" CRI_RUNTIME="containerd" bash -c "make dragonball-stability"
echo "INFO: Containerd checks"
sudo -E PATH="$PATH" bash -c "make cri-containerd"
echo "INFO: Running kubernetes tests"
sudo -E PATH="$PATH" CRI_RUNTIME="containerd" bash -c "make kubernetes"
;;
*)
echo "INFO: Running checks"
sudo -E PATH="$PATH" bash -c "make check"
echo "INFO: Running functional and integration tests ($PWD)"
sudo -E PATH="$PATH" bash -c "make test"
;;
esac