compute get_server_ip() should have detailed server object

Bug #1817701 reported by Yang Youseok
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Medium
Mark Goddard

Bug Description

in tempest/api/compute/servers/test_server_actions.py, test_resize_volume_backed_server_confirm()

get_server_ip() accept server object which has 'addresses' field. But the passed server object is returned value from create(POST) API which does not have 'addresses' field.

At result, this test case failed emitting KeyError like below.

=============================
Failed 1 test - output below:
=============================

tempest.api.compute.servers.test_server_actions.ServerActionsTestJSON.test_resize_volume_backed_server_confirm
--------------------------------------------------------------------------------------------------------------
Traceback (most recent call last):
  File "tempest/lib/decorators.py", line 112, in wrapper
    raise exc
KeyError: 'addresses'

======
Totals
======

Ran: 1 tests in 44.858 sec.
 - Success: 0
 - Skipped: 0
 - Expected failures: 0
 - Unexpected success: 0
 - Failures: 1

Furthermore, this test case also has another bug in that it was trying to validate server which was made without validation related flag (validatable,validation_resources). SSH connection was not completed since it does not have keypair (RemoteClient has no password so keypair is only way to be used)

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

Changed in tempest:
assignee: nobody → Yang Youseok (ileixe)
status: New → In Progress
Revision history for this message
Yang Youseok (ileixe) wrote :

I run test with 18.0.0 and one case failed. But seems to be more failed test cases at master with same reason.

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

Yeah, there are issue in few cases. I thought we always get complete server response and then pass it to get_server_ip.

None of the gate job run test with fixed_ip as connect_method where get_server_ip method use the addresses from server response. While grep into whole code, along with test_server_actions.py, I found few more place which need similar fix

- https://github.com/openstack/tempest/blob/91d92424bc49350ee6eff8dce0c6eb3fd18d8fb0/tempest/api/compute/servers/test_attach_interfaces.py

-https://github.com/openstack/tempest/blob/1b43d266102735617e226152b66b8dbdecf1c759/tempest/api/compute/servers/test_server_actions.py#L104

- https://github.com/openstack/tempest/blob/1b43d266102735617e226152b66b8dbdecf1c759/tempest/api/compute/servers/test_device_tagging.py#L370

Changed in tempest:
importance: Undecided → Medium
Changed in tempest:
assignee: Yang Youseok (ileixe) → Mark Goddard (mgoddard)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.opendev.org/639319
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=fa30d2fb51d40cb7ef527fa11ce5ab9dd81d6d94
Submitter: Zuul
Branch: master

commit fa30d2fb51d40cb7ef527fa11ce5ab9dd81d6d94
Author: Mark Goddard <email address hidden>
Date: Mon Sep 2 14:41:02 2019 +0100

    Fix use of get_server_ip with fixed networks

    If a fixed network is used, we see errors like the following in three
    compute tests:

    KeyError: 'addresses'

    This is because get_server_ip expects to be called with a detailed
    server response, but in these cases is called with a create server
    response, which does not contain the 'addresses' field.

    This change fixes the issue by obtaining a detailed server response
    where necessary.

    Change-Id: I9deeb0e527a8537c71657507cabd81a63a421d9c
    Closes-Bug: #1817701

Changed in tempest:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tempest 22.0.0

This issue was fixed in the openstack/tempest 22.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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