Skip to content

Commit 705cf9f

Browse files
Marketenclaude
andcommitted
Keep the ISO E2E tests from changing installer logic
Restore every installer, preseed and ISO-generation file to master so this PR only adds tests. The harness now reproduces real hardware instead of patching the installer around QEMU: - Install onto an NVMe disk rather than virtio-blk. - Boot the guest on a TAP network with DHCP, DNS and NAT. GitHub runners drop outbound ICMP, so the host answers the guest's echo requests and the first-boot `ping google.com` check behaves as on a normal LAN. - Read the expected Debian release from the generator and preseed instead of a new config file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 133128f commit 705cf9f

14 files changed

Lines changed: 156 additions & 166 deletions

‎.github/workflows/debian-iso-e2e.yml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ jobs:
2323
- name: Checkout
2424
uses: actions/checkout@v6
2525

26-
- name: Verify Debian release alignment
27-
run: bash iso/scripts/check_debian_release_alignment.sh
28-
2926
- name: Build Debian unattended ISO
3027
run: |
3128
export BASE_OS=debian
@@ -36,18 +33,21 @@ jobs:
3633
- name: Install QEMU test dependencies
3734
run: |
3835
sudo apt-get update
39-
sudo apt-get install -y --no-install-recommends qemu-system-x86 qemu-utils ovmf socat sshpass
36+
sudo apt-get install -y --no-install-recommends qemu-system-x86 qemu-utils ovmf socat sshpass dnsmasq-base
4037
if [ -e /dev/kvm ]; then
4138
sudo chmod a+rw /dev/kvm
4239
fi
4340
44-
- name: Enable ICMP for QEMU user networking
45-
run: sudo sysctl -w net.ipv4.ping_group_range="0 2147483647"
41+
- name: Create the guest network
42+
run: |
43+
mkdir -p test-output/debian-e2e
44+
sudo E2E_NETWORK_STATE_DIR="${PWD}/test-output/debian-e2e/network" bash test/e2e_network.sh up
4645
4746
- name: Complete Debian unattended UEFI USB installation
4847
env:
4948
E2E_BOOT_MODE: usb
5049
E2E_FIRMWARE: uefi
50+
E2E_TAP_IFACE: dne2e0
5151
run: |
5252
debian_iso=$(find images -maxdepth 1 -type f -name 'Dappnode-debian-*-amd64-netinst.iso' -print -quit)
5353
test -n "${debian_iso}"

‎.github/workflows/ubuntu-iso-e2e.yml‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,21 @@ jobs:
3333
- name: Install QEMU test dependencies
3434
run: |
3535
sudo apt-get update
36-
sudo apt-get install -y --no-install-recommends qemu-system-x86 qemu-utils ovmf socat sshpass
36+
sudo apt-get install -y --no-install-recommends qemu-system-x86 qemu-utils ovmf socat sshpass dnsmasq-base
3737
if [ -e /dev/kvm ]; then
3838
sudo chmod a+rw /dev/kvm
3939
fi
4040
41-
- name: Enable ICMP for QEMU user networking
42-
run: sudo sysctl -w net.ipv4.ping_group_range="0 2147483647"
41+
- name: Create the guest network
42+
run: |
43+
mkdir -p test-output/ubuntu-e2e
44+
sudo E2E_NETWORK_STATE_DIR="${PWD}/test-output/ubuntu-e2e/network" bash test/e2e_network.sh up
4345
4446
- name: Complete Ubuntu unattended UEFI USB installation
4547
env:
4648
E2E_BOOT_MODE: usb
4749
E2E_FIRMWARE: uefi
50+
E2E_TAP_IFACE: dne2e0
4851
run: |
4952
ubuntu_iso=$(find images -maxdepth 1 -type f -name 'Dappnode-ubuntu-*-live-server-amd64.iso' -print -quit)
5053
test -n "${ubuntu_iso}"

‎iso/debian_release.conf‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎iso/preseeds/preseed.cfg‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ d-i mirror/country string manual
2525
d-i mirror/http/hostname string deb.debian.org
2626
d-i mirror/http/directory string /debian
2727
d-i mirror/http/proxy string
28-
d-i apt-setup/local0/repository string http://deb.debian.org/debian/ @DEBIAN_SUITE@ main contrib non-free-firmware
28+
d-i apt-setup/local0/repository string http://deb.debian.org/debian/ trixie main contrib non-free-firmware
2929
d-i apt-setup/cdrom/set-first boolean false
3030
d-i apt-setup/cdrom/set-next boolean false
3131
d-i apt-setup/cdrom/set-failed boolean false

