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

ERL-467: nemos-images-reference-*: *: add checkbox-erlangen-classic snap #55

Merged
merged 7 commits into from
Dec 14, 2023
19 changes: 15 additions & 4 deletions .github/workflows/nemos-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,18 @@ jobs:
BUILD_DIR="$(mktemp -d)"
# If we are building for amd64, then we can build natively. Otherwise,
# we need to use the Kiwi boxbuild plugin to build in a VM
if [ "${{ matrix.config }}" = "reference" ]; then
PROFILE="development"
else
PROFILE="bootstrapped"
fi
if [ "${{ matrix.arch }}" = "amd64" ]; then
sudo kiwi-ng --debug --profile bootstrapped \
sudo kiwi-ng --debug --profile "${PROFILE}" \
--config nemos-images-${{ matrix.config }}-${{ matrix.series }}/kiwi.yaml \
system build --target-dir "${BUILD_DIR}" \
--description nemos-images-${{ matrix.config }}-${{ matrix.series }}/qemu-${{ matrix.arch}}/
else
sudo kiwi-ng --debug --profile bootstrapped \
sudo kiwi-ng --debug --profile "${PROFILE}" \
system boxbuild \
--box ubuntu --aarch64 --machine=virt --no-accel --cpu cortex-a53 \
--box-memory=$(( 2 * 1024 )) --box-smp-cpus=2 -- \
Expand All @@ -67,7 +72,8 @@ jobs:
go install github.com/snapcore/spread/cmd/spread@latest
- name: "Run the spread tests inside QEMU"
run: |
~/go/bin/spread -v "adhoc:nemos-image-${{ matrix.config }}-${{ matrix.series }}-${{ matrix.arch }}"
sudo ln -svr ${HOME}/.spread /root/.spread
sudo ~/go/bin/spread -v "adhoc:nemos-image-${{ matrix.config }}-${{ matrix.series }}-${{ matrix.arch }}"
s32g274ardb2:
runs-on: "ubuntu-latest"
strategy:
Expand Down Expand Up @@ -97,7 +103,12 @@ jobs:
qemu-system-arm
- name: "Run Kiwi"
run: |
sudo kiwi-ng --debug --profile bootstrapped \
if [ "${{ matrix.config }}" = "reference" ]; then
PROFILE="development"
else
PROFILE="bootstrapped"
fi
sudo kiwi-ng --debug --profile "${PROFILE}" \
system boxbuild \
--box ubuntu --aarch64 --machine=virt --no-accel --cpu cortex-a53 \
--box-memory=$(( 2 * 1024 )) --box-smp-cpus=2 -- \
Expand Down
1 change: 1 addition & 0 deletions nemos-images-minimal-lunar/qemu-amd64/config.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later

#======================================
# Functions...
#--------------------------------------
Expand Down
1 change: 1 addition & 0 deletions nemos-images-minimal-mantic/qemu-amd64/config.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later

#======================================
# Functions...
#--------------------------------------
Expand Down
17 changes: 12 additions & 5 deletions nemos-images-reference-lunar/qemu-amd64/config.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later

