iotests: Restrict file Python tests to file
authorMax Reitz <mreitz@redhat.com>
Mon, 2 Sep 2019 19:33:18 +0000 (21:33 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 10 Sep 2019 06:58:43 +0000 (08:58 +0200)
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>
26 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
tests/qemu-iotests/257

index 1b69f318c64079a7eed26d3f05bde39ae4bb5435..f3766f2a8174c593d057cee0dd222f5686beffb2 100755 (executable)
@@ -957,4 +957,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 6db9abf8e6ef2e1c244a73f61c803555e366ed1f..762ad1ebcb446fbddf7ec786b153b343873018f8 100755 (executable)
@@ -429,4 +429,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 8bc8f81db775f4130dd6fca2e975eea275eb3521..8568426311e59414d22ef02f81a41232f08ca1ad 100755 (executable)
@@ -1122,4 +1122,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 e761e465aef2ae35df6144c209b10c9708be05c7..98c55d8e5ae46ef3e5ec5f04b49b478a5950e6d8 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 6f45779ee9b040a2479366e115963830bfc4ec83..ea0b326ae033387db98e6b1f8e7737de31aa82ae 100755 (executable)
@@ -717,4 +717,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 2176ea51ba886140aeb4da0832115380b25bdba5..cbb5a76530c2b3eb50fee1aea6ec8f20651d0903 100755 (executable)
@@ -358,4 +358,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 7e06cc114556292e2dcf250636f99268698f7ae4..8c204caf20535a416019eed31670574b8fb26597 100755 (executable)
@@ -227,4 +227,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 bc1ceb9792f4935ae7b152ffa39412e8e5b429a7..41218d5f1db3dfe7b2e7eac649048fb75336235f 100644 (file)
@@ -1000,4 +1000,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"])
index c2a72c577aac7a77e8446af198433c448096b2b0..4a636d8ab2d7489b03034f6b18bc8c01376c1907 100755 (executable)
@@ -557,4 +557,5 @@ def main():
     test_backup_api()
 
 if __name__ == '__main__':
-    iotests.script_main(main, supported_fmts=['qcow2'])
+    iotests.script_main(main, supported_fmts=['qcow2'],
+                        supported_protocols=['file'])