Skip to content

Commit

Permalink
tests: replace local hello world bundle with busybox bundle
Browse files Browse the repository at this point in the history
Currently only amd64 and arm64v8 tarball have been checked in testdata,
while busybox bundle is downloaded on fly, and supports multiple architectures.

To enable integration tests for more architectures, the hello world
bundle is replaced by busybox one.

Signed-off-by: Shengjing Zhu <zhsj@debian.org>
(cherry picked from commit 66bf371)
  • Loading branch information
zhsj authored and kolyshkin committed Feb 8, 2023
1 parent e9f8fd3 commit b8ebeec
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 16 deletions.
3 changes: 1 addition & 2 deletions tests/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ load helpers

# setup is called at the beginning of every test.
function setup() {
setup_hello
setup_busybox
}

# teardown is called at the end of every test.
Expand All @@ -77,5 +77,4 @@ function teardown() {
# check expected output
[[ "${output}" == *"Hello"* ]]
}

```
3 changes: 2 additions & 1 deletion tests/integration/debug.bats
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
load helpers

function setup() {
setup_hello
setup_busybox
update_config '.process.args = ["/bin/echo", "Hello World"]'
}

function teardown() {
Expand Down
4 changes: 0 additions & 4 deletions tests/integration/get-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,3 @@ DEBIAN_IMAGE="$TESTDATA/debian-${arch}.tar.xz"
get "$DEBIAN_IMAGE" \
"https://github.com/debuerreotype/docker-debian-artifacts/raw/dist-${arch}/buster/slim/rootfs.tar.xz"
echo "DEBIAN_IMAGE=$DEBIAN_IMAGE"

# hello-world is local, no need to download.
HELLO_IMAGE="$TESTDATA/hello-world-${arch}.tar"
echo "HELLO_IMAGE=$HELLO_IMAGE"
5 changes: 0 additions & 5 deletions tests/integration/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -569,11 +569,6 @@ function setup_busybox() {
setup_bundle "$BUSYBOX_IMAGE"
}

function setup_hello() {
setup_bundle "$HELLO_IMAGE"
update_config '(.. | select(.? == "sh")) |= "/hello"'
}

function setup_debian() {
setup_bundle "$DEBIAN_IMAGE"
}
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/mounts_sshfs.bats
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ function setup() {
skip "test requires working sshfs mounts"
fi

setup_hello
setup_busybox
update_config '.process.args = ["/bin/echo", "Hello World"]'
}

function teardown() {
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
load helpers

function setup() {
setup_hello
setup_busybox
update_config '.process.args = ["/bin/echo", "Hello World"]'
}

function teardown() {
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/spec.bats
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
load helpers

function setup() {
setup_hello
setup_busybox
update_config '.process.args = ["/bin/echo", "Hello World"]'
}

function teardown() {
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/start_hello.bats
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
load helpers

function setup() {
setup_hello
setup_busybox
update_config '.process.args = ["/bin/echo", "Hello World"]'
}

function teardown() {
Expand Down
Binary file removed tests/integration/testdata/hello-world-amd64.tar
Binary file not shown.
Binary file removed tests/integration/testdata/hello-world-arm64v8.tar
Binary file not shown.

0 comments on commit b8ebeec

Please sign in to comment.