Fix FC and raid cannot get the new hard disk partition
(cherry picked from commit 2671ea2caaefde608ecd4a2381422628276a6f9c)
This commit is contained in:
parent
883ca7c0f7
commit
a27154a3e9
68
oec-hardware-1.1.1-fix-fc-raid.patch
Normal file
68
oec-hardware-1.1.1-fix-fc-raid.patch
Normal file
@ -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." %
|
||||||
@ -5,7 +5,7 @@
|
|||||||
Name: oec-hardware
|
Name: oec-hardware
|
||||||
Summary: openEuler Hardware Compatibility Test Suite
|
Summary: openEuler Hardware Compatibility Test Suite
|
||||||
Version: 1.1.1
|
Version: 1.1.1
|
||||||
Release: 1
|
Release: 2
|
||||||
Group: Development/Tools
|
Group: Development/Tools
|
||||||
License: Mulan PSL v2
|
License: Mulan PSL v2
|
||||||
URL: https://gitee.com/openeuler/oec-hardware
|
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
|
# patch fix issue
|
||||||
Patch0001: oec-hardware-1.1.1-fix-vesion.patch
|
Patch0001: oec-hardware-1.1.1-fix-vesion.patch
|
||||||
|
Patch0002: oec-hardware-1.1.1-fix-fc-raid.patch
|
||||||
|
|
||||||
Buildroot: %{_tmppath}/%{name}-%{version}-root
|
Buildroot: %{_tmppath}/%{name}-%{version}-root
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
@ -36,6 +37,7 @@ openEuler Hardware Compatibility Test Server
|
|||||||
%prep
|
%prep
|
||||||
%setup -q -c
|
%setup -q -c
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
|
%patch2 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
@ -77,6 +79,9 @@ DESTDIR=$RPM_BUILD_ROOT make install
|
|||||||
rm -rf /var/lock/oech.lock
|
rm -rf /var/lock/oech.lock
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Aug 1 2022 cuixucui <cuixucui1@h-partners> - 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
|
* Sat Jul 30 2022 ylzhangah <1194926515@qq.com> - 1.1.1-1
|
||||||
- Change the version in version.config to 1.1.1
|
- Change the version in version.config to 1.1.1
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user