Skip to content

Commit b2d9e05

Browse files
committed
feat(spread): add install.sh integration test suite with image-garden backend
Add Spread integration tests for install.sh using the image-garden backend to provision cloud VMs. The test suite covers three install paths across Ubuntu 24.04/26.04, Debian 13, and Fedora 44: - install-snap-only: installs OpenShell as a snap on systems with snapd but no docker - install-classic: installs OpenShell via native packages (deb/rpm) on systems with docker (either with or without snapd) Cloud-init instance templates in .image-garden.mk define the pre- installed software per system variant. A .gitignore in .image-garden/ excludes generated disk images and VM artifacts. Tests require image-garden snap, version 0.6 from the --candidate channel. Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
1 parent 04398ea commit b2d9e05

5 files changed

Lines changed: 327 additions & 0 deletions

File tree

‎.image-garden.mk‎

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Ubuntu 24.04 instances
5+
6+
# snapd-no-docker: snapd only, no docker.
7+
# install.sh chooses the "snap" install path.
8+
$(eval $(call define-instance,ubuntu-cloud-24.04,snapd-no-docker))
9+
define UBUNTU_24.04@snapd-no-docker_CLOUD_INIT_USER_DATA_TEMPLATE
10+
$(CLOUD_INIT_USER_DATA_TEMPLATE)
11+
- snap wait system seed.loaded
12+
- snap install snapd
13+
packages:
14+
- snapd
15+
endef
16+
17+
# snapd-classic-docker: snapd + native docker (docker.io deb package).
18+
# install.sh chooses the "classic" install path because native docker is detected.
19+
$(eval $(call define-instance,ubuntu-cloud-24.04,snapd-classic-docker))
20+
define UBUNTU_24.04@snapd-classic-docker_CLOUD_INIT_USER_DATA_TEMPLATE
21+
$(CLOUD_INIT_USER_DATA_TEMPLATE)
22+
- snap wait system seed.loaded
23+
- snap install snapd
24+
packages:
25+
- snapd
26+
- docker.io
27+
endef
28+
29+
# no-snapd: snapd removed, docker.io installed.
30+
# install.sh chooses the "classic" install path because snapd is absent.
31+
$(eval $(call define-instance,ubuntu-cloud-24.04,no-snapd))
32+
define UBUNTU_24.04@no-snapd_CLOUD_INIT_USER_DATA_TEMPLATE
33+
$(CLOUD_INIT_USER_DATA_TEMPLATE)
34+
- apt-get purge -y snapd
35+
packages:
36+
- docker.io
37+
endef
38+
39+
# Ubuntu 26.04 instances
40+
41+
# snapd-no-docker: snapd only, no docker.
42+
# install.sh chooses the "snap" install path.
43+
$(eval $(call define-instance,ubuntu-cloud-26.04,snapd-no-docker))
44+
define UBUNTU_26.04@snapd-no-docker_CLOUD_INIT_USER_DATA_TEMPLATE
45+
$(CLOUD_INIT_USER_DATA_TEMPLATE)
46+
- snap wait system seed.loaded
47+
- snap install snapd
48+
packages:
49+
- snapd
50+
endef
51+
52+
# snapd-classic-docker: snapd + native docker (docker.io deb package).
53+
# install.sh chooses the "classic" install path because native docker is detected.
54+
$(eval $(call define-instance,ubuntu-cloud-26.04,snapd-classic-docker))
55+
define UBUNTU_26.04@snapd-classic-docker_CLOUD_INIT_USER_DATA_TEMPLATE
56+
$(CLOUD_INIT_USER_DATA_TEMPLATE)
57+
- snap wait system seed.loaded
58+
- snap install snapd
59+
packages:
60+
- snapd
61+
- docker.io
62+
endef
63+
64+
# no-snapd: snapd removed, docker.io installed.
65+
# install.sh chooses the "classic" install path because snapd is absent.
66+
$(eval $(call define-instance,ubuntu-cloud-26.04,no-snapd))
67+
define UBUNTU_26.04@no-snapd_CLOUD_INIT_USER_DATA_TEMPLATE
68+
$(CLOUD_INIT_USER_DATA_TEMPLATE)
69+
- apt-get purge -y snapd
70+
packages:
71+
- docker.io
72+
endef
73+
74+
# Debian 12 instances
75+
76+
# snapd-no-docker: snapd only, no docker.
77+
# install.sh chooses the "snap" install path.
78+
$(eval $(call define-instance,debian-cloud-13,snapd-no-docker))
79+
define DEBIAN_13@snapd-no-docker_CLOUD_INIT_USER_DATA_TEMPLATE
80+
$(CLOUD_INIT_USER_DATA_TEMPLATE)
81+
- snap wait system seed.loaded
82+
- snap install snapd
83+
packages:
84+
- snapd
85+
endef
86+
87+
# snapd-classic-docker: snapd + native docker (docker.io deb package).
88+
# install.sh chooses the "classic" install path because native docker is detected.
89+
$(eval $(call define-instance,debian-cloud-13,snapd-classic-docker))
90+
define DEBIAN_13@snapd-classic-docker_CLOUD_INIT_USER_DATA_TEMPLATE
91+
$(CLOUD_INIT_USER_DATA_TEMPLATE)
92+
- snap wait system seed.loaded
93+
- snap install snapd
94+
packages:
95+
- snapd
96+
- docker.io
97+
endef
98+
99+
# no-snapd: snapd removed, docker.io installed.
100+
# install.sh chooses the "classic" install path because snapd is absent.
101+
$(eval $(call define-instance,debian-cloud-13,no-snapd))
102+
define DEBIAN_13@no-snapd_CLOUD_INIT_USER_DATA_TEMPLATE
103+
$(CLOUD_INIT_USER_DATA_TEMPLATE)
104+
- apt-get purge -y snapd
105+
packages:
106+
- docker.io
107+
endef
108+
109+
# Fedora 44 instances
110+
111+
# snapd-no-docker: snapd only, no docker.
112+
# install.sh chooses the "snap" install path.
113+
$(eval $(call define-instance,fedora-cloud-44,snapd-no-docker))
114+
define FEDORA_44@snapd-no-docker_CLOUD_INIT_USER_DATA_TEMPLATE
115+
$(CLOUD_INIT_USER_DATA_TEMPLATE)
116+
- systemctl enable --now snapd.socket
117+
- snap wait system seed.loaded
118+
packages:
119+
- snapd
120+
endef
121+
122+
# snapd-docker: snapd + native docker (docker rpm package).
123+
# install.sh chooses the "classic" install path because native docker is detected.
124+
$(eval $(call define-instance,fedora-cloud-44,snapd-docker))
125+
define FEDORA_44@snapd-docker_CLOUD_INIT_USER_DATA_TEMPLATE
126+
$(CLOUD_INIT_USER_DATA_TEMPLATE)
127+
- systemctl enable --now snapd.socket
128+
- snap wait system seed.loaded
129+
packages:
130+
- snapd
131+
- docker
132+
endef
133+
134+
# no-snapd: just docker, no snapd.
135+
# install.sh chooses the "classic" install path because snapd is absent.
136+
$(eval $(call define-instance,fedora-cloud-44,no-snapd))
137+
define FEDORA_44@no-snapd_CLOUD_INIT_USER_DATA_TEMPLATE
138+
$(CLOUD_INIT_USER_DATA_TEMPLATE)
139+
packages:
140+
- docker
141+
endef

