network uuid hasn't been checked in create server

Bug #1208743 reported by Ivan-Zhu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Medium
Unassigned

Bug Description

when I port a negative tempest tests into v3, this test cann't pass but it can pass when use nova v2 api. I think there is no validation for networks.

    @attr(type=['negative', 'gate'])
    def test_create_with_invalid_network_uuid(self):
        # Pass invalid network uuid while creating a server

        networks = [{'fixed_ip': '10.0.1.1', 'uuid': 'a-b-c-d-e-f-g-h-i-j'}]

        self.assertRaises(exceptions.BadRequest,
                          self.create_server,
                          networks=networks)

The following is the log:

======================================================================
FAIL: tempest.api.compute.servers.v3.test_servers_negative.ServersNegativeV3TestJSON.test_create_with_invalid_network_uuid[gate,negative]
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
  File "/opt/stack/tempest/tempest/api/compute/servers/v3/test_servers_negative.py", line 153, in test_create_with_invalid_network_uuid
    networks=networks)
  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-0d34c7cf-5047-4c75-848b-d30df693ead6', 'location': 'http://192.168.1.101:8774/v3/servers/d91862ce-d80d-44d0-957c-8b28370dd460', 'date': 'Tue, 06 Aug 2013 09:03:28 GMT', 'content-type': 'application/json'}, {u'links': [{u'href': u'http://192.168.1.101:8774/v3/servers/d91862ce-d80d-44d0-957c-8b28370dd460', u'rel': u'self'}, {u'href': u'http://192.168.1.101:8774/servers/d91862ce-d80d-44d0-957c-8b28370dd460', u'rel': u'bookmark'}], u'id': u'd91862ce-d80d-44d0-957c-8b28370dd460', u'security_groups': [{u'name': u'default'}], u'adminPass': u'r8vSmWK5W8rC'})

-------------------- >> 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": {"flavorRef": 42, "name": "ServersNegativeV3TestJSON-instance1742202142", "imageRef": "cade0819-2939-484b-a52f-600d039aefc1", "networks": [{"fixed_ip": "10.0.1.1", "uuid": "a-b-c-d-e-f-g-h-i-j"}]}}
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/d91862ce-d80d-44d0-957c-8b28370dd460', 'date': 'Tue, 06 Aug 2013 09:03:28 GMT', 'x-compute-request-id': 'req-0d34c7cf-5047-4c75-848b-d30df693ead6', 'content-type': 'application/json'}
tempest.common.rest_client: DEBUG: Response Body: {"server": {"security_groups": [{"name": "default"}], "id": "d91862ce-d80d-44d0-957c-8b28370dd460", "links": [{"href": "http://192.168.1.101:8774/v3/servers/d91862ce-d80d-44d0-957c-8b28370dd460", "rel": "self"}, {"href": "http://192.168.1.101:8774/servers/d91862ce-d80d-44d0-957c-8b28370dd460", "rel": "bookmark"}], "adminPass": "r8vSmWK5W8rC"}}

Tags: api network
Ivan-Zhu (ivan-zhu)
Changed in nova:
assignee: nobody → Ivan-Zhu (ivan-zhu)
Aaron Rosen (arosen)
tags: added: network
Mathew Odden (locke105)
Changed in nova:
assignee: Ivan-Zhu (ivan-zhu) → nobody
tags: added: api
Changed in nova:
status: New → Confirmed
importance: Undecided → Medium
lizheming (lizheming-li)
Changed in nova:
assignee: nobody → lizheming (lizheming-li)
Changed in nova:
assignee: lizheming (lizheming-li) → nobody
Revision history for this message
Dmitry Guryanov (dguryanov) wrote :

It seems bug has been fixed. Test tempest.api.compute.v3.servers.test_servers_negative.ServersNegativeV3Test doesn't fail anymore.

Brent Eagles (beagles)
tags: added: neutron
tags: removed: neutron
Changed in nova:
status: Confirmed → 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.