cgroupv2: skip tests on containerd < 1.4
containerd < 1.4 does not support cgroupv2, so we adjust the Make targets and installer scripts to skip test run on those versions. Signed-off-by: Daniel Dao <dqminh89@gmail.com>
This commit is contained in:
parent
5e984d5aa2
commit
51f39a1204
17
Makefile
17
Makefile
|
@ -113,6 +113,12 @@ RUNTIME_BIN := $(RUNTIME_DIR)/runsc
|
||||||
RUNTIME_LOG_DIR := $(RUNTIME_DIR)/logs
|
RUNTIME_LOG_DIR := $(RUNTIME_DIR)/logs
|
||||||
RUNTIME_LOGS := $(RUNTIME_LOG_DIR)/runsc.log.%TEST%.%TIMESTAMP%.%COMMAND%
|
RUNTIME_LOGS := $(RUNTIME_LOG_DIR)/runsc.log.%TEST%.%TIMESTAMP%.%COMMAND%
|
||||||
|
|
||||||
|
ifeq ($(shell stat -f -c "%T" /sys/fs/cgroup 2>/dev/null),cgroup2fs)
|
||||||
|
CGROUPV2 := true
|
||||||
|
else
|
||||||
|
CGROUPV2 := false
|
||||||
|
endif
|
||||||
|
|
||||||
$(RUNTIME_BIN): # See below.
|
$(RUNTIME_BIN): # See below.
|
||||||
@mkdir -p "$(RUNTIME_DIR)"
|
@mkdir -p "$(RUNTIME_DIR)"
|
||||||
ifeq (,$(STAGED_BINARIES))
|
ifeq (,$(STAGED_BINARIES))
|
||||||
|
@ -204,7 +210,7 @@ tests: unit-tests nogo-tests container-tests syscall-tests
|
||||||
|
|
||||||
integration-tests: ## Run all standard integration tests.
|
integration-tests: ## Run all standard integration tests.
|
||||||
integration-tests: docker-tests overlay-tests hostnet-tests swgso-tests
|
integration-tests: docker-tests overlay-tests hostnet-tests swgso-tests
|
||||||
integration-tests: do-tests kvm-tests containerd-test-1.3.9
|
integration-tests: do-tests kvm-tests containerd-tests-min
|
||||||
.PHONY: integration-tests
|
.PHONY: integration-tests
|
||||||
|
|
||||||
network-tests: ## Run all networking integration tests.
|
network-tests: ## Run all networking integration tests.
|
||||||
|
@ -320,10 +326,19 @@ else
|
||||||
endif
|
endif
|
||||||
@$(call sudo,test/root:root_test,--runtime=$(RUNTIME) -test.v)
|
@$(call sudo,test/root:root_test,--runtime=$(RUNTIME) -test.v)
|
||||||
|
|
||||||
|
ifeq ($(CGROUPV2),false)
|
||||||
|
containerd-tests-min: containerd-test-1.3.9
|
||||||
|
else
|
||||||
|
containerd-tests-min: containerd-test-1.4.3
|
||||||
|
endif
|
||||||
|
|
||||||
# The shim builds with containerd 1.3.9 and it's not backward compatible. Test
|
# The shim builds with containerd 1.3.9 and it's not backward compatible. Test
|
||||||
# with 1.3.9 and newer versions.
|
# with 1.3.9 and newer versions.
|
||||||
|
# When run under cgroupv2 environment, skip 1.3.9 as it does not support cgroupv2
|
||||||
containerd-tests: ## Runs all supported containerd version tests.
|
containerd-tests: ## Runs all supported containerd version tests.
|
||||||
|
ifeq ($(CGROUPV2),false)
|
||||||
containerd-tests: containerd-test-1.3.9
|
containerd-tests: containerd-test-1.3.9
|
||||||
|
endif
|
||||||
containerd-tests: containerd-test-1.4.3
|
containerd-tests: containerd-test-1.4.3
|
||||||
containerd-tests: containerd-test-1.5.4
|
containerd-tests: containerd-test-1.5.4
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,12 @@ if [[ "${CONTAINERD_MAJOR}" -eq 1 ]] && [[ "${CONTAINERD_MINOR}" -le 4 ]]; then
|
||||||
export GO111MODULE=off
|
export GO111MODULE=off
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# containerd < 1.4 doesn't work with cgroupv2 setup, so we check for that here
|
||||||
|
if [[ "$(stat -f -c %T /sys/fs/cgroup 2>/dev/null)" -eq "cgroup2fs" && "${CONTAINERD_MAJOR}" -eq 1 && "${CONTAINERD_MINOR}" -lt 4 ]]; then
|
||||||
|
echo "containerd < 1.4 does not work with cgroup2"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Helper for Go packages below.
|
# Helper for Go packages below.
|
||||||
install_helper() {
|
install_helper() {
|
||||||
declare -r PACKAGE="${1}"
|
declare -r PACKAGE="${1}"
|
||||||
|
|
Loading…
Reference in New Issue