From ccb1a712f9854c09a3b2e6fefec5708f9895b282 Mon Sep 17 00:00:00 2001 From: orange-snn Date: Wed, 16 Sep 2020 10:12:15 +0800 Subject: [PATCH] bugfix test-mesh-crypto faild --- ...est-mesh-crypto-on-any-detected-fail.patch | 105 ++++++++++++++++++ bluez.spec | 6 +- 2 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 0005-Exit-test-mesh-crypto-on-any-detected-fail.patch diff --git a/0005-Exit-test-mesh-crypto-on-any-detected-fail.patch b/0005-Exit-test-mesh-crypto-on-any-detected-fail.patch new file mode 100644 index 0000000..1a89dec --- /dev/null +++ b/0005-Exit-test-mesh-crypto-on-any-detected-fail.patch @@ -0,0 +1,105 @@ +From 82a1d55f20cc6977643f4c1e0efd55baec27f9a4 Mon Sep 17 00:00:00 2001 +From: Brian Gix +Date: Tue, 7 Apr 2020 09:10:33 -0700 +Subject: [PATCH] Exit test-mesh-crypto on any detected fail + +Unit test would signal failures if run on commandline, but not if +run as part of a unit test sweep. This change forces an exit(1) on +any detected fail, and is caught by test suite runner. + +https://github.com/bluez/bluez/commit/5fc60b2ce7c4370ff8d9bc3d3c3434b212465f40 + +--- + unit/test-mesh-crypto.c | 25 +++++++++++++++++++++++-- + 1 file changed, 23 insertions(+), 2 deletions(-) + +diff --git a/unit/test-mesh-crypto.c b/unit/test-mesh-crypto.c +index 32c46a5..08b7a87 100644 +--- a/unit/test-mesh-crypto.c ++++ b/unit/test-mesh-crypto.c +@@ -660,9 +660,23 @@ static const struct mesh_crypto_test s8_6_2 = { + #define INVAL COLOR_YELLOW "INVALID" COLOR_OFF + + #define EVALCMP(a, b, l) memcmp((a), (b), (l)) ? FAIL : PASS +-#define EVALSTR(a, b) (a) && (b) ? (strcmp((a), (b)) ? FAIL : PASS) : INVAL +-#define EVALNUM(a, b) a == b ? PASS : FAIL ++#define EXITCMP(a, b, l) do { if (memcmp((a), (b), (l))) \ ++ exit(1); \ ++ } while (0) ++ ++#define EVALSTR(a, b) (((a) && (b)) ? (strcmp((a), (b)) ? FAIL : PASS) \ ++ : INVAL) ++#define EXITSTR(a, b) do { if ((a) && (b)) { \ ++ if (strcmp((a), (b))) \ ++ exit(1); \ ++ } else \ ++ exit(1); \ ++ } while (0) ++ ++#define EVALNUM(a, b) (((a) == (b)) ? PASS : FAIL) ++#define EXITNUM(a, b) do { if (a != b) exit(1); } while (0) + #define EVALBOOLNOTBOTH(a, b) !(a && b) ? PASS : FAIL ++#define EXITBOOLNOTBOTH(a, b) do { if (!!(a && b)) exit(1); } while (0) + + static void verify_data(const char *label, unsigned int indent, + const char *sample, const uint8_t *data, size_t size) +@@ -673,6 +687,7 @@ static void verify_data(const char *label, unsigned int indent, + l_info("%-20s =%*c%s", label, 1 + (indent * 2), ' ', sample); + l_info("%-20s %*c%s => %s", "", 1 + (indent * 2), ' ', str, + EVALSTR(sample, str)); ++ EXITSTR(sample, str); + l_free(str); + } + +@@ -684,6 +699,7 @@ static void verify_bool_not_both(const char *label, unsigned int indent, + l_info("%-20s %*c%s => %s", "", 1 + (indent * 2), ' ', + data ? "true" : "false", + EVALBOOLNOTBOTH(sample, data)); ++ EXITBOOLNOTBOTH(sample, data); + } + + static void verify_uint8(const char *label, unsigned int indent, +@@ -692,6 +708,7 @@ static void verify_uint8(const char *label, unsigned int indent, + l_info("%-20s =%*c%02x", label, 1 + (indent * 2), ' ', sample); + l_info("%-20s %*c%02x => %s", "", 1 + (indent * 2), ' ', data, + EVALNUM(sample, data)); ++ EXITNUM(sample, data); + } + + static void verify_uint16(const char *label, unsigned int indent, +@@ -700,6 +717,7 @@ static void verify_uint16(const char *label, unsigned int indent, + l_info("%-20s =%*c%04x", label, 1 + (indent * 2), ' ', sample); + l_info("%-20s %*c%04x => %s", "", 1 + (indent * 2), ' ', data, + EVALNUM(sample, data)); ++ EXITNUM(sample, data); + } + + static void verify_uint24(const char *label, unsigned int indent, +@@ -708,6 +726,7 @@ static void verify_uint24(const char *label, unsigned int indent, + l_info("%-20s =%*c%06x", label, 1 + (indent * 2), ' ', sample); + l_info("%-20s %*c%06x => %s", "", 1 + (indent * 2), ' ', data, + EVALNUM(sample, data)); ++ EXITNUM(sample, data); + } + + static void verify_uint32(const char *label, unsigned int indent, +@@ -716,6 +735,7 @@ static void verify_uint32(const char *label, unsigned int indent, + l_info("%-20s =%*c%08x", label, 1 + (indent * 2), ' ', sample); + l_info("%-20s %*c%08x => %s", "", 1 + (indent * 2), ' ', data, + EVALNUM(sample, data)); ++ EXITNUM(sample, data); + } + + static void verify_uint64(const char *label, unsigned int indent, +@@ -726,6 +746,7 @@ static void verify_uint64(const char *label, unsigned int indent, + l_info("%-20s %*c%16llx => %s", "", 1 + (indent * 2), ' ', + (long long unsigned int) data, + EVALNUM(sample, data)); ++ EXITNUM(sample, data); + } + + static void show_str(const char *label, unsigned int indent, +-- +1.8.3.1 + + diff --git a/bluez.spec b/bluez.spec index 2bffdc0..b33accd 100644 --- a/bluez.spec +++ b/bluez.spec @@ -1,7 +1,7 @@ Name: bluez Summary: Bluetooth utilities Version: 5.54 -Release: 2 +Release: 3 License: GPLv2+ URL: http://www.bluez.org/ Source0: http://www.kernel.org/pub/linux/bluetooth/bluez-%{version}.tar.xz @@ -16,6 +16,7 @@ Patch0002: 0001-build-Always-define-confdir-and-statedir.patch Patch0003: 0002-systemd-Add-PrivateTmp-and-NoNewPrivileges-options.patch Patch0004: 0003-systemd-Add-more-filesystem-lockdown.patch Patch0005: 0004-systemd-More-lockdown.patch +Patch0006: 0005-Exit-test-mesh-crypto-on-any-detected-fail.patch BuildRequires: dbus-devel >= 1.6 libell-devel >= 0.28 autoconf BuildRequires: git-core glib2-devel libical-devel readline-devel @@ -172,6 +173,9 @@ make check %{_mandir}/man8/* %changelog +* Wed Sep 16 2020 orange-snn - 5.54-3 +- bugfix test-mesh-crypto faild + * Mon Aug 10 2020 shixuantong - 5.54-2 - update yaml file -- Gitee