xref: /freebsd/sys/contrib/openzfs/.github/workflows/scripts/qemu-6-lustre-tests-vm.sh (revision 8a62a2a5659d1839d8799b4274c04469d7f17c78)
1#!/usr/bin/env bash
2
3######################################################################
4# 6) Test if Lustre can still build against ZFS
5######################################################################
6set -e
7
8# Build from the latest Lustre tag rather than the master branch.  We do this
9# under the assumption that master is going to have a lot of churn thus will be
10# more prone to breaking the build than a point release.  We don't want ZFS
11# PR's reporting bad test results simply because upstream Lustre accidentally
12# broke their build.
13#
14# Skip any RC tags, or any tags where the last version digit is 50 or more.
15# Versions with 50 or more are development versions of Lustre.
16repo=https://github.com/lustre/lustre-release.git
17tag="$(git ls-remote --refs --exit-code --sort=version:refname --tags $repo | \
18	awk -F '_' '/-RC/{next}; /refs\/tags\/v/{if ($NF < 50){print}}' | \
19	tail -n 1 | sed 's/.*\///')"
20
21echo "Cloning Lustre tag $tag"
22git clone --depth 1 --branch "$tag" "$repo"
23
24cd lustre-release
25
26# Include Lustre patches to build against master/zfs-2.4.x.  Once these
27# patches are merged we can remove these lines.
28patches=('https://review.whamcloud.com/changes/fs%2Flustre-release~62101/revisions/2/patch?download'
29	'https://review.whamcloud.com/changes/fs%2Flustre-release~63267/revisions/9/patch?download')
30
31for p in "${patches[@]}" ; do
32	curl $p | base64 -d > patch
33	patch -p1 < patch || true
34done
35
36echo "Configure Lustre"
37./autogen.sh
38# EL 9 needs '--disable-gss-keyring'
39./configure --with-zfs --disable-gss-keyring
40echo "Building Lustre RPMs"
41make rpms
42ls *.rpm
43
44# There's only a handful of Lustre RPMs we actually need to install
45lustrerpms="$(ls *.rpm | grep -E 'kmod-lustre-osd-zfs-[0-9]|kmod-lustre-[0-9]|lustre-osd-zfs-mount-[0-9]')"
46echo "Installing: $lustrerpms"
47sudo dnf -y install $lustrerpms
48sudo modprobe -v lustre
49
50# Should see some Lustre lines in dmesg
51sudo dmesg | grep -Ei 'lnet|lustre'
52