Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
oec-hardware
提交
f8769a29
O
oec-hardware
项目概览
openeuler
/
oec-hardware
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oec-hardware
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
f8769a29
编写于
6月 23, 2020
作者:
C
cuixucui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Code specification rectification
上级
b7d464a9
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
22 addition
and
22 deletion
+22
-22
hwcompatible/compatibility.py
hwcompatible/compatibility.py
+2
-2
hwcompatible/device.py
hwcompatible/device.py
+1
-1
hwcompatible/document.py
hwcompatible/document.py
+3
-3
hwcompatible/reboot.py
hwcompatible/reboot.py
+2
-2
hwcompatible/sysinfo.py
hwcompatible/sysinfo.py
+1
-1
tests/acpi/acpi.py
tests/acpi/acpi.py
+2
-2
tests/disk/disk.py
tests/disk/disk.py
+2
-2
tests/kdump/kdump.py
tests/kdump/kdump.py
+2
-2
tests/nvme/nvme.py
tests/nvme/nvme.py
+2
-2
tests/system/system.py
tests/system/system.py
+5
-5
未找到文件。
hwcompatible/compatibility.py
浏览文件 @
f8769a29
...
...
@@ -286,7 +286,7 @@ class EulerCertification():
try
:
Command
(
"dmidecode"
).
get_str
(
"IPMI Device Information"
,
single_line
=
False
)
sort_devices
[
"ipmi"
]
=
[
empty_device
]
except
:
except
OSError
as
e
:
pass
return
sort_devices
...
...
@@ -319,7 +319,7 @@ class EulerCertification():
try
:
num
=
int
(
reply
)
except
:
except
ValueError
:
continue
if
num
>
0
and
num
<=
len
(
self
.
test_factory
):
...
...
hwcompatible/device.py
浏览文件 @
f8769a29
...
...
@@ -60,7 +60,7 @@ class CertDevice:
properties
[
"INFO"
]
=
attribute
else
:
break
except
Exception
as
e
:
except
OSError
as
e
:
print
(
"Warning: get devices fail"
)
print
(
e
)
self
.
devices
.
sort
(
key
=
lambda
k
:
k
.
path
)
...
...
hwcompatible/document.py
浏览文件 @
f8769a29
...
...
@@ -34,7 +34,7 @@ class Document():
with
open
(
self
.
filename
,
"w+"
)
as
save_f
:
json
.
dump
(
self
.
document
,
save_f
,
indent
=
4
)
save_f
.
close
()
except
Exception
as
e
:
except
(
IOError
,
ValueError
)
as
e
:
print
(
"Error: doc save fail."
)
print
(
e
)
return
False
...
...
@@ -46,7 +46,7 @@ class Document():
self
.
document
=
json
.
load
(
load_f
)
load_f
.
close
()
return
True
except
:
except
(
IOError
,
json
.
decoder
.
JSONDecodeError
)
:
return
False
class
CertDocument
(
Document
):
...
...
@@ -74,7 +74,7 @@ class CertDocument(Document):
self
.
document
[
key
]
=
value
else
:
break
except
Exception
as
e
:
except
OSError
as
e
:
print
(
"Error: get hardware info fail."
)
print
(
e
)
...
...
hwcompatible/reboot.py
浏览文件 @
f8769a29
...
...
@@ -63,7 +63,7 @@ class Reboot:
try
:
Command
(
"systemctl daemon-reload"
).
run_quiet
()
Command
(
"systemctl enable oech"
).
run_quiet
()
except
:
except
OSError
as
e
:
print
(
"Error: enable oech.service fail."
)
return
False
...
...
@@ -81,7 +81,7 @@ class Reboot:
self
.
job
.
job_id
=
self
.
reboot
[
"job_id"
]
self
.
job
.
subtests_filter
=
self
.
reboot
[
"rebootup"
]
time_reboot
=
datetime
.
datetime
.
strptime
(
self
.
reboot
[
"time"
],
"%Y%m%d%H%M%S"
)
except
:
except
KeyError
:
print
(
"Error: reboot file format not as expect."
)
return
False
...
...
hwcompatible/sysinfo.py
浏览文件 @
f8769a29
...
...
@@ -35,7 +35,7 @@ class SysInfo:
f
=
open
(
file
)
text
=
f
.
read
()
f
.
close
()
except
:
except
IOError
:
print
(
"Release file not found."
)
return
...
...
tests/acpi/acpi.py
浏览文件 @
f8769a29
...
...
@@ -13,7 +13,7 @@
# Create: 2020-04-01
from
hwcompatible.test
import
Test
from
hwcompatible.command
import
Command
from
hwcompatible.command
import
Command
,
CertCommandError
class
AcpiTest
(
Test
):
...
...
@@ -26,7 +26,7 @@ class AcpiTest(Test):
try
:
Command
(
"acpidump"
).
echo
()
return
True
except
OS
Error
as
e
:
except
CertCommand
Error
as
e
:
print
(
e
)
return
False
tests/disk/disk.py
浏览文件 @
f8769a29
...
...
@@ -50,7 +50,7 @@ class DiskTest(Test):
Command
(
"cat /proc/mdstat"
).
echo
(
ignore_errors
=
True
)
sys
.
stdout
.
flush
()
print
(
"
\n
"
)
except
Exception
as
e
:
except
CertCommandError
as
e
:
print
(
"Warning: could not get disk info"
)
print
(
e
)
...
...
@@ -195,7 +195,7 @@ class DiskTest(Test):
if
not
self
.
do_fio
(
path
,
size
,
opts
):
return_code
=
False
break
except
Exception
as
e
:
except
CertCommandError
as
e
:
print
(
e
)
return_code
=
False
break
...
...
tests/kdump/kdump.py
浏览文件 @
f8769a29
...
...
@@ -36,7 +36,7 @@ class KdumpTest(Test):
def
test
(
self
):
try
:
Command
(
"cat /proc/cmdline"
).
get_str
(
r
"crashkernel=[^\ ]*"
)
except
:
except
(
OSError
,
ValueError
)
:
print
(
"Error: no crashkernel found."
)
return
False
...
...
@@ -53,7 +53,7 @@ class KdumpTest(Test):
try
:
Command
(
"systemctl restart kdump"
).
run
()
Command
(
"systemctl status kdump"
).
get_str
(
regex
=
"Active: active"
,
single_line
=
False
)
except
:
except
(
OSError
,
ValueError
)
:
print
(
"Error: kdump service not working."
)
return
False
...
...
tests/nvme/nvme.py
浏览文件 @
f8769a29
...
...
@@ -16,7 +16,7 @@ import os
import
sys
import
argparse
from
hwcompatible.test
import
Test
from
hwcompatible.command
import
Command
from
hwcompatible.command
import
Command
,
CertCommandError
from
hwcompatible.device
import
CertDevice
,
Device
...
...
@@ -69,7 +69,7 @@ class NvmeTest(Test):
Command
(
"nvme list"
).
echo
(
ignore_errors
=
True
)
return
True
except
Exception
as
e
:
except
CertCommandError
as
e
:
print
(
"Error: nvme cmd fail."
)
print
(
e
)
return
False
...
...
tests/system/system.py
浏览文件 @
f8769a29
...
...
@@ -68,7 +68,7 @@ class SystemTest(Test):
sys
.
stdout
.
flush
()
if
rpm_verify
.
output
and
len
(
rpm_verify
.
output
)
>
0
:
return_code
=
False
except
:
except
OSError
as
err
:
print
(
"Error: files in %s have been tampered."
%
cert_package
)
return_code
=
False
return
return_code
...
...
@@ -94,7 +94,7 @@ class SystemTest(Test):
if
kernel_dict
.
document
[
os_version
]
!=
self
.
sysinfo
.
kernel_version
:
print
(
"Error: kernel %s check GA status fail."
%
self
.
sysinfo
.
kernel_version
)
return_code
=
False
except
:
except
KeyError
:
print
(
"Error: %s is not supported."
%
os_version
)
return_code
=
False
...
...
@@ -129,7 +129,7 @@ class SystemTest(Test):
print
(
""
)
tainted_file
.
close
()
except
Exception
as
e
:
except
(
IOError
,
ValueError
)
as
e
:
print
(
e
)
print
(
"Error: could not determine if kernel is tainted."
)
return_code
=
False
...
...
@@ -142,7 +142,7 @@ class SystemTest(Test):
try
:
params
=
Command
(
"cat /proc/cmdline"
).
get_str
()
print
(
"Boot Parameters: %s"
%
params
)
except
Exception
as
e
:
except
OSError
as
e
:
print
(
e
)
print
(
"Error: could not determine boot parameters."
)
return_code
=
False
...
...
@@ -261,7 +261,7 @@ class SystemTest(Test):
if
os
.
path
.
islink
(
modulefile
):
modulefile
=
os
.
readlink
(
modulefile
)
return
modulefile
except
:
except
OSError
:
print
(
"Error: could no find module file for %s:"
%
module
)
return
None
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录