Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
integration-test
提交
f1c3a7ae
I
integration-test
项目概览
openeuler
/
integration-test
通知
6
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
integration-test
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
f1c3a7ae
编写于
7月 23, 2020
作者:
L
lutianxiong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add new testcase
上级
2b59e1b3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
183 addition
and
0 deletion
+183
-0
suite2cases/smoke-testing
suite2cases/smoke-testing
+3
-0
testcases/smoke-testing/oe_test_iscsi/oe_test_iscsi.sh
testcases/smoke-testing/oe_test_iscsi/oe_test_iscsi.sh
+79
-0
testcases/smoke-testing/oe_test_nfs/oe_test_nfs.sh
testcases/smoke-testing/oe_test_nfs/oe_test_nfs.sh
+63
-0
testcases/smoke-testing/oe_test_pciutils/oe_test_pciutils.sh
testcases/smoke-testing/oe_test_pciutils/oe_test_pciutils.sh
+38
-0
未找到文件。
suite2cases/smoke-testing
浏览文件 @
f1c3a7ae
...
...
@@ -35,3 +35,6 @@ oe_test_syslog_journalctl_002
oe_test_syslog_journald_001
oe_test_syslog_logrotate_001
oe_test_syslog_messages_001
oe_test_iscsi
oe_test_nfs
oe_test_pciutils
testcases/smoke-testing/oe_test_iscsi/oe_test_iscsi.sh
0 → 100644
浏览文件 @
f1c3a7ae
#!/usr/bin/bash
# Copyright (c) 2020 Huawei Technologies Co.,Ltd.ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM 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.
# #############################################
# @Author : lutianxiong
# @Contact : lutianxiong@huawei.com
# @Date : 2020-07-20
# @License : Mulan PSL v2
# @Desc : open-iscsi & multipath-tools & target test
# ############################################
set
-eo
pipefail
source
"
$OET_PATH
/libs/locallibs/common_lib.sh"
lun1
=
/home/iscsi_lun1_
$$
lun2
=
/home/iscsi_lun2_
$$
local_addr
=
"127.0.0.1"
iscsi_name
=
"iqn.2020-07.org.openeuler:iscsi
$$
"
firewall_status
=
0
function
pre_test
()
{
dnf
install
-y
open-iscsi multipath-tools target-restore targetcli
dd
if
=
/dev/zero
of
=
$lun1
count
=
10
bs
=
1M
dd
if
=
/dev/zero
of
=
$lun2
count
=
10
bs
=
1M
systemctl status
--no-pager
firewalld
&&
firewall_status
=
1
systemctl stop firewalld
mv
/etc/iscsi/initiatorname.iscsi
.
}
function
run_test
()
{
echo
-e
"cd /
\n
clearconfig confirm=true
\n
"
| targetcli
echo
-e
"cd /backstores/fileio
\n
create name=disk1 file_or_dev=
${
lun1
}
\n
"
| targetcli
echo
-e
"cd /backstores/fileio
\n
create name=disk2 file_or_dev=
${
lun2
}
\n
"
| targetcli
echo
-e
"cd /iscsi
\n
create
${
iscsi_name
}
\n
"
| targetcli
echo
-e
"cd /iscsi/
${
iscsi_name
}
/tpg1/acls
\n
create
${
iscsi_name
}
:client
\n
"
| targetcli
echo
-e
"cd /iscsi/
${
iscsi_name
}
/tpg1/luns
\n
create /backstores/fileio/disk1 lun1
\n
"
| targetcli
echo
-e
"cd /iscsi/
${
iscsi_name
}
/tpg1/luns
\n
create /backstores/fileio/disk2 lun2
\n
"
| targetcli
systemctl restart target
echo
"InitiatorName=
${
iscsi_name
}
:client"
>
/etc/iscsi/initiatorname.iscsi
systemctl restart iscsid
iscsiadm
-m
discovery
-t
st
-p
${
local_addr
}
iscsiadm
-m
node
-p
${
local_addr
}
-l
systemctl restart multipathd
path1
=
$(
multipath
-ll
|
grep
disk1 |
awk
'{print $1}'
)
path2
=
$(
multipath
-ll
|
grep
disk2 |
awk
'{print $1}'
)
test
-n
"
$path1
"
&&
test
-n
"
$path2
"
||
return
1
mkfs.ext4
-F
/dev/mapper/
$path1
mkfs.ext4
-F
/dev/mapper/
$path2
iscsiadm
-m
node
-p
${
local_addr
}
-u
iscsiadm
-m
node
-o
delete
-p
${
local_addr
}
systemctl stop multipathd
systemctl stop iscsid
systemctl stop target
}
function
post_test
()
{
set
+e
iscsiadm
-m
node
-p
${
local_addr
}
-u
iscsiadm
-m
node
-o
delete
-p
${
local_addr
}
systemctl stop multipathd
systemctl stop iscsid
systemctl stop target
echo
-e
"cd /
\n
clearconfig confirm=true
\n
"
| targetcli
test
-f
initiatorname.iscsi
&&
mv
initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
rm
-rf
$lun1
$lun2
test
${
firewall_status
}
-eq
1
&&
systemctl restart firewalld
}
main
$@
testcases/smoke-testing/oe_test_nfs/oe_test_nfs.sh
0 → 100644
浏览文件 @
f1c3a7ae
#!/usr/bin/bash
# Copyright (c) 2020 Huawei Technologies Co.,Ltd.ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM 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.
# #############################################
# @Author : lutianxiong
# @Contact : lutianxiong@huawei.com
# @Date : 2020-07-20
# @License : Mulan PSL v2
# @Desc : nfs test
# ############################################
set
-eo
pipefail
source
"
$OET_PATH
/libs/locallibs/common_lib.sh"
test_user
=
nfs_test_
$$
server_dir
=
/home/nfs_server_
$$
client_dir
=
/home/nfs_client_
$$
function
pre_test
()
{
dnf
install
-y
nfs-utils nfs4-acl-tools
useradd
$test_user
mkdir
$server_dir
$client_dir
test
-f
/etc/exports
&&
cp
/etc/exports
.
return
0
}
function
run_test
()
{
echo
"
$server_dir
*(rw,sync,no_root_squash)"
>>
/etc/exports
systemctl restart nfs-server
showmount
-e
localhost |
grep
-w
"
$server_dir
"
mount
-t
nfs4 localhost:
$server_dir
$client_dir
echo
"
$$
"
>
$client_dir
/file
diff
$server_dir
/file
$client_dir
/file
chmod
640
$client_dir
/file
sudo
-u
$test_user
cat
$client_dir
/file 2> error.log
&&
return
1
cat
error.log |
grep
"Permission denied"
uid
=
$(
id
-u
$test_user
)
nfs4_setfacl
-a
"A::
${
uid
}
:r"
$client_dir
/file
nfs4_getfacl
$client_dir
/file |
grep
"A::
${
uid
}
:r"
sudo
-u
$test_user
cat
$client_dir
/file
umount
$client_dir
}
function
post_test
()
{
set
+e
umount
$client_dir
rm
-rf
$client_dir
$server_dir
userdel
-r
$test_user
rm
-f
error.log
test
-f
exports
&&
mv
exports /etc/exports
}
main
$@
testcases/smoke-testing/oe_test_pciutils/oe_test_pciutils.sh
0 → 100644
浏览文件 @
f1c3a7ae
#!/usr/bin/bash
# Copyright (c) 2020 Huawei Technologies Co.,Ltd.ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM 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.
# #############################################
# @Author : lutianxiong
# @Contact : lutianxiong@huawei.com
# @Date : 2020-07-20
# @License : Mulan PSL v2
# @Desc : pciutils test
# ############################################
set
-eo
pipefail
source
"
$OET_PATH
/libs/locallibs/common_lib.sh"
function
pre_test
()
{
dnf
install
-y
pciutils
}
function
run_test
()
{
lspci 2> error.log
test
-s
error.log
&&
return
1
update-pciids
lspci |
grep
"PCI bridge"
}
function
post_test
()
{
test
-f
error.log
&&
cat
error.log
&&
rm
-f
error.log
}
main
$@
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录