]>
Commit | Line | Data |
---|---|---|
aa743acc GM |
1 | name: zfs-tests-functional |
2 | ||
3 | on: | |
4 | push: | |
5 | pull_request: | |
6 | ||
7 | jobs: | |
8 | tests-functional-ubuntu: | |
9 | strategy: | |
10 | fail-fast: false | |
11 | matrix: | |
3a6d89ae | 12 | os: [20.04, 22.04] |
aa743acc GM |
13 | runs-on: ubuntu-${{ matrix.os }} |
14 | steps: | |
4bbd7a0f | 15 | - uses: actions/checkout@v3 |
aa743acc GM |
16 | with: |
17 | ref: ${{ github.event.pull_request.head.sha }} | |
e2909fae DS |
18 | - name: Reclaim disk space |
19 | run: | | |
20 | ${{ github.workspace }}/.github/workflows/scripts/reclaim_disk_space.sh | |
aa743acc GM |
21 | - name: Install dependencies |
22 | run: | | |
23 | sudo apt-get update | |
9e7fc5da | 24 | sudo apt-get -qq upgrade |
9e7fc5da | 25 | sudo xargs --arg-file=${{ github.workspace }}/.github/workflows/build-dependencies.txt apt-get install -qq |
add15e95 | 26 | sudo apt-get clean |
aa743acc GM |
27 | - name: Autogen.sh |
28 | run: | | |
add15e95 | 29 | ./autogen.sh |
aa743acc GM |
30 | - name: Configure |
31 | run: | | |
6f8602a5 | 32 | ./configure --enable-debug --enable-debuginfo --enable-asan --enable-ubsan |
aa743acc GM |
33 | - name: Make |
34 | run: | | |
add15e95 | 35 | make -j$(nproc) --no-print-directory --silent pkg-utils pkg-kmod |
aa743acc GM |
36 | - name: Install |
37 | run: | | |
38 | sudo dpkg -i *.deb | |
39 | # Update order of directories to search for modules, otherwise | |
40 | # Ubuntu will load kernel-shipped ones. | |
41 | sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf | |
42 | sudo depmod | |
43 | sudo modprobe zfs | |
731fbb5d RE |
44 | # Workaround for cloud-init bug |
45 | # see https://github.com/openzfs/zfs/issues/12644 | |
46 | FILE=/lib/udev/rules.d/10-cloud-init-hook-hotplug.rules | |
47 | if [ -r "${FILE}" ]; then | |
48 | HASH=$(md5sum "${FILE}" | awk '{ print $1 }') | |
49 | if [ "${HASH}" = "121ff0ef1936cd2ef65aec0458a35772" ]; then | |
50 | # Just shove a zd* exclusion right above the hotplug hook... | |
51 | sudo sed -i -e s/'LABEL="cloudinit_hook"'/'KERNEL=="zd*", GOTO="cloudinit_end"\n&'/ "${FILE}" | |
52 | sudo udevadm control --reload-rules | |
53 | fi | |
54 | fi | |
add15e95 DS |
55 | - name: Clear the kernel ring buffer |
56 | run: | | |
57 | sudo dmesg -c >/var/tmp/dmesg-prerun | |
e2909fae DS |
58 | - name: Report disk space |
59 | run: | | |
60 | df -h / | |
aa743acc GM |
61 | - name: Tests |
62 | run: | | |
0df22afe | 63 | set -o pipefail |
427fad7f | 64 | /usr/share/zfs/zfs-tests.sh -vKR -s 3G | scripts/zfs-tests-color.sh |
0df22afe | 65 | shell: bash |
cd26b217 | 66 | timeout-minutes: 330 |
aa743acc GM |
67 | - name: Prepare artifacts |
68 | if: failure() | |
69 | run: | | |
70 | RESULTS_PATH=$(readlink -f /var/tmp/test_results/current) | |
71 | sudo dmesg > $RESULTS_PATH/dmesg | |
add15e95 | 72 | sudo cp /var/log/syslog /var/tmp/dmesg-prerun $RESULTS_PATH/ |
aa743acc GM |
73 | sudo chmod +r $RESULTS_PATH/* |
74 | # Replace ':' in dir names, actions/upload-artifact doesn't support it | |
ddc026f5 | 75 | for f in $(find /var/tmp/test_results -name '*:*'); do mv "$f" "${f//:/__}"; done |
87d5ff8e | 76 | - uses: actions/upload-artifact@v3 |
aa743acc GM |
77 | if: failure() |
78 | with: | |
79 | name: Test logs Ubuntu-${{ matrix.os }} | |
add15e95 DS |
80 | path: | |
81 | /var/tmp/test_results/* | |
82 | !/var/tmp/test_results/current | |
aa743acc | 83 | if-no-files-found: ignore |