summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-06-25 09:03:39 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-06-28 09:13:41 +0100
commit05d40ce0234db9fe16703ba0e1f22088ce437a61 (patch)
tree4333dd442bfc5e55cd32e0d007fb35a9f6cda7b1 /python
parente6dc4a257423c533cb1b3f0c91409ccd55ce2ecd (diff)
downloadlibguestfs-05d40ce0234db9fe16703ba0e1f22088ce437a61.tar.gz
libguestfs-05d40ce0234db9fe16703ba0e1f22088ce437a61.tar.xz
libguestfs-05d40ce0234db9fe16703ba0e1f22088ce437a61.zip
tests: Fix a few tests where /dev/null was being used with format=qcow2.
This was always incorrect behaviour, but qemu appears to tolerate it. This cherry picks just the test fixes from commit 729bb9c6b5ae0c0e7c68dc802b1617936062f966.
Diffstat (limited to 'python')
-rw-r--r--python/t/060-optargs.py2
-rw-r--r--python/t/rhbz811650.py10
2 files changed, 10 insertions, 2 deletions
diff --git a/python/t/060-optargs.py b/python/t/060-optargs.py
index 75ea06f3..be28a3ce 100644
--- a/python/t/060-optargs.py
+++ b/python/t/060-optargs.py
@@ -21,5 +21,5 @@ import guestfs
g = guestfs.GuestFS()
g.add_drive_opts ("/dev/null")
g.add_drive_opts ("/dev/null", readonly = 1)
-g.add_drive_opts ("/dev/null", iface = "virtio", format = "qcow2")
+g.add_drive_opts ("/dev/null", iface = "virtio", format = "raw")
g.close ()
diff --git a/python/t/rhbz811650.py b/python/t/rhbz811650.py
index 84daf0fe..cf01673f 100644
--- a/python/t/rhbz811650.py
+++ b/python/t/rhbz811650.py
@@ -15,11 +15,17 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+import os
import guestfs
+f = open ("test.img", "w")
+f.truncate (500 * 1024 * 1024)
+f.close ()
+
g = guestfs.GuestFS ()
-g.add_drive_opts ("/dev/null", format="qcow2");
+# Deliberate error: the disk format is supposed to be raw.
+g.add_drive_opts ("test.img", format="qcow2");
# Because error() wasn't being called, guestfs_last_error would return
# NULL, causing a segfault in the Python bindings (RHBZ#811650).
@@ -27,3 +33,5 @@ try:
g.launch ()
except:
pass
+
+os.unlink ("test.img")