From 604dbfbe12a3fb68365601a3605c297f930eb411 Mon Sep 17 00:00:00 2001 From: Bin Lu Date: Mon, 6 Nov 2017 18:36:56 -0800 Subject: [PATCH] enable integration test on arm64 platform Currently, integration test can't be done on arm64 platform due to several issues. Fix points: 1, add busybox.tar with arm64 format 2, add hello-world.tar with arm64 format Signed-off-by: Bin Lu --- Dockerfile | 7 +++--- tests/integration/helpers.bash | 8 +++++-- tests/integration/multi-arch.bash | 22 ++++++++++++++++++ .../testdata/hello-world-aarch64.tar | Bin 0 -> 12800 bytes 4 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 tests/integration/multi-arch.bash create mode 100644 tests/integration/testdata/hello-world-aarch64.tar diff --git a/Dockerfile b/Dockerfile index 168d8999..7767ad1c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,12 +50,13 @@ RUN mkdir -p /usr/src/criu \ # setup a playground for us to spawn containers in ENV ROOTFS /busybox -RUN mkdir -p ${ROOTFS} \ - && curl -o- -sSL 'https://github.com/docker-library/busybox/raw/a0558a9006ce0dd6f6ec5d56cfd3f32ebeeb815f/glibc/busybox.tar.xz' | tar xfJC - ${ROOTFS} - +RUN mkdir -p ${ROOTFS} COPY script/tmpmount / WORKDIR /go/src/github.com/opencontainers/runc ENTRYPOINT ["/tmpmount"] ADD . /go/src/github.com/opencontainers/runc + +RUN . tests/integration/multi-arch.bash \ + && curl -o- -sSL `get_busybox` | tar xfJC - ${ROOTFS} diff --git a/tests/integration/helpers.bash b/tests/integration/helpers.bash index 66dd622a..99d48b7b 100644 --- a/tests/integration/helpers.bash +++ b/tests/integration/helpers.bash @@ -2,6 +2,9 @@ # Root directory of integration tests. INTEGRATION_ROOT=$(dirname "$(readlink -f "$BASH_SOURCE")") + +. ${INTEGRATION_ROOT}/multi-arch.bash + RUNC="${INTEGRATION_ROOT}/../../runc" RECVTTY="${INTEGRATION_ROOT}/../../contrib/cmd/recvtty/recvtty" GOPATH="$(mktemp -d --tmpdir runc-integration-gopath.XXXXXX)" @@ -14,7 +17,8 @@ BUSYBOX_IMAGE="$BATS_TMPDIR/busybox.tar" BUSYBOX_BUNDLE="$BATS_TMPDIR/busyboxtest" # hello-world in tar format -HELLO_IMAGE="$TESTDATA/hello-world.tar" +HELLO_FILE=`get_hello` +HELLO_IMAGE="$TESTDATA/$HELLO_FILE" HELLO_BUNDLE="$BATS_TMPDIR/hello-world" # CRIU PATH @@ -270,7 +274,7 @@ function setup_busybox() { BUSYBOX_IMAGE="/testdata/busybox.tar" fi if [ ! -e $BUSYBOX_IMAGE ]; then - curl -o $BUSYBOX_IMAGE -sSL 'https://github.com/docker-library/busybox/raw/a0558a9006ce0dd6f6ec5d56cfd3f32ebeeb815f/glibc/busybox.tar.xz' + curl -o $BUSYBOX_IMAGE -sSL `get_busybox` fi tar --exclude './dev/*' -C "$BUSYBOX_BUNDLE"/rootfs -xf "$BUSYBOX_IMAGE" cd "$BUSYBOX_BUNDLE" diff --git a/tests/integration/multi-arch.bash b/tests/integration/multi-arch.bash new file mode 100644 index 00000000..52c59bf7 --- /dev/null +++ b/tests/integration/multi-arch.bash @@ -0,0 +1,22 @@ +#!/bin/bash +get_busybox(){ + case $(go env GOARCH) in + arm64) + echo 'https://github.com/docker-library/busybox/raw/23fbd9c43e0f4bec7605091bfba23db278c367ac/glibc/busybox.tar.xz' + ;; + *) + echo 'https://github.com/docker-library/busybox/raw/a0558a9006ce0dd6f6ec5d56cfd3f32ebeeb815f/glibc/busybox.tar.xz' + ;; + esac +} + +get_hello(){ + case $(go env GOARCH) in + arm64) + echo 'hello-world-aarch64.tar' + ;; + *) + echo 'hello-world.tar' + ;; + esac +} diff --git a/tests/integration/testdata/hello-world-aarch64.tar b/tests/integration/testdata/hello-world-aarch64.tar new file mode 100644 index 0000000000000000000000000000000000000000..186c8aefc47da2e2acc74c636e53204c63253c41 GIT binary patch literal 12800 zcmeHNO^*~s7_Qmob1=aJi6k1R1rCNRJ>4@qGek^WScLT>M%N|rhCSW2(;d3ICSBG0 zAqUsQ9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