diff --git a/fix-cpu_sentry-result-when-found_fault_cores_number-.patch b/fix-cpu_sentry-result-when-found_fault_cores_number-.patch new file mode 100644 index 0000000000000000000000000000000000000000..eda221f6210e37cf24c99f520b32bff3fb33a0cb --- /dev/null +++ b/fix-cpu_sentry-result-when-found_fault_cores_number-.patch @@ -0,0 +1,51 @@ +From 5fbe38f4c3568e744d640252c20d37d4fe92c34e Mon Sep 17 00:00:00 2001 +From: shixuantong +Date: Sat, 17 May 2025 15:02:39 +0800 +Subject: [PATCH] fix cpu_sentry result when found_fault_cores_number != + isolated_cores_number + +--- + selftest/test/test_cpu_sentry.py | 2 ++ + src/python/syssentry/cpu_sentry.py | 6 ++++++ + 2 files changed, 8 insertions(+) + +diff --git a/selftest/test/test_cpu_sentry.py b/selftest/test/test_cpu_sentry.py +index 47e366b..c9af184 100644 +--- a/selftest/test/test_cpu_sentry.py ++++ b/selftest/test/test_cpu_sentry.py +@@ -20,6 +20,7 @@ class TestCaseCpuSentry: + ("1-", []), + ("-1", []), + ("", []), ++ (" ", []), + ("1-3,5-8", [1,2,3,5,6,7,8]), + ("1-3,8", [1,2,3,8]), + ("11", [11]), +@@ -53,6 +54,7 @@ class TestCaseCpuSentry: + ("0, 2-4", False), + ("1-3-6", False), + ("", False), ++ (" ", False), + ("xxx", False), + ("1-3,,", False), + ("1-3,,6", False), +diff --git a/src/python/syssentry/cpu_sentry.py b/src/python/syssentry/cpu_sentry.py +index 2f18d14..b2338b4 100644 +--- a/src/python/syssentry/cpu_sentry.py ++++ b/src/python/syssentry/cpu_sentry.py +@@ -141,6 +141,12 @@ class CpuSentry: + self.send_result["details"]["code"] = 1002 + self.send_result["result"] = ResultLevel.MINOR_ALM + self.send_result["details"]["msg"] = "Some CPUs are faulty. The faulty cores are isolated successfully." ++ else: ++ found_fault_cores_set = set(found_fault_cores_list) ++ isolated_cpu_set = set(CpuSentry.cpu_format_convert_to_list(self.send_result["details"]["isolated_cpu_list"])) ++ self.send_result["details"]["code"] = 1002 ++ self.send_result["result"] = ResultLevel.MINOR_ALM ++ self.send_result["details"]["msg"] = "Some cores are isolated successfully and some cores ({}) fail to be isolated.".format(list(found_fault_cores_set - isolated_cpu_set)) + + def cpu_report_result(self): + """report result to sysSentry""" +-- +2.27.0 + diff --git a/sysSentry.spec b/sysSentry.spec index 0d7e585f73d2d1e0ad47d9d7290a5fca9a7d1ae7..f4c7b0ba8545435ed2822e99253a13ab5a9cee04 100644 --- a/sysSentry.spec +++ b/sysSentry.spec @@ -4,7 +4,7 @@ Summary: System Inspection Framework Name: sysSentry Version: 1.0.2 -Release: 34 +Release: 35 License: Mulan PSL v2 Group: System Environment/Daemons Source0: https://gitee.com/openeuler/sysSentry/releases/download/v%{version}/%{name}-%{version}.tar.gz @@ -45,6 +45,7 @@ Patch32: fix-the-sentryCollector-service-can-t-be-stopped-for.patch Patch33: ai-block-io-exit-when-stage-is-not-supported.patch Patch34: fix-period-task-some-bugs.patch Patch35: fix-env_file-and-environ_conf.patch +Patch36: fix-cpu_sentry-result-when-found_fault_cores_number-.patch BuildRequires: cmake gcc-c++ BuildRequires: python3 python3-setuptools @@ -362,6 +363,12 @@ rm -rf %{buildroot} %attr(0550,root,root) %{python3_sitelib}/sentryCollector/__pycache__/collect_plugin* %changelog +* Sat May 17 2025 shixuantong - 1.0.2-35 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:fix cpu_sentry result when found_fault_cores_number != isolated_cores_number + * Sat Mar 29 2025 shixuantong - 1.0.2-34 - Type:bugfix - CVE:NA