代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/iSulad 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 79b2027b87dd1b7f110d73721b8d47941d993e0e Mon Sep 17 00:00:00 2001
From: gaohuatao <[email protected]>
Date: Mon, 26 Oct 2020 13:57:07 +0800
Subject: [PATCH 10/28] add nonroot execute CI
Signed-off-by: gaohuatao <[email protected]>
---
CI/test_cases/container_cases/nonroot.sh | 70 ++++++++++++++++++++++++
1 file changed, 70 insertions(+)
create mode 100755 CI/test_cases/container_cases/nonroot.sh
diff --git a/CI/test_cases/container_cases/nonroot.sh b/CI/test_cases/container_cases/nonroot.sh
new file mode 100755
index 0000000..b123d70
--- /dev/null
+++ b/CI/test_cases/container_cases/nonroot.sh
@@ -0,0 +1,70 @@
+#!/bin/bash
+#
+# attributes: isulad inheritance start
+# concurrent: YES
+# spend time: 11
+
+#######################################################################
+##- @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-10-19
+#######################################################################
+
+curr_path=$(dirname $(readlink -f "$0"))
+data_path=$(realpath $curr_path/../data)
+source ../helpers.sh
+group="isula"
+user="nonroot_test"
+container="test_nonroot_user"
+
+function do_test_t()
+{
+ local ret=0
+ local test="isula execute with non root => (${FUNCNAME[@]})"
+
+ msg_info "${test} starting..."
+
+ userdel $user
+ useradd -g $group $user
+ [[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - add user $user and add to group $group failed" && ((ret++))
+
+ su - $user -c "isula run -tid --name $container busybox /bin/bash"
+ [[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - run container failed" && ((ret++))
+
+ su - $user -c "isula inspect $container"
+ [[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - inspect container failed" && ((ret++))
+
+ su - $user -c "isula restart $container"
+ [[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - restart container failed" && ((ret++))
+
+ su - $user -c "isula exec $container pwd"
+ [[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - exec container failed" && ((ret++))
+
+ su - $user -c "isula stop $container"
+ [[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - stop container failed" && ((ret++))
+
+ su - $user -c "isula rm $container"
+ [[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - rm container failed" && ((ret++))
+
+ userdel $user
+
+ return $TC_RET_T
+}
+
+ret=0
+
+do_test_t
+if [ $? -ne 0 ];then
+ let "ret=$ret + 1"
+fi
+
+show_result $ret "basic start"
--
2.20.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。