several tests fail when image_ref_alt is set to non-cirros image

Bug #1844535 reported by Weronika Sikora
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
devstack
Fix Released
Medium
Weronika Sikora
tempest
Fix Released
Medium
Weronika Sikora

Bug Description

Devstack allows uploading guest images during the stacking process. The user might choose to upload both cirros and a different OS (ie. xenial) with DOWNLOAD_DEFAULT_IMAGES set to False - which in turn would leave DEFAULT_IMAGE_NAME unset. That action would result in different image IDs being set as image_ref and image_ref_alt in tempest.conf.

That would result in failures of a few tests that use image_ref_alt, namely:

tempest.api.compute.servers.test_server_actions.ServerActionsTestJSON.test_rebuild_server
tempest.api.compute.servers.test_server_actions.ServerActionsTestJSON.test_rebuild_server_with_volume_attached
tempest.scenario.test_network_advanced_server_ops.TestNetworkAdvancedServerOps.test_server_connectivity_rebuild

The tests throw an tempest.lib.exceptions.SSHTimeout error. They try to make an SSH connection with an instance using the image_ssh_user variable from tempest.conf even if the instance is built with image_ref_alt as its image. If image_ref_alt is not cirros, the connection fails to be made as the user is not correctly set.

I propose a change that sets a new variable, image_alt_ssh_user, in tempest.conf during the stacking process and replaces uses of image_ssh_user with image_alt_ssh_user in those tests that require it. That way, if the user chooses to upload non-cirros guest images, they can also set this variable in local.conf to an appropriate username to avoid breaking tests. The default value would be set to cirros to avoid breaking the tests in any other scenario.

The steps to reproduce the issue:
Set DOWNLOAD_DEFAULT_IMAGES=False in devstack/local.conf
Set IMAGE_URLS to a cirros image and IMAGE_URLS+= to non-cirros image, ie. xenial-server-cloudimg-amd64-disk1
Run tempest tests
The aforementioned tests would fail with tempest.lib.exceptions.SSHTimeout

summary: - several tests fail with image_ref_alt set to non-cirros image
+ several tests fail when image_ref_alt is set to non-cirros image
description: updated
Changed in devstack:
assignee: nobody → Weronika Sikora (shushuda)
Changed in tempest:
assignee: nobody → Weronika Sikora (shushuda)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to devstack (master)

Fix proposed to branch: master
Review: https://review.opendev.org/682902

Changed in devstack:
status: New → In Progress
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/682904

Changed in tempest:
status: New → In Progress
Martin Kopec (mkopec)
Changed in tempest:
importance: Undecided → Medium
Changed in devstack:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to devstack (master)

Reviewed: https://review.opendev.org/682902
Committed: https://git.openstack.org/cgit/openstack/devstack/commit/?id=d7d87b0202212e21727f6ced4a1eaa38a66808dd
Submitter: Zuul
Branch: master

commit d7d87b0202212e21727f6ced4a1eaa38a66808dd
Author: Weronika Sikora <email address hidden>
Date: Wed Sep 18 13:45:53 2019 +0000

    Set image_alt_ssh_user during stack

    At this moment, only image_ssh_user is present in the config
    of Tempest. It's set to cirros by default and used for
    SSH connections in tests. However, several tests build
    instances with image_ref_alt, but still use image_ssh_user to
    connect, which results in failure if image_ref_alt is set to
    a non-cirros image. They should use image_alt_ssh_user instead,
    which can be set to whichever user the image_ref_alt needs in
    either local.conf or during plugin installation.

    Change-Id: I899909fb71a9862c891e94ba54c6a8fa137f9769
    Partial-Bug: #1844535

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

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

commit c54a911004011e20494cd132c2577496c9401a15
Author: Weronika Sikora <email address hidden>
Date: Wed Sep 18 13:55:07 2019 +0000

    Set image_alt_ssh_user during stack

    At this moment, only image_ssh_user is present in the config
    of Tempest. It's set to cirros by default and used for
    SSH connections in tests. However, several tests build
    instances with image_ref_alt, but still use image_ssh_user to
    connect, which results in failure if image_ref_alt is set to
    a non-cirros image. They should use image_alt_ssh_user instead,
    which can be set to whichever user the image_ref_alt needs in
    either local.conf or during plugin installation.

    This change replaces image_ssh_user with image_alt_ssh_user
    and modifies Tempest's config to have access to said
    variable. It also adds a password variable in Tempest's
    config for the alternative image.

    Change-Id: Ibe81a068c6fdeb7cd1eedf1df76ce62737160a01
    Closes-Bug: #1844535
    Depends-On: https://review.opendev.org/682902/

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

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

Revision history for this message
Weronika Sikora (shushuda) wrote :

The commit has been merged a while ago.

Changed in devstack:
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.