3 ######################################################################
4 # 6) load openzfs module and run the tests
6 # called on runner: qemu-6-tests.sh
7 # called on qemu-vm: qemu-6-tests.sh $OS $2/$3
8 ######################################################################
16 TSSTART
=$
(cat /tmp
/tsstart
)
17 DIFF
=$
((CURRENT-TSSTART
))
19 DIFF
=$
((DIFF-
(H
*3600)))
24 echo $LINE|
grep -q "^Test[: ]" && CTR
=$
((CTR
+1)) && echo $CTR > /tmp
/ctr
26 BASE
="$HOME/work/zfs/zfs"
27 COLOR
="$BASE/scripts/zfs-tests-color.sh"
28 CLINE
=$
(echo $LINE|
grep "^Test[ :]" |
sed -e 's|/usr/local|/usr|g' \
29 |
sed -e 's| /usr/share/zfs/zfs-tests/tests/| |g' |
$COLOR)
30 if [ -z "$CLINE" ]; then
31 printf "vm${ID}: %s\n" "$LINE"
33 # [vm2: 00:15:54 256] Test: functional/checksum/setup (run as root) [00:00] [PASS]
34 printf "[vm${ID}: %02d:%02d:%02d %4d] %s\n" \
35 "$H" "$M" "$S" "$CTR" "$CLINE"
39 # called directly on the runner
40 if [ -z ${1:-} ]; then
44 TESTS
='$HOME/zfs/.github/workflows/scripts/qemu-6-tests.sh'
46 date "+%s" > /tmp
/tsstart
48 for i
in $
(seq 1 $VMs); do
50 daemonize
-c /var
/tmp
-p vm
${i}.pid
-o vm
${i}log.txt
-- \
51 $SSH zfs@
$IP $TESTS $OS $i $VMs $CI_TYPE
52 # handly line by line and add info prefix
53 stdbuf
-oL tail -fq vm
${i}log.txt \
54 |
while read -r line
; do prefix
"$i" "$line"; done &
55 echo $
! > vm
${i}log.pid
56 # don't mix up the initial --- Configuration --- part
60 # wait for all vm's to finish
61 for i
in $
(seq 1 $VMs); do
62 tail --pid=$
(cat vm
${i}.pid
) -f /dev
/null
63 pid
=$
(cat vm
${i}log.pid
)
71 # this part runs inside qemu vm
72 export PATH
="$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin"
75 sudo kldstat
-n zfs
2>/dev
/null
&& sudo kldunload zfs
76 sudo
-E .
/zfs
/scripts
/zfs.sh
77 TDIR
="/usr/local/share/zfs"
80 # use xfs @ /var/tmp for all distros
81 sudo
mv -f /var
/tmp
/*.txt
/tmp
82 sudo mkfs.xfs
-fq /dev
/vdb
83 sudo mount
-o noatime
/dev
/vdb
/var
/tmp
84 sudo
chmod 1777 /var
/tmp
85 sudo
mv -f /tmp
/*.txt
/var
/tmp
91 # run functional testings and save exitcode
94 if [ "$4" == "quick" ]; then
95 export RUNFILES
="sanity.run"
97 sudo dmesg
-c > dmesg-prerun.txt
100 $TDIR/zfs-tests.sh
-vK -s 3GB
-T $TAGS
102 df
-h > df-postrun.txt
103 echo $RV > tests-exitcode.txt