2020-12-08 20:53:45 +03:00
|
|
|
name: zfs-tests-sanity
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
2022-02-07 22:44:17 +03:00
|
|
|
runs-on: ubuntu-20.04
|
2020-12-08 20:53:45 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
2022-02-09 22:50:13 +03:00
|
|
|
- name: Reclaim disk space
|
|
|
|
run: |
|
|
|
|
${{ github.workspace }}/.github/workflows/scripts/reclaim_disk_space.sh
|
2020-12-08 20:53:45 +03:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2022-02-07 22:44:17 +03:00
|
|
|
xargs --arg-file=${{ github.workspace }}/.github/workflows/build-dependencies.txt sudo apt-get install -qq
|
|
|
|
sudo apt-get clean
|
2020-12-08 20:53:45 +03:00
|
|
|
- name: Autogen.sh
|
|
|
|
run: |
|
2022-02-07 22:44:17 +03:00
|
|
|
./autogen.sh
|
2020-12-08 20:53:45 +03:00
|
|
|
- name: Configure
|
|
|
|
run: |
|
2022-05-26 19:24:50 +03:00
|
|
|
./configure --enable-debug --enable-debuginfo --enable-asan --enable-ubsan --with-config=dist
|
2020-12-08 20:53:45 +03:00
|
|
|
- name: Make
|
|
|
|
run: |
|
2022-02-07 22:44:17 +03:00
|
|
|
make -j$(nproc) --no-print-directory --silent pkg-utils pkg-kmod
|
2020-12-08 20:53:45 +03:00
|
|
|
- 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 20:27:05 +03: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 22:44:17 +03:00
|
|
|
- name: Clear the kernel ring buffer
|
|
|
|
run: |
|
|
|
|
sudo dmesg -c >/var/tmp/dmesg-prerun
|
2022-02-09 22:50:13 +03:00
|
|
|
- name: Report disk space
|
|
|
|
run: |
|
|
|
|
df -h /
|
2020-12-08 20:53:45 +03:00
|
|
|
- name: Tests
|
|
|
|
run: |
|
2022-02-16 22:40:25 +03:00
|
|
|
set -o pipefail
|
2022-03-24 17:01:26 +03:00
|
|
|
/usr/share/zfs/zfs-tests.sh -vKR -s 3G -r sanity | scripts/zfs-tests-color.sh
|
2022-02-16 22:40:25 +03:00
|
|
|
shell: bash
|
2022-01-25 02:54:52 +03:00
|
|
|
timeout-minutes: 330
|
2020-12-08 20:53:45 +03:00
|
|
|
- name: Prepare artifacts
|
|
|
|
if: failure()
|
|
|
|
run: |
|
|
|
|
RESULTS_PATH=$(readlink -f /var/tmp/test_results/current)
|
|
|
|
sudo dmesg > $RESULTS_PATH/dmesg
|
2022-02-07 22:44:17 +03:00
|
|
|
sudo cp /var/log/syslog /var/tmp/dmesg-prerun $RESULTS_PATH/
|
2020-12-08 20:53:45 +03:00
|
|
|
sudo chmod +r $RESULTS_PATH/*
|
2021-01-26 15:01:44 +03:00
|
|
|
# Replace ':' in dir names, actions/upload-artifact doesn't support it
|
2021-12-02 03:18:45 +03:00
|
|
|
for f in $(find /var/tmp/test_results -name '*:*'); do mv "$f" "${f//:/__}"; done
|
2020-12-08 20:53:45 +03:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
if: failure()
|
|
|
|
with:
|
2022-02-07 22:44:17 +03:00
|
|
|
name: Test logs Ubuntu-${{ matrix.os }}
|
|
|
|
path: |
|
|
|
|
/var/tmp/test_results/*
|
|
|
|
!/var/tmp/test_results/current
|
2020-12-08 20:53:45 +03:00
|
|
|
if-no-files-found: ignore
|