|
|
1bdc94 |
From 60808b0c672add535f7381785faa6e5609fb20ce Mon Sep 17 00:00:00 2001
|
|
|
1bdc94 |
From: Kevin Wolf <kwolf@redhat.com>
|
|
|
1bdc94 |
Date: Fri, 13 Jul 2018 14:50:02 +0200
|
|
|
1bdc94 |
Subject: [PATCH 44/89] iotests: add test 226 for file driver types
|
|
|
1bdc94 |
|
|
|
1bdc94 |
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
|
|
1bdc94 |
Message-id: <20180713145002.20953-3-kwolf@redhat.com>
|
|
|
1bdc94 |
Patchwork-id: 81351
|
|
|
1bdc94 |
O-Subject: [RHV-7.6 qemu-kvm-rhev PATCH 2/2] iotests: add test 226 for file driver types
|
|
|
1bdc94 |
Bugzilla: 1525829
|
|
|
1bdc94 |
RH-Acked-by: John Snow <jsnow@redhat.com>
|
|
|
1bdc94 |
RH-Acked-by: Max Reitz <mreitz@redhat.com>
|
|
|
1bdc94 |
RH-Acked-by: Fam Zheng <famz@redhat.com>
|
|
|
1bdc94 |
|
|
|
1bdc94 |
From: John Snow <jsnow@redhat.com>
|
|
|
1bdc94 |
|
|
|
1bdc94 |
Test that we're rejecting what we ought to for file,
|
|
|
1bdc94 |
host_driver and host_cdrom drivers. Test that we're
|
|
|
1bdc94 |
seeing the deprecated message for block and chardevs
|
|
|
1bdc94 |
on the file driver.
|
|
|
1bdc94 |
|
|
|
1bdc94 |
Signed-off-by: John Snow <jsnow@redhat.com>
|
|
|
1bdc94 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
1bdc94 |
(cherry picked from commit 2d4cb49ddaa219ed3f5a985ecf8b188aeb2b3d6b)
|
|
|
1bdc94 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
1bdc94 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
1bdc94 |
---
|
|
|
1bdc94 |
tests/qemu-iotests/226 | 66 ++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
1bdc94 |
tests/qemu-iotests/226.out | 26 ++++++++++++++++++
|
|
|
1bdc94 |
tests/qemu-iotests/group | 1 +
|
|
|
1bdc94 |
3 files changed, 93 insertions(+)
|
|
|
1bdc94 |
create mode 100755 tests/qemu-iotests/226
|
|
|
1bdc94 |
create mode 100644 tests/qemu-iotests/226.out
|
|
|
1bdc94 |
|
|
|
1bdc94 |
diff --git a/tests/qemu-iotests/226 b/tests/qemu-iotests/226
|
|
|
1bdc94 |
new file mode 100755
|
|
|
1bdc94 |
index 0000000..460aea2
|
|
|
1bdc94 |
--- /dev/null
|
|
|
1bdc94 |
+++ b/tests/qemu-iotests/226
|
|
|
1bdc94 |
@@ -0,0 +1,66 @@
|
|
|
1bdc94 |
+#!/bin/bash
|
|
|
1bdc94 |
+#
|
|
|
1bdc94 |
+# This test covers expected filetypes for the file, host_cdrom and
|
|
|
1bdc94 |
+# host_device drivers.
|
|
|
1bdc94 |
+#
|
|
|
1bdc94 |
+# Copyright (C) 2018 Red Hat, Inc.
|
|
|
1bdc94 |
+#
|
|
|
1bdc94 |
+# This program is free software; you can redistribute it and/or modify
|
|
|
1bdc94 |
+# it under the terms of the GNU General Public License as published by
|
|
|
1bdc94 |
+# the Free Software Foundation; either version 2 of the License, or
|
|
|
1bdc94 |
+# (at your option) any later version.
|
|
|
1bdc94 |
+#
|
|
|
1bdc94 |
+# This program is distributed in the hope that it will be useful,
|
|
|
1bdc94 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
1bdc94 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
1bdc94 |
+# GNU General Public License for more details.
|
|
|
1bdc94 |
+#
|
|
|
1bdc94 |
+# You should have received a copy of the GNU General Public License
|
|
|
1bdc94 |
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1bdc94 |
+#
|
|
|
1bdc94 |
+
|
|
|
1bdc94 |
+# creator
|
|
|
1bdc94 |
+owner=jsnow@redhat.com
|
|
|
1bdc94 |
+
|
|
|
1bdc94 |
+seq=`basename $0`
|
|
|
1bdc94 |
+echo "QA output created by $seq"
|
|
|
1bdc94 |
+
|
|
|
1bdc94 |
+here=`pwd`
|
|
|
1bdc94 |
+status=1 # failure is the default!
|
|
|
1bdc94 |
+
|
|
|
1bdc94 |
+_cleanup()
|
|
|
1bdc94 |
+{
|
|
|
1bdc94 |
+ rmdir "$TEST_IMG"
|
|
|
1bdc94 |
+}
|
|
|
1bdc94 |
+trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
1bdc94 |
+
|
|
|
1bdc94 |
+# get standard environment, filters and checks
|
|
|
1bdc94 |
+. ./common.rc
|
|
|
1bdc94 |
+. ./common.filter
|
|
|
1bdc94 |
+. ./common.pattern
|
|
|
1bdc94 |
+
|
|
|
1bdc94 |
+# Generic format, but tests file-protocol specific error handling
|
|
|
1bdc94 |
+_supported_fmt generic
|
|
|
1bdc94 |
+_supported_proto file
|
|
|
1bdc94 |
+_supported_os Linux
|
|
|
1bdc94 |
+
|
|
|
1bdc94 |
+# Create something decidedly not a file, blockdev or chardev...
|
|
|
1bdc94 |
+mkdir "$TEST_IMG"
|
|
|
1bdc94 |
+
|
|
|
1bdc94 |
+for PROTO in "file" "host_device" "host_cdrom"; do
|
|
|
1bdc94 |
+ echo
|
|
|
1bdc94 |
+ echo "=== Testing with driver:$PROTO ==="
|
|
|
1bdc94 |
+ echo
|
|
|
1bdc94 |
+ echo "== Testing RO =="
|
|
|
1bdc94 |
+ $QEMU_IO -c "open -r -o driver=$PROTO,filename=$TEST_IMG" 2>&1 | _filter_imgfmt | _filter_testdir
|
|
|
1bdc94 |
+ $QEMU_IO -c "open -r -o driver=$PROTO,filename=/dev/null" 2>&1 | _filter_imgfmt
|
|
|
1bdc94 |
+ echo "== Testing RW =="
|
|
|
1bdc94 |
+ $QEMU_IO -c "open -o driver=$PROTO,filename=$TEST_IMG" 2>&1 | _filter_imgfmt | _filter_testdir
|
|
|
1bdc94 |
+ $QEMU_IO -c "open -o driver=$PROTO,filename=/dev/null" 2>&1 | _filter_imgfmt
|
|
|
1bdc94 |
+done
|
|
|
1bdc94 |
+
|
|
|
1bdc94 |
+# success, all done
|
|
|
1bdc94 |
+echo
|
|
|
1bdc94 |
+echo "*** done"
|
|
|
1bdc94 |
+rm -f $seq.full
|
|
|
1bdc94 |
+status=0
|
|
|
1bdc94 |
diff --git a/tests/qemu-iotests/226.out b/tests/qemu-iotests/226.out
|
|
|
1bdc94 |
new file mode 100644
|
|
|
1bdc94 |
index 0000000..8c0d060
|
|
|
1bdc94 |
--- /dev/null
|
|
|
1bdc94 |
+++ b/tests/qemu-iotests/226.out
|
|
|
1bdc94 |
@@ -0,0 +1,26 @@
|
|
|
1bdc94 |
+QA output created by 226
|
|
|
1bdc94 |
+
|
|
|
1bdc94 |
+=== Testing with driver:file ===
|
|
|
1bdc94 |
+
|
|
|
1bdc94 |
+== Testing RO ==
|
|
|
1bdc94 |
+can't open: A regular file was expected by the 'file' driver, but something else was given
|
|
|
1bdc94 |
+warning: Opening a character device as a file using the 'file' driver is deprecated
|
|
|
1bdc94 |
+== Testing RW ==
|
|
|
1bdc94 |
+can't open: Could not open 'TEST_DIR/t.IMGFMT': Is a directory
|
|
|
1bdc94 |
+warning: Opening a character device as a file using the 'file' driver is deprecated
|
|
|
1bdc94 |
+
|
|
|
1bdc94 |
+=== Testing with driver:host_device ===
|
|
|
1bdc94 |
+
|
|
|
1bdc94 |
+== Testing RO ==
|
|
|
1bdc94 |
+can't open: 'host_device' driver expects either a character or block device
|
|
|
1bdc94 |
+== Testing RW ==
|
|
|
1bdc94 |
+can't open: Could not open 'TEST_DIR/t.IMGFMT': Is a directory
|
|
|
1bdc94 |
+
|
|
|
1bdc94 |
+=== Testing with driver:host_cdrom ===
|
|
|
1bdc94 |
+
|
|
|
1bdc94 |
+== Testing RO ==
|
|
|
1bdc94 |
+can't open: 'host_cdrom' driver expects either a character or block device
|
|
|
1bdc94 |
+== Testing RW ==
|
|
|
1bdc94 |
+can't open: Could not open 'TEST_DIR/t.IMGFMT': Is a directory
|
|
|
1bdc94 |
+
|
|
|
1bdc94 |
+*** done
|
|
|
1bdc94 |
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
|
|
|
1bdc94 |
index 5c55adc..11498fd 100644
|
|
|
1bdc94 |
--- a/tests/qemu-iotests/group
|
|
|
1bdc94 |
+++ b/tests/qemu-iotests/group
|
|
|
1bdc94 |
@@ -218,3 +218,4 @@
|
|
|
1bdc94 |
217 rw auto quick
|
|
|
1bdc94 |
218 rw auto quick
|
|
|
1bdc94 |
219 rw auto
|
|
|
1bdc94 |
+226 auto quick
|
|
|
1bdc94 |
--
|
|
|
1bdc94 |
1.8.3.1
|
|
|
1bdc94 |
|