CI: set /etc/hostid in zloop runner

ztest can enable and disable the multihost property when testing.
This can result in a failure when attempting to import an existing
pool when multihost=on but no /etc/hostid file exists.  Update the
workflow to use zgenhostid to create /etc/hostid when not present.

Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #18413
This commit is contained in:
Brian Behlendorf
2026-04-08 09:15:03 -07:00
committed by Tony Hutter
parent e9a8c6e080
commit f4e5eb7e51
+1
View File
@@ -41,6 +41,7 @@ jobs:
sudo modprobe zfs
- name: Tests
run: |
[ -r /etc/hostid ] && [ -s /etc/hostid ] || sudo zgenhostid -f
sudo truncate -s 256G /mnt/vdev
sudo zpool create cipool -m $WORK_DIR -O compression=on -o autotrim=on /mnt/vdev
sudo /usr/share/zfs/zloop.sh -t 600 -I 6 -l -m 1 -c $CORE_DIR -f $WORK_DIR -- -T 120 -P 60