mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Tweaks to containerd tests and helpers.
PiperOrigin-RevId: 565839195
This commit is contained in:
committed by
gVisor bot
parent
d81768d4c8
commit
3134858468
@@ -331,13 +331,25 @@ fsstress-test: load-basic $(RUNTIME_BIN)
|
||||
@$(call test_runtime,$(RUNTIME),//test/fsstress:fsstress_test)
|
||||
.PHONY: fsstress-test
|
||||
|
||||
# Helper to install containerd.
|
||||
# $(1) is the containerd version.
|
||||
install_containerd = \
|
||||
($(call header,INSTALL CONTAINERD); \
|
||||
export T=$$(mktemp -d --tmpdir containerd.XXXXXX); \
|
||||
cp tools/install_containerd.sh $$T && \
|
||||
cd /tmp && \
|
||||
sudo -H "PATH=$$PATH" $$T/install_containerd.sh $(1); \
|
||||
rm -rf $$T)
|
||||
|
||||
# Specific containerd version tests.
|
||||
containerd-test-%: load-basic_alpine load-basic_python load-basic_busybox load-basic_symlink-resolv load-basic_httpd load-basic_ubuntu $(RUNTIME_BIN)
|
||||
@$(call install_runtime,$(RUNTIME),) # Clear flags.
|
||||
@sudo -H tools/install_containerd.sh $*
|
||||
@$(call install_containerd,$*)
|
||||
ifeq (,$(STAGED_BINARIES))
|
||||
@$(call sudocopy,//shim:containerd-shim-runsc-v1,"$$(dirname $$(which containerd))")
|
||||
@(export T=$$(mktemp -d --tmpdir containerd.XXXXXX); \
|
||||
$(call copy,//shim:containerd-shim-runsc-v1,$$T) && \
|
||||
sudo mv $$T/containerd-shim-runsc-v1 "$$(dirname $$(which containerd))"; \
|
||||
rm -rf $$T)
|
||||
else
|
||||
gsutil cat "$(STAGED_BINARIES)" | \
|
||||
sudo tar -C "$$(dirname $$(which containerd))" -zxvf - containerd-shim-runsc-v1
|
||||
|
||||
@@ -265,7 +265,6 @@ copy = $(call header,COPY $(1) $(2)) && $(call build_paths,$(1),cp -fa {} $(
|
||||
run = $(call header,RUN $(1) $(2)) && $(call build_paths,$(1),{} $(2))
|
||||
sudo = $(call header,SUDO $(1) $(2)) && $(call build_paths,$(1),sudo -E {} $(2))
|
||||
test = $(call header,TEST $(1)) && $(call wrapper,$(BAZEL) test --strip=never $(BAZEL_OPTIONS) $(TEST_OPTIONS) $(1))
|
||||
sudocopy = $(call header,COPY $(1) $(2)) && $(call build_paths,$(1),sudo cp -fa {} $(2))
|
||||
|
||||
clean: ## Cleans the bazel cache.
|
||||
@$(call clean)
|
||||
|
||||
@@ -65,9 +65,12 @@ install_helper() {
|
||||
#
|
||||
# Ubuntu 16.04 has only btrfs-tools, while 18.04 has a transitional package,
|
||||
# and later versions no longer have the transitional package.
|
||||
#
|
||||
# If we can't detect the VERSION_ID, we assume it's a newer version and use
|
||||
# libbtrfs-dev.
|
||||
source /etc/os-release
|
||||
declare BTRFS_DEV
|
||||
if [[ "${VERSION_ID%.*}" -le "18" ]]; then
|
||||
if [[ ! -z "${VERSION_ID}" && "${VERSION_ID%.*}" -le "18" ]]; then
|
||||
BTRFS_DEV="btrfs-tools"
|
||||
else
|
||||
BTRFS_DEV="libbtrfs-dev"
|
||||
|
||||
Reference in New Issue
Block a user