#======================================
# Functions...
#--------------------------------------
Expand Down Expand Up @@ -52,16 +53,22 @@ for profile in ${kiwi_profiles//,/ }; do
# This requires network access to the Snap Store in Kiwi.
mkdir -p /var/lib/snapd/seed
echo "snaps": > /var/lib/snapd/seed/seed.yaml
for snap in snapd checkbox22 checkbox core22; do
snap download $snap
for snap in snapd checkbox22 checkbox-erlangen-classic core22; do
# Always download the very latest checkbox-erlangen-classic snap
if [ "${snap}" = "checkbox-erlangen-classic" ]; then
CHANNEL="latest/edge"
else
CHANNEL="latest/stable"
fi
snap download "${snap}" --channel "${CHANNEL}"
# Add this new snap to the list of seeded snaps
cat >> /var/lib/snapd/seed/seed.yaml << EOF
- name: ${snap}
channel: latest/stable
channel: ${CHANNEL}
file: $(ls ${snap}_*.snap)
EOF
# Checkbox snap requires classic confinement mode
if [ "${snap}" = "checkbox" ]; then
# checkbox-erlangen-classic snap requires classic confinement mode
if [ "${snap}" = "checkbox-erlangen-classic" ]; then
cat >> /var/lib/snapd/seed/seed.yaml << EOF
classic: true
EOF
Expand Down
17 changes: 12 additions & 5 deletions nemos-images-reference-lunar/qemu-arm64/config.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later

#======================================
# Functions...
#--------------------------------------
Expand Down Expand Up @@ -52,16 +53,22 @@ for profile in ${kiwi_profiles//,/ }; do
# This requires network access to the Snap Store in Kiwi.
mkdir -p /var/lib/snapd/seed
echo "snaps": > /var/lib/snapd/seed/seed.yaml
for snap in snapd checkbox22 checkbox core22; do
snap download $snap
for snap in snapd checkbox22 checkbox-erlangen-classic core22; do
# Always download the very latest checkbox-erlangen-classic snap
if [ "${snap}" = "checkbox-erlangen-classic" ]; then
CHANNEL="latest/edge"
else
CHANNEL="latest/stable"
fi
snap download "${snap}" --channel "${CHANNEL}"
# Add this new snap to the list of seeded snaps
cat >> /var/lib/snapd/seed/seed.yaml << EOF
- name: ${snap}
channel: latest/stable
channel: ${CHANNEL}
file: $(ls ${snap}_*.snap)
EOF
# Checkbox snap requires classic confinement mode
if [ "${snap}" = "checkbox" ]; then
# checkbox-erlangen-classic snap requires classic confinement mode
if [ "${snap}" = "checkbox-erlangen-classic" ]; then
cat >> /var/lib/snapd/seed/seed.yaml << EOF
classic: true
EOF
Expand Down
16 changes: 11 additions & 5 deletions nemos-images-reference-lunar/s32g274ardb2/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,22 @@ for profile in ${kiwi_profiles//,/ }; do
# This requires network access to the Snap Store in Kiwi.
mkdir -p /var/lib/snapd/seed
echo "snaps": > /var/lib/snapd/seed/seed.yaml
for snap in snapd checkbox22 checkbox core22; do
snap download $snap
for snap in snapd checkbox22 checkbox-erlangen-classic core22; do
# Always download the very latest checkbox-erlangen-classic snap
if [ "${snap}" = "checkbox-erlangen-classic" ]; then
CHANNEL="latest/edge"
else
CHANNEL="latest/stable"
fi
snap download "${snap}" --channel "${CHANNEL}"
# Add this new snap to the list of seeded snaps
cat >> /var/lib/snapd/seed/seed.yaml << EOF
- name: ${snap}
channel: latest/stable
channel: ${CHANNEL}
file: $(ls ${snap}_*.snap)
EOF
# Checkbox snap requires classic confinement mode
if [ "${snap}" = "checkbox" ]; then
# checkbox-erlangen-classic snap requires classic confinement mode
if [ "${snap}" = "checkbox-erlangen-classic" ]; then
cat >> /var/lib/snapd/seed/seed.yaml << EOF
classic: true
EOF
Expand Down
17 changes: 12 additions & 5 deletions nemos-images-reference-mantic/qemu-amd64/config.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later

#======================================
# Functions...
#--------------------------------------
Expand Down Expand Up @@ -52,16 +53,22 @@ for profile in ${kiwi_profiles//,/ }; do
# This requires network access to the Snap Store in Kiwi.
mkdir -p /var/lib/snapd/seed
echo "snaps": > /var/lib/snapd/seed/seed.yaml
for snap in snapd checkbox22 checkbox core22; do
snap download $snap
for snap in snapd checkbox22 checkbox-erlangen-classic core22; do
# Always download the very latest checkbox-erlangen-classic snap
if [ "${snap}" = "checkbox-erlangen-classic" ]; then
CHANNEL="latest/edge"
else
CHANNEL="latest/stable"
fi
snap download "${snap}" --channel "${CHANNEL}"
# Add this new snap to the list of seeded snaps
cat >> /var/lib/snapd/seed/seed.yaml << EOF
- name: ${snap}
channel: latest/stable
channel: ${CHANNEL}
file: $(ls ${snap}_*.snap)
EOF
# Checkbox snap requires classic confinement mode
if [ "${snap}" = "checkbox" ]; then
# checkbox-erlangen-classic snap requires classic confinement mode
if [ "${snap}" = "checkbox-erlangen-classic" ]; then
cat >> /var/lib/snapd/seed/seed.yaml << EOF
classic: true
EOF
Expand Down
17 changes: 12 additions & 5 deletions nemos-images-reference-mantic/qemu-arm64/config.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later

#======================================
# Functions...
#--------------------------------------
Expand Down Expand Up @@ -52,16 +53,22 @@ for profile in ${kiwi_profiles//,/ }; do
# This requires network access to the Snap Store in Kiwi.
mkdir -p /var/lib/snapd/seed
echo "snaps": > /var/lib/snapd/seed/seed.yaml
for snap in snapd checkbox22 checkbox core22; do
snap download $snap
for snap in snapd checkbox22 checkbox-erlangen-classic core22; do
# Always download the very latest checkbox-erlangen-classic snap
if [ "${snap}" = "checkbox-erlangen-classic" ]; then
CHANNEL="latest/edge"
else
CHANNEL="latest/stable"
fi
snap download "${snap}" --channel "${CHANNEL}"
# Add this new snap to the list of seeded snaps
cat >> /var/lib/snapd/seed/seed.yaml << EOF
- name: ${snap}
channel: latest/stable
channel: ${CHANNEL}
file: $(ls ${snap}_*.snap)
EOF
# Checkbox snap requires classic confinement mode
if [ "${snap}" = "checkbox" ]; then
# checkbox-erlangen-classic snap requires classic confinement mode
if [ "${snap}" = "checkbox-erlangen-classic" ]; then
cat >> /var/lib/snapd/seed/seed.yaml << EOF
classic: true
EOF
Expand Down
16 changes: 11 additions & 5 deletions nemos-images-reference-mantic/s32g274ardb2/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,22 @@ for profile in ${kiwi_profiles//,/ }; do
# This requires network access to the Snap Store in Kiwi.
mkdir -p /var/lib/snapd/seed
echo "snaps": > /var/lib/snapd/seed/seed.yaml
for snap in snapd checkbox22 checkbox core22; do
snap download $snap
for snap in snapd checkbox22 checkbox-erlangen-classic core22; do
# Always download the very latest checkbox-erlangen-classic snap
if [ "${snap}" = "checkbox-erlangen-classic" ]; then
CHANNEL="latest/edge"
else
CHANNEL="latest/stable"
fi
snap download "${snap}" --channel "${CHANNEL}"
# Add this new snap to the list of seeded snaps
cat >> /var/lib/snapd/seed/seed.yaml << EOF
- name: ${snap}
channel: latest/stable
channel: ${CHANNEL}
file: $(ls ${snap}_*.snap)
EOF
# Checkbox snap requires classic confinement mode
if [ "${snap}" = "checkbox" ]; then
# checkbox-erlangen-classic snap requires classic confinement mode
if [ "${snap}" = "checkbox-erlangen-classic" ]; then
cat >> /var/lib/snapd/seed/seed.yaml << EOF
classic: true
EOF
Expand Down
22 changes: 22 additions & 0 deletions tests/spread/snaps/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---

summary: "Verify installed snaps"

systems:
- "nemos-image-reference-*"

execute: |
# Wait for snapd to finish setting itself up
TIMEOUT=1000
while [ $(systemctl is-active snapd.seeded) != "active" ] && [ $TIMEOUT -gt 0 ]; do
sleep 1
TIMEOUT=$((${TIMEOUT} - 1))
done

for snap in \
snapd \
checkbox22 \
checkbox-erlangen-classic \
core22; do
snap list "${snap}"
done