← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1218746] Re: test_create_instance_with_availability_zone failed while run test by nosetests

 

Cannot reproduce such issue with latest code in my environment.

root@liugya-ubuntu:~/src/nova-ce/test/nova# nosetests nova/tests/api/openstack/compute/plugins/v3/test_availability_zone.py
........
----------------------------------------------------------------------
Ran 8 tests in 3.487s
 
OK
root@liugya-ubuntu:~/src/nova-ce/test/nova# nosetests nova.tests.api.openstack.compute.plugins.v3.test_availability_zone:ServersControllerCreateTest
...
----------------------------------------------------------------------
Ran 3 tests in 1.685s
 
OK

** Changed in: nova
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1218746

Title:
  test_create_instance_with_availability_zone failed while run test by
  nosetests

Status in OpenStack Compute (Nova):
  Invalid

Bug description:
  this may because the source code in v3 plugin servers.py doesn't use the availability_zone parameter, and also not pass it to the create method of compute api.
  https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/plugins/v3/servers.py#L823

  $ nosetests nova.tests.api.openstack.compute.plugins.v3.test_availability_zone:ServersControllerCreateTest
  Traceback (most recent call last):
    File "/home/hzwangpan/nova/nova/tests/api/openstack/compute/plugins/v3/test_availability_zone.py", line 470, in test_create_instance_with_availability_zone
      res = self.controller.create(req, body).obj
    File "/home/hzwangpan/nova/nova/api/openstack/compute/plugins/v3/servers.py", line 941, in create
      (instances, resv_id) = self.compute_api.create(context,
    File "/home/hzwangpan/nova/nova/tests/api/openstack/compute/plugins/v3/test_availability_zone.py", line 437, in create
      self.assertIn('availability_zone', kwargs)
    File "/usr/local/lib/python2.7/dist-packages/testtools/testcase.py", line 328, in assertIn
      self.assertThat(haystack, Contains(needle))
    File "/usr/local/lib/python2.7/dist-packages/testtools/testcase.py", line 417, in assertThat
      raise MismatchError(matchee, matcher, mismatch, verbose)
  MismatchError: 'availability_zone' not in {'display_name': 'config_drive_test', 'access_ip_v6': None, 'access_ip_v4': None, 'block_device_mapping': None, 'display_description': 'config_drive_test', 'max_count': 1, 'auto_disk_config': False, 'admin_password': '84pEtaJCiDJA', 'injected_files': [], 'min_count': 1, 'security_group': ['default'], 'requested_networks': None, 'metadata': {'open': 'stack', 'hello': 'world'}}

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1218746/+subscriptions