2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

travis: Do not run privileged containers in LXD

Travis uses unprivileged containers for aarch64 in LXD. Docker with
'--privileged' fails in such situation. This changes the travis setup
to only start docker with '--privileged' if running on x86_64.

Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
Adrian Reber
2019-11-04 08:54:22 +01:00
committed by Andrei Vagin
parent 62953d4334
commit 6be414bb2b

View File

@@ -13,6 +13,9 @@ endif
TARGETS := alpine fedora-rawhide centos
ZDTM_OPTIONS :=
UNAME := $(shell uname -m)
export UNAME
alpine: ZDTM_OPTIONS=-x zdtm/static/binfmt_misc -x zdtm/static/netns-nf -x zdtm/static/sched_policy00 -x zdtm/static/seccomp_strict -x zdtm/static/sigaltstack -x zdtm/static/signalfd00 -x zdtm/static/config_inotify_irmap
@@ -23,17 +26,29 @@ define DOCKER_JSON
endef
export DOCKER_JSON
$(TARGETS):
echo "$$DOCKER_JSON" > /etc/docker/daemon.json
systemctl restart docker
$(MAKE) -C ../build $@$(target-suffix)
docker run --env-file docker.env --rm -it --privileged -v /lib/modules:/lib/modules --tmpfs /run criu-$@ scripts/travis/travis-tests
fedora-asan:
echo "$$DOCKER_JSON" > /etc/docker/daemon.json
systemctl restart docker
ifeq ($(UNAME),x86_64)
CONTAINER_OPTS := --rm -it --privileged -v /lib/modules:/lib/modules --tmpfs /run
else
CONTAINER_OPTS := --rm -v /lib/modules:/lib/modules --tmpfs /run
endif
restart-docker:
if [ "$$UNAME" = "x86_64" ]; then \
echo "$$DOCKER_JSON" > /etc/docker/daemon.json; \
cat /etc/docker/daemon.json; \
systemctl status docker; \
systemctl restart docker; \
systemctl status docker; \
fi
$(TARGETS): restart-docker
$(MAKE) -C ../build $@$(target-suffix)
docker run --rm -it --privileged -v /lib/modules:/lib/modules --tmpfs /run criu-$@ ./scripts/travis/asan.sh $(ZDTM_OPTIONS)
docker run --env-file docker.env $(CONTAINER_OPTS) criu-$@ scripts/travis/travis-tests
fedora-asan: restart-docker
$(MAKE) -C ../build $@$(target-suffix)
docker run -it $(CONTAINER_OPTS) criu-$@ ./scripts/travis/asan.sh $(ZDTM_OPTIONS)
docker-test:
./docker-test.sh