diff options
author | CoprDistGit <infra@openeuler.org> | 2024-01-20 09:57:05 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-01-20 09:57:05 +0000 |
commit | c56563a5cfb85fcba9f28dd1df9647037eb2931e (patch) | |
tree | 82e936c48ac53d5a05ac395f897e421a743f8023 /0022-add-update-restart-policy-test.patch | |
parent | 8c7a257a80c20ee3fae444f9e3d670a86dca161f (diff) |
automatic import of iSuladopeneuler23.09openeuler22.03_LTS_SP2
Diffstat (limited to '0022-add-update-restart-policy-test.patch')
-rw-r--r-- | 0022-add-update-restart-policy-test.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/0022-add-update-restart-policy-test.patch b/0022-add-update-restart-policy-test.patch new file mode 100644 index 0000000..1f324ae --- /dev/null +++ b/0022-add-update-restart-policy-test.patch @@ -0,0 +1,57 @@ +From 6815aec33caedaacba3b392ee5a2e5088fdf1faa Mon Sep 17 00:00:00 2001 +From: zhangxiaoyu <zhangxiaoyu58@huawei.com> +Date: Tue, 21 Nov 2023 10:24:26 +0800 +Subject: [PATCH 22/64] add update restart policy test + +Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com> +--- + CI/test_cases/container_cases/update.sh | 26 +++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +diff --git a/CI/test_cases/container_cases/update.sh b/CI/test_cases/container_cases/update.sh +index d379acc2..29543e7c 100755 +--- a/CI/test_cases/container_cases/update.sh ++++ b/CI/test_cases/container_cases/update.sh +@@ -138,6 +138,27 @@ function do_test_t() + return $TC_RET_T + } + ++function test_autoremove_restartpolicy() ++{ ++ containername=test_update2 ++ containerid=`isula run -itd --runtime $1 --rm --name $containername busybox` ++ fn_check_eq "$?" "0" "run failed" ++ ++ isula update --restart always $containerid ++ fn_check_ne "$?" "0" "update should fail" ++ ++ isula update --restart nooooooooooo $containerid ++ fn_check_ne "$?" "0" "update should fail" ++ ++ isula update --restart no $containerid ++ fn_check_eq "$?" "0" "update restart policy no failed" ++ ++ isula rm -f $containername ++ fn_check_eq "$?" "0" "rm failed" ++ ++ return $TC_RET_T ++} ++ + function do_test_t1() + { + containername=test_update1 +@@ -173,6 +194,11 @@ do + let "ret=$ret + 1" + fi + ++ test_autoremove_restartpolicy $element ++ if [ $? -ne 0 ];then ++ let "ret=$ret + 1" ++ fi ++ + if [ -f "/sys/fs/cgroup/memory/memory.memsw.usage_in_bytes" ];then + do_test_t1 $element + if [ $? -ne 0 ];then +-- +2.42.0 + |