]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
iotests: Restrict file Python tests to file
authorMax Reitz <mreitz@redhat.com>
Mon, 2 Sep 2019 19:33:18 +0000 (21:33 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 1 Oct 2019 21:58:28 +0000 (16:58 -0500)
Most of our Python unittest-style tests only support the file protocol.
You can run them with any other protocol, but the test will simply
ignore your choice and use file anyway.

We should let them signal that they require the file protocol so they
are skipped when you want to test some other protocol.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 103cbc771e5660d1f5bb458be80aa9e363547ae0)
 Conflicts:
tests/qemu-iotests/257
*drop changes for test 257, not present in 4.0
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
25 files changed:
tests/qemu-iotests/030
tests/qemu-iotests/040
tests/qemu-iotests/041
tests/qemu-iotests/044
tests/qemu-iotests/045
tests/qemu-iotests/055
tests/qemu-iotests/056
tests/qemu-iotests/057
tests/qemu-iotests/065
tests/qemu-iotests/096
tests/qemu-iotests/118
tests/qemu-iotests/124
tests/qemu-iotests/129
tests/qemu-iotests/132
tests/qemu-iotests/139
tests/qemu-iotests/148
tests/qemu-iotests/151
tests/qemu-iotests/152
tests/qemu-iotests/155
tests/qemu-iotests/163
tests/qemu-iotests/165
tests/qemu-iotests/169
tests/qemu-iotests/196
tests/qemu-iotests/199
tests/qemu-iotests/245

