mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-11 12:46:49 +00:00
test(snapshots): check the call that creates a snapshot, not a wrapper of it
_snapshotCreateXML only forwarded to the domain's snapshotCreateXML, and every snapshot test replaced it with a mock: a wrapper that called nothing passed all of them. The wrapper is gone and the tests assert on the domain's call, which the code makes directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
parent
8eb619114c
commit
b737b1f8f7
3 changed files with 15 additions and 22 deletions
|
|
@ -1839,9 +1839,6 @@ class wvmInstance(wvmConnect):
|
|||
grew = True
|
||||
return files[len(tops):] + memory
|
||||
|
||||
def _snapshotCreateXML(self, xml, flag):
|
||||
self.instance.snapshotCreateXML(xml, flag)
|
||||
|
||||
def create_snapshot(self, name, desc=None):
|
||||
self._check_snapshot_state()
|
||||
if self.instance.snapshotListNames(VIR_DOMAIN_SNAPSHOT_LIST_EXTERNAL):
|
||||
|
|
@ -1864,7 +1861,7 @@ class wvmInstance(wvmConnect):
|
|||
xml += self._XMLDesc(VIR_DOMAIN_XML_SECURE)
|
||||
xml += """<active>0</active>
|
||||
</domainsnapshot>"""
|
||||
self._snapshotCreateXML(xml, 0)
|
||||
self.instance.snapshotCreateXML(xml, 0)
|
||||
|
||||
def create_external_snapshot(self, name, desc="", memory=False, quiesce=False, free_percent=10, free_min_gib=1):
|
||||
"""A disk-only snapshot, or with memory too (running VMs only). Every
|
||||
|
|
@ -1922,7 +1919,7 @@ class wvmInstance(wvmConnect):
|
|||
if quiesce:
|
||||
self.ping_agent()
|
||||
flags |= VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE
|
||||
self._snapshotCreateXML(xml, flags)
|
||||
self.instance.snapshotCreateXML(xml, flags)
|
||||
self._refresh_pools_after_snapshot()
|
||||
|
||||
def _snapshot_memory(self, name, disks):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue