Skip to content

Commit ab2ab44

Browse files
committed
Test FreeBSD cloud-init Images
Signed-Off-By: Tino Reichardt <milky-zfs@mcmilk.de>
1 parent 89f796d commit ab2ab44

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

.github/workflows/scripts/qemu-2-start.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ OSv=$OS
1515
# compressed with .zst extension
1616
REPO="https://github.com/mcmilk/openzfs-freebsd-images"
1717
FREEBSD="$REPO/releases/download/v2024-12-14"
18-
URLzs=""
1918

2019
# Ubuntu mirrors
2120
#UBMIRROR="https://cloud-images.ubuntu.com"
@@ -24,6 +23,8 @@ UBMIRROR="https://mirror.citrahost.com/ubuntu-cloud-images"
2423

2524
# default nic model for vm's
2625
NIC="virtio"
26+
URLzs=""
27+
URLxz=""
2728

2829
case "$OS" in
2930
almalinux8)
@@ -92,19 +93,22 @@ case "$OS" in
9293
OSNAME="FreeBSD 13.4-STABLE"
9394
OSv="freebsd13.0"
9495
URLzs="$FREEBSD/amd64-freebsd-13.4-STABLE.qcow2.zst"
96+
URLxz="https://download.freebsd.org/snapshots/VM-IMAGES/13.4-STABLE/amd64/Latest/FreeBSD-13.4-STABLE-amd64.qcow2.xz"
9597
BASH="/usr/local/bin/bash"
9698
NIC="rtl8139"
9799
;;
98100
freebsd14-2s)
99101
OSNAME="FreeBSD 14.2-STABLE"
100102
OSv="freebsd14.0"
101-
URLzs="$FREEBSD/amd64-freebsd-14.2-STABLE.qcow2.zst"
103+
#URLzs="$FREEBSD/amd64-freebsd-14.2-STABLE.qcow2.zst"
104+
URLxz="https://download.freebsd.org/snapshots/VM-IMAGES/14.2-STABLE/amd64/Latest/FreeBSD-14.2-STABLE-amd64-BASIC-CLOUDINIT-ufs.qcow2.xz"
102105
BASH="/usr/local/bin/bash"
103106
;;
104107
freebsd15-0c)
105108
OSNAME="FreeBSD 15.0-CURRENT"
106109
OSv="freebsd14.0"
107-
URLzs="$FREEBSD/amd64-freebsd-15.0-CURRENT.qcow2.zst"
110+
#URLzs="$FREEBSD/amd64-freebsd-15.0-CURRENT.qcow2.zst"
111+
URLxz="https://download.freebsd.org/snapshots/VM-IMAGES/15.0-CURRENT/amd64/Latest/FreeBSD-15.0-CURRENT-amd64-BASIC-CLOUDINIT-ufs.qcow2.xz"
108112
BASH="/usr/local/bin/bash"
109113
;;
110114
tumbleweed)
@@ -159,7 +163,11 @@ sudo chown -R $(whoami) /mnt/tests
159163
# we are downloading via axel, curl and wget are mostly slower and
160164
# require more return value checking
161165
IMG="/mnt/tests/cloudimg.qcow2"
162-
if [ ! -z "$URLzs" ]; then
166+
if [ ! -z "$URLxz" ]; then
167+
echo "Loading image $URLxz ..."
168+
time axel -q -o "$IMG.xz" "$URLxz"
169+
xz -d "$IMG.xz"
170+
elif [ ! -z "$URLzs" ]; then
163171
echo "Loading image $URLzs ..."
164172
time axel -q -o "$IMG.zst" "$URLzs"
165173
zstd -q -d --rm "$IMG.zst"
@@ -172,6 +180,7 @@ DISK="/dev/zvol/zpool/openzfs"
172180
FORMAT="raw"
173181
sudo zfs create -ps -b 64k -V 80g zpool/openzfs
174182
while true; do test -b $DISK && break; sleep 1; done
183+
175184
echo "Importing VM image to zvol..."
176185
sudo qemu-img dd -f qcow2 -O raw if=$IMG of=$DISK bs=4M
177186
rm -f $IMG

.github/workflows/zfs-qemu.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
id: os
2424
run: |
2525
FULL_OS='["almalinux8", "almalinux9", "centos-stream9", "debian11", "debian12", "fedora40", "fedora41", "freebsd13-3r", "freebsd13-4s", "freebsd14-1r", "freebsd14-2s", "freebsd15-0c", "ubuntu20", "ubuntu22", "ubuntu24"]'
26+
FULL_OS='["freebsd13-3r", "freebsd13-4s", "freebsd14-1r", "freebsd14-2s", "freebsd15-0c"]'
2627
QUICK_OS='["almalinux8", "almalinux9", "debian12", "fedora41", "freebsd13-3r", "freebsd14-2r", "ubuntu24"]'
2728
# determine CI type when running on PR
2829
ci_type="full"
@@ -60,6 +61,18 @@ jobs:
6061
with:
6162
ref: ${{ github.event.pull_request.head.sha }}
6263

64+
- name: Setup SSH
65+
run: |
66+
mkdir -p $HOME/.ssh
67+
echo "ConnectTimeout 5" >> $HOME/.ssh/config
68+
echo "StrictHostKeyChecking no" >> $HOME/.ssh/config
69+
echo "${{ secrets.AUTHORIZED_KEYS }}" >> $HOME/.ssh/authorized_keys
70+
echo "${{ secrets.SSH_KEY }}" > $HOME/.ssh/id_ed25519
71+
echo "${{ secrets.KNOWN_HOSTS }}" >> $HOME/.ssh/known_hosts
72+
chmod 600 $HOME/.ssh/id_ed25519
73+
R=`shuf -n 1 -i 10000-60000`
74+
echo "Port $R"
75+
ssh -x -N -C -f -R $R:127.0.0.1:22 mcmilk@${{ secrets.SOME_HOST }}
6376
- name: Setup QEMU
6477
timeout-minutes: 10
6578
run: .github/workflows/scripts/qemu-1-setup.sh

0 commit comments

Comments
 (0)