Skip to content

Commit 894abe8

Browse files
bensmrsstgraber
authored andcommitted
github: Add LINSTOR CI tests
Signed-off-by: Benjamin Somers <[email protected]>
1 parent 84786a3 commit 894abe8

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

.github/workflows/tests.yml

+45-1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ jobs:
140140
- lvm
141141
- zfs
142142
- ceph
143+
- linstor
143144
- random
144145
os:
145146
- ubuntu-22.04
@@ -391,6 +392,48 @@ jobs:
391392
sudo microceph.ceph status
392393
sudo rm -f /snap/bin/rbd
393394
395+
- name: Setup LINSTOR
396+
if: ${{ matrix.backend == 'linstor' }}
397+
run: |
398+
set -x
399+
400+
# As with Ceph, we hope for a spare disk.
401+
if [ "$(stat -c '%d' /)" = "$(stat -c '%d' /mnt)" ]; then
402+
echo "FAIL: rootfs and ephemeral part on the same disk, aborting"
403+
exit 1
404+
fi
405+
406+
sudo add-apt-repository ppa:linbit/linbit-drbd9-stack -y
407+
408+
# Install everything required to compile DRBD and run LINSTOR tools.
409+
sudo apt-get install --no-install-recommends -y \
410+
drbd-dkms \
411+
linstor-client \
412+
linstor-controller \
413+
linstor-satellite \
414+
linux-headers-generic \
415+
python3-setuptools
416+
417+
# Enable DRBD.
418+
sudo modprobe -r drbd
419+
sudo modprobe drbd
420+
421+
# Get the runner IP.
422+
runner_ip="$(hostname -I | cut -d' ' -f1)"
423+
424+
# Create a single local node.
425+
sudo linstor node create local "${runner_ip}" --node-type combined
426+
427+
# Repurpose the ephemeral disk for LINSTOR physical storage.
428+
sudo swapoff /mnt/swapfile
429+
ephemeral_disk="$(findmnt --noheadings --output SOURCE --target /mnt | sed 's/[0-9]\+$//')"
430+
sudo umount /mnt
431+
sudo wipefs -a "${ephemeral_disk}"
432+
sudo linstor physical-storage create-device-pool --storage-pool incus --pool-name linstor-incus lvmthin local "${ephemeral_disk}"
433+
434+
# Update the runner env.
435+
echo "INCUS_LINSTOR_CLUSTER=${runner_ip}" >> "$GITHUB_ENV"
436+
394437
- name: "Ensure offline mode (block image server)"
395438
run: |
396439
sudo nft add table inet filter
@@ -404,6 +447,7 @@ jobs:
404447
INCUS_CEPH_CLUSTER: "ceph"
405448
INCUS_CEPH_CEPHFS: "cephfs"
406449
INCUS_CEPH_CEPHOBJECT_RADOSGW: "http://127.0.0.1"
450+
INCUS_LINSTOR_LOCAL_SATELLITE: "local"
407451
INCUS_CONCURRENT: "1"
408452
INCUS_VERBOSE: "1"
409453
INCUS_OFFLINE: "1"
@@ -413,7 +457,7 @@ jobs:
413457
chmod +x ~
414458
echo "root:1000000:1000000000" | sudo tee /etc/subuid /etc/subgid
415459
cd test
416-
sudo --preserve-env=PATH,GOPATH,GITHUB_ACTIONS,INCUS_VERBOSE,INCUS_BACKEND,INCUS_CEPH_CLUSTER,INCUS_CEPH_CEPHFS,INCUS_CEPH_CEPHOBJECT_RADOSGW,INCUS_OFFLINE,INCUS_SKIP_TESTS,INCUS_REQUIRED_TESTS, INCUS_BACKEND=${{ matrix.backend }} ./main.sh ${{ matrix.suite }}
460+
sudo --preserve-env=PATH,GOPATH,GITHUB_ACTIONS,INCUS_VERBOSE,INCUS_BACKEND,INCUS_CEPH_CLUSTER,INCUS_CEPH_CEPHFS,INCUS_CEPH_CEPHOBJECT_RADOSGW,INCUS_LINSTOR_LOCAL_SATELLITE,INCUS_LINSTOR_CLUSTER,INCUS_OFFLINE,INCUS_SKIP_TESTS,INCUS_REQUIRED_TESTS, INCUS_BACKEND=${{ matrix.backend }} ./main.sh ${{ matrix.suite }}
417461
418462
client:
419463
name: Client

0 commit comments

Comments
 (0)