代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/iSulad 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From c7cf33c432b3d9479b2fe365169d4b9a37cae8f7 Mon Sep 17 00:00:00 2001
From: jikai <[email protected]>
Date: Tue, 9 Jul 2024 12:30:01 +0000
Subject: [PATCH 116/121] fix bug in ci test
Signed-off-by: jikai <[email protected]>
---
CI/test_cases/container_cases/run.sh | 6 +++---
CI/test_cases/helpers.sh | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/CI/test_cases/container_cases/run.sh b/CI/test_cases/container_cases/run.sh
index 1bfd388b..ef04b547 100755
--- a/CI/test_cases/container_cases/run.sh
+++ b/CI/test_cases/container_cases/run.sh
@@ -26,9 +26,9 @@ source ../helpers.sh
function do_test_t()
{
tid=`isula run --runtime $1 -tid --name hostname busybox`
- chostname=`isula exec -it $tid hostname`
- clean_hostname=$(echo "$hostname" | sed 's/[\x01-\x1F\x7F]//g')
- fn_check_eq "${clean_hostname}" "${tid:0:12}" "default hostname is not id of container"
+ # should not use -it option, otherwise the hostname will containe special characters such as '$' or '\r'
+ hostname=`isula exec $tid hostname`
+ fn_check_eq "${hostname}" "${tid:0:12}" "default hostname is not id of container"
isula exec -it hostname env | grep HOSTNAME
fn_check_eq "$?" "0" "check HOSTNAME env failed"
isula stop -t 0 $tid
diff --git a/CI/test_cases/helpers.sh b/CI/test_cases/helpers.sh
index c5eba8a2..0288b4ea 100755
--- a/CI/test_cases/helpers.sh
+++ b/CI/test_cases/helpers.sh
@@ -52,15 +52,16 @@ function cut_output_lines() {
return $retval
}
+# use string compare to check the result
function fn_check_eq() {
- if [[ "$1" -ne "$2" ]];then
+ if [ "x$1" != "x$2" ];then
echo "$3"
TC_RET_T=$(($TC_RET_T+1))
fi
}
function fn_check_ne() {
- if [[ "$1" -eq "$2" ]];then
+ if [[ "x$1" == "x$2" ]];then
echo "$3"
TC_RET_T=$(($TC_RET_T+1))
fi
--
2.25.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。