‎iso/preseeds/preseed_unattended.cfg‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ d-i mirror/country string manual
6262
d-i mirror/http/hostname string deb.debian.org
6363
d-i mirror/http/directory string /debian
6464
d-i mirror/http/proxy string
65-
d-i apt-setup/local0/repository string http://deb.debian.org/debian/ @DEBIAN_SUITE@ main contrib non-free-firmware
65+
d-i apt-setup/local0/repository string http://deb.debian.org/debian/ trixie main contrib non-free-firmware
6666
d-i apt-setup/cdrom/set-first boolean false
6767
d-i apt-setup/cdrom/set-next boolean false
6868
d-i apt-setup/cdrom/set-failed boolean false

‎iso/scripts/check_debian_release_alignment.sh‎

Lines changed: 0 additions & 58 deletions
This file was deleted.

‎iso/scripts/common_iso_generation.sh‎

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,16 @@ WORKDIR="/usr/src/app"
44
ISO_BUILD_PATH="${WORKDIR}/dappnode-iso"
55
DAPPNODE_ISO_PREFIX="Dappnode-"
66

7-
# Usage: download_iso <path> <name> <url> [fallback_url...]
8-
# URLs are tried in order, which covers mirrors that move older releases elsewhere.
97
download_iso() {
108
local iso_path=$1
119
local iso_name=$2
12-
shift 2
10+
local iso_url=$3
1311

1412
echo "[INFO] Downloading base ISO image: ${iso_name}..."
15-
if [ -f "${iso_path}" ]; then
16-
echo "[INFO] Download complete!"
17-
return 0
13+
if [ ! -f "${iso_path}" ]; then
14+
wget "${iso_url}" -O "${iso_path}"
1815
fi
19-
20-
local iso_url
21-
for iso_url in "$@"; do
22-
if wget "${iso_url}" -O "${iso_path}"; then
23-
echo "[INFO] Download complete!"
24-
return 0
25-
fi
26-
# wget leaves a partial file behind, which would be reused on the next run
27-
rm -f "${iso_path}"
28-
echo "[WARN] Could not download ${iso_url}"
29-
done
30-
31-
echo "[ERROR] Could not download ${iso_name} from any known location"
32-
exit 1
16+
echo "[INFO] Download complete!"
3317
}
3418

