← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1208746] Re: no validation for security groups in create server of v3 api

 

** Changed in: nova
       Status: Fix Committed => Fix Released

-- 
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/1208746

Title:
  no validation for security groups in create server of v3 api

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  when I port negative tempest  test into v3, this test cann't pass
  against v3 api. I think it failed because the security_groups
  extension has not been implemented.

       @attr(type=['negative', 'gate'])
      def test_create_with_nonexistent_security_group(self):
          # Create a server with a nonexistent security group

          security_groups = [{'name': 'does_not_exist'}]
          self.assertRaises(exceptions.BadRequest,
                            self.create_server,
                            security_groups=security_groups)

  
  the following is the log:

  
  FAIL: tempest.api.compute.servers.v3.test_servers_negative.ServersNegativeV3TestJSON.test_create_with_nonexistent_security_group[gate,negative]
  ----------------------------------------------------------------------
  _StringException: Traceback (most recent call last):
    File "/opt/stack/tempest/tempest/api/compute/servers/v3/test_servers_negative.py", line 249, in test_create_with_nonexistent_security_group
      security_groups=security_groups)
    File "/opt/stack/tempest/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 394, in assertRaises
      self.assertThat(our_callable, matcher)
    File "/opt/stack/tempest/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 417, in assertThat
      raise MismatchError(matchee, matcher, mismatch, verbose)
  MismatchError: <bound method type.create_server of <class 'tempest.api.compute.servers.v3.test_servers_negative.ServersNegativeV3TestJSON'>> returned ({'status': '202', 'content-length': '345', 'x-compute-request-id': 'req-0251d6a1-38e0-4249-8ee2-459fb09fa0a0', 'location': 'http://192.168.1.101:8774/v3/servers/c5738f95-11ad-42d0-b91d-bbb248c834ec', 'date': 'Tue, 06 Aug 2013 09:03:29 GMT', 'content-type': 'application/json'}, {u'links': [{u'href': u'http://192.168.1.101:8774/v3/servers/c5738f95-11ad-42d0-b91d-bbb248c834ec', u'rel': u'self'}, {u'href': u'http://192.168.1.101:8774/servers/c5738f95-11ad-42d0-b91d-bbb248c834ec', u'rel': u'bookmark'}], u'id': u'c5738f95-11ad-42d0-b91d-bbb248c834ec', u'security_groups': [{u'name': u'default'}], u'adminPass': u'cBR2Y9tt3nhr'})

  -------------------- >> begin captured logging << --------------------
  tempest.common.rest_client: INFO: Request: POST http://192.168.1.101:8774/v3/servers
  tempest.common.rest_client: DEBUG: Request Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<Token omitted>'}
  tempest.common.rest_client: DEBUG: Request Body: {"server": {"security_groups": [{"name": "does_not_exist"}], "flavorRef": 42, "name": "ServersNegativeV3TestJSON-instance24887116", "imageRef": "cade0819-2939-484b-a52f-600d039aefc1"}}
  tempest.common.rest_client: INFO: Response Status: 202
  tempest.common.rest_client: DEBUG: Response Headers: {'content-length': '345', 'location': 'http://192.168.1.101:8774/v3/servers/c5738f95-11ad-42d0-b91d-bbb248c834ec', 'date': 'Tue, 06 Aug 2013 09:03:29 GMT', 'x-compute-request-id': 'req-0251d6a1-38e0-4249-8ee2-459fb09fa0a0', 'content-type': 'application/json'}
  tempest.common.rest_client: DEBUG: Response Body: {"server": {"security_groups": [{"name": "default"}], "id": "c5738f95-11ad-42d0-b91d-bbb248c834ec", "links": [{"href": "http://192.168.1.101:8774/v3/servers/c5738f95-11ad-42d0-b91d-bbb248c834ec";, "rel": "self"}, {"href": "http://192.168.1.101:8774/servers/c5738f95-11ad-42d0-b91d-bbb248c834ec";, "rel": "bookmark"}], "adminPass": "cBR2Y9tt3nhr"}}
  --------------------- >> end captured logging << ---------------------

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