KeyError: 'addresses' appeared in test_attach_scsi_disk_with_config_drive

Bug #1973307 reported by Ilya Popov
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Medium
Ilya Popov

Bug Description

Validation method was changed in tempest/common/compute.py which caused error in some tests in fixed network scenarios.
For example stack trace for tempest.api.compute.admin.test_volume.AttachSCSIVolumeTestJSON.
test_attach_scsi_disk_with_config_drive:

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):

      File "/root/venvs/tempest/lib/python3.8/site-packages/tempest/api/compute/admin/test_volume.py", line 90, in test_attach_scsi_disk_with_config_drive
    server = self.create_test_server(

      File "/root/venvs/tempest/lib/python3.8/site-packages/tempest/api/compute/base.py", line 270, in create_test_server
    body, servers = compute.create_test_server(

      File "/root/venvs/tempest/lib/python3.8/site-packages/tempest/common/compute.py", line 353, in create_test_server
    LOG.exception('Server %s failed to delete in time',

      File "/root/venvs/tempest/lib/python3.8/site-packages/oslo_utils/excutils.py", line 227, in __exit__
    self.force_reraise()

      File "/root/venvs/tempest/lib/python3.8/site-packages/oslo_utils/excutils.py", line 200, in force_reraise
    raise self.value

      File "/root/venvs/tempest/lib/python3.8/site-packages/tempest/common/compute.py", line 328, in create_test_server
    wait_for_ssh_or_ping(

      File "/root/venvs/tempest/lib/python3.8/site-packages/tempest/common/compute.py", line 131, in wait_for_ssh_or_ping
    server_ip = get_server_ip(

      File "/root/venvs/tempest/lib/python3.8/site-packages/tempest/common/compute.py", line 78, in get_server_ip
    addresses = server['addresses'][CONF.validation.network_for_ssh]

    KeyError: 'addresses'

It happens because we dont have IP addresses in server create response body. It will appear after server change state to ACTIVE.
So it is needed to get server info after it will changed its state to ACTIVE

The similar issue was fixed here:
https://review.opendev.org/c/openstack/tempest/+/531100

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/tempest/+/841719

Changed in tempest:
status: New → In Progress
Ilya Popov (ilya-p)
Changed in tempest:
assignee: nobody → Ilya Popov (ilya-p)
Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :

problem here is that tempest.common.compute.create_test_server() method does not refresh the server response when it wait for server to be active. In that case, we have the server active means full response including the addresses. we just need to make sure we return the full server response when there is wait for active state.

Changed in tempest:
importance: Undecided → Medium
Revision history for this message
manu (manuvakery) wrote :

For me, a few tests were failing due to this. One of the failed test is
tempest.api.compute.volumes.test_attach_volume.AttachVolumeTestJSON.test_attach_detach_volume. I applied the proposed changes from https://review.opendev.org/c/openstack/tempest/+/841719 and tests started passing. my tempest.conf validation section is as follows
[validation]
image_ssh_user = ubuntu
connect_method = fixed
network_for_ssh = provider.public

Revision history for this message
Lukas Piwowarski (lukas-piwowarski) wrote :

This patch could potentially solve the issue: https://review.opendev.org/c/openstack/tempest/+/855047

Revision history for this message
Martin Kopec (mkopec) wrote :
Changed in tempest:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tempest (master)

Change abandoned by "Martin Kopec <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/tempest/+/841719
Reason: the associated bug got fixed, in case this patch is still needed, feel free to restore it

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.