direct_get_suffix_hashes doesn't use replication_ip
Bug #1566395 reported by
Sivasathurappan Radhakrishnan
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Released
|
Low
|
Sivasathurappan Radhakrishnan |
Bug Description
direct_
Changed in swift: | |
assignee: | nobody → Sivasathurappan Radhakrishnan (siva-radhakrishnan) |
description: | updated |
description: | updated |
description: | updated |
Changed in swift: | |
status: | New → Confirmed |
importance: | Undecided → Low |
To post a comment you must log in.
right now `direct_ get_suffix_ hashes` is only being used in probe tests so it's not a big deal - but if it's going to get used anywhere else with out surprise side effects this is bad.
Something like this might work for a test
diff --git a/test/ unit/common/ test_direct_ client. py b/test/ unit/common/ test_direct_ client. py unit/common/ test_direct_ client. py unit/common/ test_direct_ client. py
index 664a622..d543f0e 100644
--- a/test/
+++ b/test/
@@ -19,6 +19,7 @@ import os
from contextlib import contextmanager
from hashlib import md5
import time
+import pickle
import mock http_conn( *args, **kwargs): t(unittest. TestCase) :
import six
@@ -97,7 +98,8 @@ def mocked_
class TestDirectClien
def setUp(self):
self. part = '0'
- self.node = {'ip': '1.2.3.4', 'port': '6000', 'device': 'sda'}
+ self.node = {'ip': '1.2.3.4', 'port': '6000', 'device': 'sda',
+ 'replication_ip': '2.3.4.5', 'replication_port': '7000'}
@@ -732,5 +734,17 @@ class TestDirectClien
for line in error_lines:
+ def test_direct_ get_suffix_ hashes( self): 02aada0f4eee694 94ff'} http_conn( 200, {}, body) as conn: client. direct_ get_suffix_ hashes( l(conn. method, 'REPLICATE') l(conn. path, '/sda/0/a83') l(conn. host, '1.2.3.4') l(data, resp_data)
unittest. main()
+ data = {'a83': 'c130a2c17ed451
+ body = pickle.dumps(data)
+
+ with mocked_
+ resp_data = direct_
+ self.node, self.part, ['a83'])
+ self.assertEqua
+ self.assertEqua
+ self.assertEqua
+ self.assertEqua
+
if __name__ == '__main__':
But I feel like that host should be 2.3.4.5, might check port too - are validate the path with multiple hashes