tests/qemu-iotests/205: fix race in assertExportNotFound
After nbd-server-remove with mode=hard and an active client, the export is removed from the NBD export list synchronously but remains in the block export list until async cleanup completes (via blk_exp_delete_bh bottom-half). A subsequent nbd-server-remove call may find the export still in the block list with user_owned=false, returning "already shutting down" instead of "not found". Accept both error messages in assertExportNotFound, since both indicate the export is no longer usable. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20260828-qemu-no-hmp-v5-18-9227de146347@redhat.com>
Marc-André Lureau committed
Aug 28, 2026 at 16:04 UTC
fa3cf7a0f564bb862589e3fe9188e202dd01a097
1 file changed
+3
-1
tests/qemu-iotests/205
+3
-1
@@ -60,7 +60,9 @@ class TestNbdServerRemove(iotests.QMPTestCase):
60
61
def assertExportNotFound(self, name):
62
result = self.vm.qmp('nbd-server-remove', name=name)
63
- self.assert_qmp(result, 'error/desc', "Export 'exp' is not found")
63
+ desc = result.get('error', {}).get('desc', '')
64
+ self.assertIn(desc, ("Export '%s' is not found" % name,
65
+ "Export '%s' is already shutting down" % name))
66
67
def assertExistingClients(self, result):
68
self.assert_qmp(result, 'error/desc', "export 'exp' still in use")