Version Matching and comparison must be done consistently in manila tempest tests

Bug #1518996 reported by Goutham Pacha Ravi
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
High
Valeriy Ponomaryov
python-manilaclient
Fix Released
High
Valeriy Ponomaryov

Bug Description

Going forward, we'll be performing a ton of version checks within manila_tempest_tests:

In the manila core code, we sanitize the comparisons:

 https://github.com/openstack/manila/blob/b4611145/manila/api/openstack/api_version_request.py

Since we can't reference a class within manila itself, we should have a helper definition exclusively in manila_tempest_tests.

And wherever necessary, we should:
0) Always accept micro version as a string
1) Split the micro version into major and minor portions.
3) Either use the ComparableMixin (make a copy from manila/utils: https://github.com/openstack/manila/blob/b4611145/manila/utils.py)

or,
3) Perform comparison on major version and then,
4) Perform comparison on minor version.

 https://github.com/openstack/manila/blob/b4611145/manila/api/openstack/api_version_request.py

Tags: tempest
Changed in manila:
assignee: nobody → Goutham Pacha Ravi (gouthamr)
Changed in manila:
assignee: Goutham Pacha Ravi (gouthamr) → Valeriy Ponomaryov (vponomaryov)
status: New → In Progress
Changed in manila:
milestone: none → mitaka-2
importance: Undecided → High
Changed in python-manilaclient:
milestone: none → mitaka-2
assignee: nobody → Valeriy Ponomaryov (vponomaryov)
importance: Undecided → High
status: New → In Progress
tags: added: tempest
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-manilaclient (master)

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

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

Reviewed: https://review.openstack.org/257480
Committed: https://git.openstack.org/cgit/openstack/python-manilaclient/commit/?id=bdf2045d95d6bccf45d991bbbd7236cb27ace2ac
Submitter: Jenkins
Branch: master

commit bdf2045d95d6bccf45d991bbbd7236cb27ace2ac
Author: Valeriy Ponomaryov <email address hidden>
Date: Mon Dec 14 18:48:15 2015 +0200

    Fix microversion comparison approach in functional tests

    Manila microversions have following template:

    x.y

    where 'x' and 'y' both digits.

    And now manilaclient functional tests transform string 'x.y' to float,
    but it is incorrect thing to do because float assumes that each
    left value is bigger than right one. And it is not suitable
    for microversion comparisons.

    Examples:

    Microversions true conditions:
    2.9 < 2.10
    2.9 < 2.81

    Float true conditions:
    2.9 > 2.10
    2.9 > 2.81

    Change-Id: Ibb20e394cefdab82f7be946ce710a6681224051d
    Closes-bug: #1518996

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

Reviewed: https://review.openstack.org/257459
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=afeb366fd30fea70c7de905e54b39347bc411edc
Submitter: Jenkins
Branch: master

commit afeb366fd30fea70c7de905e54b39347bc411edc
Author: Valeriy Ponomaryov <email address hidden>
Date: Mon Dec 14 18:06:13 2015 +0200

    Fix Tempest microversion comparison approach

    Manila microversions have following template:

    x.y

    where 'x' and 'y' both digits.

    And now tempest transforms string 'x.y' to float but it is incorrect
    thing to do because float assumes that each left value is bigger than
    right one. And it is not suitable for microversion comparisons.

    Examples:

    Microversions true conditions:
    2.9 < 2.10
    2.9 < 2.81

    Float true conditions:
    2.9 > 2.10
    2.9 > 2.81

    So, create new file 'manila_tempest_tests/utils.py' and place there
    old and new functions that serve all microversion actions. In addition,
    port another existing utility function called 'rand_ip'.

    Change-Id: I88bf2cb51fd8de1bc89bf169bda7a05ca5a0b8ab
    Closes-Bug: #1518996

Changed in manila:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/manila 2.0.0.0b2

This issue was fixed in the openstack/manila 2.0.0.0b2 development milestone.

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.