示例#1
0
 def gen_snapshot_helper(self, build_mock_domain):
     dom = build_mock_domain
     callbacks_registrer = DomExtSnapshotCallbackRegistrer(dom._conn)
     self.snapshot_helper = DomExtSnapshot(
         dom=dom,
         callbacks_registrer=callbacks_registrer,
         disks={
             "vda": {"src": "/vda.qcow2", "type": "qcow2",},
             "vdb": {"src": "/vdb.qcow2", "type": "qcow2",},
         },
     )
示例#2
0
 def gen_snapshot_helper(self, build_mock_domain):
     self.snapshot_helper = DomExtSnapshot(dom=build_mock_domain,
                                           disks={
                                               "vda": {
                                                   "src": "/vda.qcow2",
                                                   "type": "qcow2",
                                               },
                                               "vdb": {
                                                   "src": "/vdb.qcow2",
                                                   "type": "qcow2",
                                               },
                                           })
    def take_snapshot_and_return_date(self, mock_domain, target_dir,
                                      monkeypatch):
        dombkup = DomBackup(dom=mock_domain,
                            dev_disks=("vda", ),
                            target_dir=target_dir)

        snapshot_helper = DomExtSnapshot(dombkup.dom, dombkup.disks,
                                         dombkup.conn, dombkup.timeout)
        monkeypatch.setattr(snapshot_helper, "external_snapshot",
                            lambda: MockSnapshot(name="test"))
        dombkup._ext_snapshot_helper = snapshot_helper

        definition = dombkup.get_definition()
        return dombkup._snapshot_and_save_date(definition)