提交 dc73c09b 编写于 作者: L luluyalula 提交者: Gitee

update testcases/smoke-testing/oe_test_acl_001/oe_test_acl_001.sh.

更改判断用户是否存在的语句
上级 11503943
......@@ -26,21 +26,20 @@ function config_params() {
function pre_test() {
LOG_INFO "Start environment preparation."
ls /tmp/acl01 && rm -rf /tmp/acl01
pre=$(cat /etc/passwd |grep -w "testuser"|awk -F : '{print $1}')
[ -n "$pre" ] || useradd testuser
id -u testuser || useradd testuser
}
function run_test() {
LOG_INFO "Start testing..."
mkdir -p /tmp/acl01/acl02
mkdir -p /tmp/acl01
getfacl -p /tmp/acl01|grep "user"|awk -F : '{print $2}'|grep -w "testuser"
CHECK_RESULT $? 0 1
setfacl -m u:testuser:rx /tmp/acl01
getfacl -p /tmp/acl01|grep "user"|awk -F : '{print $2}'|grep -w "testuser"
CHECK_RESULT $? 0 0
touch /tmp/acl01/acl02
mkdir /tmp/acl01/acl02
getfacl -p /tmp/acl01/acl02|grep "user"|awk -F : '{print $2}'|grep -w "testuser"
CHECK_RESULT $? 0 1
......@@ -48,7 +47,7 @@ function run_test() {
setfacl -m d:u:testuser:rx /tmp/acl01
getfacl -p /tmp/acl01|grep "user"|awk -F : '{print $2}'|grep -w "testuser"
CHECK_RESULT $? 0 0
touch /tmp/acl01/acl03
mkdir /tmp/acl01/acl03
getfacl -p /tmp/acl01/acl03|grep "user"|awk -F : '{print $2}'|grep -w "testuser"
CHECK_RESULT $? 0 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册