tests: add a simple test for smbcacls -x
authorRalph Boehme <slow@samba.org>
Sat, 2 Mar 2019 14:37:38 +0000 (15:37 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 4 Mar 2019 19:11:06 +0000 (19:11 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Mar  4 19:11:06 UTC 2019 on sn-devel-144

source3/script/tests/test_acl_xattr.sh

index cba79122045073d615cb8d9f0b4efdc19d1b6892..f134ff79c919050bfab9e299f01437a13cd5e3b0 100755 (executable)
@@ -33,6 +33,22 @@ setup_remote_file() {
     $SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "lcd $PREFIX; put $fname" || exit 1
 }
 
+smbcacls_x() {
+    local share=$1
+    local fname="$share.$$"
+
+    # skip with SMB1
+    echo "$ADDARGS" | grep mNT1 && exit 0
+
+    $SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD "$fname" -x || exit 1
+    mxac=$($SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD "$fname" -x | awk '/Maximum access/ {print $3}')
+
+    echo "mxac: $mxac"
+    if test "$mxac" != "0x1f01ff" ; then
+        exit 1
+    fi
+}
+
 nt_affects_posix() {
     local share=$1
     local expected=$2
@@ -122,6 +138,7 @@ nt_affects_chgrp() {
 
 testit "setup remote file tmp" setup_remote_file tmp
 testit "setup remote file ign_sysacls" setup_remote_file ign_sysacls
+testit "smbcacls -x" smbcacls_x tmp
 testit "nt_affects_posix tmp" nt_affects_posix tmp "true"
 testit "nt_affects_posix ign_sysacls" nt_affects_posix ign_sysacls "false"
 testit "setup remote file tmp" setup_remote_file tmp