Bug 1320098

Summary: With LB, pagination url become incorrect
Product: Red Hat OpenStack Reporter: Arx Cruz <acruz>
Component: openstack-cinderAssignee: Gorka Eguileor <geguileo>
Status: CLOSED ERRATA QA Contact: lkuchlan <lkuchlan>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0 (Kilo)CC: adahms, eharney, sgotliv, srevivo, tkammer
Target Milestone: ---Keywords: Automation, AutomationBlocker, ZStream
Target Release: 7.0 (Kilo)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-cinder-2015.1.3-5.el7ost Doc Type: Bug Fix
Doc Text:
Previously, Cinder did not take the "X-Forwarded-Host" header into account when generating pagination links, using the real server IP address instead of that of the load balancer. With this update, the "X-Forwarded-Host" header is used to build links if present.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-26 15:30:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Arx Cruz 2016-03-22 10:11:25 UTC
Description of problem:
With LoadBalancer, we expect the url with virtual ip in API response.
But cinder-api returns the url with actual server ip.

So test test_volume_list_details_pagination and test_volume_list_pagination raise MismatchError

Version-Release number of selected component (if applicable):
openstack-cinder-7.0.1-8.el7ost.noarch


Steps to Reproduce:
1. Install osp7
2. Run tempest


Actual results:
Test fails with:
MismatchError: !=:
reference = u'http://192.168.1.101:13776/v2/d471371a1f0d43859e21f15d58bcb306/volumes/detail?limit=1&marker=dba665f6-47b5-4f94-a41e-93f3d3ed020f'
actual    = 'https://192.168.1.101:13776/v2/d471371a1f0d43859e21f15d58bcb306/volumes/detail?limit=1&marker=dba665f6-47b5-4f94-a41e-93f3d3ed020f'

Expected results:
Test pass

Additional info:

Comment 3 lkuchlan 2016-04-10 11:52:18 UTC
Tested using:
openstack-cinder-2015.1.2-5.el7ost.noarch

[stack@undercloud tempest]$ testr run tempest.api.volume.v2.test_volumes_list.VolumesV2ListTestJSON.test_volume_list_details_pagination
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \
${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_PATH:-./tempest/test_discover} --list 
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \
${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_PATH:-./tempest/test_discover}  --load-list /tmp/tmpuaqTsX
Ran 1 tests in 28.485s
PASSED (id=0)

[stack@undercloud tempest]$ testr list-tests | grep test_volume_list_pagination
tempest.api.volume.v2.test_volumes_list.VolumesV2ListTestJSON.test_volume_list_pagination[id-af55e775-8e4b-4feb-8719-215c43b0238c]
[stack@undercloud tempest]$ testr run tempest.api.volume.v2.test_volumes_list.VolumesV2ListTestJSON.test_volume_list_pagination
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \
${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_PATH:-./tempest/test_discover} --list 
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \
${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_PATH:-./tempest/test_discover}  --load-list /tmp/tmpE6dvQi
Ran 1 tests in 17.345s (+13.079s)
PASSED (id=1)

Comment 5 errata-xmlrpc 2016-04-26 15:30:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0688.html