Skip to content
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

Spread lxd jammy test #17

Open
wants to merge 9 commits into
base: ubuntu-22.04
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:

integration-tests:
name: Integration tests
uses: canonical/chisel-releases/.github/workflows/spread.yaml@main
uses: cjdcordeiro/chisel-releases/.github/workflows/spread.yaml@main
1 change: 1 addition & 0 deletions slices/base-passwd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
mutate: |
gr = content.read("/usr/share/base-passwd/group.master")
content.write("/etc/group", gr)

Check failure on line 16 in slices/base-passwd.yaml

View workflow job for this annotation

GitHub Actions / Lint / Lint

16:1 [trailing-spaces] trailing spaces
pw = content.read("/usr/share/base-passwd/passwd.master")
content.write("/etc/passwd", pw)

Expand Down
2 changes: 1 addition & 1 deletion slices/ca-certificates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ essential:
- ca-certificates_copyright

slices:
# This slice only contains the certificates bundle at /etc/ssl/certs/ca-certificates.crt.
# FOOThis slice only contains the certificates bundle at /etc/ssl/certs/ca-certificates.crt.
# To keep the individual certificates at /usr/share/ca-certificates/mozilla/ and the
# configuration file at /etc/ca-certificates.conf, please use the "data-with-certs" slice.
# Please note that the mutation script (partially) mimics the deb's maintainer
Expand Down
39 changes: 34 additions & 5 deletions spread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,37 @@ exclude:
- .github

backends:
# We can switch back to using the official Spread LXD backend after
# https://github.com/snapcore/spread/pulls?q=is%3Apr+is%3Aopen+LXD+updated%3A%3C%3D2024-02-23+
lxd:
type: adhoc
allocate: |
set -x
release=$(echo $SPREAD_SYSTEM | awk -F '-' '{print $2}')

# Ideally, we would add the ubuntu-minimal remote
# e.g. https://cloud-images.ubuntu.com/minimal/releases/jammy/
# but that would effectively change the host's LXC configurations.

echo "Allocating $SPREAD_SYSTEM..."
lxc launch --ephemeral ubuntu:$release $SPREAD_SYSTEM
until lxc exec $SPREAD_SYSTEM -- pgrep sshd &>/dev/null
do
sleep 5
done
lxc exec $SPREAD_SYSTEM -- sed -i 's/^\s*#\?\s*\(PermitRootLogin\|PasswordAuthentication\)\>.*/\1 yes/' /etc/ssh/sshd_config
lxc exec $SPREAD_SYSTEM -- bash -c "sed -i 's/^\s*\(PermitRootLogin\|PasswordAuthentication\)\>.*/# COMMENTED OUT BY SPREAD: \0/' /etc/ssh/sshd_config.d/* || true"
lxc exec $SPREAD_SYSTEM -- bash -c "test -d /etc/ssh/sshd_config.d && echo -e 'PermitRootLogin=yes\nPasswordAuthentication=yes' > /etc/ssh/sshd_config.d/00-spread.conf"
lxc exec $SPREAD_SYSTEM -- bash -c "echo root:${SPREAD_SYSTEM_PASSWORD} | chpasswd"
lxc exec $SPREAD_SYSTEM -- killall -HUP sshd
ADDRESS `lxc list --format=json $SPREAD_SYSTEM | jq -r '.[0].state.network.eth0.addresses[] | select(.family=="inet") | .address'`
discard: lxc stop $SPREAD_SYSTEM || true
systems:
- ubuntu-jammy:
password: ubuntu

# The Docker backend is recommended for comprehensive multi-arch tests, but
# not ideal for tests that need to perform privileged operations (like "mount").
docker:
type: adhoc
allocate: |
Expand Down Expand Up @@ -48,9 +79,8 @@ backends:
password: ubuntu
- ubuntu-22.04-s390x:
password: ubuntu
# Re-enable risvc64 once we have re-enabled this arch for the Ubuntu container
# - ubuntu-22.04-riscv64:
# password: ubuntu
- ubuntu-22.04-riscv64:
password: ubuntu

prepare: |
# Deb arch to GOARCH
Expand All @@ -66,8 +96,7 @@ prepare: |

tar -xf $chisel_tar -C /usr/local/bin

prepare-each:
chisel version
prepare-each: chisel version

suites:
tests/spread/integration/:
Expand Down
Loading