def test_hypervisorCheckIn_preregistered(self): temp, filename = tempfile.mkstemp(suffix=TEST_SYSTEM_ID) self.addCleanup(os.unlink, filename) f = os.fdopen(temp, "wb") pickle.dump({"system_id": TEST_SYSTEM_ID}, f) f.close() options = Options("http://localhost:%s" % TEST_PORT, "username", "password") s = Satellite(self.logger, options) s.HYPERVISOR_SYSTEMID_FILE = filename.replace(TEST_SYSTEM_ID, "%s") config = Config("test", "libvirt") report = HostGuestAssociationReport(config, self.mapping) result = s.hypervisorCheckIn(report, options) self.assertTrue("failedUpdate" in result) self.assertTrue("created" in result) self.assertTrue("updated" in result)
def test_hypervisorCheckIn_preregistered(self): temp, filename = tempfile.mkstemp(suffix=TEST_SYSTEM_ID) self.addCleanup(os.unlink, filename) f = os.fdopen(temp, "wb") pickle.dump({'system_id': TEST_SYSTEM_ID}, f) f.close() options = Options("http://localhost:%s" % TEST_PORT, "username", "password") options.env = "ENV" options.owner = "OWNER" s = Satellite(self.logger, options) s.HYPERVISOR_SYSTEMID_FILE = filename.replace(TEST_SYSTEM_ID, '%s') result = s.hypervisorCheckIn(options, self.mapping, "type") self.assertTrue("failedUpdate" in result) self.assertTrue("created" in result) self.assertTrue("updated" in result)
def test_hypervisorCheckIn_preregistered(self): temp, filename = tempfile.mkstemp(suffix=TEST_SYSTEM_ID) self.addCleanup(os.unlink, filename) f = os.fdopen(temp, "wb") pickle.dump({'system_id': TEST_SYSTEM_ID}, f) f.close() options = Options("http://localhost:8080", "username", "password") s = Satellite(self.logger, options) s.HYPERVISOR_SYSTEMID_FILE = filename.replace(TEST_SYSTEM_ID, '%s') mapping = { 'host-1': ['guest1-1', 'guest1-2'], 'host-2': ['guest2-1', 'guest2-2', 'guest2-3'] } result = s.hypervisorCheckIn("owner", "env", mapping, "type") self.assertTrue("failedUpdate" in result) self.assertTrue("created" in result) self.assertTrue("updated" in result)
def test_hypervisorCheckIn_preregistered(self): temp, filename = tempfile.mkstemp(suffix=TEST_SYSTEM_ID) self.addCleanup(os.unlink, filename) f = os.fdopen(temp, "wb") pickle.dump({'system_id': TEST_SYSTEM_ID}, f) f.close() options = Options("http://localhost:8080", "username", "password") s = Satellite(self.logger, options) s.HYPERVISOR_SYSTEMID_FILE = filename.replace(TEST_SYSTEM_ID, '%s') mapping = { 'host-1': ['guest1-1', 'guest1-2'], 'host-2': ['guest2-1', 'guest2-2', 'guest2-3'] } result = s.hypervisorCheckIn("owner", "env", mapping, "type") self.assertTrue("failedUpdate" in result) self.assertTrue("created" in result) self.assertTrue("updated" in result)
def test_hypervisorCheckIn_preregistered(self): temp, filename = tempfile.mkstemp(suffix=TEST_SYSTEM_ID) self.addCleanup(os.unlink, filename) f = os.fdopen(temp, "wb") pickle.dump({'system_id': TEST_SYSTEM_ID}, f) f.close() options = Options("http://localhost:%s" % TEST_PORT, "username", "password") options.env = "ENV" options.owner = "OWNER" s = Satellite(self.logger, options) s.HYPERVISOR_SYSTEMID_FILE = filename.replace(TEST_SYSTEM_ID, '%s') result = s.hypervisorCheckIn(options, self.mapping, "type") self.assertTrue("failedUpdate" in result) self.assertTrue("created" in result) self.assertTrue("updated" in result)