diff --git a/0004-ldb-Use-deterministic-order-of-dict-for-tests.patch b/0004-ldb-Use-deterministic-order-of-dict-for-tests.patch new file mode 100644 index 0000000..976bd6f --- /dev/null +++ b/0004-ldb-Use-deterministic-order-of-dict-for-tests.patch @@ -0,0 +1,43 @@ +From b34b0f3459523a93da37e881bc2bb59e5274cff8 Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Fri, 18 Jan 2019 19:55:02 +0100 +Subject: [PATCH] ldb: Use deterministic order of dict for tests + +Test failed on s390x but there is a simple reproducer for any +architecture + + for i in {1..30}; do + PYTHONHASHSEED=random \ + python2 -c 'import ldb; msg = ldb.Message(); msg.dn = ldb.Dn(ldb.Ldb(), "dc=foo29"); msg["dc"] = b"foo"; print(repr(msg)) ' + done + + ====================================================================== + FAIL: test_repr (__main__.LdbMsgTests) + ---------------------------------------------------------------------- + Traceback (most recent call last): + File "tests/python/api.py", line 2322, in test_repr + "Message({'dn': Dn('dc=foo29'), 'dc': MessageElement(['foo'])})") + AssertionError: "Message({'dc': MessageElement(['foo']), 'dn': Dn('dc=foo29')})" != "Message({'dn': Dn('dc=foo29'), 'dc': MessageElement(['foo'])})" + ---------------------------------------------------------------------- + Ran 1025 tests in 29.146s + FAILED (failures=1) +--- + wscript | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/wscript b/wscript +index 851344733645f51186d0b568f2741ac888a52660..02307956ccca7fdec16ba9e3aafc9b56c3a9a3e0 100644 +--- a/wscript ++++ b/wscript +@@ -559,7 +559,7 @@ def test(ctx): + if env.HAVE_LMDB: + pyret = samba_utils.RUN_PYTHON_TESTS( + ['tests/python/api.py', 'tests/python/index.py'], +- extra_env={'SELFTEST_PREFIX': test_prefix}) ++ extra_env={'SELFTEST_PREFIX': test_prefix, 'PYTHONHASHSEED': '0'}) + else: + pyret = 0 + print("Python testsuite returned %d" % pyret) +-- +2.20.1 + diff --git a/libldb.spec b/libldb.spec index aa95d72..ae9fe2a 100644 --- a/libldb.spec +++ b/libldb.spec @@ -46,6 +46,7 @@ Source: http://samba.org/ftp/ldb/ldb-%{version}.tar.gz Patch0001: 0001-Fix-detection-of-HAVE_LARGEFILE-with-python2.patch Patch0002: 0002-ldb-Run-at-least-some-tests-on-32-bit-machines.patch Patch0003: 0003-ldb-Out-ouf-bound-read-in-ldb_wildcard_compare.patch +Patch0004: 0004-ldb-Use-deterministic-order-of-dict-for-tests.patch BuildRequires: gcc BuildRequires: libtalloc-devel >= %{talloc_version}