components/openstack/swift/patches/test.patch
author Drew Fisher <drew.fisher@oracle.com>
Wed, 11 Jun 2014 17:13:12 -0700
changeset 1944 56ac2df1785b
parent 1896 f83e6dde6c3b
child 2167 c9ff638a3018
permissions -rw-r--r--
PSARC/2014/207 OpenStack Glance Update to Havana PSARC/2014/208 OpenStack Cinder Update to Havana PSARC/2014/209 OpenStack Keystone Update to Havana PSARC/2014/210 OpenStack Nova Update to Havana 18416146 Neutron agents (L3 and DHCP) should cleanup resources when they are disabled 18562372 Failed to create a new project under Horizon 18645763 ZFSSA Cinder Driver support 18686327 evs agent silently ignores user-specified pool allocation ranges 18702697 fibre channel volumes should be supported in the cinder volume driver 18734289 nova won't terminate failed kz deployments 18738371 cinder-volume:setup should account for commented-out zfs_volume_base 18738374 cinder-volume:setup should check for existence of configuration file 18826190 nova-compute fails due to nova.utils.to_bytes 18855698 Update OpenStack to Havana 2013.2.3 18855710 Update python-cinderclient to 1.0.9 18855743 Update python-keystoneclient to 0.8.0 18855754 Update python-neutronclient to 2.3.4 18855764 Update python-novaclient to 2.17.0 18855793 Update python-swiftclient to 2.1.0 18856992 External networks can be deleted even when floating IP addresses are in use 18857784 bake in some more openstack configuration 18884923 Incorrect locale facets in python modules for openstack 18913890 the error in _get_view_and_lun may cause the failure of deleting volumes 18943044 Disable 'Security Groups' tab in Horizon dashboard

Various testing fixes:

  - Tests involving large (5GB+) bodies are mocked, but on 32-bit python,
    len() is limited to returning a ssize_t, which can represent 2GB.

  - Solaris doesn't yet support syslog logging to /dev/log.

The first, while potentially useful elsewhere, is really only an issue on
Solaris because Linux runs almost exclusively 64-bit, which makes this a
non-issue.  The last is Solaris-only -- though clearly a similar problem
exists on MacOS -- and we will want to fix this in our Python.

diff --git a/test/unit/__init__.py b/test/unit/__init__.py
--- a/test/unit/__init__.py
+++ b/test/unit/__init__.py
@@ -450,7 +450,7 @@ def fake_http_connect(*code_iter, **kwar
                 else:
                     etag = '"68b329da9893e34099c7d8ad5cb9c940"'
 
-            headers = {'content-length': len(self.body),
+            headers = {'content-length': self.body.__len__(),
                        'content-type': 'x-application/test',
                        'x-timestamp': self.timestamp,
                        'last-modified': self.timestamp,
diff --git a/test/unit/proxy/test_server.py b/test/unit/proxy/test_server.py
--- a/test/unit/proxy/test_server.py
+++ b/test/unit/proxy/test_server.py
@@ -2876,6 +2876,9 @@ class TestObjectController(unittest.Test
 
             class LargeResponseBody(object):
 
+                def __nonzero__(self):
+                    return True
+
                 def __len__(self):
                     return MAX_FILE_SIZE + 1
 
@@ -3006,6 +3009,9 @@ class TestObjectController(unittest.Test
 
             class LargeResponseBody(object):
 
+                def __nonzero__(self):
+                    return True
+
                 def __len__(self):
                     return MAX_FILE_SIZE + 1
 
diff --git a/test/unit/common/test_utils.py b/test/unit/common/test_utils.py
--- a/test/unit/common/test_utils.py
+++ b/test/unit/common/test_utils.py
@@ -437,7 +437,8 @@ class TestUtils(unittest.TestCase):
             }, 'server', log_route='server')
             expected_args = [((), {'address': '/dev/log',
                                    'facility': orig_sysloghandler.LOG_LOCAL3})]
-            if not os.path.exists('/dev/log') or \
+            if sys.platform == 'sunos5' or \
+                    not os.path.exists('/dev/log') or \
                     os.path.isfile('/dev/log') or \
                     os.path.isdir('/dev/log'):
                 # Since socket on OSX is in /var/run/syslog, there will be