forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 3
192 lines (176 loc) · 7.39 KB
/
zfs-qemu.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: zfs-qemu
on:
push:
pull_request:
jobs:
qemu-vm:
name: QEMU
strategy:
fail-fast: false
matrix:
# os: [almalinux8, almalinux9, archlinux, centos-stream9, fedora39, fedora40, debian11, debian12, freebsd13, freebsd14, freebsd15, ubuntu22, ubuntu24]
os: [almalinux8, almalinux9, fedora39, fedora40, debian11, debian12, freebsd13, freebsd14, freebsd15, ubuntu22, ubuntu24]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup QEMU
timeout-minutes: 10
run: .github/workflows/scripts/qemu-1-setup.sh
- name: Start build machine
timeout-minutes: 5
run: .github/workflows/scripts/qemu-2-start.sh ${{ matrix.os }}
- name: Install dependencies
timeout-minutes: 20
run: |
echo "Install dependencies in QEMU machine"
echo "ConnectTimeout 1" >> $HOME/.ssh/config
echo "StrictHostKeyChecking no" >> $HOME/.ssh/config
while pidof /usr/bin/qemu-system-x86_64 >/dev/null; do
ssh 2>/dev/null [email protected] "uname -a" && break
done
scp .github/workflows/scripts/qemu-3-deps.sh [email protected]:qemu-3-deps.sh
PID=`pidof /usr/bin/qemu-system-x86_64`
ssh [email protected] '$HOME/qemu-3-deps.sh' ${{ matrix.os }}
# wait for poweroff to succeed
tail --pid=$PID -f /dev/null
sleep 5 # avoid this: "error: Domain is already active"
- name: Build modules
timeout-minutes: 30
run: |
echo "Build modules in QEMU machine"
sudo virsh start openzfs
while pidof /usr/bin/qemu-system-x86_64 >/dev/null; do
ssh 2>/dev/null [email protected] "uname -a" && break
done
rsync -ar $HOME/work/zfs/zfs [email protected]:./
ssh [email protected] '$HOME/zfs/.github/workflows/scripts/qemu-4-build.sh' ${{ matrix.os }}
- name: Setup testing machines
timeout-minutes: 5
run: |
.github/workflows/scripts/qemu-5-setup.sh
# Save the VM's serial output (ttyS0) to /var/tmp/console.txt
# - ttyS0 on the VM corresponds to a local /dev/pty/N entry
# - use 'virsh ttyconsole' to lookup the /dev/pty/N entry
RESPATH="/var/tmp/test_results"
mkdir -p $RESPATH/vm{1,2,3}
sudo mkdir -p /var/tmp
read "pty1" <<< $(sudo virsh ttyconsole "vm1")
read "pty2" <<< $(sudo virsh ttyconsole "vm2")
read "pty3" <<< $(sudo virsh ttyconsole "vm3")
sudo nohup bash -c "cat "$pty1" > $RESPATH/vm1/console.txt" &
sudo nohup bash -c "cat "$pty2" > $RESPATH/vm2/console.txt" &
sudo nohup bash -c "cat "$pty3" > $RESPATH/vm3/console.txt" &
echo "Console logging for $pty1, $pty2 and $pty3 started."
- name: Run tests
timeout-minutes: 210
run: |
.github/workflows/scripts/qemu-6-tests.sh
- name: Test reports
timeout-minutes: 10
run: |
.github/workflows/scripts/qemu-7-reports.sh
- name: Prepare artifacts
if: success() || failure()
run: |
RESPATH="/var/tmp/test_results"
rsync -arL [email protected]:$RESPATH/current $RESPATH/vm1 || true
rsync -arL [email protected]:$RESPATH/current $RESPATH/vm2 || true
rsync -arL [email protected]:$RESPATH/current $RESPATH/vm3 || true
scp [email protected]:"/var/tmp/*.txt" $RESPATH/vm1 || true
scp [email protected]:"/var/tmp/*.txt" $RESPATH/vm2 || true
scp [email protected]:"/var/tmp/*.txt" $RESPATH/vm3 || true
cp -f /var/tmp/*.txt $RESPATH || true
ls -la /var/tmp
tar cf qemu-${{ matrix.os }}.tar -C $RESPATH -h . || true
- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: Logs-functional-${{ matrix.os }}
path: qemu-${{ matrix.os }}.tar
if-no-files-found: ignore
- name: Simple test results
if: success() || failure()
run: |
ZFSDIR="$(pwd)"
cd /var/tmp/test_results
cat vm*log.txt | grep -v 'Test[ :]' | \
sed -e 's/\x1b\[[0-9;]*m//g' | \
$ZFSDIR/.github/workflows/scripts/merge_summary.awk | \
$ZFSDIR/scripts/zfs-tests-color.sh
awk '/\[FAIL\]|\[KILLED\]/{ show=1; print; next; }; /\[SKIP\]|\[PASS\]/{ show=0; } show' ./vm*/current/log
cleanup:
if: always()
name: Cleanup
runs-on: ubuntu-latest
needs: [ qemu-vm ]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/download-artifact@v4
- name: Generating summary
run: .github/workflows/scripts/generate-summary.sh
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 1
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 2
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 3
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 4
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 5
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 6
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 7
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 8
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 9
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 10
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 11
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 12
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 13
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 14
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 15
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 16
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 17
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 18
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 19
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 20
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 21
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 22
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 23
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 24
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 25
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 26
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 27
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 28
- name: Generating summary...
run: .github/workflows/scripts/generate-summary.sh 29
- uses: actions/upload-artifact@v4
with:
name: Summary Files
path: out-*