‎.image-garden/.gitignore‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
*.img
5+
*.iso
6+
*.lock
7+
*.log
8+
*.meta-data
9+
*.qcow2
10+
*.run
11+
*.user-data

‎spread.yaml‎

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
project: openshell
5+
6+
backends:
7+
garden:
8+
type: adhoc
9+
allocate: |
10+
# Spread automatically injects /snap/bin to PATH. When we are
11+
# running from the image-garden snap then SPREAD_HOST_PATH is the
12+
# original path before such modifications were applied. Snap
13+
# applications cannot normally run /snap/bin/* entry-points
14+
# successfully so re-set PATH to the original value, as provided by
15+
# snapcraft.
16+
if [ -n "${SPREAD_HOST_PATH-}" ]; then
17+
PATH="${SPREAD_HOST_PATH}"
18+
fi
19+
export GARDEN_ARCH="$(uname -m)"
20+
export SYSTEM="${SPREAD_SYSTEM/-plus-/+}"
21+
export SYSTEM="${SYSTEM/-at-/@}"
22+
exec image-garden allocate --spread "$SYSTEM"."$GARDEN_ARCH"
23+
discard: |
24+
# Spread automatically injects /snap/bin to PATH. When we are
25+
# running from the image-garden snap then SPREAD_HOST_PATH is the
26+
# original path before such modifications were applied. Snap
27+
# applications cannot normally run /snap/bin/* entry-points
28+
# successfully so re-set PATH to the original value, as provided by
29+
# snapcraft.
30+
if [ -n "${SPREAD_HOST_PATH-}" ]; then
31+
PATH="${SPREAD_HOST_PATH}"
32+
fi
33+
image-garden discard "$SPREAD_SYSTEM_ADDRESS"
34+
systems:
35+
# Each system name follows the pattern: {os}-{version}-{variant}.
36+
#
37+
# Three variants are available:
38+
#
39+
# snapd-no-docker — snapd installed, no docker. The installer
40+
# chooses the snap install path.
41+
#
42+
# *-classic-docker — snapd + native docker installed. The
43+
# installer chooses the classic (deb/rpm)
44+
# install path.
45+
#
46+
# no-snapd — docker installed, snapd absent. The
47+
# installer chooses the classic (deb/rpm)
48+
# install path.
49+
#
50+
# See .image-garden.mk for the cloud-init templates that define
51+
# the per-system setup.
52+
- ubuntu-cloud-24.04-at-snapd-no-docker:
53+
username: root
54+
password: root
55+
- ubuntu-cloud-24.04-at-snapd-classic-docker:
56+
username: root
57+
password: root
58+
- ubuntu-cloud-24.04-at-no-snapd:
59+
username: root
60+
password: root
61+
- ubuntu-cloud-26.04-at-snapd-no-docker:
62+
username: root
63+
password: root
64+
- ubuntu-cloud-26.04-at-snapd-classic-docker:
65+
username: root
66+
password: root
67+
- ubuntu-cloud-26.04-at-no-snapd:
68+
username: root
69+
password: root
70+
- debian-cloud-13-at-snapd-no-docker:
71+
username: root
72+
password: root
73+
- debian-cloud-13-at-snapd-classic-docker:
74+
username: root
75+
password: root
76+
- debian-cloud-13-at-no-snapd:
77+
username: root
78+
password: root
79+
- fedora-cloud-44-at-snapd-no-docker:
80+
username: root
81+
password: root
82+
environment:
83+
PATH: /var/lib/snapd/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
84+
- fedora-cloud-44-at-snapd-docker:
85+
username: root
86+
password: root
87+
environment:
88+
PATH: /var/lib/snapd/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
89+
- fedora-cloud-44-at-no-snapd:
90+
username: root
91+
password: root
92+
93+
exclude:
94+
- ".cache/*"
95+
- ".image-garden/*"
96+
- "target/*"
97+
- ".spread-reuse.*.yaml"
98+
99+
path: /root/openshell
100+
101+
debug-each: |
102+
echo "Kernel and architecture:"
103+
uname -a
104+
105+
echo "OS release info:"
106+
cat /etc/os-release
107+
108+
echo "Docker availability:"
109+
command -v docker >/dev/null 2>&1 && {
110+
docker version --format '{{.Server.Version}}' 2>/dev/null || true
111+
}
112+
command -v snap >/dev/null 2>&1 && snap list docker 2>/dev/null || true
113+
114+
suites:
115+
tests/install/:
116+
summary: Install smoke tests for OpenShell
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
summary: Install via native package (deb or rpm) on classic install path
5+
details: |
6+
This test installs OpenShell via the classic install path using a native
7+
package (deb on Ubuntu/Debian, rpm on Fedora). The installer chooses this
8+
path when native docker is present. On Ubuntu 24.04, Ubuntu 26.04 and
9+
Debian 13, snapd is removed via cloud-init for the no-snapd variant; on
10+
Fedora 44, snapd is absent by default. This verifies that the native
11+
package installation, user gateway service, and gateway registration work
12+
correctly across all supported systems.
13+
14+
systems:
15+
- ubuntu-cloud-24.04-at-snapd-classic-docker
16+
- ubuntu-cloud-24.04-at-no-snapd
17+
- ubuntu-cloud-26.04-at-snapd-classic-docker
18+
- ubuntu-cloud-26.04-at-no-snapd
19+
- debian-cloud-13-at-snapd-classic-docker
20+
- debian-cloud-13-at-no-snapd
21+
- fedora-cloud-44-at-snapd-docker
22+
- fedora-cloud-44-at-no-snapd
23+
24+
prepare: |
25+
cat "$SPREAD_PATH/install.sh" | sh
26+
27+
execute: |
28+
which openshell | NOMATCH "/snap/"
29+
openshell status | sed 's/\x1b\[[0-9;]*m//g' | MATCH "Status: Connected"
30+
31+
# TODO: Add cleanup section to tear down the gateway service and remove
32+
# the installed package after a successful test, so the machine can be
33+
# reused by subsequent spread tests without leftover state.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
summary: Install via snap on snapd-only system
5+
details: |
6+
This test installs OpenShell on a system with only snapd (no docker).
7+
The installer detects snapd and no classic docker, choosing the snap
8+
install path. This verifies that the snap can be installed, its
9+
interfaces connected, and the gateway registered.
10+
11+
systems:
12+
- ubuntu-cloud-24.04-at-snapd-no-docker
13+
- ubuntu-cloud-26.04-at-snapd-no-docker
14+
- debian-cloud-13-at-snapd-no-docker
15+
- fedora-cloud-44-at-snapd-no-docker
16+
17+
prepare: |
18+
cat "$SPREAD_PATH/install.sh" | sh
19+
20+
execute: |
21+
which openshell | MATCH "/snap/bin/openshell"
22+
openshell status | sed 's/\x1b\[[0-9;]*m//g' | MATCH "Status: Connected"
23+
24+
# TODO: Add cleanup section to tear down the gateway service and remove
25+
# the installed package after a successful test, so the machine can be
26+
# reused by subsequent spread tests without leftover state.

0 commit comments

Comments
 (0)