Merge pull request #152 from truenas/truenas/zfs-2.1-release #2069
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: zfs-tests-sanity | |
on: [push, pull_request] | |
jobs: | |
skip-tests-sanity: | |
runs-on: ubuntu-22.04 | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- name: Skip Duplicate Actions | |
id: skip_check | |
uses: fkirc/[email protected] | |
with: | |
concurrent_skipping: 'same_content_newer' | |
tests: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Reclaim disk space | |
run: | | |
${{ github.workspace }}/.github/workflows/scripts/reclaim_disk_space.sh | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --yes -qq build-essential autoconf libtool gdb lcov \ | |
git alien fakeroot wget curl bc fio acl \ | |
sysstat mdadm lsscsi parted gdebi attr dbench watchdog ksh \ | |
nfs-kernel-server samba rng-tools xz-utils \ | |
zlib1g-dev uuid-dev libblkid-dev libselinux-dev \ | |
xfslibs-dev libattr1-dev libacl1-dev libudev-dev libdevmapper-dev \ | |
libssl-dev libffi-dev libaio-dev libelf-dev libmount-dev \ | |
libpam0g-dev libbsd-dev pamtester python-setuptools \ | |
python3 python3-dev python3-setuptools python3-cffi python3-packaging \ | |
libcurl4-openssl-dev debhelper-compat dh-python po-debconf \ | |
python3-all-dev python3-sphinx dh-sequence-dkms | |
- name: Autogen.sh | |
run: | | |
sh autogen.sh | |
- name: Configure | |
run: | | |
./configure --enable-debug --enable-debuginfo | |
- name: Make | |
run: | | |
make --no-print-directory --silent native-deb-utils native-deb-kmod | |
mv ../*.deb . | |
rm ./openzfs-zfs-dkms*.deb ./openzfs-zfs-dracut*.deb | |
- 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 | |
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 | |
# 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 | |
- name: Clear the kernel ring buffer | |
run: | | |
sudo dmesg -c >/var/tmp/dmesg-prerun | |
- name: Report disk space | |
run: | | |
df -h / | |
- name: Tests | |
run: | | |
set -o pipefail | |
/usr/share/zfs/zfs-tests.sh -vR -s 3G -r sanity | |
shell: bash | |
timeout-minutes: 330 | |
- name: Prepare artifacts | |
if: failure() | |
run: | | |
RESULTS_PATH=$(readlink -f /var/tmp/test_results/current) | |
sudo dmesg > $RESULTS_PATH/dmesg | |
sudo cp /var/log/syslog /var/tmp/dmesg-prerun $RESULTS_PATH/ | |
sudo chmod +r $RESULTS_PATH/* | |
# Replace ':' in dir names, actions/upload-artifact doesn't support it | |
for f in $(find /var/tmp/test_results -name '*:*'); do mv "$f" "${f//:/__}"; done | |
- uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: Test logs Ubuntu-${{ matrix.os }} | |
path: | | |
/var/tmp/test_results/* | |
!/var/tmp/test_results/current | |
if-no-files-found: ignore |