KeyError: key 'networks' does not exist in response body

Bug #1401028 reported by Wang Bo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Medium
Ghanshyam Mann

Bug Description

In case tempest.scenario.test_network_basic_ops.TestNetworkBasicOps.test_network_basic_ops, it called following function to check tenant network connectivity if "tenant_networks_reachable=True" in tempest.conf
https://github.com/openstack/tempest/blob/master/tempest/scenario/manager.py#L727

However, it reported KeyError that there is no key "networks" in the response body from booting instance. Refer to Openstack API doc: http://developer.openstack.org/api-ref-compute-v2.html. The response body is as following:
"networks" does not exist.
{
    "server": {
        "accessIPv4": "",
        "accessIPv6": "",
        "addresses": {
            "private": [
                {
                    "addr": "192.168.0.3",
                    "version": 4
                }
            ]
        },
        "created": "2012-08-20T21:11:09Z",
        "flavor": {
            "id": "1",
            "links": [
                {
                    "href": "http://openstack.example.com/openstack/flavors/1",
                    "rel": "bookmark"
                }
            ]
        },
        "hostId": "65201c14a29663e06d0748e561207d998b343e1d164bfa0aafa9c45d",
        "id": "893c7791-f1df-4c3d-8383-3caae9656c62",
        "image": {
            "id": "70a599e0-31e7-49b7-b260-868f441e862b",
            "links": [
                {
                    "href": "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
                    "rel": "bookmark"
                }
            ]
        },
        "links": [
            {
                "href": "http://openstack.example.com/v2/openstack/servers/893c7791-f1df-4c3d-8383-3caae9656c62",
                "rel": "self"
            },
            {
                "href": "http://openstack.example.com/openstack/servers/893c7791-f1df-4c3d-8383-3caae9656c62",
                "rel": "bookmark"
            }
        ],
        "metadata": {
            "My Server Name": "Apache1"
        },
        "name": "new-server-test",
        "progress": 0,
        "status": "ACTIVE",
        "tenant_id": "openstack",
        "updated": "2012-08-20T21:11:09Z",
        "user_id": "fake"
    }
}

Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :

Yes this is issue.

Actually this was introduced while doing scenario manager migration to tempest client.

IP should be fetched from server['addresses']

This was not caught anywhere as none of gate job run tests with tenant_networks_reachable=True

Changed in tempest:
status: New → Confirmed
importance: Undecided → High
Masayuki Igawa (igawa)
Changed in tempest:
importance: High → Medium
Revision history for this message
Masayuki Igawa (igawa) wrote :

I think this is a bug actually. Now, in the gate, we set the value
 tenant_networks_reachable = false
So we don't face this bug.

And I think this bug related to https://bugs.launchpad.net/tempest/+bug/1226158 .
However, not the same one.

Changed in tempest:
assignee: nobody → Ghanshyam Mann (ghanshyammann)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

Fix proposed to branch: master
Review: https://review.openstack.org/142663

Changed in tempest:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/142663
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=807211c0bec90354ed9ef338b63f96e46b49b210
Submitter: Jenkins
Branch: master

commit 807211c0bec90354ed9ef338b63f96e46b49b210
Author: ghanshyam <email address hidden>
Date: Thu Dec 18 13:21:22 2014 +0900

    Correctly fetch the ips from server

    In _check_tenant_network_connectivity(), server's ips are not fetched
    correctly. Current code throw KeyError as mentioned in bug.

    This patch fix the above issue.

    Change-Id: Ibf9b3997b927a66c507f04e2671faf9cb8581ff3
    Closes-Bug: #1401028

Changed in tempest:
status: In Progress → Fix Released
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.