From 861defd159bdf03d06cd8a82283c6fd7d7a163af Mon Sep 17 00:00:00 2001 From: liqiang1118 Date: Tue, 13 Dec 2022 11:08:35 +0800 Subject: [PATCH] fixbug and optimize (cherry picked from commit c96c33ee356a978e65726624929539f5679ca275) --- oec-hardware-1.1.3-fixbug-optimize.patch | 144 +++++++++++++++++++++++ oec-hardware.spec | 14 ++- 2 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 oec-hardware-1.1.3-fixbug-optimize.patch diff --git a/oec-hardware-1.1.3-fixbug-optimize.patch b/oec-hardware-1.1.3-fixbug-optimize.patch new file mode 100644 index 0000000..33b93dd --- /dev/null +++ b/oec-hardware-1.1.3-fixbug-optimize.patch @@ -0,0 +1,144 @@ +diff -Naur rpm/config/pci.ids oech/config/pci.ids +--- rpm/config/pci.ids 2022-10-24 08:36:33.000000000 +0800 ++++ oech/config/pci.ids 2022-12-13 10:13:13.228273472 +0800 +@@ -20115,7 +20115,8 @@ + 15b3 0113 MCX565M-CDAB + 101a MT28800 Family [ConnectX-5 Ex Virtual Function] + 101b MT28908 Family [ConnectX-6] +- 15b3 0006 MCX653105A-EFAT ++ 15b3 0006 MCX653105A-ECAT ++ 15b3 0029 MCX653105A-EFAT + 101c MT28908 Family [ConnectX-6 Virtual Function] + 101d MT2892 Family [ConnectX-6 Dx] + 101e ConnectX Family mlx5Gen Virtual Function +diff -Naur rpm/docs/design_docs/dev_design.md oech/docs/design_docs/dev_design.md +--- rpm/docs/design_docs/dev_design.md 2022-12-13 17:29:04.328175692 +0800 ++++ oech/docs/design_docs/dev_design.md 2022-12-13 10:13:13.228273472 +0800 +@@ -321,6 +321,7 @@ + | 16 | `CertEnv()` | 工具环境信息模块 | 提供工具文件环境路径 | + | 17 | `SysInfo()` | 系统信息模块 | 系统信息获取 | + | 18 | `ConfigIP()` | 网卡IP配置模块 | 查询并配置网卡IP | ++| 19 | `CertInfo()` | 兼容性信息收集模块 | 自动收集并生成兼容性信息文件 | + + ### 3.6 web服务接口清单 + +diff -Naur rpm/hwcompatible/common.py oech/hwcompatible/common.py +--- rpm/hwcompatible/common.py 2022-10-24 08:36:33.000000000 +0800 ++++ oech/hwcompatible/common.py 2022-12-13 10:13:13.232273494 +0800 +@@ -21,7 +21,8 @@ + import importlib + from .test import Test + from .env import CertEnv +-from .constants import NODEVICE ++from .constants import NODEVICE, TEST_KABI_ARCH ++from .command import Command + + + def create_test_suite(test_factory, logger, subtests_filter=None): +@@ -53,7 +54,9 @@ + if test["name"] == "kabi": + kabi_test = test + +- if kabi_select: ++ command = Command(logger) ++ arch = command.run_cmd("uname -m")[0].strip() ++ if kabi_select and arch in TEST_KABI_ARCH: + logger.info("The hardware will test kabi automatically.") + kabi_test["run"] = True + testcase = __create_testcase(kabi_test, logger, subtests_filter) +diff -Naur rpm/hwcompatible/constants.py oech/hwcompatible/constants.py +--- rpm/hwcompatible/constants.py 2022-10-24 08:36:33.000000000 +0800 ++++ oech/hwcompatible/constants.py 2022-12-13 10:13:13.232273494 +0800 +@@ -26,6 +26,7 @@ + VERSION = "driverVersion" + NODEVICE = ("cpufreq", "memory", "clock", "profiler", "system", + "stress", "kdump", "perf", "acpi", "watchdog", "kabi") ++TEST_KABI_ARCH = ("aarch64", "x86_64") + CDTYPES = ("DVD_RW", "DVD_PLUS_RW", "DVD_R", "DVD_PLUS_R", "DVD", + "BD_RE", "BD_R", "BD", "CD_RW", "CD_R", "CD") + GPU_DRIVER = ("nouveau", "nvidia", "bi_driver", "amdgpu") +diff -Naur rpm/oec-hardware.spec oech/oec-hardware.spec +--- rpm/oec-hardware.spec 2022-10-24 08:36:33.000000000 +0800 ++++ oech/oec-hardware.spec 2022-12-13 10:13:13.232273494 +0800 +@@ -37,6 +37,7 @@ + %setup -q -c + + %build ++strip tests/keycard/libswsds_%{_arch}.so + [ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; + DESTDIR=$RPM_BUILD_ROOT VERSION_RELEASE=%{version} make + +diff -Naur rpm/README.md oech/README.md +--- rpm/README.md 2022-12-13 17:29:04.328175692 +0800 ++++ oech/README.md 2022-12-13 10:13:13.224273450 +0800 +@@ -314,9 +314,11 @@ + + - oec-hardware-server 生成的html测试报告 + +- - 兼容性清单文件(请参考templates目录下的模板) ++ - 兼容性清单文件 + +- 整机适配需要测试至少一张RAID卡、一张网卡,并提供对应的信息。 ++ oec-hardware 执行结束后会自动为测试通过的硬件生成兼容性信息文件`hw_compatibility.json`,请参考该文件填写templates目录下的模板,然后上传填写的模板文件。 ++ ++ 整机适配需要测试至少一张RAID卡、一张网卡,并提供对应的信息。 + + # 测试项介绍 + +diff -Naur rpm/tests/kabi/kabi.py oech/tests/kabi/kabi.py +--- rpm/tests/kabi/kabi.py 2022-10-24 08:36:33.000000000 +0800 ++++ oech/tests/kabi/kabi.py 2022-12-13 10:13:13.236273516 +0800 +@@ -19,6 +19,7 @@ + from hwcompatible.env import CertEnv + from hwcompatible.command import Command + from hwcompatible.test import Test ++from hwcompatible.constants import TEST_KABI_ARCH + + kabi_dir = os.path.dirname(os.path.realpath(__file__)) + +@@ -55,6 +56,11 @@ + Run kabi test case + return: result + """ ++ arch = self.command.run_cmd("uname -m")[0].strip() ++ if arch not in TEST_KABI_ARCH: ++ self.logger.info(" %s architecture does not support kabi testing." % arch) ++ return True ++ + result = True + os_version = getoutput( + "grep openeulerversion /etc/openEuler-latest | awk -F = '{print $2}'") +@@ -125,7 +131,7 @@ + + def _get_kernel_source_rpm(self, arch): + standard_kernel_version = getoutput( +- "dnf list --repo=source | grep kernel.src | head -n 1 | awk '{print $2}'") ++ "dnf list --repo=source | grep '^kernel.src' | awk '{print $2}'") + rpmpath = "/root/rpmbuild/SOURCES" + standard_symvers = os.path.join(rpmpath, "Module.kabi_" + arch) + if os.path.exists(standard_symvers): +diff -Naur rpm/tests/memory/memory.py oech/tests/memory/memory.py +--- rpm/tests/memory/memory.py 2022-10-24 08:36:33.000000000 +0800 ++++ oech/tests/memory/memory.py 2022-12-13 10:13:13.244273560 +0800 +@@ -65,7 +65,7 @@ + if not self.hugetlb_test(): + self.logger.error("Hugepages test failed.") + return False +- self.logger.error("Hugepages test succeed.") ++ self.logger.info("Hugepages test succeed.") + + return True + +diff -Naur rpm/tests/nvme/nvme.py oech/tests/nvme/nvme.py +--- rpm/tests/nvme/nvme.py 2022-10-24 08:36:33.000000000 +0800 ++++ oech/tests/nvme/nvme.py 2022-12-13 10:13:13.248273582 +0800 +@@ -63,7 +63,8 @@ + elif size > 128 * 1024: + size = 128 * 1024 + +- size_per_block = int(self.command.run_cmd("nvme list | grep %s | awk '{print $10}'" % disk)[0]) ++ size_per_block = int(self.command.run_cmd("nvme list -o json /dev/%s | grep SectorSize " ++ "| awk -F : '{print $2}'" % disk)[0].strip()) + block_num = 1 + if size_per_block != 0: + block_num = int(int(size) / size_per_block) - 1 diff --git a/oec-hardware.spec b/oec-hardware.spec index 725896a..504e8cf 100644 --- a/oec-hardware.spec +++ b/oec-hardware.spec @@ -4,7 +4,7 @@ Name: oec-hardware Summary: openEuler Hardware Compatibility Test Suite Version: 1.1.3 -Release: 2 +Release: 3 Group: Development/Tools License: Mulan PSL v2 URL: https://gitee.com/openeuler/oec-hardware @@ -13,6 +13,7 @@ Source0: https://gitee.com/openeuler/oec-hardware/repository/archive/v%{v # patch fix issue Patch0001: oec-hardware-1.1.3-fix-disk.patch Patch0002: oec-hardware-1.1.3-fix-network-cdrom-bug-update-log-print.patch +Patch0003: oec-hardware-1.1.3-fixbug-optimize.patch Buildroot: %{_tmppath}/%{name}-%{version}-root BuildRequires: gcc @@ -38,9 +39,10 @@ openEuler Hardware Compatibility Test Server %setup -q -c %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build - +strip tests/keycard/libswsds_%{_arch}.so sed -i '15i CFLAGS+=-g -fstack-protector-strong' tests/memory/Makefile [ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; @@ -80,6 +82,14 @@ DESTDIR=$RPM_BUILD_ROOT make install rm -rf /var/lock/oech.lock %changelog +* Tue Dec 13 2022 liqiang - 1.1.3-3 +- Fix libswsds.so not stripped +- Fix the value of kernel.src obtained by the kabi test case is incorrect +- Add board infomation and fix memory bug +- Fix the block size fails to be obtained during the NVME test +- Judge whether to support kabi testing by architecture +- Update readme and dev_design + * Wed Nov 09 2022 cuixucui - 1.1.3-2 - Fix code issue and update log print in network - Cancel deleting the IP that automatically configured on the server -- Gitee