3519
verify_download() {

‎iso/scripts/generate_dappnode_iso_debian.sh‎

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,17 @@ set -e
44
SCRIPTS_DIR=$(dirname "${BASH_SOURCE[0]}")
55

66
source ${SCRIPTS_DIR}/common_iso_generation.sh
7-
source ${SCRIPTS_DIR}/../debian_release.conf
87

98
BASE_ISO_NAME="debian-13.5.0-amd64-netinst.iso"
109
BASE_ISO_VERSION="${BASE_ISO_NAME#debian-}"
1110
BASE_ISO_VERSION="${BASE_ISO_VERSION%-amd64-netinst.iso}"
1211
BASE_ISO_PATH="/images/${BASE_ISO_NAME}"
13-
# Debian serves the newest point release from debian-cd/ and only moves it to the
14-
# archive once it is superseded, so try both.
15-
BASE_ISO_URL="https://cdimage.debian.org/debian-cd/${BASE_ISO_VERSION}/amd64/iso-cd/${BASE_ISO_NAME}"
16-
BASE_ISO_ARCHIVE_URL="https://cdimage.debian.org/mirror/cdimage/archive/${BASE_ISO_VERSION}/amd64/iso-cd/${BASE_ISO_NAME}"
12+
BASE_ISO_URL="https://cdimage.debian.org/mirror/cdimage/archive/${BASE_ISO_VERSION}/amd64/iso-cd/${BASE_ISO_NAME}"
1713
BASE_ISO_SHASUM="95838884f5ea6c82421dfe6baaa5a639dbbe6756c1e380f9fe7a7cb0c1949d2a ${BASE_ISO_PATH}"
1814

1915
DAPPNODE_ISO_NAME="${DAPPNODE_ISO_PREFIX}${BASE_ISO_NAME}"
2016
DAPPNODE_ISO_PATH="/images/${DAPPNODE_ISO_NAME}"
2117

22-
# Fail before downloading or building if the ISO and repositories target different releases.
23-
bash "${SCRIPTS_DIR}/check_debian_release_alignment.sh"
24-
2518
customize_debian_preseed() {
2619
local iso_build_path=$1
2720
local workdir=$2
@@ -57,13 +50,6 @@ customize_debian_preseed() {
5750
exit 1
5851
}
5952

60-
# Keep package repositories aligned with the Debian release used by the ISO.
61-
sed -i "s/@DEBIAN_SUITE@/${DEBIAN_SUITE}/g" "${tmp_initrd}/preseed.cfg"
62-
if grep -q "@DEBIAN_SUITE@" "${tmp_initrd}/preseed.cfg"; then
63-
echo "[ERROR] Could not render the Debian suite in the preseed file"
64-
exit 1
65-
fi
66-
6753
# Recreate (and recompress) the initrd
6854
(cd "${tmp_initrd}" && find . -print0 | cpio -0 -ov -H newc | gzip >"${install_dir}/initrd.gz") || {
6955
echo "[ERROR] Could not create new initrd"
@@ -101,7 +87,7 @@ generate_debian_iso() {
10187
-isohybrid-gpt-basdat -o "${iso_output_path}" ${iso_build_path}
10288
}
10389

104-
download_iso "${BASE_ISO_PATH}" "${BASE_ISO_NAME}" "${BASE_ISO_URL}" "${BASE_ISO_ARCHIVE_URL}"
90+
download_iso "${BASE_ISO_PATH}" "${BASE_ISO_NAME}" "${BASE_ISO_URL}"
10591
verify_download "${BASE_ISO_PATH}" "${BASE_ISO_SHASUM}"
10692
clean_old_files "${ISO_BUILD_PATH}" "${DAPPNODE_ISO_PREFIX}"
10793
extract_iso "${BASE_ISO_PATH}" "${ISO_BUILD_PATH}"

‎scripts/check-disks.sh‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,4 @@ for DISK in ${DEVICE}; do
1212
DISKS="${DISKS} ${DISK}";
1313
done;
1414
DISKS=$(echo "${DISKS}" | sed "s/^ //g");
15-
debconf-set partman-auto/disk "$DISKS";
16-
17-
# grub-installer/bootdev is preseeded to "default", which marks the question as
18-
# already seen. grub-installer then resolves "default" to the first entry of
19-
# grub-mkdevicemap, i.e. (hd0) -- the installer USB itself. Its safeguard against
20-
# installing onto the installation media only runs for grub-pc, so on UEFI it
21-
# happily targets the stick and then dies reading its partition table:
22-
# Can't read partition table from /dev/sda
23-
# Point it at the same non-USB disks partman is using. grub-installer accepts a
24-
# space separated list and installs to each entry in turn.
25-
debconf-set grub-installer/bootdev "$DISKS";
15+
debconf-set partman-auto/disk "$DISKS";

‎scripts/dappnode_install.sh‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -428,16 +428,7 @@ normalize_ipfs_version_ref() {
428428
local cid_path="$ref"
429429
local manifest_url="${IPFS_ENDPOINT%/}${cid_path}/dappnode_package.json"
430430
local manifest
431-
local attempt
432-
for attempt in 1 2 3 4 5; do
433-
manifest="$(download_stdout "$manifest_url" 2>/dev/null || true)"
434-
if [[ -n "$manifest" ]]; then
435-
break
436-
fi
437-
if [[ "$attempt" -lt 5 ]]; then
438-
sleep 2
439-
fi
440-
done
431+
manifest="$(download_stdout "$manifest_url" 2>/dev/null || true)"
441432
if [[ -z "$manifest" ]]; then
442433
error "Could not fetch IPFS manifest for ${comp} from: $manifest_url"
443434
error "Provide ${comp}_VERSION as /ipfs/<cid>:<version> (example: /ipfs/Qm...:0.2.11)"

0 commit comments

Comments
 (0)