components/openstack/swift/patches/test.patch
branchs11u3-sru
changeset 6035 c9748fcc32de
parent 4072 db0cec748ec0
child 6853 cf1567491b1b
--- a/components/openstack/swift/patches/test.patch	Mon May 16 14:46:20 2016 +0200
+++ b/components/openstack/swift/patches/test.patch	Fri May 20 17:42:29 2016 -0400
@@ -21,9 +21,9 @@
 the test should fork a separate process to test the lock, which should work
 regardless of the OS.
 
---- swift-2.2.2/test/sample.conf.~1~	2015-02-01 23:44:11.000000000 -0800
-+++ swift-2.2.2/test/sample.conf	2015-02-26 16:36:42.753470819 -0800
-@@ -62,17 +62,17 @@ fake_syslog = False
+--- swift-2.3.0/test/sample.conf.~1~	2015-04-30 06:57:42.000000000 -0700
++++ swift-2.3.0/test/sample.conf	2016-02-08 01:24:17.841343735 -0800
+@@ -87,17 +87,17 @@ fake_syslog = False
  # Note that the cluster must have "sane" values for the test suite to pass
  # (for some definition of sane).
  #
@@ -52,9 +52,9 @@
  
  # Newer swift versions default to strict cors mode, but older ones were the
  # opposite.
