Skip to content

Commit

Permalink
test: add a squashfs and tar interop test (#540)
Browse files Browse the repository at this point in the history
Changelog: use "EOF" to avoid $ expansion

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
Signed-off-by: Serge Hallyn <serge@hallyn.com>
  • Loading branch information
rchincha authored Nov 11, 2023
1 parent dcc1eca commit 356d628
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions test/squashfs.bats
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,46 @@ EOF
cat layer1/message
[ "$(cat layer1/message)" == "foo bar" ]
}

@test "build squashfs then tar" {
echo "x" > x
cat > stacker.yaml <<"EOF"
install-base:
build_only: true
from:
type: docker
url: "docker://zothub.io/machine/bootkit/rootfs:v0.0.17.231018-squashfs"
install-rootfs-pkg:
from:
type: built
tag: install-base
build_only: true
run: |
#!/bin/sh -ex
writefile() {
mkdir -p "${1%/*}"
echo "write $1" 1>&2
cat >"$1"
}
writefile /etc/systemd/network/20-wire-enp0s-dhcp.network <<"END"
[Match]
Name=enp0s*
[Network]
DHCP=yes
END
demo-zot:
from:
type: built
tag: install-rootfs-pkg
import:
- x
run: |
#!/bin/sh -ex
cp /stacker/imports/x /usr/bin/x
EOF
stacker build --layer-type=squashfs
stacker build --layer-type=tar
}

0 comments on commit 356d628

Please sign in to comment.