-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable integration test on arm64 platform #1642
Conversation
Dockerfile
Outdated
|
||
RUN case $(uname -m) in \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would always recommend against using uname
for platform detection, both because it will often return the wrong result (building arm/v7
images on an arm64
box, for example) and because for many ARM 32-bit platforms it gets a little out of hand, and would recommend instead using something like dpkg --print-architecture
or apk --print-arch
to get a simple and consistent string that represents the architecture of the image/userspace instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tianon
Can you check it?
Thanks.
Hi @tianon , |
@avagin |
tests/integration/helpers.bash
Outdated
@@ -14,7 +14,15 @@ BUSYBOX_IMAGE="$BATS_TMPDIR/busybox.tar" | |||
BUSYBOX_BUNDLE="$BATS_TMPDIR/busyboxtest" | |||
|
|||
# hello-world in tar format | |||
HELLO_IMAGE="$TESTDATA/hello-world.tar" | |||
case $(dpkg --print-architecture) in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use dpkg, non debian systems won't be able to run local integration tests, are there any other standard way to detect the osarch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$(go env GOARCH)
seems like it would be a much better idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I will update it.
tests/integration/helpers.bash
Outdated
;; | ||
*) | ||
HELLO_IMAGE="$TESTDATA/hello-world.tar" | ||
;; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't necessary to have two different filenames for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cyphar I uploaded the file of 'hello-world-aarch64.tar' in 'runc/tests/integration/testdata/'.
The file of 'hello-world.tar' can't be used on Arm64 platform, because the binary files with x86 format can't be used on Arm platform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't notice that you included the .tar
in testdata
(I thought we always downloaded the rootfs archive).
Dockerfile
Outdated
*) \ | ||
curl -o- -sSL 'https://github.com/docker-library/busybox/raw/a0558a9006ce0dd6f6ec5d56cfd3f32ebeeb815f/glibc/busybox.tar.xz' | tar xfJC - ${ROOTFS} \ | ||
;; \ | ||
esac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a script that both this and helpers.bash
call into. No point in replicating this logic in more than one place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cyphar
Hi, I have moved all the multi-arch related code into 'tests/integration/multi-arch.bash'.
Please check it.
Thanks.
tests/integration/helpers.bash
Outdated
@@ -270,7 +278,14 @@ 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' | |||
case $(dpkg --print-architecture) in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use $(go env GOARCH)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I will update it.
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 <bin.lu@arm.com>
@cyphar |
@avagin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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 bin.lu@arm.com