예제 #1
0
 def setUp(self):
     super(TestShareBasicOps, self).setUp()
     # Setup image and flavor the test instance
     # Support both configured and injected values
     if not hasattr(self, 'flavor_ref'):
         self.flavor_ref = CONF.compute.flavor_ref
     if CONF.share.image_with_share_tools:
         images = self.images_client.list_images()
         for img in images:
             if img["name"] == CONF.share.image_with_share_tools:
                 self.image_ref = img['id']
                 break
         if not self.image_ref:
             msg = ("Image %s not found" %
                    CONF.share.image_with_share_tools)
             raise exceptions.InvalidConfiguration(message=msg)
     self.image_utils = test_utils.ImageUtils()
     if not self.image_utils.is_flavor_enough(self.flavor_ref,
                                              self.image_ref):
         raise self.skipException(
             '{image} does not fit in {flavor}'.format(
                 image=self.image_ref, flavor=self.flavor_ref
             )
         )
     self.ssh_user = CONF.compute.image_ssh_user
     LOG.debug('Starting test for i:{image}, f:{flavor}. '
               'user: {ssh_user}'.format(
                   image=self.image_ref, flavor=self.flavor_ref,
                   ssh_user=self.ssh_user))
예제 #2
0
 def setUp(self):
     super(TestResourceReservationScenario, self).setUp()
     # Setup image and flavor the test instance
     # Support both configured and injected values
     if not hasattr(self, 'image_ref'):
         self.image_ref = CONF.compute.image_ref
     if not hasattr(self, 'flavor_ref'):
         self.flavor_ref = CONF.compute.flavor_ref
     self.image_utils = utils.ImageUtils()
     if not self.image_utils.is_flavor_enough(self.flavor_ref,
                                              self.image_ref):
         raise self.skipException('{image} does not fit in {flavor}'.format(
             image=self.image_ref, flavor=self.flavor_ref))
예제 #3
0
 def setUp(self):
     super(TestServerBasicOps, self).setUp()
     # Setup image and flavor the test instance
     # Support both configured and injected values
     if not hasattr(self, 'image_ref'):
         self.image_ref = CONF.compute.image_ref
     if not hasattr(self, 'flavor_ref'):
         self.flavor_ref = CONF.compute.flavor_ref
     self.image_utils = test_utils.ImageUtils(self.manager)
     if not self.image_utils.is_flavor_enough(self.flavor_ref,
                                              self.image_ref):
         raise self.skipException('{image} does not fit in {flavor}'.format(
             image=self.image_ref, flavor=self.flavor_ref))
     self.run_ssh = CONF.validation.run_validation and \
         self.image_utils.is_sshable_image(self.image_ref)
     self.ssh_user = self.image_utils.ssh_user(self.image_ref)
     LOG.debug('Starting test for i:{image}, f:{flavor}. '
               'Run ssh: {ssh}, user: {ssh_user}'.format(
                   image=self.image_ref,
                   flavor=self.flavor_ref,
                   ssh=self.run_ssh,
                   ssh_user=self.ssh_user))