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 $QSD --chardev stdio
,id
=stdio
--monitor chardev
=stdio \
56 --blockdev node-name
=file0
,driver
=file,filename
="$TEST_IMG" \
57 --blockdev node-name
=fmt0
,driver
=qcow2
,file=file0
<<EOF | _filter_qmp
58 {"execute":"qmp_capabilities"}
59 {"execute": "block-commit", "arguments": {"device": "fmt0", "job-id": "job0"}}
64 echo "=== Streaming can't get permission on base node ==="
67 # Just make sure that this doesn't crash
68 $QSD --chardev stdio
,id
=stdio
--monitor chardev
=stdio \
69 --blockdev node-name
=file_base
,driver
=file,filename
="$TEST_IMG.base" \
70 --blockdev node-name
=fmt_base
,driver
=qcow2
,file=file_base \
71 --blockdev node-name
=file_overlay
,driver
=file,filename
="$TEST_IMG" \
72 --blockdev node-name
=fmt_overlay
,driver
=qcow2
,file=file_overlay
,backing
=fmt_base \
73 --nbd-server addr.
type=unix
,addr.path
="$SOCK_DIR/nbd.sock" \
74 --export type=nbd
,id
=export1
,node-name
=fmt_base
,writable
=on
,name
=export1 \
76 {"execute": "qmp_capabilities"}
77 {"execute": "block-stream",
78 "arguments": {"device": "fmt_overlay", "job-id": "job0"}}