提交 cee24589 编写于 作者: L lifeng68

CI: add test cases for inspect\stats\top\ulimit

Signed-off-by: Nlifeng68 <lifeng68@huawei.com>
上级 bc8ddb67
......@@ -2,7 +2,7 @@
#
# attributes: isulad inheritance fd
# concurrent: NO
# spend time: 15
# spend time: 16
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
# - iSulad licensed under the Mulan PSL v2.
......
......@@ -2,7 +2,7 @@
#
# attributes: isulad cri cni
# concurrent: NA
# spend time: 45
# spend time: 46
curr_path=$(dirname $(readlink -f "$0"))
data_path=$(realpath $curr_path/criconfigs)
......
......@@ -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.
......
......@@ -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.
......
......@@ -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.
......
......@@ -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.
......
......@@ -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.
......
......@@ -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.
......
#!/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
......@@ -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.
......
......@@ -2,7 +2,7 @@
#
# attributes: isulad inheritance ps list
# concurrent: NO
# spend time: 12
# spend time: 11
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
......
......@@ -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.
......
......@@ -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.
......
......@@ -2,7 +2,7 @@
#
# attributes: isulad inheritance restartpolicy
# concurrent: NO
# spend time: 29
# spend time: 28
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
......
......@@ -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.
......
......@@ -2,7 +2,7 @@
#
# attributes: isulad share namepaces
# concurrent: NO
# spend time: 25
# spend time: 29
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
......
#!/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
......@@ -2,7 +2,7 @@
#
# attributes: isulad inheritance stop
# concurrent: YES
# spend time: 28
# spend time: 27
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2020. All rights reserved.
......
#!/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
#!/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}"
......@@ -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()
......
......@@ -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.
......
......@@ -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.
......
......@@ -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.
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册