diff --git a/oec-hardware-1.1.1-fix-fc-raid.patch b/oec-hardware-1.1.1-fix-fc-raid.patch new file mode 100644 index 0000000000000000000000000000000000000000..529f6f197e28746f43e6993b895983c669571d6d --- /dev/null +++ b/oec-hardware-1.1.1-fix-fc-raid.patch @@ -0,0 +1,68 @@ +diff -Naur rpm/tests/fc/fc.py oech/tests/fc/fc.py +--- rpm/tests/fc/fc.py 2022-08-01 17:27:14.639340460 +0800 ++++ oech/tests/fc/fc.py 2022-08-01 17:25:50.615340460 +0800 +@@ -20,6 +20,7 @@ + + from hwcompatible.test import Test + from hwcompatible.command import Command ++from hwcompatible.device import CertDevice + + + class FCTest(Test): +@@ -102,10 +103,14 @@ + """ + self.disks = list() + disks = list() +- disk_info = Command("cd /sys/block; ls -l").read().split('\n') +- for disk in disk_info: +- if self.pci_num in disk: +- disks.append(disk.split('/')[-1]) ++ devices = CertDevice(self.logger).get_devices() ++ for device in devices: ++ if (device.get_property("DEVTYPE") == "disk" and not ++ device.get_property("ID_TYPE")) or device.\ ++ get_property("ID_TYPE") == "disk": ++ if "/host" in device.get_property("DEVPATH") and \ ++ self.pci_num in device.get_property("DEVPATH"): ++ disks.append(device.get_name()) + + partition_file = open("/proc/partitions", "r") + partition = partition_file.read() +diff -Naur rpm/tests/raid/raid.py oech/tests/raid/raid.py +--- rpm/tests/raid/raid.py 2022-08-01 17:27:14.643340460 +0800 ++++ oech/tests/raid/raid.py 2022-08-01 17:25:50.615340460 +0800 +@@ -20,6 +20,7 @@ + + from hwcompatible.test import Test + from hwcompatible.command import Command ++from hwcompatible.device import CertDevice + + + class RaidTest(Test): +@@ -102,10 +103,14 @@ + """ + self.disks = list() + disks = list() +- disk_info = Command("cd /sys/block; ls -l").read().split('\n') +- for disk in disk_info: +- if self.pci_num in disk: +- disks.append(disk.split('/')[-1]) ++ devices = CertDevice(self.logger).get_devices() ++ for device in devices: ++ if (device.get_property("DEVTYPE") == "disk" and not ++ device.get_property("ID_TYPE")) or device.\ ++ get_property("ID_TYPE") == "disk": ++ if "/host" in device.get_property("DEVPATH") and \ ++ self.pci_num in device.get_property("DEVPATH"): ++ disks.append(device.get_name()) + + partition_file = open("/proc/partitions", "r") + partition = partition_file.read() +@@ -136,7 +141,6 @@ + if disk in mdstat or os.system("pvs 2>/dev/null | grep -q '/dev/%s'" % disk) == 0: + continue + self.disks.append(disk) +- + un_suitable = list(set(disks).difference(set(self.disks))) + if len(un_suitable) > 0: + self.logger.info("These disks %s are in use now, skip them." % diff --git a/oec-hardware.spec b/oec-hardware.spec index 7b148e1245de84ec1c2e4712e212856fa193f676..0645318c6f082c76591a4bdbf816b29068613826 100644 --- a/oec-hardware.spec +++ b/oec-hardware.spec @@ -5,7 +5,7 @@ Name: oec-hardware Summary: openEuler Hardware Compatibility Test Suite Version: 1.1.1 -Release: 1 +Release: 2 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.1-fix-vesion.patch +Patch0002: oec-hardware-1.1.1-fix-fc-raid.patch Buildroot: %{_tmppath}/%{name}-%{version}-root BuildRequires: gcc @@ -36,6 +37,7 @@ openEuler Hardware Compatibility Test Server %prep %setup -q -c %patch1 -p1 +%patch2 -p1 %build @@ -77,6 +79,9 @@ DESTDIR=$RPM_BUILD_ROOT make install rm -rf /var/lock/oech.lock %changelog +* Mon Aug 1 2022 cuixucui - 1.1.1-2 +- Fix FC and raid cannot get the new hard disk partition + * Sat Jul 30 2022 ylzhangah <1194926515@qq.com> - 1.1.1-1 - Change the version in version.config to 1.1.1