NetworkScenarioTest Ignores Flavor Reference while creating Instance

Bug #1541199 reported by Ashok Kumar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
intel-nfv-ci-tests
New
Undecided
Unassigned
tempest
Invalid
Undecided
Unassigned

Bug Description

I have created a Test case which extends ScenarioManager.NetworkScenarioTest.
While creating Instance using below method NetworkScenarioTest ignores the Flavor references sent and creates instance with default FlavorRef from Config.

Here is how I am creating instance:
class TestServerNumaBase(manager.NetworkScenarioTest):
    credentials = ['admin']

    @classmethod
    def setup_clients(cls):
        cls.manager = cls.admin_manager
        super(manager.NetworkScenarioTest, cls).setup_clients()
        # Use admin client by default

   def boot_instance(self, flavor=None):
          security_groups = [{'name': self.security_group['name']}]
          create_kwargs = {
              'key_name': self.keypair['name'],
              'security_groups': security_groups
          }

         if flavor is None:
              flavor = self.create_flavor_with_extra()

         self.instance = self.create_server(
              image=self.image_ref,
              flavor=flavor,
              create_kwargs=create_kwargs)

I am not sure if i missing something.
I have a patch ready to fix it but not sure if I am calling it correctly. So just wanted to make sure that this is a bug.

Revision history for this message
Castulo J. Martinez (castulo-martinez) wrote :

I don't think you are calling the create_server method correctly. Looking at the function definition (https://github.com/openstack/tempest/blob/master/tempest/scenario/manager.py#L157-L159) I see that method receives these parameters:

name=None, image_id=None, flavor=None, validatable=False, wait_until=None, wait_on_delete=True, clients=None, **kwargs

So the first thing I notice is that you are using wrong name for parameters. Also make sure you are actually passing it a flavor. I see you default value for flavor is None, and I have no idea what your method create_flavor_with_extra() is and if it is actually returning a valid flavor. so my guess is that you are sending None ad flavor, and that will result in the default image from the config file being used (https://github.com/openstack/tempest/blob/master/tempest/common/compute.py#L54-L55).

I'm closing this bug as invalid, if you still think it is a bug, please provide more info and reopen the bug.

Changed in tempest:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.