Tempest fails against wrong data types when using postgresql

Bug #1182754 reported by Mauro S M Rodrigues
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Mauro S M Rodrigues

Bug Description

Currently we have 6 Tempest tests failing only when using postgresql:

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
tempest.api.compute.admin.test_fixed_ips.FixedIPsTestJson.test_set_reserve_with_invalid_ip
tempest.api.compute.admin.test_fixed_ips.FixedIPsTestXml.test_set_reserve_with_invalid_ip
tempest.api.compute.floating_ips.test_floating_ips_actions.FloatingIPsTestJSON.test_delete_nonexistant_floating_ip
tempest.api.compute.floating_ips.test_floating_ips_actions.FloatingIPsTestXML.test_delete_nonexistant_floating_ip
tempest.api.compute.floating_ips.test_list_floating_ips.FloatingIPDetailsTestJSON.test_get_nonexistant_floating_ip_details
tempest.api.compute.floating_ips.test_list_floating_ips.FloatingIPDetailsTestXML.test_get_nonexistant_floating_ip_details
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This happens cause the tests are request using a different data type again postgresql: in the fixed_ips tests it is not an ip and in the floating ips tests the ip id is bigger than postgresql's integer, causing sqlalchemy to raise DataError like:

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2013-05-22 04:55:25.708 ERROR nova.api.openstack [req-5edb2331-ecfa-44c8-8935-039235e7f84f admin admin] Caught error: (DataError) invalid input syntax for type inet: "my.invalid.ip"
LINE 3: ...ERE fixed_ips.deleted = 0 AND fixed_ips.address = 'my.invali...
                                                             ^
 'SELECT fixed_ips.created_at AS fixed_ips_created_at, fixed_ips.updated_at AS fixed_ips_updated_at, fixed_ips.deleted_at AS fixed_ips_deleted_at, fixed_ips.deleted AS fixed_ips_deleted, fixed_ips.id AS fixed_ips_id, fixed_ips.address AS fixed_ips_address, fixed_ips.network_id AS fixed_ips_network_id, fixed_ips.virtual_interface_id AS fixed_ips_virtual_interface_id, fixed_ips.instance_uuid AS fixed_ips_instance_uuid, fixed_ips.allocated AS fixed_ips_allocated, fixed_ips.leased AS fixed_ips_leased, fixed_ips.reserved AS fixed_ips_reserved, fixed_ips.host AS fixed_ips_host \nFROM fixed_ips \nWHERE fixed_ips.deleted = %(deleted_1)s AND fixed_ips.address = %(address_1)s \n LIMIT %(param_1)s' {'param_1': 1, 'address_1': u'my.invalid.ip', 'deleted_1': 0}
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Although all of them are valid test cases.

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

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

Changed in nova:
status: New → In Progress
description: updated
tags: added: postgresql
David Ripton (dripton)
Changed in nova:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/30057
Committed: http://github.com/openstack/nova/commit/1b7f77f22d847803a24b66a9f6c08dc4a564bddb
Submitter: Jenkins
Branch: master

commit 1b7f77f22d847803a24b66a9f6c08dc4a564bddb
Author: Mauro S. M. Rodrigues <email address hidden>
Date: Wed May 22 02:01:22 2013 -0400

    Fix postgresql failures related to Data type

    Postgresql is kind of sensitive about different kind of data in a query, so it
    was failing in cases like lookin for an ip using a filter which wasn't a valid
    ip or ids values greater than the id type on the table.

    This patch fix this behavior to fixed ips and floating ips.

    Fixes bug 1182754

    Change-Id: I83d532c28c9aec690e8e1ffad8b58e71d619d728

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-2
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

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

Reviewed: https://review.openstack.org/38688
Committed: http://github.com/openstack/nova/commit/df3ac534f099712485a71488812b799ca82cfc6e
Submitter: Jenkins
Branch: master

commit df3ac534f099712485a71488812b799ca82cfc6e
Author: Mauro S. M. Rodrigues <email address hidden>
Date: Thu Jul 25 15:36:30 2013 -0400

    Fix postgresql failures related to Data type to API-v3 fixed-ip

    Postgresql is kind of sensitive about different kind of data in a query, so it
    was failing in cases like looking for an ip using a filter which wasn't a valid
    ip or ids values greater than the id type on the table.

    This patch fix this behavior to fixed ips in API-v3.
    In v2 this was fixed by change I83d532c28c9aec690e8e1ffad8b58e71d619d728

    Fixes bug 1182754
    Fixes bug 1204503

    Change-Id: I9aa14bea2f29f1df85dfd1f07eb0b1947d2c1100

Thierry Carrez (ttx)
Changed in nova:
milestone: havana-2 → 2013.2
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.