mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-09 19:56:48 +00:00
test: the live suite passes on v3.1.0 again
The live suite run against v3.1.0 on two Vagrant computes (TCP and SSH,
TLS, a socket inside compute1) found two tests that no longer held, and
nothing else:
- A SATA disk added to a running VM is refused by libvirt; since
90c148d a refused form goes back to its page with the reason instead
of a 500. The test expected the 500; it now expects the redirect and
the message, and still checks that neither definition changed.
- The NVRAM copy test built its libvirtError("define failed") and
matched that text, but libvirt-python gives a new libvirtError the
message of the last error its thread recorded: in the socket run a
connection of an earlier live test was closed by then ("client socket
is closed"). The test now checks that its own error object is raised.
This commit is contained in:
parent
ab5ed59ea1
commit
0a37ca8b70
2 changed files with 9 additions and 3 deletions
|
|
@ -472,8 +472,12 @@ class NvramCopyTestCase(unittest.TestCase):
|
|||
self.shared.start()
|
||||
|
||||
def test_the_copy_is_deleted_when_the_definition_fails(self):
|
||||
self.host.defineXML = mock.MagicMock(side_effect=libvirt.libvirtError("define failed"))
|
||||
with self.assertRaisesRegex(libvirt.libvirtError, "define failed"):
|
||||
# the raised error is this one: its message can be another libvirt
|
||||
# error the thread recorded (a closed connection of an earlier live test)
|
||||
error = libvirt.libvirtError("define failed")
|
||||
self.host.defineXML = mock.MagicMock(side_effect=error)
|
||||
with self.assertRaises(libvirt.libvirtError) as raised:
|
||||
self.move()
|
||||
self.assertIs(raised.exception, error)
|
||||
self.dest_pool.storageVolLookupByName.assert_called_once_with("vm_VARS.fd")
|
||||
self.dest_pool.storageVolLookupByName.return_value.delete.assert_called_once_with(0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue