代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/iSulad 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 0504a907def3efb4c0ad7eabd5921c97090430af Mon Sep 17 00:00:00 2001
From: songbuhuang <[email protected]>
Date: Tue, 14 Feb 2023 15:55:56 +0800
Subject: [PATCH 09/53] fix cpu-rt CI
Signed-off-by: songbuhuang <[email protected]>
---
CI/test_cases/container_cases/cpu_rt.sh | 32 +++++++++++++++++++------
1 file changed, 25 insertions(+), 7 deletions(-)
diff --git a/CI/test_cases/container_cases/cpu_rt.sh b/CI/test_cases/container_cases/cpu_rt.sh
index 353c2d71..42006bc8 100755
--- a/CI/test_cases/container_cases/cpu_rt.sh
+++ b/CI/test_cases/container_cases/cpu_rt.sh
@@ -24,14 +24,14 @@ source ../helpers.sh
function test_cpurt_isulad_abnormal()
{
local ret=0
- local test="isulad cpu realtime test => (${FUNCNAME[@]})"
+ local test="isulad cpu realtime abnormal test => (${FUNCNAME[@]})"
msg_info "${test} starting..."
- isulad --cpu-rt-period xx --cpu-rt-runtime 950000 /bin/sh 2>&1 | grep 'Invalid value "xx" for flag --cpu-rt-period: Invalid argument'
+ isulad --cpu-rt-period xx --cpu-rt-runtime 950000 2>&1 | grep 'Invalid value "xx" for flag --cpu-rt-period: Invalid argument'
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - Invalid argument for cpu-rt-period" && ((ret++))
- isulad --cpu-rt-period 1000000 --cpu-rt-runtime xx /bin/sh 2>&1 | grep 'Invalid value "xx" for flag --cpu-rt-runtime: Invalid argument'
+ isulad --cpu-rt-period 1000000 --cpu-rt-runtime xx 2>&1 | grep 'Invalid value "xx" for flag --cpu-rt-runtime: Invalid argument'
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - Invalid argument for cpu-rt-runtime" && ((ret++))
msg_info "${test} finished with return ${ret}..."
@@ -40,6 +40,12 @@ function test_cpurt_isulad_abnormal()
function test_isula_update_normal()
{
+ local ret=0
+ local image="busybox"
+ local test="isulad update cpu realtime normal test => (${FUNCNAME[@]})"
+
+ msg_info "${test} starting..."
+
#start isulad with cpu_rt
isulad --cpu-rt-period 1000000 --cpu-rt-runtime 950000 -l DEBUG > /dev/null 2>&1 &
wait_isulad_running
@@ -70,6 +76,10 @@ function test_isula_update_normal()
function test_isula_update_abnormal()
{
+ local ret=0
+ local image="busybox"
+ local test="isulad update cpu realtime abnormal test => (${FUNCNAME[@]})"
+
#start isulad with cpu_rt
isulad --cpu-rt-period 1000000 --cpu-rt-runtime 950000 -l DEBUG > /dev/null 2>&1 &
wait_isulad_running
@@ -77,10 +87,10 @@ function test_isula_update_abnormal()
c_id=`isula run -itd --cpu-rt-period 1000000 --cpu-rt-runtime 950000 ${image} sh`
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - failed to run container with image: ${image}" && ((ret++))
- isula update --cpu-rt-period 800000 --cpu-rt-runtime 900000 $c_id | grep "Invalid --cpu-rt-runtime: rt runtime cannot be higher than rt period"
+ isula update --cpu-rt-period 800000 --cpu-rt-runtime 900000 $c_id 2>&1 | grep "Invalid --cpu-rt-runtime: rt runtime cannot be higher than rt period"
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - failed to update container cpu-rt-runtime" && ((ret++))
- isula update --cpu-rt-runtime 1000000 $c_id | grep "updating cgroup cpu.rt_runtime_us to 1000000: Invalid argument"
+ isula update --cpu-rt-runtime 1000000 $c_id 2>&1 | grep "updating cgroup cpu.rt_runtime_us to 1000000: Invalid argument"
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - failed to update container cpu-rt-runtime" && ((ret++))
isula rm -f $c_id
@@ -158,17 +168,23 @@ function test_isula_run_abnormal()
isula run -itd --cpu-rt-period 1000000 --cpu-rt-runtime 960000 $image /bin/sh 2>&1 | grep "failed to write 960000" | grep "cpu.rt_runtime_us: Invalid argument"
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - Invalid argument for cpu-rt-runtime" && ((ret++))
- stop_isulad_without_valgrind
+ msg_info "${test} finished with return ${ret}..."
+ return ${ret}
}
function test_isula_run_normal()
{
+ local ret=0
+ local image="busybox"
+
isula run -itd -n box --cpu-rt-period 1000000 --cpu-rt-runtime 900000 $image /bin/sh 2>&1
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - failed to run container" && ((ret++))
isula rm -f box
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - failed to rm container ${c_id}" && ((ret++))
-
+
+ msg_info "${test} finished with return ${ret}..."
+ return ${ret}
}
declare -i ans=0
@@ -183,4 +199,6 @@ else
test_kernel_without_cpurt || ((ans++))
fi
+isula rm -f $(isula ps -aq)
+
show_result ${ans} "${curr_path}/${0}"
--
2.25.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。