From eaa060f4374c3a363b769ec6b8f2d970b0358a31 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 18 Jul 2020 09:58:53 +0800 Subject: [PATCH 1/3] Update kernel file modification scope --- oec-hardware-1.0.0-system.patch | 6 ++ oec-hardware.spec | 158 ++++++++++++++++---------------- 2 files changed, 87 insertions(+), 77 deletions(-) create mode 100644 oec-hardware-1.0.0-system.patch diff --git a/oec-hardware-1.0.0-system.patch b/oec-hardware-1.0.0-system.patch new file mode 100644 index 0000000..289fb94 --- /dev/null +++ b/oec-hardware-1.0.0-system.patch @@ -0,0 +1,6 @@ +diff tests/system_new.py tests/system.py > oec-hardware-1.0.0-system.patch +155,156c155 +< except_list = ["/modules.dep$", "/modules.symbols$", "/modules.dep.bin$", "/modules.symbols.bin$"] +< if os.system("rpm -V --nomtime --nomode --nocontexts %s | grep -Ev '%s'" % (kernel_rpm, "|".join(except_list))) is 0: +--- +> if not os.system("rpm -V --nomtime --nomode --nocontexts %s" % kernel_rpm) is 0: diff --git a/oec-hardware.spec b/oec-hardware.spec index f4de8bc..a86909a 100644 --- a/oec-hardware.spec +++ b/oec-hardware.spec @@ -1,77 +1,81 @@ -%define version 1.0.0 -%define release 2 -%define debug_package %{nil} -%global _build_id_links none -%undefine __brp_mangle_shebangs - -Name: oec-hardware -Summary: openEuler Hardware Compatibility Test Suite -Version: %{version} -Release: %{release} -Group: Development/Tools -License: Mulan PSL v2 -URL: https://gitee.com/openeuler/oec-hardware -Source0: %{name}-%{version}.tar.bz2 - -Buildroot: %{_tmppath}/%{name}-%{version}-root -BuildRequires: gcc -Requires: kernel-devel, kernel-headers, dmidecode, tar -Requires: qperf, fio, memtester -Requires: kernel >= 4 -Requires: python3 - -# server subpackage -%package server -Summary: openEuler Hardware Compatibility Test Server -Group: Development/Tools -Requires: python3, python3-devel, nginx, tar, qperf, psmisc - -%description -openEuler Hardware Compatibility Test Suite - -%description server -openEuler Hardware Compatibility Test Server - -%prep -%setup -q -c - -%build -[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; -DESTDIR=$RPM_BUILD_ROOT VERSION_RELEASE=%{version} make - -%install -DESTDIR=$RPM_BUILD_ROOT make install - -%clean -[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; - -%pre - -%post - -%files -%defattr(-,root,root) -/usr/bin/oech -/usr/share/oech/kernelrelease.json -/usr/share/oech/lib/hwcompatible -/usr/share/oech/lib/tests -/usr/lib/systemd/system/oech.service -%dir /var/oech -%dir /usr/share/oech/lib -%dir /usr/share/oech - -%files server -%defattr(-,root,root) -/usr/share/oech/lib/server -/usr/share/oech/lib/server/uwsgi.ini -/usr/share/oech/lib/server/uwsgi.conf -/usr/lib/systemd/system/oech-server.service - -%postun -rm -rf /var/lock/oech.lock - -%changelog -* Sun Jul 01 2020 Cui XuCui - 1.0.0-2 -* Fri Jul 26 2019 Lu Tianxiong - 1.0.0-h1 -- Initial spec - +%define version 1.0.0 +%define release 3 +%define debug_package %{nil} +%global _build_id_links none +%undefine __brp_mangle_shebangs + +Name: oec-hardware +Summary: openEuler Hardware Compatibility Test Suite +Version: %{version} +Release: %{release} +Group: Development/Tools +License: Mulan PSL v2 +URL: https://gitee.com/openeuler/oec-hardware +Source0: %{name}-%{version}.tar.bz2 + +#PATCH-FIX-https://gitee.com/src-openEuler/ patch from oec-hardware project +Patch0001: oec-hardware-1.0.0-system.patch + +Buildroot: %{_tmppath}/%{name}-%{version}-root +BuildRequires: gcc +Requires: kernel-devel, kernel-headers, dmidecode, tar +Requires: qperf, fio, memtester +Requires: kernel >= 4 +Requires: python3 + +# server subpackage +%package server +Summary: openEuler Hardware Compatibility Test Server +Group: Development/Tools +Requires: python3, python3-devel, nginx, tar, qperf, psmisc + +%description +openEuler Hardware Compatibility Test Suite + +%description server +openEuler Hardware Compatibility Test Server + +%prep +%setup -q -c + +%build +[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; +DESTDIR=$RPM_BUILD_ROOT VERSION_RELEASE=%{version} make + +%install +DESTDIR=$RPM_BUILD_ROOT make install + +%clean +[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; + +%pre + +%post + +%files +%defattr(-,root,root) +/usr/bin/oech +/usr/share/oech/kernelrelease.json +/usr/share/oech/lib/hwcompatible +/usr/share/oech/lib/tests +/usr/lib/systemd/system/oech.service +%dir /var/oech +%dir /usr/share/oech/lib +%dir /usr/share/oech + +%files server +%defattr(-,root,root) +/usr/share/oech/lib/server +/usr/share/oech/lib/server/uwsgi.ini +/usr/share/oech/lib/server/uwsgi.conf +/usr/lib/systemd/system/oech-server.service + +%postun +rm -rf /var/lock/oech.lock + +%changelog +* Sun Jul 18 2020 Cui XuCui - 1.0.0-3 +* Sun Jul 01 2020 Cui XuCui - 1.0.0-2 +* Fri Jul 26 2019 Lu Tianxiong - 1.0.0-h1 +- Initial spec + -- Gitee From 55fcec1a2f9330e9bfd2b931f8ceff16582dc4b8 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 21 Jul 2020 13:05:35 +0800 Subject: [PATCH 2/3] change \r\n to \n --- oec-hardware.spec | 162 +++++++++++++++++++++++----------------------- 1 file changed, 81 insertions(+), 81 deletions(-) diff --git a/oec-hardware.spec b/oec-hardware.spec index a86909a..c10be45 100644 --- a/oec-hardware.spec +++ b/oec-hardware.spec @@ -1,81 +1,81 @@ -%define version 1.0.0 -%define release 3 -%define debug_package %{nil} -%global _build_id_links none -%undefine __brp_mangle_shebangs - -Name: oec-hardware -Summary: openEuler Hardware Compatibility Test Suite -Version: %{version} -Release: %{release} -Group: Development/Tools -License: Mulan PSL v2 -URL: https://gitee.com/openeuler/oec-hardware -Source0: %{name}-%{version}.tar.bz2 - -#PATCH-FIX-https://gitee.com/src-openEuler/ patch from oec-hardware project -Patch0001: oec-hardware-1.0.0-system.patch - -Buildroot: %{_tmppath}/%{name}-%{version}-root -BuildRequires: gcc -Requires: kernel-devel, kernel-headers, dmidecode, tar -Requires: qperf, fio, memtester -Requires: kernel >= 4 -Requires: python3 - -# server subpackage -%package server -Summary: openEuler Hardware Compatibility Test Server -Group: Development/Tools -Requires: python3, python3-devel, nginx, tar, qperf, psmisc - -%description -openEuler Hardware Compatibility Test Suite - -%description server -openEuler Hardware Compatibility Test Server - -%prep -%setup -q -c - -%build -[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; -DESTDIR=$RPM_BUILD_ROOT VERSION_RELEASE=%{version} make - -%install -DESTDIR=$RPM_BUILD_ROOT make install - -%clean -[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; - -%pre - -%post - -%files -%defattr(-,root,root) -/usr/bin/oech -/usr/share/oech/kernelrelease.json -/usr/share/oech/lib/hwcompatible -/usr/share/oech/lib/tests -/usr/lib/systemd/system/oech.service -%dir /var/oech -%dir /usr/share/oech/lib -%dir /usr/share/oech - -%files server -%defattr(-,root,root) -/usr/share/oech/lib/server -/usr/share/oech/lib/server/uwsgi.ini -/usr/share/oech/lib/server/uwsgi.conf -/usr/lib/systemd/system/oech-server.service - -%postun -rm -rf /var/lock/oech.lock - -%changelog -* Sun Jul 18 2020 Cui XuCui - 1.0.0-3 -* Sun Jul 01 2020 Cui XuCui - 1.0.0-2 -* Fri Jul 26 2019 Lu Tianxiong - 1.0.0-h1 -- Initial spec - +%define version 1.0.0 +%define release 2 +%define debug_package %{nil} +%global _build_id_links none +%undefine __brp_mangle_shebangs + +Name: oec-hardware +Summary: openEuler Hardware Compatibility Test Suite +Version: %{version} +Release: %{release} +Group: Development/Tools +License: Mulan PSL v2 +URL: https://gitee.com/openeuler/oec-hardware +Source0: %{name}-%{version}.tar.bz2 + +#PATCH-FIX-https://gitee.com/src-openEuler/ patch from oec-hardware-1.0.0 project +Patch0001: oec-hardware-1.0.0-system.patch + +Buildroot: %{_tmppath}/%{name}-%{version}-root +BuildRequires: gcc +Requires: kernel-devel, kernel-headers, dmidecode, tar +Requires: qperf, fio, memtester +Requires: kernel >= 4 +Requires: python3 + +# server subpackage +%package server +Summary: openEuler Hardware Compatibility Test Server +Group: Development/Tools +Requires: python3, python3-devel, nginx, tar, qperf, psmisc + +%description +openEuler Hardware Compatibility Test Suite + +%description server +openEuler Hardware Compatibility Test Server + +%prep +%setup -q -c + +%build +[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; +DESTDIR=$RPM_BUILD_ROOT VERSION_RELEASE=%{version} make + +%install +DESTDIR=$RPM_BUILD_ROOT make install + +%clean +[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; + +%pre + +%post + +%files +%defattr(-,root,root) +/usr/bin/oech +/usr/share/oech/kernelrelease.json +/usr/share/oech/lib/hwcompatible +/usr/share/oech/lib/tests +/usr/lib/systemd/system/oech.service +%dir /var/oech +%dir /usr/share/oech/lib +%dir /usr/share/oech + +%files server +%defattr(-,root,root) +/usr/share/oech/lib/server +/usr/share/oech/lib/server/uwsgi.ini +/usr/share/oech/lib/server/uwsgi.conf +/usr/lib/systemd/system/oech-server.service + +%postun +rm -rf /var/lock/oech.lock + +%changelog +* Sun Jul 18 2020 Cui XuCui - 1.0.0-3 +* Sun Jul 01 2020 Cui XuCui - 1.0.0-2 +* Fri Jul 26 2019 Lu Tianxiong - 1.0.0-h1 +- Initial spec + -- Gitee From 5e8cda03c7fe51c5af5f64150f999426d00559ec Mon Sep 17 00:00:00 2001 From: root Date: Fri, 24 Jul 2020 15:45:40 +0800 Subject: [PATCH 3/3] delete tape case --- oec-hardware-1.0.0-delete-tape.patch | 154 +++++++++++++++++++++++++++ oec-hardware.spec | 10 +- 2 files changed, 161 insertions(+), 3 deletions(-) create mode 100644 oec-hardware-1.0.0-delete-tape.patch diff --git a/oec-hardware-1.0.0-delete-tape.patch b/oec-hardware-1.0.0-delete-tape.patch new file mode 100644 index 0000000..c51c5cd --- /dev/null +++ b/oec-hardware-1.0.0-delete-tape.patch @@ -0,0 +1,154 @@ +diff -urN oec-hardware/hwcompatible/compatibility.py oec-hardware_new/hwcompatible/compatibility.py +--- oec-hardware/hwcompatible/compatibility.py 2020-07-24 15:14:10.247167239 +0800 ++++ oec-hardware_new/hwcompatible/compatibility.py 2020-07-24 14:42:19.385147869 +0800 +@@ -266,12 +266,6 @@ + if device.get_property("PCI_CLASS") == "30000" or device.get_property("PCI_CLASS") == "38000": + sort_devices["video"] = [device] + continue +- if device.get_property("SUBSYSTEM") == "tape" and "/dev/st" in device.get_property("DEVNAME"): +- try: +- sort_devices["tape"].extend([device]) +- except KeyError: +- sort_devices["tape"] = [device] +- continue + if (device.get_property("DEVTYPE") == "disk" and not device.get_property("ID_TYPE")) or \ + device.get_property("ID_TYPE") == "disk": + if "nvme" in device.get_property("DEVPATH"): +diff -urN oec-hardware/README.md oec-hardware_new/README.md +--- oec-hardware/README.md 2020-07-24 15:14:10.243167168 +0800 ++++ oec-hardware_new/README.md 2020-07-24 14:42:19.381147798 +0800 +@@ -335,15 +335,11 @@ + + 使用 nvme-cli 工具对盘进行格式化、读写、查询测试。 + +-13. **tape** +- +- 测试磁带是否正常读写。 +- +-14. **usb** ++13. **usb** + + 插拔 usb 设备,测试 usb 接口能否正常识别。 + +-15. **acpi** ++14. **acpi** + + 利用 acpidump 工具读取数据。 + +diff -urN oec-hardware/tests/tape/Makefile oec-hardware_new/tests/tape/Makefile +--- oec-hardware/tests/tape/Makefile 2020-07-24 15:14:10.255167381 +0800 ++++ oec-hardware_new/tests/tape/Makefile 1970-01-01 08:00:00.000000000 +0800 +@@ -1,22 +0,0 @@ +-# Copyright (c) 2020 Huawei Technologies Co., Ltd. +-# oec-hardware is licensed under the Mulan PSL v2. +-# You can use this software according to the terms and conditions of the Mulan PSL v2. +-# You may obtain a copy of Mulan PSL v2 at: +-# http://license.coscl.org.cn/MulanPSL2 +-# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +-# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +-# PURPOSE. +-# See the Mulan PSL v2 for more details. +-# Create: 2020-04-01 +- +-.PHONY: install clean +- +-all: ; +- +-install: +- mkdir -p $(DEST) +- cp -a *.py $(DEST) +- chmod a+x $(DEST)/*.py +- +-clean: +- rm -rf $(DEST) +diff -urN oec-hardware/tests/tape/tape.py oec-hardware_new/tests/tape/tape.py +--- oec-hardware/tests/tape/tape.py 2020-07-24 15:14:10.255167381 +0800 ++++ oec-hardware_new/tests/tape/tape.py 1970-01-01 08:00:00.000000000 +0800 +@@ -1,87 +0,0 @@ +-#!/usr/bin/env python +-# coding: utf-8 +- +-# Copyright (c) 2020 Huawei Technologies Co., Ltd. +-# oec-hardware is licensed under the Mulan PSL v2. +-# You can use this software according to the terms and conditions of the Mulan PSL v2. +-# You may obtain a copy of Mulan PSL v2 at: +-# http://license.coscl.org.cn/MulanPSL2 +-# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +-# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +-# PURPOSE. +-# See the Mulan PSL v2 for more details. +-# Create: 2020-04-01 +- +-import argparse +- +-from hwcompatible.test import Test +-from hwcompatible.command import Command, CertCommandError +- +- +-class TapeTest(Test): +- """ +- Tape test +- """ +- def __init__(self): +- Test.__init__(self) +- self.args = None +- self.device = None +- self.tapeDevice = None +- +- def setup(self, args=None): +- """ +- Initialization before test +- :param args: +- :return: +- """ +- self.args = args or argparse.Namespace() +- self.device = getattr(args, "device", None) +- self.tapeDevice = self.device.get_property("DEVNAME") +- if self.tapeDevice == "": +- print("Did not found any Tape Device") +- else: +- print("Found the Tape Device :\n %s" % self.tapeDevice) +- +- def test(self): +- """ +- test case +- :return: +- """ +- if not self.tapeDevice: +- return False +- +- print("Testing tape device %s" % self.tapeDevice) +- # set default block size to 32k (64 x 512byte = 32k) +- bs = 64 +- # rewind the tape +- try: +- tape_rewind = Command("mt -f %s rewind 2>/dev/null" % self.tapeDevice).read() +- print("Rewind tape : \n %s" % tape_rewind) +- except CertCommandError as exception: +- print(exception) +- return False +- # Write data +- try: +- tapewritedata = Command("tar -Pcb %s -f %s /usr" % (bs, self.tapeDevice)).read() +- if tapewritedata == 0: +- print("Write data done. Start comparing ...") +- # Compare data +- comparedata = Command("tar -Pdb %s -f %s /usr" % (bs, self.tapeDevice)).read() +- if comparedata == 0: +- print("Tape test on device %s passed." % self.tapeDevice) +- return True +- else: +- print("Error: data comparison fail.") +- return False +- else: +- print("Error: write data fail.") +- return False +- +- except CertCommandError as exception: +- print(exception) +- return False +- +- +-if __name__ == "__main__": +- main = TapeTest() +- main.test() diff --git a/oec-hardware.spec b/oec-hardware.spec index c10be45..2977533 100644 --- a/oec-hardware.spec +++ b/oec-hardware.spec @@ -1,5 +1,5 @@ %define version 1.0.0 -%define release 2 +%define release 4 %define debug_package %{nil} %global _build_id_links none %undefine __brp_mangle_shebangs @@ -16,6 +16,9 @@ Source0: %{name}-%{version}.tar.bz2 #PATCH-FIX-https://gitee.com/src-openEuler/ patch from oec-hardware-1.0.0 project Patch0001: oec-hardware-1.0.0-system.patch +#PATCH-FIX-https://gitee.com/src-openEuler/ patch from oec-hardware-1.0.0 project +Patch0002: oec-hardware-1.0.0-delete-tape.patch + Buildroot: %{_tmppath}/%{name}-%{version}-root BuildRequires: gcc Requires: kernel-devel, kernel-headers, dmidecode, tar @@ -74,8 +77,9 @@ DESTDIR=$RPM_BUILD_ROOT make install rm -rf /var/lock/oech.lock %changelog -* Sun Jul 18 2020 Cui XuCui - 1.0.0-3 -* Sun Jul 01 2020 Cui XuCui - 1.0.0-2 +* Fri Jul 24 2020 Cui XuCui - 1.0.0-4 +* Sun Jul 18 2020 Cui XuCui - 1.0.0-3 +* Sun Jul 01 2020 Cui XuCui - 1.0.0-2 * Fri Jul 26 2019 Lu Tianxiong - 1.0.0-h1 - Initial spec -- Gitee