Exemplo n.º 1
0
 def test_sendVirtGuests(self, create_from_file, connection):
     self.prepare(create_from_file, connection)
     config = Config('test', 'libvirt')
     config.smType = 'sam'
     manager = Manager.fromOptions(self.logger, self.options, config)
     manager.sendVirtGuests(self.domain_report, self.options)
     manager.connection.updateConsumer.assert_called_with(
         ANY,
         guest_uuids=[guest.toDict() for guest in self.guestInfo],
         hypervisor_id=self.hypervisor_id)
Exemplo n.º 2
0
 def test_hypervisorCheckIn(self, create_from_file, connection):
     self.prepare(create_from_file, connection)
     config = Config('test', 'libvirt')
     config.smType = 'sam'
     manager = Manager.fromOptions(self.logger, self.options, config)
     self.options.env = "ENV"
     self.options.owner = "OWNER"
     manager.hypervisorCheckIn(self.host_guest_report, self.options)
     manager.connection.hypervisorCheckIn.assert_called_with(
         self.options.owner,
         self.options.env,
         dict(
             (
                 host.hypervisorId,
                 [
                     guest.toDict()
                     for guest in host.guestIds
                 ]
             )
             for host in self.host_guest_report.association['hypervisors']),
         options=self.options)