---- swift-2.2.2/test/unit/__init__.py.~1~	2015-02-26 16:36:42.754399372 -0800
-+++ swift-2.2.2/test/unit/__init__.py	2015-02-26 16:41:30.006380635 -0800
-@@ -670,7 +670,7 @@ def fake_http_connect(*code_iter, **kwar
+--- swift-2.3.0/test/unit/__init__.py.~1~	2015-04-30 06:57:42.000000000 -0700
++++ swift-2.3.0/test/unit/__init__.py	2016-02-08 01:24:17.842339594 -0800
+@@ -817,7 +817,7 @@ def fake_http_connect(*code_iter, **kwar
                      etag = '"68b329da9893e34099c7d8ad5cb9c940"'
  
              headers = swob.HeaderKeyDict({
@@ -63,9 +63,9 @@
                  'content-type': 'x-application/test',
                  'x-timestamp': self.timestamp,
                  'x-backend-timestamp': self.timestamp,
---- swift-2.2.2/test/unit/common/test_utils.py.~1~	2015-02-01 23:44:11.000000000 -0800
-+++ swift-2.2.2/test/unit/common/test_utils.py	2015-02-26 16:36:42.756657286 -0800
-@@ -52,6 +52,7 @@ from functools import partial
+--- swift-2.3.0/test/unit/common/test_utils.py.~1~	2015-04-30 06:57:42.000000000 -0700
++++ swift-2.3.0/test/unit/common/test_utils.py	2016-02-08 01:24:17.844724978 -0800
+@@ -53,6 +53,7 @@ from functools import partial
  from tempfile import TemporaryFile, NamedTemporaryFile, mkdtemp
  from netifaces import AF_INET6
  from mock import MagicMock, patch
@@ -73,7 +73,7 @@
  
  from swift.common.exceptions import (Timeout, MessageTimeout,
                                       ConnectionTimeout, LockTimeout,
-@@ -733,6 +734,8 @@ class TestUtils(unittest.TestCase):
+@@ -748,6 +749,8 @@ class TestUtils(unittest.TestCase):
          utils.HASH_PATH_PREFIX = 'startcap'
  
      def test_lock_path(self):
@@ -82,7 +82,7 @@
          tmpdir = mkdtemp()
          try:
              with utils.lock_path(tmpdir, 0.1):
-@@ -749,6 +752,8 @@ class TestUtils(unittest.TestCase):
+@@ -764,6 +767,8 @@ class TestUtils(unittest.TestCase):
              shutil.rmtree(tmpdir)
  
      def test_lock_path_num_sleeps(self):
@@ -91,7 +91,7 @@
          tmpdir = mkdtemp()
          num_short_calls = [0]
          exception_raised = [False]
-@@ -773,6 +778,8 @@ class TestUtils(unittest.TestCase):
+@@ -788,6 +793,8 @@ class TestUtils(unittest.TestCase):
          self.assertTrue(exception_raised[0])
  
      def test_lock_path_class(self):
@@ -100,7 +100,7 @@
          tmpdir = mkdtemp()
          try:
              with utils.lock_path(tmpdir, 0.1, ReplicationLockTimeout):
-@@ -1195,7 +1202,8 @@ class TestUtils(unittest.TestCase):
+@@ -1214,7 +1221,8 @@ class TestUtils(unittest.TestCase):
              }, 'server', log_route='server')
              expected_args = [((), {'address': '/dev/log',
                                     'facility': orig_sysloghandler.LOG_LOCAL3})]
@@ -110,7 +110,7 @@
                      os.path.isfile('/dev/log') or \
                      os.path.isdir('/dev/log'):
                  # Since socket on OSX is in /var/run/syslog, there will be
-@@ -2374,6 +2382,8 @@ cluster_dfw1 = http://dfw1.host/v1/
+@@ -2402,6 +2410,8 @@ cluster_dfw1 = http://dfw1.host/v1/
                  MagicMock(side_effect=BaseException('test3')))
  
      def test_lock_file(self):
@@ -119,7 +119,7 @@
          flags = os.O_CREAT | os.O_RDWR
          with NamedTemporaryFile(delete=False) as nt:
              nt.write("test string")
-@@ -2452,6 +2462,8 @@ cluster_dfw1 = http://dfw1.host/v1/
+@@ -2480,6 +2490,8 @@ cluster_dfw1 = http://dfw1.host/v1/
                                          os.fstat(f.fileno()).st_ino)
  
      def test_lock_file_held_on_unlink(self):
@@ -128,7 +128,7 @@
          os_unlink = os.unlink
  
          def flocking_unlink(filename):
-@@ -2468,6 +2480,8 @@ cluster_dfw1 = http://dfw1.host/v1/
+@@ -2496,6 +2508,8 @@ cluster_dfw1 = http://dfw1.host/v1/
                      pass
  
      def test_lock_file_no_unlink_if_fail(self):
@@ -137,18 +137,18 @@
          os_open = os.open
          with NamedTemporaryFile(delete=True) as nt:
  
---- swift-2.2.2/test/unit/obj/test_diskfile.py.~1~	2015-02-01 23:44:11.000000000 -0800
-+++ swift-2.2.2/test/unit/obj/test_diskfile.py	2015-02-26 16:36:42.757582696 -0800
+--- swift-2.3.0/test/unit/obj/test_diskfile.py.~1~	2015-04-30 06:57:42.000000000 -0700
++++ swift-2.3.0/test/unit/obj/test_diskfile.py	2016-02-08 01:24:17.846568734 -0800
 @@ -18,6 +18,7 @@
  
  import cPickle as pickle
  import os
 +import sys
  import errno
+ import itertools
  import mock
- import unittest
-@@ -902,6 +903,8 @@ class TestDiskFileManager(unittest.TestC
-         self.assertEqual(hashes, {})
+@@ -608,6 +609,8 @@ class DiskFileManagerMixin(BaseDiskFileT
+         self.assertEqual(locations, [])
  
      def test_replication_lock_on(self):
 +        if sys.platform == 'sunos5':
@@ -156,9 +156,9 @@
          # Double check settings
          self.df_mgr.replication_one_per_device = True
          self.df_mgr.replication_lock_timeout = 0.1
---- swift-2.2.2/test/unit/proxy/test_server.py.~1~	2015-02-01 23:44:11.000000000 -0800
-+++ swift-2.2.2/test/unit/proxy/test_server.py	2015-02-26 16:36:42.760354922 -0800
-@@ -3376,6 +3376,9 @@ class TestObjectController(unittest.Test
+--- swift-2.3.0/test/unit/proxy/test_server.py.~1~	2015-04-30 06:57:42.000000000 -0700
++++ swift-2.3.0/test/unit/proxy/test_server.py	2016-02-08 01:24:17.849738022 -0800
+@@ -4263,6 +4263,9 @@ class TestObjectController(unittest.Test
  
          class LargeResponseBody(object):
  
@@ -168,7 +168,7 @@
              def __len__(self):
                  return constraints.MAX_FILE_SIZE + 1
  
-@@ -3620,6 +3623,9 @@ class TestObjectController(unittest.Test
+@@ -4510,6 +4513,9 @@ class TestObjectController(unittest.Test
  
          class LargeResponseBody(object):
  
@@ -178,7 +178,7 @@
              def __len__(self):
                  return constraints.MAX_FILE_SIZE + 1
  
-@@ -3644,6 +3650,9 @@ class TestObjectController(unittest.Test
+@@ -4537,6 +4543,9 @@ class TestObjectController(unittest.Test
  
          class LargeResponseBody(object):