2020-12-08 17:53:45 +00:00
|
|
|
name: zfs-tests-sanity
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
2022-11-12 12:48:32 +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-02-27 17:19:25 +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
|
2022-11-12 12:48:32 +00:00
|
|
|
sudo xargs --arg-file=${{ github.workspace }}/.github/workflows/build-dependencies.txt apt-get install -qq
|
2022-02-07 19:44:17 +00:00
|
|
|
sudo apt-get clean
|
2020-12-08 17:53:45 +00:00
|
|
|
- name: Autogen.sh
|
|
|
|
run: |
|
2022-02-07 19:44:17 +00:00
|
|
|
./autogen.sh
|
2020-12-08 17:53:45 +00:00
|
|
|
- name: Configure
|
|
|
|
run: |
|
2022-09-14 23:26:57 +00:00
|
|
|
./configure --enable-debug --enable-debuginfo --enable-asan --enable-ubsan
|
2020-12-08 17:53:45 +00:00
|
|
|
- name: Make
|
|
|
|
run: |
|
2022-12-14 01:33:05 +00:00
|
|
|
make --no-print-directory --silent native-deb-utils native-deb-kmod
|
|
|
|
mv ../*.deb .
|
|
|
|
rm ./openzfs-zfs-dkms*.deb ./openzfs-zfs-dracut*.deb
|
2020-12-08 17:53:45 +00:00
|
|
|
- name: Install
|
|
|
|
run: |
|
|
|
|
# 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
|
2022-12-14 01:33:05 +00:00
|
|
|
sudo dpkg -i *.deb
|
|
|
|
# Native Debian packages enable and start the services
|
|
|
|
# Stop zfs-zed daemon, as it may interfere with some ZTS test cases
|
|
|
|
sudo systemctl stop zfs-zed
|
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
|
2022-02-07 19:44:17 +00:00
|
|
|
- name: Clear the kernel ring buffer
|
|
|
|
run: |
|
|
|
|
sudo dmesg -c >/var/tmp/dmesg-prerun
|
2023-01-17 17:52:27 +00:00
|
|
|
- name: Reclaim and report disk space
|
2022-02-09 19:50:13 +00:00
|
|
|
run: |
|
2023-01-17 17:52:27 +00:00
|
|
|
${{ github.workspace }}/.github/workflows/scripts/reclaim_disk_space.sh
|
2022-02-09 19:50:13 +00:00
|
|
|
df -h /
|
2020-12-08 17:53:45 +00:00
|
|
|
- name: Tests
|
|
|
|
run: |
|
2022-02-16 19:40:25 +00:00
|
|
|
set -o pipefail
|
2022-03-24 14:01:26 +00:00
|
|
|
/usr/share/zfs/zfs-tests.sh -vKR -s 3G -r sanity | scripts/zfs-tests-color.sh
|
2022-02-16 19:40:25 +00:00
|
|
|
shell: bash
|
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
|
2022-02-07 19:44:17 +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:
|
2022-02-07 19:44:17 +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
|