swift/test/probe
Romain LE DISEZ 091157fc7f Fix encoding issue in ssync_sender.send_put()
EC object metadata can currently have a mixture of bytestrings and
unicode.  The ssync_sender.send_put() method raises an
UnicodeDecodeError when it attempts to concatenate the metadata
values, if any bytestring has non-ascii characters.

The root cause of this issue is that the object server uses unicode
for the keys of some object metadata items that are received in the
footer of an EC PUT request, whereas all other object metadata keys
and values are persisted as bytestrings.

This patch fixes the bug by changing diskfile write_metadata()
function to encode all unicode metadata keys and values as utf8
encoded bytes before writing to disk. To cope with existing objects
that have a mixture of unicode and bytestring metadata, the diskfile
read_metadata() function is also changed so that all returned unicode
metadata keys and values are utf8 encoded. This ensures that
ssync_sender.send_put() (and any other caller of diskfile
read_metadata) only reads bytestrings from object metadata.

Closes-Bug: #1678018
Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Change-Id: Ic23c55754ee142f6f5388dcda592a3afc9845c39
2017-04-19 18:05:52 +01:00
..
__init__.py Add option to make probetests more brittle 2013-07-19 01:39:42 -07:00
brain.py Refactor tests and add tests 2016-06-15 16:36:25 +01:00
common.py DRY out probe.common 2016-09-14 10:12:38 -07:00
test_account_failures.py Remove executable flag from some test modules 2016-10-31 21:22:10 +00:00
test_account_get_fake_responses_match.py Remove executable flag from some test modules 2016-10-31 21:22:10 +00:00
test_account_reaper.py Follow up delayed reap probe test 2016-08-18 14:08:56 +01:00
test_container_failures.py Remove executable flag from some test modules 2016-10-31 21:22:10 +00:00
test_container_merge_policy_index.py Use more specific asserts in test/probe tests 2016-11-02 18:13:22 +00:00
test_container_sync.py Make container sync copy SLO manifests 2016-09-14 13:32:00 +01:00
test_empty_device_handoff.py Remove executable flag from some test modules 2016-10-31 21:22:10 +00:00
test_object_async_update.py Merge "Fixups for ghost listing fix" 2016-12-09 03:03:03 +00:00
test_object_expirer.py Probe tests fail, as requests checks for strings. 2017-02-23 12:09:18 -08:00
test_object_failures.py Remove executable flag from some test modules 2016-10-31 21:22:10 +00:00
test_object_handoff.py Add probetest for response with duplicate frags 2016-11-04 17:29:04 +00:00
test_object_metadata_replication.py Use more specific asserts in test/probe tests 2016-11-02 18:13:22 +00:00
test_reconstructor_rebuild.py Fix encoding issue in ssync_sender.send_put() 2017-04-19 18:05:52 +01:00
test_reconstructor_revert.py Fix test_delete_propagate probe test 2017-02-10 10:07:39 -06:00
test_replication_servers_working.py Fix some reST field lists in docstrings 2017-03-29 09:11:07 +08:00
test_signals.py Fix signal handling for daemons with InternalClient 2016-11-04 20:00:00 -07:00