Пример #1
0
 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()
Пример #2
0
 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)
Пример #3
0
 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)
Пример #4
0
 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()
Пример #5
0
 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
Пример #6
0
 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()
Пример #7
0
 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()
Пример #8
0
 def _assertRaisesVMChangeError(self, method, *args, **kwargs):
     moreasserts.assertRaisesXenapiFailure(self, 'VMChangedDuringExport', method, *args, **kwargs)
Пример #9
0
 def assertRaisesArgumentError(self, method, *args, **kwargs):
     moreasserts.assertRaisesXenapiFailure(self, "ArgumentError", method, *args, **kwargs)
Пример #10
0
 def assertRaisesConfigurationError(self, method, *args, **kwargs):
     moreasserts.assertRaisesXenapiFailure(self, "ConfigurationError", method, *args, **kwargs)
Пример #11
0
 def assertRaisesArgumentError(self, method, *args, **kwargs):
     moreasserts.assertRaisesXenapiFailure(self, 'ArgumentError', method,
                                           *args, **kwargs)
Пример #12
0
 def assertRaisesConfigurationError(self, method, *args, **kwargs):
     moreasserts.assertRaisesXenapiFailure(self, 'ConfigurationError',
                                           method, *args, **kwargs)
Пример #13
0
 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)
Пример #14
0
 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)
Пример #15
0
 def _assertRaisesVMChangeError(self, method, *args, **kwargs):
     moreasserts.assertRaisesXenapiFailure(self, 'VMChangedDuringExport',
                                           method, *args, **kwargs)