From 99122e519c504b2248282cd7493a74e2b02d2fff Mon Sep 17 00:00:00 2001 From: eaglegai Date: Tue, 23 Mar 2021 16:47:58 +0800 Subject: [PATCH] fix tests failed when build with rpmbuild command --- ...the-over-estimation-for-sparse-files.patch | 48 +++++++++++++++++++ ...ee_list_test-on-ppc64el-ppc64-and-sp.patch | 27 +++++++++++ libldb.spec | 11 ++++- 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 Fix-FTBFS-Increase-the-over-estimation-for-sparse-files.patch create mode 100644 Skip-ldb_lmdb_free_list_test-on-ppc64el-ppc64-and-sp.patch diff --git a/Fix-FTBFS-Increase-the-over-estimation-for-sparse-files.patch b/Fix-FTBFS-Increase-the-over-estimation-for-sparse-files.patch new file mode 100644 index 0000000..5e5ed3d --- /dev/null +++ b/Fix-FTBFS-Increase-the-over-estimation-for-sparse-files.patch @@ -0,0 +1,48 @@ +From 9d935795ea5a3294f82fe65cca17c79a7b6589f0 Mon Sep 17 00:00:00 2001 +From: Mathieu Parent +Date: Thu, 25 Jun 2020 09:48:04 +0200 +Subject: [PATCH] Fix FTBFS / Increase the over-estimation for sparse files + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=14418 +Signed-off-by: Mathieu Parent +Reviewed-by: Andrew Bartlett +Reviewed-by: Douglas Bagnall + +Autobuild-User(master): Andrew Bartlett +Autobuild-Date(master): Tue Aug 25 04:23:19 UTC 2020 on sn-devel-184 +--- + lib/ldb/tests/ldb_kv_ops_test.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/lib/ldb/tests/ldb_kv_ops_test.c b/lib/ldb/tests/ldb_kv_ops_test.c +index 30adebf1952..9db2212895f 100644 +--- a/tests/ldb_kv_ops_test.c ++++ b/tests/ldb_kv_ops_test.c +@@ -1717,8 +1717,11 @@ static void test_get_size(void **state) + /* + * The tdb implementation of get_size over estimates for sparse files + * which is perfectly acceptable for it's intended use. ++ * mipsel, ia64: 9994 ++ * ppc64el, powerpc, ppc64: 13369 ++ * sparc64: 5046 + */ +- assert_in_range(size, 2500, 5000); ++ assert_in_range(size, 2500, 15000); + #endif + + /* +@@ -1746,8 +1749,11 @@ static void test_get_size(void **state) + /* + * The tdb implementation of get_size over estimates for sparse files + * which is perfectly acceptable for it's intended use. ++ * mipsel, ia64: 9994 ++ * ppc64el, powerpc, ppc64: 13369 ++ * sparc64: 5046 + */ +- assert_in_range(size, 2500, 5000); ++ assert_in_range(size, 2500, 15000); + #endif + talloc_free(tmp_ctx); + } +-- +GitLab diff --git a/Skip-ldb_lmdb_free_list_test-on-ppc64el-ppc64-and-sp.patch b/Skip-ldb_lmdb_free_list_test-on-ppc64el-ppc64-and-sp.patch new file mode 100644 index 0000000..a608299 --- /dev/null +++ b/Skip-ldb_lmdb_free_list_test-on-ppc64el-ppc64-and-sp.patch @@ -0,0 +1,27 @@ +From eb5409dd5e4dde482935421ce0eddf88a0d2d2f4 Mon Sep 17 00:00:00 2001 +From: Mathieu Parent +Date: Thu, 25 Jun 2020 15:15:40 +0200 +Subject: [PATCH] Skip ldb_lmdb_free_list_test on alpha, ia64, mips64el, ppc64el, ppc64 and sparc64 + +Workaround: https://bugzilla.samba.org/show_bug.cgi?id=14404 +--- + wscript | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff -ruNa ldb-2.1.4/wscript ldb-2.1.4-org/wscript +--- ldb-2.1.4/wscript 2021-03-23 11:14:55.530512420 +0800 ++++ ldb-2.1.4-org/wscript 2020-06-25 16:43:52.000000000 +0800 +@@ -635,8 +635,9 @@ + # fit > 4G of data into the DB), it would fill up the disk on + # many of our test instances + 'ldb_mdb_kv_ops_test', ++ 'ldb_key_value_sub_txn_mdb_test'] ++ if os.environ.get('DEB_HOST_ARCH', 'unknown') not in ['alpha', 'ia64', 'mips64el', 'ppc64el', 'ppc64', 'sparc64', 'unknown']: ++ test_exes += ['ldb_lmdb_free_list_test'] +- 'ldb_key_value_sub_txn_mdb_test', +- 'ldb_lmdb_free_list_test'] + else: + test_exes += ['ldb_no_lmdb_test'] + +-- +2.26.2 diff --git a/libldb.spec b/libldb.spec index fbbf357..8c9cbe8 100644 --- a/libldb.spec +++ b/libldb.spec @@ -6,7 +6,7 @@ Name: libldb Version: 2.1.4 -Release: 1 +Release: 2 Summary: A schema-less, ldap like, API and database Requires: libtalloc%{?_isa} >= %{talloc_version} Requires: libtdb%{?_isa} >= %{tdb_version} @@ -16,6 +16,9 @@ URL: http://ldb.samba.org/ Source0: http://samba.org/ftp/ldb/ldb-%{version}.tar.gz Source1: http://samba.org/ftp/ldb/ldb-%{version}.tar.asc +Patch0: Fix-FTBFS-Increase-the-over-estimation-for-sparse-files.patch +Patch1: Skip-ldb_lmdb_free_list_test-on-ppc64el-ppc64-and-sp.patch + BuildRequires: gcc libtalloc-devel >= %{talloc_version} libtdb-devel >= %{tdb_version} BuildRequires: libtevent-devel >= %{tevent_version} lmdb-devel >= 0.9.16 popt-devel BuildRequires: libxslt docbook-style-xsl python3-devel python3-tdb python3-talloc-devel @@ -151,6 +154,12 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_* %{_mandir}/man1/ldbsearch.1.* %changelog +* Tue Mar 23 2021 gaihuiying - 2.1.4-2 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix tests failed when build with rpmbuild command + * Fri Jul 24 2020 openEuler Buildteam - 2.1.4-1 - Type:update - ID:NA -- Gitee