!36 [sync] PR-25: Upgrade oech version to 1.1.0

From: @openeuler-sync-bot 
Reviewed-by: @meitingli 
Signed-off-by: @meitingli
This commit is contained in:
openeuler-ci-bot 2022-06-30 02:24:49 +00:00 committed by Gitee
commit 9cd5f8b3c2
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
9 changed files with 51 additions and 3378 deletions

126
README.md
View File

@ -1,96 +1,33 @@
# oec-hardware
## 背景介绍
OS 厂商为了扩大自己产品的兼容性范围常常寻求与硬件厂商的合作进行兼容性测试。OS 厂商制定一个测试标准并提供测试用例硬件厂商进行实际的测试。测试通过后OS 厂商和硬件厂商将共同在对应的官网发布兼容性信息。
## 工具介绍
验证目的就是保证 OS 与硬件平台的兼容性,验证仅限于基本功能验证,不包括性能测试等其它测试。
oec-hardware工具是openEuler社区提供的一款硬件兼容性测试工具oec-hardware提供服务器整机、板卡与openEuler的兼容性验证测试,验证仅限于基本功能验证,不包括性能测试等其它测试。
openEuler硬件兼容性测试框架有如下特点
硬件厂商在需要验证硬件产品与openEuler的兼容性时可以使用oec-hardware。社区提供硬件兼容性测试流程硬件厂商可以参考 [社区兼容性适配流程](https://www.openeuler.org/zh/compatibility/hardware/) 进行和openEuler的适配。
1. 为满足可信要求必须使用openEuler操作系统不能随意重编/插入内核模块。
2. 通过扫描机制自适应发现硬件列表,来确定要运行的测试用例集合。
3. 面向对象抽象各种硬件类型以及测试用例类,用于扩展开发。
通过oec-hardware工具测试的硬件产品openEuler会在社区官网发布 [兼容性清单](https://www.openeuler.org/zh/compatibility/) ,硬件厂商会在厂商官网发布对应的兼容性信息。
## 软件架构
```
.
├── hwcompatible 框架主功能
│ ├── compatibility.py 框架核心功能
│ ├── client.py 上传测试结果到服务端
│ ├── command.py bash命令执行封装
│ ├── commandUI.py 命令行交互工具
│ ├── device.py 扫描设备信息
│ ├── document.py 收集配置信息
│ ├── env.py 全局变量,主要是各个配置文件或目录的路径
│ ├── job.py 测试任务管理
│ ├── log.py 日志模块
│ ├── reboot.py 重启类任务专用,便于机器重启后仍能继续执行测试
│ ├── sysinfo.py 收集系统信息
│ └── test.py 测试套模板
├── scripts 工具脚本
│ ├── oech 框架命令行工具
│ ├── oech-server.service 框架服务端 service 文件,用于启动 web 服务器
│ ├── oech.service 框架客户端 service 文件,用于接管 reboot 用例
│ └── kernelrelease.json 规范可用于认证的系统和内核版本
├── server 服务端
│ ├── oech-server-pre.sh 服务预执行脚本
│ ├── results/ 测试结果存放目录
│ ├── server.py 服务端主程序
│ ├── static/ 图片存放目录
│ ├── templates/ 网页模板存放目录
│ ├── uwsgi.conf nginx 服务配置
│ └── uwsgi.ini uwsgi 服务配置
└── tests 测试套
```
## 安装介绍
## 安装测试框架
本工具支持在 openEuler 20.03 (LTS) 或更高版本上运行,详细支持版本请查看 [操作系统支持版本信息](https://gitee.com/openeuler/oec-hardware/blob/master/scripts/kernelrelease.json) 文件。
### 前提条件
### 客户端
安装了 openEuler 20.03 (LTS) 或更高版本。
### 获取安装包
* 安装包从 openEuler 官方网站下载。
* 校验安装包的完整性。
1. 获取校验文件中的校验值:
```
cat oec-hardware-*.rpm.sha256sum
```
2. 计算文件的 sha256 校验值:
```
sha256sum oec-hardware-*.rpm
```
命令执行完成后,输出校验值。
3. 对比步骤1和步骤2计算的校验值是否一致。
如果校验值一致说明安装文件完整性没有破坏,如果校验值不一致则可以确认文件完整性已被破坏,需要重新获取。
### 安装过程
#### 客户端
1. 配置 [openEuler 官方 repo](https://repo.openeuler.org/) 中对应版本的 everything 源以20.03 LTS的版本的everyting源为例路径为https://repo.openeuler.org/openEuler-20.03-LTS/everything/。使用 `dnf` 安装客户端 oec-hardware。
1. 配置 [openEuler 官方 repo](https://repo.openeuler.org/) 中对应版本的 everything 和 update 源,使用 `dnf` 安装客户端 oec-hardware。
```
dnf install oec-hardware-XXX.rpm
dnf install oec-hardware
```
2. 输入 `oech` 命令,可正常运行,则表示安装成功。
#### 服务端
### 服务端
1. 配置 [openEuler 官方 repo](https://repo.openeuler.org/) 中对应版本的 everything 以20.03 LTS的版本的everyting源为例路径为https://repo.openeuler.org/openEuler-20.03-LTS/everything/。使用 `dnf` 安装服务端 oec-hardware-server。
1. 配置 [openEuler 官方 repo](https://repo.openeuler.org/) 中对应版本的 everything 和 update 源,使用 `dnf` 安装服务端 oec-hardware-server。
```
dnf install oec-hardware-server-XXX.rpm
dnf install oec-hardware-server
```
2. 服务端 web 展示页面需要的部分组件系统本身不提供,需要使用 `pip3` 安装(请自行配置可用 pip 源)。
@ -114,9 +51,17 @@ openEuler硬件兼容性测试框架有如下特点
setenforce 0
```
## 使用说明
# 使用指导
1. 在客户端启动测试框架。在客户端启动 `oech`,其中 `ID``URL` 可以按需填写,`ID` 建议填写 gitee 上的 issue ID`Server` 必须填写为客户端可以直接访问的服务器域名或 ip用于展示测试报告和作网络测试的服务端。
## 前提条件
* `/usr/share/oech/kernelrelease.json` 文件中列出了当前支持的所有系统版本,使用`uname -a` 命令确认当前系统内核版本是否属于框架支持的版本。
* 框架默认会扫描所有网卡,对网卡进行测试前,请自行筛选被测网卡,并给它配上能 `ping` 通服务端的 ip如果客户端是对 InfiniBand 网卡进行测试,服务端也必须有一个 InfiniBand 网卡并提前配好 ip 。建议不要使用业务网口进行网卡测试。
## 使用步骤
1. 在客户端启动测试框架。在客户端启动 `oech`,填写`ID``URL``Server`配置项,`ID` 建议填写 gitee 上的 issue ID注意`ID`中不能带特殊字符);`URL`建议填写产品链接;`Server` 必须填写为客户端可以直接访问的服务器域名或 ip用于展示测试报告和作网络测试的服务端。
```
# oech
@ -147,7 +92,7 @@ openEuler硬件兼容性测试框架有如下特点
Ready to begin testing? (run|edit|quit)
```
3. 选择测试套。`all|none` 分别用于 `全选|全取消`(必测项 `system` 不可取消);数字编号可选择测试套,每次只能选择一个数字,按回车符之后 `no` 变为 `yes`,表示已选择该测试套。
3. 选择测试套。`all|none` 分别用于 `全选|全取消`(必测项 `system` 不可取消,多次执行成功后 `system` 的状态会变为`Force`);数字编号可选择测试套,每次只能选择一个数字,按回车符之后 `no` 变为 `yes`,表示已选择该测试套。
```
Select tests to run:
@ -176,15 +121,16 @@ openEuler硬件兼容性测试框架有如下特点
...
------------- Summary -------------
ethernet-enp3s0 PASS
system FAIL
system PASS
Log saved to /usr/share/oech/logs/oech-20200228210118-TnvUJxFb50.tar succ.
Do you want to submit last result? (y|n) y
Uploading...
Successfully uploaded result to server X.X.X.X.
```
## 查看结果
### 如何查看
# 结果获取
## 查看结果
1. 浏览器打开服务端 IP 地址,点击导航栏 `Results` 界面,找到对应的测试 id 进入。
@ -197,10 +143,20 @@ openEuler硬件兼容性测试框架有如下特点
- `Runtime` 查看测试运行日志。
- `Attachment` 下载测试附件
- `Attachment` 下载测试附件
### 结果说明&建议
## 结果说明
**Result** 列展示测试结果,结果有两种:**PASS** 或者 **FAIL**。如果结果为**FAIL**,可以直接点击结果来查看执行日志,根据报错对照用例代码进行排查。
## 测试结果审核
如果测试的硬件、整机需要发布到openEuler的兼容性清单请将以下测试结果全部上传至相关的适配issue下
- oech测试日志
- oech生成的html测试报告
- 兼容性清单文件请参考templates目录下的模板)
整机适配需要测试至少一张RAID卡、一张网卡并提供对应的信息。

View File

@ -1,154 +0,0 @@
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()

View File

@ -1,19 +0,0 @@
diff -aurpN source/tests/cdrom/cdrom.py modify/tests/cdrom/cdrom.py
--- source/tests/cdrom/cdrom.py 2020-07-01 21:00:19.000000000 +0800
+++ modify/tests/cdrom/cdrom.py 2021-06-23 15:36:13.666396511 +0800
@@ -93,13 +93,13 @@ class CDRomTest(Test):
if device.get_property("ID_CDROM_" + bd_type) == "1":
return bd_type
for dvd_type in dvd_types:
- if device.get_ertpropy("ID_CDROM_" + dvd_type) == "1":
+ if device.get_property("ID_CDROM_" + dvd_type) == "1":
return dvd_type
for cd_type in cd_types:
if device.get_property("ID_CDROM_" + cd_type) == "1":
return cd_type
- print("Can not find pr)oper test-type for %s." % device.get_name())
+ print("Can not find proper test-type for %s." % device.get_name())
return None
def get_mode(self, device_type):

View File

@ -1,21 +0,0 @@
diff -aurpN source/tests/cpufreq/cpufreq.py modify/tests/cpufreq/cpufreq.py
--- source/tests/cpufreq/cpufreq.py 2020-07-01 21:00:19.000000000 +0800
+++ modify/tests/cpufreq/cpufreq.py 2021-07-15 15:20:59.840152638 +0800
@@ -241,7 +241,7 @@ class CPUFreqTest(Test):
tolerance = 1.0
min_speedup = expected_speedup - (expected_speedup - 1.0) * tolerance
max_speedup = expected_speedup + (expected_speedup - 1.0) * tolerance
- if not min_speedup < measured_speedup < max_speedup:
+ if not min_speedup <= measured_speedup <= max_speedup:
print("[X] The speedup(%.2f) is not between %.2f and %.2f" %
(measured_speedup, min_speedup, max_speedup))
return False
@@ -326,7 +326,7 @@ class CPUFreqTest(Test):
load_test.run()
sleep(1)
target_cpu_freq = self.cpu.get_freq(target_cpu)
- if not self.cpu.min_freq < target_cpu_freq < self.cpu.max_freq:
+ if not self.cpu.min_freq <= target_cpu_freq <= self.cpu.max_freq:
print("[X] The freq of CPU%s(%d) is not between %d~%d." %
(target_cpu, target_cpu_freq, self.cpu.min_freq, self.cpu.max_freq))
return False

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +0,0 @@
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:

View File

@ -4,23 +4,13 @@
Name: oec-hardware
Summary: openEuler Hardware Compatibility Test Suite
Version: 1.0.0
Release: 8
Version: 1.1.0
Release: 0
Group: Development/Tools
License: Mulan PSL v2
URL: https://gitee.com/openeuler/oec-hardware
Source0: https://gitee.com/openeuler/oec-hardware/repository/archive/v%{version}.tar.gz
#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
Patch0003: oec-hardware-1.0.0-fix-cdrom.patch
Patch0004: oec-hardware-1.0.0-fix-cpufreq.patch
Patch0005: oec-hardware-1.0.0-optimization.patch
Buildroot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: gcc
Requires: kernel-devel, kernel-headers, dmidecode, tar
@ -42,10 +32,6 @@ openEuler Hardware Compatibility Test Server
%prep
%setup -q -c
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
@ -70,6 +56,7 @@ DESTDIR=$RPM_BUILD_ROOT make install
/usr/share/oech/kernelrelease.json
/usr/share/oech/lib/hwcompatible
/usr/share/oech/lib/tests
/usr/share/oech/lib/config
/usr/lib/systemd/system/oech.service
%dir /var/oech
%dir /usr/share/oech/lib
@ -77,15 +64,20 @@ DESTDIR=$RPM_BUILD_ROOT make install
%files server
%defattr(-,root,root)
/usr/bin/oech-server
/usr/share/oech/lib/server
/usr/share/oech/lib/server/uwsgi.ini
/usr/share/oech/lib/server/uwsgi.conf
/usr/share/oech/lib/config
/usr/lib/systemd/system/oech-server.service
%postun
rm -rf /var/lock/oech.lock
%changelog
* Mon May 30 2022 meitingli <bubble_mt@outlook.com> - 1.1.0-0
- 1. Add support os version: openEuler 22.03LTS
- 2. Add FC/RAID/keycard/GPU/infiniband testcases
- 3. Bugfix
* Thu Sep 09 2021 Cui XuCui <cuixucui1@huawei.com> - 1.0.0-8
* Thu Jul 15 2021 zhangzikang <zhangzikang@kylinos.cn> - 1.0.0-7
- Fix cdrom and cpufreq test failed

Binary file not shown.

BIN
v1.1.0.tar.gz Normal file

Binary file not shown.