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