Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad
提交
cee24589
I
iSulad
项目概览
openeuler
/
iSulad
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
iSulad
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cee24589
编写于
7月 03, 2020
作者:
L
lifeng68
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
CI: add test cases for inspect\stats\top\ulimit
Signed-off-by:
N
lifeng68
<
lifeng68@huawei.com
>
上级
bc8ddb67
变更
25
隐藏空白更改
内联
并排
Showing
25 changed file
with
425 addition
and
20 deletion
+425
-20
CI/test_cases/container_cases/check_fd_leakage_of_isulad.bash
...est_cases/container_cases/check_fd_leakage_of_isulad.bash
+1
-1
CI/test_cases/container_cases/cni_test.bash
CI/test_cases/container_cases/cni_test.bash
+1
-1
CI/test_cases/container_cases/cp.bash
CI/test_cases/container_cases/cp.bash
+1
-1
CI/test_cases/container_cases/create.bash
CI/test_cases/container_cases/create.bash
+1
-1
CI/test_cases/container_cases/create_mtab_test.bash
CI/test_cases/container_cases/create_mtab_test.bash
+1
-1
CI/test_cases/container_cases/export.bash
CI/test_cases/container_cases/export.bash
+1
-1
CI/test_cases/container_cases/hook_ignore_poststart_error.bash
...st_cases/container_cases/hook_ignore_poststart_error.bash
+1
-1
CI/test_cases/container_cases/hook_spec_test.bash
CI/test_cases/container_cases/hook_spec_test.bash
+1
-1
CI/test_cases/container_cases/inspect.bash
CI/test_cases/container_cases/inspect.bash
+149
-0
CI/test_cases/container_cases/kill.bash
CI/test_cases/container_cases/kill.bash
+1
-1
CI/test_cases/container_cases/ps.bash
CI/test_cases/container_cases/ps.bash
+1
-1
CI/test_cases/container_cases/rename.bash
CI/test_cases/container_cases/rename.bash
+1
-1
CI/test_cases/container_cases/restart.bash
CI/test_cases/container_cases/restart.bash
+1
-1
CI/test_cases/container_cases/restartpolicy.bash
CI/test_cases/container_cases/restartpolicy.bash
+1
-1
CI/test_cases/container_cases/rm.bash
CI/test_cases/container_cases/rm.bash
+1
-1
CI/test_cases/container_cases/share_ns_test.bash
CI/test_cases/container_cases/share_ns_test.bash
+1
-1
CI/test_cases/container_cases/stats.bash
CI/test_cases/container_cases/stats.bash
+87
-0
CI/test_cases/container_cases/stop.bash
CI/test_cases/container_cases/stop.bash
+1
-1
CI/test_cases/container_cases/top.bash
CI/test_cases/container_cases/top.bash
+56
-0
CI/test_cases/container_cases/ulimit.bash
CI/test_cases/container_cases/ulimit.bash
+111
-0
CI/test_cases/container_cases/version.bash
CI/test_cases/container_cases/version.bash
+2
-0
CI/test_cases/image_cases/image_load.bash
CI/test_cases/image_cases/image_load.bash
+1
-1
CI/test_cases/image_cases/image_remove.bash
CI/test_cases/image_cases/image_remove.bash
+1
-1
CI/test_cases/image_cases/image_tag.bash
CI/test_cases/image_cases/image_tag.bash
+1
-1
CI/test_cases/image_cases/registry.bash
CI/test_cases/image_cases/registry.bash
+1
-1
未找到文件。
CI/test_cases/container_cases/check_fd_leakage_of_isulad.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad inheritance fd
# concurrent: NO
# spend time: 1
5
# spend time: 1
6
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
# - iSulad licensed under the Mulan PSL v2.
...
...
CI/test_cases/container_cases/cni_test.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad cri cni
# concurrent: NA
# spend time: 4
5
# spend time: 4
6
curr_path
=
$(
dirname
$(
readlink
-f
"
$0
"
))
data_path
=
$(
realpath
$curr_path
/criconfigs
)
...
...
CI/test_cases/container_cases/cp.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad basic container hook
# concurrent: NA
# spend time:
25
# spend time:
8
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
...
...
CI/test_cases/container_cases/create.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad inheritance create
# concurrent: YES
# spend time:
4
# spend time:
17
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
...
...
CI/test_cases/container_cases/create_mtab_test.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad inheritance start
# concurrent: YES
# spend time:
1
# spend time:
2
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
...
...
CI/test_cases/container_cases/export.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad basic export container
# concurrent: NA
# spend time:
5
# spend time:
6
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
...
...
CI/test_cases/container_cases/hook_ignore_poststart_error.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad basic container hook
# concurrent: NA
# spend time:
25
# spend time:
7
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
...
...
CI/test_cases/container_cases/hook_spec_test.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad basic container hook
# concurrent: NA
# spend time:
5
# spend time:
9
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
...
...
CI/test_cases/container_cases/inspect.bash
0 → 100644
浏览文件 @
cee24589
#!/bin/bash
#
# attributes: isulad basic container hook
# concurrent: NA
# spend time: 6
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
# - iSulad 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.
##- @Description:CI
##- @Author: lifeng
##- @Create: 2020-06-03
#######################################################################
declare
-r
curr_path
=
$(
dirname
$(
readlink
-f
"
$0
"
))
source
../helpers.bash
test_data_path
=
$(
realpath
$curr_path
/test_data
)
function
test_inspect_spec
()
{
local
ret
=
0
local
image
=
"busybox"
local test
=
"container inspect test => (
${
FUNCNAME
[@]
}
)"
msg_info
"
${
test
}
starting..."
isula pull
${
image
}
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to pull image:
${
image
}
"
&&
return
${
FAILURE
}
isula images |
grep
busybox
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- missing list image:
${
image
}
"
&&
((
ret++
))
containername
=
test_inspect
isula create
--name
$containername
--ipc
host
--pid
host
--uts
host
--restart
=
on-failure:10
--hook-spec
${
test_data_path
}
/test-hookspec.json
--cpu-shares
100
--memory
5MB
--memory-reservation
4MB
--cpu-period
1000000
--cpu-quota
200000
--cpuset-cpus
1
--cpuset-mems
0
--kernel-memory
50M
--pids-limit
=
10000
--volume
/home:/root
--env
a
=
1
$image
/bin/sh
ls
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to run container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .Path}}'
$containername
2>&1 |
grep
"/bin/sh"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .Args}}'
$containername
2>&1 |
grep
"ls"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .HostConfig.IpcMode}}'
$containername
2>&1 |
grep
"host"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .HostConfig.PidMode}}'
$containername
2>&1 |
grep
"host"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .HostConfig.UTSMode}}'
$containername
2>&1 |
grep
"host"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .HostConfig.RestartPolicy.Name}}'
$containername
2>&1 |
grep
"on-failure"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .HostConfig.RestartPolicy.MaximumRetryCount}}'
$containername
2>&1 |
grep
"10"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .HostConfig.HookSpec}}'
$containername
2>&1 |
grep
"test-hookspec.json"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .HostConfig.Binds}}'
$containername
2>&1 |
grep
"/home:/root"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .HostConfig.CPUShares}}'
$containername
2>&1 |
grep
"100"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .HostConfig.Memory}}'
$containername
2>&1 |
grep
"5242880"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .HostConfig.MemoryReservation}}'
$containername
2>&1 |
grep
"4194304"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .HostConfig.CPUPeriod}}'
$containername
2>&1 |
grep
"1000000"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .HostConfig.CPUQuota}}'
$containername
2>&1 |
grep
"200000"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .HostConfig.CpusetCpus}}'
$containername
2>&1 |
grep
"1"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .HostConfig.CpusetMems}}'
$containername
2>&1 |
grep
"0"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .HostConfig.KernelMemory}}'
$containername
2>&1 |
grep
"52428800"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .HostConfig.PidsLimit}}'
$containername
2>&1 |
grep
"10000"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{.Config.Image}}'
$containername
2>&1 |
grep
${
image
}
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
image_id
=
$(
isula inspect
-f
'{{.image.id}}'
${
image
}
)
isula inspect
--format
=
'{{.Image}}'
$containername
2>&1 |
grep
"sha256:
${
image_id
}
"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
if
[
-d
/sys/fs/cgroup/files
]
;
then
grepval
=
"100"
else
grepval
=
"0"
fi
isula inspect
--format
=
'{{json .HostConfig.FilesLimit}}'
$containername
2>&1 |
grep
"
$grepval
"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .Config.Env}}'
$containername
2>&1 |
grep
"a=1"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .Config.Cmd}}'
$containername
2>&1 |
grep
"ls"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula
rm
-f
$containername
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
containername
=
test_inspect_entrypoint
isula create
--entrypoint
/bin/sh
--name
$containername
$image
-c
"exit 0"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .Path}}'
$containername
2>&1 |
grep
"/bin/sh"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .Args}}'
$containername
2>&1 |
grep
"exit 0"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .Config.Entrypoint}}'
$containername
2>&1 |
grep
"/bin/sh"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula inspect
--format
=
'{{json .Config.Cmd}}'
$containername
2>&1 |
grep
"exit 0"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to check container with image:
${
image
}
"
&&
((
ret++
))
isula
rm
-f
$containername
msg_info
"
${
test
}
finished with return
${
ret
}
..."
return
${
ret
}
}
declare
-i
ans
=
0
test_inspect_spec
||
((
ans++
))
show_result
${
ans
}
"
${
curr_path
}
/
${
0
}
"
\ No newline at end of file
CI/test_cases/container_cases/kill.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad inheritance kill
# concurrent: YES
# spend time:
9
# spend time:
3
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
...
...
CI/test_cases/container_cases/ps.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad inheritance ps list
# concurrent: NO
# spend time: 1
2
# spend time: 1
1
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
...
...
CI/test_cases/container_cases/rename.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad basic container hook
# concurrent: NA
# spend time:
5
# spend time:
7
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
...
...
CI/test_cases/container_cases/restart.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad inheritance restart
# concurrent: YES
# spend time:
33
# spend time:
26
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
...
...
CI/test_cases/container_cases/restartpolicy.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad inheritance restartpolicy
# concurrent: NO
# spend time: 2
9
# spend time: 2
8
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
...
...
CI/test_cases/container_cases/rm.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad inheritance rm
# concurrent: YES
# spend time:
12
# spend time:
24
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
...
...
CI/test_cases/container_cases/share_ns_test.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad share namepaces
# concurrent: NO
# spend time: 2
5
# spend time: 2
9
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
...
...
CI/test_cases/container_cases/stats.bash
0 → 100644
浏览文件 @
cee24589
#!/bin/bash
#
# attributes: isulad basic container hook
# concurrent: NA
# spend time: 5
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
# - iSulad 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.
##- @Description:CI
##- @Author: lifeng
##- @Create: 2020-06-03
#######################################################################
declare
-r
curr_path
=
$(
dirname
$(
readlink
-f
"
$0
"
))
source
../helpers.bash
function
test_stats_spec
()
{
local
ret
=
0
local
image
=
"busybox"
local test
=
"container stats test => (
${
FUNCNAME
[@]
}
)"
statslog
=
/tmp/stats.log
msg_info
"
${
test
}
starting..."
isula pull
${
image
}
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to pull image:
${
image
}
"
&&
return
${
FAILURE
}
isula images |
grep
busybox
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- missing list image:
${
image
}
"
&&
((
ret++
))
isula stats xxxxxx 2>&1 |
grep
"No such container"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to run container with image:
${
image
}
"
&&
((
ret++
))
isula stats - 2>&1 |
grep
"Invalid container name"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to run container with image:
${
image
}
"
&&
((
ret++
))
container_name_stop
=
stats_stopped
id_stop
=
`
isula create
-t
-n
$container_name_stop
$image
/bin/sh
`
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to run container with image:
${
image
}
"
&&
((
ret++
))
container_name_running
=
stats_running
id_running
=
`
isula run
-td
-n
$container_name_running
$image
/bin/sh
`
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to run container with image:
${
image
}
"
&&
((
ret++
))
isula stats
--no-stream
>
$statslog
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to run container with image:
${
image
}
"
&&
((
ret++
))
cat
$statslog
|
grep
"
${
id_running
:0:12
}
"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to run container with image:
${
image
}
"
&&
((
ret++
))
isula stats
--no-stream
-a
>
$statslog
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to run container with image:
${
image
}
"
&&
((
ret++
))
cat
$statslog
|
grep
"
${
id_running
:0:12
}
"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to run container with image:
${
image
}
"
&&
((
ret++
))
cat
$statslog
|
grep
"
${
id_stop
:0:12
}
"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to run container with image:
${
image
}
"
&&
((
ret++
))
isula stats
--no-stream
"
$id_stop
"
>
$statslog
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to run container with image:
${
image
}
"
&&
((
ret++
))
cat
$statslog
|
grep
"
${
id_stop
:0:12
}
"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to run container with image:
${
image
}
"
&&
((
ret++
))
isula
rm
-f
"
$container_name_stop
"
"
$container_name_running
"
rm
-f
$statslog
msg_info
"
${
test
}
finished with return
${
ret
}
..."
return
${
ret
}
}
declare
-i
ans
=
0
test_stats_spec
||
((
ans++
))
show_result
${
ans
}
"
${
curr_path
}
/
${
0
}
"
\ No newline at end of file
CI/test_cases/container_cases/stop.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad inheritance stop
# concurrent: YES
# spend time: 2
8
# spend time: 2
7
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
...
...
CI/test_cases/container_cases/top.bash
0 → 100644
浏览文件 @
cee24589
#!/bin/bash
#
# attributes: isulad basic container hook
# concurrent: NA
# spend time: 4
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
# - iSulad 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.
##- @Description:CI
##- @Author: lifeng
##- @Create: 2020-06-03
#######################################################################
declare
-r
curr_path
=
$(
dirname
$(
readlink
-f
"
$0
"
))
source
../helpers.bash
function
test_top_spec
()
{
local
ret
=
0
local
image
=
"busybox"
local test
=
"container top test => (
${
FUNCNAME
[@]
}
)"
msg_info
"
${
test
}
starting..."
isula pull
${
image
}
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to pull image:
${
image
}
"
&&
return
${
FAILURE
}
isula images |
grep
busybox
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- missing list image:
${
image
}
"
&&
((
ret++
))
CONT
=
`
isula run
-itd
$image
/bin/sh
`
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to run container with image:
${
image
}
"
&&
((
ret++
))
isula top
$CONT
-ef
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to run container with image:
${
image
}
"
&&
((
ret++
))
isula
rm
-f
$CONT
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- failed to run container with image:
${
image
}
"
&&
((
ret++
))
msg_info
"
${
test
}
finished with return
${
ret
}
..."
return
${
ret
}
}
declare
-i
ans
=
0
test_top_spec
||
((
ans++
))
show_result
${
ans
}
"
${
curr_path
}
/
${
0
}
"
\ No newline at end of file
CI/test_cases/container_cases/ulimit.bash
0 → 100644
浏览文件 @
cee24589
#!/bin/bash
#
# attributes: isulad inheritance restart
# concurrent: YES
# spend time: 18
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
# - iSulad 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.
##- @Description:CI
##- @Author: gaohuatao
##- @Create: 2020-07-1
#######################################################################
curr_path
=
$(
dirname
$(
readlink
-f
"
$0
"
))
data_path
=
$(
realpath
$curr_path
/../data
)
source
../helpers.bash
function
test_ulimit
()
{
local
ret
=
0
local
image
=
"busybox"
ulimitlog
=
/tmp/ulimit.log
local test
=
"ulimit test => (
${
FUNCNAME
[@]
}
)"
msg_info
"
${
test
}
starting..."
check_valgrind_log
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- stop isulad failed"
&&
((
ret++
))
start_isulad_with_valgrind
--default-ulimit
nproc
=
2048:4096
--default-ulimit
nproc
=
2048:8192
--default-ulimit
nofile
=
1024:4096
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- start isulad failed"
&&
((
ret++
))
isula run
--ulimit
nproc
=
$image
/bin/sh
>
$ulimitlog
2>&1
cat
$ulimitlog
|
grep
"delimiter '=' can't be the first or the last character"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- check failed"
&&
((
ret++
))
isula run
--ulimit
nproc
=
1024:
$image
/bin/sh
>
$ulimitlog
2>&1
cat
$ulimitlog
|
grep
"delimiter ':' can't be the first or the last character"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- check failed"
&&
((
ret++
))
isula run
--ulimit
npro
=
1024:2048
$image
/bin/sh
>
$ulimitlog
2>&1
cat
$ulimitlog
|
grep
"Invalid ulimit type"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- check failed"
&&
((
ret++
))
isula run
--ulimit
nproc
=
4096:2048
$image
/bin/sh
>
$ulimitlog
2>&1
cat
$ulimitlog
|
grep
"Ulimit soft limit must be less than or equal to hard limit"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- check failed"
&&
((
ret++
))
isula run
--ulimit
nproc
=
2048:4096.5
$image
/bin/sh
>
$ulimitlog
2>&1
cat
$ulimitlog
|
grep
"Invalid ulimit hard value"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- check failed"
&&
((
ret++
))
isula run
--ulimit
nproc
==
2048:4096
$image
/bin/sh
>
$ulimitlog
2>&1
cat
$ulimitlog
|
grep
"Invalid ulimit argument"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- check failed"
&&
((
ret++
))
isula run
--ulimit
nproc
=
2048::4096
$image
/bin/sh
>
$ulimitlog
2>&1
cat
$ulimitlog
|
grep
"Too many limit value arguments"
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- check failed"
&&
((
ret++
))
container_name
=
"ulimit_test"
isula run
-td
-n
$container_name
--ulimit
nofile
=
20480:40960
--ulimit
core
=
1024:2048
$image
/bin/sh
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- check failed"
&&
((
ret++
))
isula
exec
$container_name
/bin/sh
-c
"cat /proc/self/limits"
|
grep
"Max open files"
|awk
'{ print $(NF-1) }'
|grep 40960
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- check failed"
&&
((
ret++
))
isula
exec
$container_name
/bin/sh
-c
"cat /proc/self/limits"
|
grep
"Max open files"
|awk
'{ print $(NF-2) }'
|grep 20480
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- check failed"
&&
((
ret++
))
isula
exec
$container_name
/bin/sh
-c
"cat /proc/self/limits"
|
grep
"Max processes"
|awk
'{ print $(NF-1) }'
|grep 8192
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- check failed"
&&
((
ret++
))
isula
exec
$container_name
/bin/sh
-c
"cat /proc/self/limits"
|
grep
"Max processes"
|awk
'{ print $(NF-2) }'
|grep 2048
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- check failed"
&&
((
ret++
))
isula
exec
$container_name
/bin/sh
-c
"cat /proc/self/limits"
|
grep
"Max core file size"
|awk
'{ print $(NF-1) }'
|grep 4
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- check failed"
&&
((
ret++
))
isula
exec
$container_name
/bin/sh
-c
"cat /proc/self/limits"
|
grep
"Max core file size"
|awk
'{ print $(NF-2) }'
|grep 2
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- check failed"
&&
((
ret++
))
isula
rm
-f
$container_name
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- check failed"
&&
((
ret++
))
check_valgrind_log
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- stop isulad failed"
&&
((
ret++
))
start_isulad_with_valgrind
[[
$?
-ne
0
]]
&&
msg_err
"
${
FUNCNAME
[0]
}
:
${
LINENO
}
- start isulad failed"
&&
((
ret++
))
rm
-rf
$ulimitlog
msg_info
"
${
test
}
finished with return
${
ret
}
..."
return
${
ret
}
}
declare
-i
ans
=
0
test_ulimit
||
((
ans++
))
show_result
${
ans
}
"
${
curr_path
}
/
${
0
}
"
CI/test_cases/container_cases/version.bash
浏览文件 @
cee24589
...
...
@@ -90,6 +90,8 @@ function isula_version()
echo
"isula version error"
TC_RET_T
=
$((
$TC_RET_T
+
1
))
fi
isula info
}
function
do_test_t
()
...
...
CI/test_cases/image_cases/image_load.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad basic image
# concurrent: NA
# spend time:
18
# spend time:
22
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
...
...
CI/test_cases/image_cases/image_remove.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad basic remove image
# concurrent: NA
# spend time:
8
# spend time:
5
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
...
...
CI/test_cases/image_cases/image_tag.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad inheritance tag
# concurrent: YES
# spend time:
9
# spend time:
10
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
...
...
CI/test_cases/image_cases/registry.bash
浏览文件 @
cee24589
...
...
@@ -2,7 +2,7 @@
#
# attributes: isulad inheritance version
# concurrent: YES
# spend time:
7
# spend time:
10
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录