test_server_addresses fails on python 2.6.6

Bug #1108238 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
High
Tiago Mello

Bug Description

We are running nosetests against Tempest master branch on a RHEL 6.3 xLinux 64-bit system with python 2.6.6 and hit this failure:

_StringException: Traceback (most recent call last):
  File "/tmp/tempest/tempest/tempest/tests/compute/servers/test_server_addresses.py", line 77, in test_list_server_addresses
    self.assertGreaterEqual(len(addresses), 1)
AttributeError: 'ServerAddressesTest' object has no attribute 'assertGreaterEqual'

The unittest.TestCase class in python 2.6.6 does not have an assertGreaterEqual method. This was introduced this commit:

https://github.com/openstack/tempest/commit/1feeb38e17d3aeac05bb000a630480eb0a3e6a78

Revision history for this message
Matt Riedemann (mriedem) wrote :

Assigned to Tiago Mello per Sean Dague's direction.

Changed in tempest:
assignee: nobody → Tiago Rodrigues de Mello (tmello)
Sean Dague (sdague)
Changed in tempest:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

Simple fix :

diff --git a/tempest/tests/compute/servers/test_server_addresses.py b/tempest/tests/compute/servers/test_server_addresses.py
index 6e819a2..6b0f7ae 100644
--- a/tempest/tests/compute/servers/test_server_addresses.py
+++ b/tempest/tests/compute/servers/test_server_addresses.py
@@ -74,9 +74,9 @@ class ServerAddressesTest(BaseComputeTest):

         # We do not know the exact network configuration, but an instance
         # should at least have a single public or private address
- self.assertGreaterEqual(len(addresses), 1)
+ self.assertTrue(len(addresses) >= 1)
         for network_name, network_addresses in addresses.iteritems():
- self.assertGreaterEqual(len(network_addresses), 1)
+ self.assertTrue(len(network_addresses) >= 1)
             for address in network_addresses:
                 self.assertTrue(address['addr'])
                 self.assertTrue(address['version'])

Revision history for this message
Tiago Mello (timello) wrote :

Thanks for the suggestion. I'll test it and come up with a patch!

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

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

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

Reviewed: https://review.openstack.org/20836
Committed: http://github.com/openstack/tempest/commit/7b1f4028b23d30a98e86884a191ebaba77c9b3b4
Submitter: Jenkins
Branch: master

commit 7b1f4028b23d30a98e86884a191ebaba77c9b3b4
Author: Tiago Mello <email address hidden>
Date: Wed Jan 30 17:07:18 2013 -0500

    Removes assertGreaterEqual for Python 2.6 backward compat

    The unittest.TestCase class in python 2.6.6 does not have
    an assertGreaterEqual method. Changes the code to use
    assertTrue instead to guarantee backward compatibility with
    Python 2.6.

    Fixes Bug 1108238.

    Change-Id: Ifaba250d9d9813de913be322d18541cd2dbdf28e

Changed in tempest:
status: In Progress → Fix Released
Revision history for this message
Matt Riedemann (mriedem) wrote :

I verified this fix today and it was successful, thanks!

Sean Dague (sdague)
Changed in tempest:
milestone: none → havana-3
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.