diff --git a/0013-intg-convert-results-returned-as-bytes-to-strings.patch b/0013-intg-convert-results-returned-as-bytes-to-strings.patch new file mode 100644 index 0000000..0174103 --- /dev/null +++ b/0013-intg-convert-results-returned-as-bytes-to-strings.patch @@ -0,0 +1,48 @@ +From 414ce6438a5450e5f1c1b03994f59d37f0ff8a36 Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Fri, 16 Mar 2018 13:43:17 +0100 +Subject: [PATCH 13/15] intg: convert results returned as bytes to strings + +With python3 comparisons between byte literals and strings will fail. To +make sure assertions will pass the search results must be converted to +(utf-8) strings first. + +Resolves https://pagure.io/SSSD/sssd/issue/3666 + +Reviewed-by: Sumit Bose +Reviewed-by: Jakub Hrozek +--- + src/tests/intg/test_ts_cache.py | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +diff --git a/src/tests/intg/test_ts_cache.py b/src/tests/intg/test_ts_cache.py +index 703e3b255..c3819e21a 100644 +--- a/src/tests/intg/test_ts_cache.py ++++ b/src/tests/intg/test_ts_cache.py +@@ -212,12 +212,17 @@ def get_attrs(ldb_conn, type, name, domain, attr_list): + ts_attrs = dict() + + for attr in attr_list: +- sysdb_attrs[attr] = ldb_conn.get_entry_attr( +- sssd_ldb.CacheType.sysdb, +- type, name, domain, attr) +- ts_attrs[attr] = ldb_conn.get_entry_attr( +- sssd_ldb.CacheType.timestamps, +- type, name, domain, attr) ++ val = ldb_conn.get_entry_attr(sssd_ldb.CacheType.sysdb, ++ type, name, domain, attr) ++ if val: ++ val = val.decode('utf-8') ++ sysdb_attrs[attr] = val ++ ++ val = ldb_conn.get_entry_attr(sssd_ldb.CacheType.timestamps, ++ type, name, domain, attr) ++ if val: ++ val = val.decode('utf-8') ++ ts_attrs[attr] = val + return (sysdb_attrs, ts_attrs) + + +-- +2.14.3 + diff --git a/sssd.spec b/sssd.spec index a4e74d6..17d7d24 100644 --- a/sssd.spec +++ b/sssd.spec @@ -54,6 +54,7 @@ Patch0009: 0009-KCM-Remove-mem_ctx-from-kcm_new_req.patch Patch0010: 0010-KCM-Introduce-kcm_input_get_payload_len.patch Patch0011: 0011-KCM-Do-not-use-2048-as-fixed-size-for-the-payload.patch Patch0012: 0012-KCM-Adjust-REPLY_MAX-to-the-one-used-in-krb5.patch +Patch0013: 0013-intg-convert-results-returned-as-bytes-to-strings.patch Patch0502: 0502-SYSTEMD-Use-capabilities.patch Patch0503: 0503-Disable-stopping-idle-socket-activated-responders.patch @@ -1261,6 +1262,7 @@ fi - Resolves: upstream#3687 - KCM: Don't pass a non null terminated string to json_loads() - Resolves: upstream#3386 - KCM: Payload buffer is too small +- Resolves: upstream#3666 - Fix usage of str.decode() in our tests * Fri Mar 9 2018 Fabiano FidĂȘncio - 1.16.1-1 - New upstream release 1.16.1