2 # group: rw auto quick qsd
4 # Job tests related specifically to qemu-storage-daemon
6 # Copyright (C) 2021 Red Hat, Inc.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 owner
=kwolf@redhat.com
26 echo "QA output created by $seq"
28 status
=1 # failure is the default!
33 rm -f "$SOCK_DIR/nbd.sock"
35 trap "_cleanup; exit \$status" 0 1 2 3 15
37 # get standard environment, filters and checks
43 _supported_proto generic
47 TEST_IMG
="$TEST_IMG.base" _make_test_img
$size
48 _make_test_img
-b "$TEST_IMG.base" -F $IMGFMT
51 echo "=== Job still present at shutdown ==="
54 # Just make sure that this doesn't crash
55 # (Filter job status and READY events, because their order may differ
56 # between runs, particularly around when 'quit' is issued)
57 $QSD --chardev stdio
,id
=stdio
--monitor chardev
=stdio \
58 --blockdev node-name
=file0
,driver
=file,filename
="$TEST_IMG" \
59 --blockdev node-name
=fmt0
,driver
=qcow2
,file=file0
<<EOF \
60 | _filter_qmp | grep -v JOB_STATUS_CHANGE | grep -v BLOCK_JOB_READY
61 {"execute":"qmp_capabilities"}
62 {"execute": "block-commit", "arguments": {"device": "fmt0", "job-id": "job0"}}
67 echo "=== Streaming can't get permission on base node ==="
70 # Just make sure that this doesn't crash
71 $QSD --chardev stdio
,id
=stdio
--monitor chardev
=stdio \
72 --blockdev node-name
=file_base
,driver
=file,filename
="$TEST_IMG.base" \
73 --blockdev node-name
=fmt_base
,driver
=qcow2
,file=file_base \
74 --blockdev node-name
=file_overlay
,driver
=file,filename
="$TEST_IMG" \
75 --blockdev node-name
=fmt_overlay
,driver
=qcow2
,file=file_overlay
,backing
=fmt_base \
76 --nbd-server addr.
type=unix
,addr.path
="$SOCK_DIR/nbd.sock" \
77 --export type=nbd
,id
=export1
,node-name
=fmt_base
,writable
=on
,name
=export1 \
79 {"execute": "qmp_capabilities"}
80 {"execute": "block-stream",
81 "arguments": {"device": "fmt_overlay", "job-id": "job0"}}