index c6311d182561c51e830eabd576c5b55699ddfc1d..cb550812a779da29d4cd25a8f591926e52fcdd81 100755 (executable)
@@ -865,4 +865,5 @@ class TestSetSpeed(iotests.QMPTestCase):
         self.cancel_and_wait(resume=True)
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['qcow2', 'qed'])
+    iotests.main(supported_fmts=['qcow2', 'qed'],
+                 supported_protocols=['file'])
index b81133a474392a2521f1ea58381436b65ae7c232..e2ca706117b7e124044941339a3521517ee40737 100755 (executable)
@@ -395,4 +395,5 @@ class TestReopenOverlay(ImageCommitTestCase):
         self.run_commit_test(self.img1, self.img0)
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['qcow2', 'qed'])
+    iotests.main(supported_fmts=['qcow2', 'qed'],
+                 supported_protocols=['file'])
index 26bf1701ebd6f9700d0986c8920f7d25c4858ebb..ae6ed952c69cb9e50bed2381be0dd743c4308a75 100755 (executable)
@@ -1068,4 +1068,5 @@ class TestOrphanedSource(iotests.QMPTestCase):
         self.assert_qmp(result, 'error/class', 'GenericError')
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['qcow2', 'qed'])
+    iotests.main(supported_fmts=['qcow2', 'qed'],
+                 supported_protocols=['file'])
index 9ec3dba734a224ada0caec0d15427be8b8bb0871..05ea1f49c5a4450223cba0e3519d274343d3fbcf 100755 (executable)
@@ -118,4 +118,5 @@ class TestRefcountTableGrowth(iotests.QMPTestCase):
         pass
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['qcow2'])
+    iotests.main(supported_fmts=['qcow2'],
+                 supported_protocols=['file'])
index d5484a0ee1779b3341501880981888c84193aa4a..01cc038884fa433874e204864ad1c91f8ccd8d4f 100755 (executable)
@@ -175,4 +175,5 @@ class TestSCMFd(iotests.QMPTestCase):
             "File descriptor named '%s' not found" % fdname)
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['raw'])
+    iotests.main(supported_fmts=['raw'],
+                 supported_protocols=['file'])
index 3437c1150739c98a20b93c198d2f323ffc86b616..c732a112d6670f4d011b656065b0bbccd9cd419a 100755 (executable)
@@ -563,4 +563,5 @@ class TestDriveCompression(iotests.QMPTestCase):
                                         target='drive1')
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['raw', 'qcow2'])
+    iotests.main(supported_fmts=['raw', 'qcow2'],
+                 supported_protocols=['file'])
index e5ac25127b04c3bbc4daae08e78a5da6dea6b52b..ce7adf9174fe68b4213029b96e17a9ef91773d5d 100755 (executable)
@@ -335,4 +335,5 @@ class BackupTest(iotests.QMPTestCase):
         self.dismissal_failure(True)
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['qcow2', 'qed'])
+    iotests.main(supported_fmts=['qcow2', 'qed'],
+                 supported_protocols=['file'])
index 9f0a5a30578fa3a1746517d2ffe896b26cfa1f80..9fbba759b61a83d2b4bf8cc3ca0c43eaa1a97a4e 100755 (executable)
@@ -256,4 +256,5 @@ class TestSnapshotDelete(ImageSnapshotTestCase):
         self.assert_qmp(result, 'error/class', 'GenericError')
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['qcow2'])
+    iotests.main(supported_fmts=['qcow2'],
+                 supported_protocols=['file'])
index 8bac383ea76b6110af231deafa3b3c5b1c192b53..5b21eb96bd0975a351aea130ccc5573c06e17024 100755 (executable)
@@ -129,4 +129,5 @@ TestQemuImgInfo = None
 TestQMP = None
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['qcow2'])
+    iotests.main(supported_fmts=['qcow2'],
+                 supported_protocols=['file'])
index a69439602d4e5206e8f2e8cbcda35aeb635764a0..ab9cb4782212619028991140a09f5afb72600f9c 100755 (executable)
@@ -67,4 +67,5 @@ class TestLiveSnapshot(iotests.QMPTestCase):
         self.checkConfig('target')
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['qcow2'])
+    iotests.main(supported_fmts=['qcow2'],
+                 supported_protocols=['file'])
index 603e10e8a2c4840fe526e93849df257bd6148965..c8543782814a345d7425e879daf4453d161254ee 100755 (executable)
@@ -703,4 +703,5 @@ if __name__ == '__main__':
                        iotests.qemu_default_machine)
     # Need to support image creation
     iotests.main(supported_fmts=['vpc', 'parallels', 'qcow', 'vdi', 'qcow2',
-                                 'vmdk', 'raw', 'vhdx', 'qed'])
+                                 'vmdk', 'raw', 'vhdx', 'qed'],
+                 supported_protocols=['file'])
index 3440f5478188601fca967246035e866dea970749..ca40ba3be26c7274ec06192ee0318cf72c91813f 100755 (executable)
@@ -779,4 +779,5 @@ class TestIncrementalBackupBlkdebug(TestIncrementalBackupBase):
 
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['qcow2'])
+    iotests.main(supported_fmts=['qcow2'],
+                 supported_protocols=['file'])
index 9e87e1c8d9f259f39aa0220776f9be2b4a57c637..cd6b9e9ce7bb0b27a5297c1d6c2860efd9f74cb4 100755 (executable)
@@ -83,4 +83,5 @@ class TestStopWithBlockJob(iotests.QMPTestCase):
         self.do_test_stop("block-commit", device="drive0")
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=["qcow2"])
+    iotests.main(supported_fmts=["qcow2"],
+                 supported_protocols=["file"])
index f53ef6e391bc8780077748da10a40406f4d41400..0f2a106c81dfe6a566c179f1a9db1078c313c272 100755 (executable)
@@ -56,4 +56,5 @@ class TestSingleDrive(iotests.QMPTestCase):
                         'target image does not match source after mirroring')
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['raw', 'qcow2'])
+    iotests.main(supported_fmts=['raw', 'qcow2'],
+                 supported_protocols=['file'])
index 933b45121a9c70f8f06ba0a9c0cce626ef708db1..8dc839ec7e7d3c1b0f24a5c155348e9d1ddf18cc 100755 (executable)
@@ -361,4 +361,5 @@ class TestBlockdevDel(iotests.QMPTestCase):
 
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=["qcow2"])
+    iotests.main(supported_fmts=["qcow2"],
+                 supported_protocols=["file"])
index e01b061fe7aa6d5b67d7800b37b7de5e01726db4..8c11c53cbafe22f76d098adcaeb82934aefbbfff 100755 (executable)
@@ -137,4 +137,5 @@ class TestFifoQuorumEvents(TestQuorumEvents):
 
 if __name__ == '__main__':
     iotests.verify_quorum()
