render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From 743fd6401299ceee855b50ee844b8f2fb39551d2 Mon Sep 17 00:00:00 2001
Message-Id: <743fd6401299ceee855b50ee844b8f2fb39551d2@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Mon, 21 Jan 2019 18:43:12 +0100
Subject: [PATCH] tests: qemuxml2argv: Add test case for empty CDROM with cache
 mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Upcomming change will influence CDROM with cache mode so add a test
case.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit a641e044c1294984979199fefbb9a9c928f7708a)

https://bugzilla.redhat.com/show_bug.cgi?id=1553255

 Conflicts:
	tests/qemuxml2argvdata/disk-cdrom.args
            - context: bootindex not yet assumed
	tests/qemuxml2argvdata/disk-cdrom.x86_64-2.12.0.args
	tests/qemuxml2argvdata/disk-cdrom.x86_64-latest.args
            - missing refactor to capability file based tests

Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 tests/qemuxml2argvdata/disk-cdrom.args  | 4 +++-
 tests/qemuxml2argvdata/disk-cdrom.xml   | 6 ++++++
 tests/qemuxml2xmloutdata/disk-cdrom.xml | 6 ++++++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/tests/qemuxml2argvdata/disk-cdrom.args b/tests/qemuxml2argvdata/disk-cdrom.args
index 55a76f6dac..547263cbd8 100644
--- a/tests/qemuxml2argvdata/disk-cdrom.args
+++ b/tests/qemuxml2argvdata/disk-cdrom.args
@@ -24,6 +24,8 @@ server,nowait \
 -usb \
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
--drive file=/root/boot.iso,format=raw,if=none,id=drive-ide0-1-0,media=cdrom,\
+-drive file=/root/boot.iso,format=raw,if=none,id=drive-ide0-0-1,media=cdrom,\
 readonly=on \
+-device ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 \
+-drive if=none,id=drive-ide0-1-0,media=cdrom,readonly=on,cache=none \
 -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0
diff --git a/tests/qemuxml2argvdata/disk-cdrom.xml b/tests/qemuxml2argvdata/disk-cdrom.xml
index 341025c477..fa78f652bf 100644
--- a/tests/qemuxml2argvdata/disk-cdrom.xml
+++ b/tests/qemuxml2argvdata/disk-cdrom.xml
@@ -23,6 +23,12 @@
     <disk type='file' device='cdrom'>
       <driver name='qemu' type='raw'/>
       <source file='/root/boot.iso'/>
+      <target dev='hdb' bus='ide'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
+    </disk>
+    <disk type='file' device='cdrom'>
+      <driver name='qemu' type='raw' cache='none'/>
       <target dev='hdc' bus='ide'/>
       <readonly/>
       <address type='drive' controller='0' bus='1' target='0' unit='0'/>
diff --git a/tests/qemuxml2xmloutdata/disk-cdrom.xml b/tests/qemuxml2xmloutdata/disk-cdrom.xml
index 163ce88f19..ccc2716828 100644
--- a/tests/qemuxml2xmloutdata/disk-cdrom.xml
+++ b/tests/qemuxml2xmloutdata/disk-cdrom.xml
@@ -23,6 +23,12 @@
     <disk type='file' device='cdrom'>
       <driver name='qemu' type='raw'/>
       <source file='/root/boot.iso'/>
+      <target dev='hdb' bus='ide'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
+    </disk>
+    <disk type='file' device='cdrom'>
+      <driver name='qemu' type='raw' cache='none'/>
       <target dev='hdc' bus='ide'/>
       <readonly/>
       <address type='drive' controller='0' bus='1' target='0' unit='0'/>
-- 
2.20.1