2020-12-08 17:53:45 +00:00
|
|
|
name: zfs-tests-sanity
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
2023-03-02 22:53:34 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2020-12-08 17:53:45 +00:00
|
|
|
steps:
|
2022-10-11 19:59:06 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-12-08 17:53:45 +00:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2023-03-02 22:58:21 +00:00
|
|
|
# https://github.com/orgs/community/discussions/47863
|
|
|
|
sudo apt-mark hold grub-efi-amd64-signed
|
|
|
|
sudo apt-get update --fix-missing
|
|
|
|
sudo apt-get upgrade
|
2023-03-03 00:18:27 +00:00
|
|
|
sudo xargs --arg-file=${{ github.workspace }}/.github/workflows/build-dependencies.txt apt-get install -qq
|
|
|
|
sudo apt-get clean
|
2020-12-08 17:53:45 +00:00
|
|
|
- name: Autogen.sh
|
|
|
|
run: |
|
|
|
|
sh autogen.sh
|
|
|
|
- name: Configure
|
|
|
|
run: |
|
|
|
|
./configure --enable-debug --enable-debuginfo
|
|
|
|
- name: Make
|
|
|
|
run: |
|
|
|
|
make --no-print-directory -s pkg-utils pkg-kmod
|
|
|
|
- name: Install
|
|
|
|
run: |
|
|
|
|
sudo dpkg -i *.deb
|
|
|
|
# Update order of directories to search for modules, otherwise
|
|
|
|
# Ubuntu will load kernel-shipped ones.
|
|
|
|
sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf
|
|
|
|
sudo depmod
|
|
|
|
sudo modprobe zfs
|
2021-10-25 17:27:05 +00:00
|
|
|
# Workaround for cloud-init bug
|
|
|
|
# see https://github.com/openzfs/zfs/issues/12644
|
|
|
|
FILE=/lib/udev/rules.d/10-cloud-init-hook-hotplug.rules
|
|
|
|
if [ -r "${FILE}" ]; then
|
|
|
|
HASH=$(md5sum "${FILE}" | awk '{ print $1 }')
|
|
|
|
if [ "${HASH}" = "121ff0ef1936cd2ef65aec0458a35772" ]; then
|
|
|
|
# Just shove a zd* exclusion right above the hotplug hook...
|
|
|
|
sudo sed -i -e s/'LABEL="cloudinit_hook"'/'KERNEL=="zd*", GOTO="cloudinit_end"\n&'/ "${FILE}"
|
|
|
|
sudo udevadm control --reload-rules
|
|
|
|
fi
|
|
|
|
fi
|
2023-03-03 00:18:27 +00:00
|
|
|
- name: Clear the kernel ring buffer
|
|
|
|
run: |
|
|
|
|
sudo dmesg -c >/var/tmp/dmesg-prerun
|
|
|
|
- name: Reclaim and report disk space
|
|
|
|
run: |
|
|
|
|
${{ github.workspace }}/.github/workflows/scripts/reclaim_disk_space.sh
|
|
|
|
df -h /
|
2020-12-08 17:53:45 +00:00
|
|
|
- name: Tests
|
|
|
|
run: |
|
2021-12-01 17:38:53 +00:00
|
|
|
/usr/share/zfs/zfs-tests.sh -vR -s 3G -r sanity
|
2022-01-24 23:54:52 +00:00
|
|
|
timeout-minutes: 330
|
2020-12-08 17:53:45 +00:00
|
|
|
- name: Prepare artifacts
|
|
|
|
if: failure()
|
|
|
|
run: |
|
|
|
|
RESULTS_PATH=$(readlink -f /var/tmp/test_results/current)
|
|
|
|
sudo dmesg > $RESULTS_PATH/dmesg
|
2023-03-03 00:18:27 +00:00
|
|
|
sudo cp /var/log/syslog /var/tmp/dmesg-prerun $RESULTS_PATH/
|
2020-12-08 17:53:45 +00:00
|
|
|
sudo chmod +r $RESULTS_PATH/*
|
2021-01-26 12:01:44 +00:00
|
|
|
# Replace ':' in dir names, actions/upload-artifact doesn't support it
|
2021-12-02 00:18:45 +00:00
|
|
|
for f in $(find /var/tmp/test_results -name '*:*'); do mv "$f" "${f//:/__}"; done
|
2022-10-12 06:33:38 +00:00
|
|
|
- uses: actions/upload-artifact@v3
|
2020-12-08 17:53:45 +00:00
|
|
|
if: failure()
|
|
|
|
with:
|
2023-03-03 00:18:27 +00:00
|
|
|
name: Test logs Ubuntu-${{ matrix.os }}
|
|
|
|
path: |
|
|
|
|
/var/tmp/test_results/*
|
|
|
|
!/var/tmp/test_results/current
|
2020-12-08 17:53:45 +00:00
|
|
|
if-no-files-found: ignore
|