Esempio n. 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()
Esempio n. 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)
Esempio n. 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)
Esempio n. 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()
Esempio n. 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
Esempio n. 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()
Esempio n. 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()
Esempio n. 8
0
 def _assertRaisesVMChangeError(self, method, *args, **kwargs):
     moreasserts.assertRaisesXenapiFailure(self, 'VMChangedDuringExport', method, *args, **kwargs)
Esempio n. 9
0
 def assertRaisesArgumentError(self, method, *args, **kwargs):
     moreasserts.assertRaisesXenapiFailure(self, "ArgumentError", method, *args, **kwargs)
Esempio n. 10
0
 def assertRaisesConfigurationError(self, method, *args, **kwargs):
     moreasserts.assertRaisesXenapiFailure(self, "ConfigurationError", method, *args, **kwargs)
Esempio n. 11
0
 def assertRaisesArgumentError(self, method, *args, **kwargs):
     moreasserts.assertRaisesXenapiFailure(self, 'ArgumentError', method,
                                           *args, **kwargs)
Esempio n. 12
0
 def assertRaisesConfigurationError(self, method, *args, **kwargs):
     moreasserts.assertRaisesXenapiFailure(self, 'ConfigurationError',
                                           method, *args, **kwargs)
Esempio n. 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)
Esempio n. 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)
Esempio n. 15
0
 def _assertRaisesVMChangeError(self, method, *args, **kwargs):
     moreasserts.assertRaisesXenapiFailure(self, 'VMChangedDuringExport',
                                           method, *args, **kwargs)