def testGetRecordRaisesArgumentErrorIfVdiUuidIsMissing(self): hostname, network, vdi = testsetup.setup_host_and_network(templates=1, vdi_mb=10) moreasserts.assertRaisesXenapiFailure(self, 'ArgumentError', transferclient.get_record, hostname) clean_up()
def testUnexposeOfUnmountedVDIFailsWithVDINotInUse(self): hostname, network, vdi = testsetup.setup_host_and_network(templates=1, vdi_mb=10) moreasserts.assertRaisesXenapiFailure(self, 'VDINotInUse', transferclient.unexpose, hostname, vdi_uuid=vdi)
def testUnexposeOfUnknownVDIFailsWithVDINotFound(self): hostname, network, vdi = testsetup.setup_host_and_network(templates=1, vdi_mb=10) invalid_vdi = vdi[:-6] + 'abcdef' moreasserts.assertRaisesXenapiFailure(self, 'VDINotFound', transferclient.unexpose, hostname, vdi_uuid=invalid_vdi)
def testGetRecordRaisesVDINotFoundIfThereIsNoSuchVDIOnTheHost(self): hostname, network, vdi = testsetup.setup_host_and_network(templates=1, vdi_mb=10) invalidvdi = vdi[:-6] + 'abcdef' moreasserts.assertRaisesXenapiFailure(self, 'VDINotFound', transferclient.get_record, hostname, vdi_uuid=invalidvdi) clean_up()
def run(self): try: moreasserts.assertRaisesXenapiFailure(self.testinstance, 'ConfigurationError', transferclient.expose, self.hostname, vdi_uuid=self.vdi, network_uuid=self.network, transfer_mode='http') except Exception, e: # threading.Thread does not provide run() return values or exceptions to the caller. # Return the exception via output_list. # TODO: It would be nicer to use some third-party python library for background tasks that handle this. self.output_list.append(e) return
def _assertRaisesVMChangeError(self, method, *args, **kwargs): moreasserts.assertRaisesXenapiFailure(self, 'VMChangedDuringExport', method, *args, **kwargs)
def assertRaisesArgumentError(self, method, *args, **kwargs): moreasserts.assertRaisesXenapiFailure(self, "ArgumentError", method, *args, **kwargs)
def assertRaisesConfigurationError(self, method, *args, **kwargs): moreasserts.assertRaisesXenapiFailure(self, "ConfigurationError", method, *args, **kwargs)
def assertRaisesArgumentError(self, method, *args, **kwargs): moreasserts.assertRaisesXenapiFailure(self, 'ArgumentError', method, *args, **kwargs)
def assertRaisesConfigurationError(self, method, *args, **kwargs): moreasserts.assertRaisesXenapiFailure(self, 'ConfigurationError', method, *args, **kwargs)