Skip to content

Commit 604dbfb

Browse files
author
Bin Lu
committed
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 <[email protected]>
1 parent c4f49e2 commit 604dbfb

File tree

4 files changed

+32
-5
lines changed

4 files changed

+32
-5
lines changed

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ RUN mkdir -p /usr/src/criu \
5050

5151
# setup a playground for us to spawn containers in
5252
ENV ROOTFS /busybox
53-
RUN mkdir -p ${ROOTFS} \
54-
&& curl -o- -sSL 'https://github.com/docker-library/busybox/raw/a0558a9006ce0dd6f6ec5d56cfd3f32ebeeb815f/glibc/busybox.tar.xz' | tar xfJC - ${ROOTFS}
55-
53+
RUN mkdir -p ${ROOTFS}
5654

5755
COPY script/tmpmount /
5856
WORKDIR /go/src/github.com/opencontainers/runc
5957
ENTRYPOINT ["/tmpmount"]
6058

6159
ADD . /go/src/github.com/opencontainers/runc
60+
61+
RUN . tests/integration/multi-arch.bash \
62+
&& curl -o- -sSL `get_busybox` | tar xfJC - ${ROOTFS}

tests/integration/helpers.bash

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
# Root directory of integration tests.
44
INTEGRATION_ROOT=$(dirname "$(readlink -f "$BASH_SOURCE")")
5+
6+
. ${INTEGRATION_ROOT}/multi-arch.bash
7+
58
RUNC="${INTEGRATION_ROOT}/../../runc"
69
RECVTTY="${INTEGRATION_ROOT}/../../contrib/cmd/recvtty/recvtty"
710
GOPATH="$(mktemp -d --tmpdir runc-integration-gopath.XXXXXX)"
@@ -14,7 +17,8 @@ BUSYBOX_IMAGE="$BATS_TMPDIR/busybox.tar"
1417
BUSYBOX_BUNDLE="$BATS_TMPDIR/busyboxtest"
1518

1619
# hello-world in tar format
17-
HELLO_IMAGE="$TESTDATA/hello-world.tar"
20+
HELLO_FILE=`get_hello`
21+
HELLO_IMAGE="$TESTDATA/$HELLO_FILE"
1822
HELLO_BUNDLE="$BATS_TMPDIR/hello-world"
1923

2024
# CRIU PATH
@@ -270,7 +274,7 @@ function setup_busybox() {
270274
BUSYBOX_IMAGE="/testdata/busybox.tar"
271275
fi
272276
if [ ! -e $BUSYBOX_IMAGE ]; then
273-
curl -o $BUSYBOX_IMAGE -sSL 'https://github.com/docker-library/busybox/raw/a0558a9006ce0dd6f6ec5d56cfd3f32ebeeb815f/glibc/busybox.tar.xz'
277+
curl -o $BUSYBOX_IMAGE -sSL `get_busybox`
274278
fi
275279
tar --exclude './dev/*' -C "$BUSYBOX_BUNDLE"/rootfs -xf "$BUSYBOX_IMAGE"
276280
cd "$BUSYBOX_BUNDLE"

tests/integration/multi-arch.bash

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
get_busybox(){
3+
case $(go env GOARCH) in
4+
arm64)
5+
echo 'https://github.com/docker-library/busybox/raw/23fbd9c43e0f4bec7605091bfba23db278c367ac/glibc/busybox.tar.xz'
6+
;;
7+
*)
8+
echo 'https://github.com/docker-library/busybox/raw/a0558a9006ce0dd6f6ec5d56cfd3f32ebeeb815f/glibc/busybox.tar.xz'
9+
;;
10+
esac
11+
}
12+
13+
get_hello(){
14+
case $(go env GOARCH) in
15+
arm64)
16+
echo 'hello-world-aarch64.tar'
17+
;;
18+
*)
19+
echo 'hello-world.tar'
20+
;;
21+
esac
22+
}
12.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)