-    iotests.main(supported_fmts=["raw"])
+    iotests.main(supported_fmts=["raw"],
+                 supported_protocols=["file"])
index ad7359fc8d0201e83dc5eeb92ed2325fc7b250de..76ae265cc166b0c7c50b9181f30d3bbe2a3cb1a0 100755 (executable)
@@ -142,4 +142,5 @@ class TestActiveMirror(iotests.QMPTestCase):
 
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['qcow2', 'raw'])
+    iotests.main(supported_fmts=['qcow2', 'raw'],
+                 supported_protocols=['file'])
index fec546d0335ac047855cb7b1851c1f7675667153..732bf5f062f02db2f0d3a937a8c580311781ee7f 100755 (executable)
@@ -59,4 +59,5 @@ class TestUnaligned(iotests.QMPTestCase):
 
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['raw', 'qcow2'])
+    iotests.main(supported_fmts=['raw', 'qcow2'],
+                 supported_protocols=['file'])
index 63a5b5e2c03492d708e87aa2d5f7a1da74ff2994..e19485911cc0139cd8ffb61e07a82dacbc8faf72 100755 (executable)
@@ -258,4 +258,5 @@ BaseClass = None
 MirrorBaseClass = None
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['qcow2'])
+    iotests.main(supported_fmts=['qcow2'],
+                 supported_protocols=['file'])
index 158ba5d0920a77e22f524d7dfa3871c46a9e4ccc..081ccc8ac1d437d59f596eabee5f10431f359650 100755 (executable)
@@ -170,4 +170,5 @@ class TestShrink1M(ShrinkBaseClass):
 ShrinkBaseClass = None
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['raw', 'qcow2'])
+    iotests.main(supported_fmts=['raw', 'qcow2'],
+                 supported_protocols=['file'])
index 88f62d3c6d269c54af4fd0c595424ace8ac266cb..5650dc7c874c197153ba7152789e918e6a0f39e9 100755 (executable)
@@ -103,4 +103,5 @@ class TestPersistentDirtyBitmap(iotests.QMPTestCase):
         self.vm.shutdown()
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['qcow2'])
+    iotests.main(supported_fmts=['qcow2'],
+                 supported_protocols=['file'])
index 527aebd0cb0d0b41ae852e20be5b13a971e03967..25924d68fc99b0d124e3dd05c42c8f6c54647624 100755 (executable)
@@ -222,4 +222,5 @@ for cmb in list(itertools.product((True, False), repeat=2)):
                      'do_test_migration_resume_source', *list(cmb))
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['qcow2'])
+    iotests.main(supported_fmts=['qcow2'],
+                 supported_protocols=['file'])
index 4116ebc92b4e7734577feb066a822c5c0b06540d..92fe9244f85d4218a72473cd8b1e24f6ab21d3f2 100755 (executable)
@@ -63,4 +63,5 @@ class TestInvalidateAutoclear(iotests.QMPTestCase):
             self.assertEqual(f.read(1), b'\x00')
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['qcow2'])
+    iotests.main(supported_fmts=['qcow2'],
+                 supported_protocols=['file'])
index 651e8df5d905906426da00e5b0213036d0572b6f..a2c8ecab5a04918d23a357930ef3abc08cc479c7 100755 (executable)
@@ -115,4 +115,5 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         self.assert_qmp(result, 'return/sha256', sha256);
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['qcow2'], supported_cache_modes=['none'])
+    iotests.main(supported_fmts=['qcow2'], supported_cache_modes=['none'],
+                 supported_protocols=['file'])
index a04c6235c12a0a15b2190a2cb45706550c8636a4..fbfd6248787999d5308df010cbf4c788a1e92874 100644 (file)
@@ -994,4 +994,5 @@ class TestBlockdevReopen(iotests.QMPTestCase):
         self.reopen(opts, {'backing': 'hd2'})
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=["qcow2"])
+    iotests.main(supported_fmts=["qcow2"],
+                 supported_protocols=["file"])