wscript: Add check for --wrap linker flag
[vlendec/samba-autobuild/.git] / source3 / script / tests / test_acl_xattr.sh
index 9b8808df78a9a871f086fbf2a195aa176b6000cd..cba79122045073d615cb8d9f0b4efdc19d1b6892 100755 (executable)
@@ -15,8 +15,10 @@ PASSWORD="$3"
 PREFIX="$4"
 SMBCLIENT="$5"
 SMBCACLS="$6"
-SMBCLIENT="$VALGRIND ${SMBCLIENT}"
-SMBCACLS="$VALGRIND ${SMBCACLS}"
+shift 6
+ADDARGS="$*"
+SMBCLIENT="$VALGRIND ${SMBCLIENT} ${ADDARGS}"
+SMBCACLS="$VALGRIND ${SMBCACLS} ${ADDARGS}"
 
 incdir=`dirname $0`/../../../testprogs/blackbox
 . $incdir/subunit.sh
@@ -42,6 +44,8 @@ nt_affects_posix() {
     af=$($SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "getfacl $fname" 2>/dev/null) || exit 1
     echo "before: $b4"
     echo "after: $af"
+    echo "${b4}" | grep -q "^# owner:" || exit 1
+    echo "${af}" | grep -q "^# owner:" || exit 1
     if test "$expected" = "true" ; then
         test "$b4" != "$af"
     else
@@ -71,9 +75,12 @@ nt_affects_chown() {
     test "$b4_expected != $af_expected" || exit 1
 
     b4_actual=$($SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "getfacl $fname" 2>/dev/null) || exit 1
+    echo "${b4_actual}" | grep -q "^# owner:" || exit 1
     b4_actual=$(echo "$b4_actual" | sed -rn 's/^# owner: (.*)/\1/p')
-    $SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD -C force_user 2>/dev/null || exit 1
+    $SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD -a "ACL:$SERVER\force_user:ALLOWED/0x0/FULL" || exit 1
+    $SMBCACLS //$SERVER/$share $fname -U force_user%$PASSWORD -C force_user 2>/dev/null || exit 1
     af_actual=$($SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "getfacl $fname" 2>/dev/null) || exit 1
+    echo "${af_actual}" | grep -q "^# owner:" || exit 1
     af_actual=$(echo "$af_actual" | sed -rn 's/^# owner: (.*)/\1/p')
     echo "before: $b4_actual"
     echo "after: $af_actual"
@@ -93,22 +100,24 @@ nt_affects_chgrp() {
     b4_expected=$(echo "$b4_expected" | awk -F: '{print $3}')
     echo "$b4_expected"
 
-    echo -n "determining uid of domadmins..."
-    af_expected=$(getent passwd domadmins) || exit 1
+    echo -n "determining gid of domadmins..."
+    af_expected=$(getent group domadmins) || exit 1
     af_expected=$(echo "$af_expected" | awk -F: '{print $3}')
     echo "$af_expected"
 
     #basic sanity...
-    test "$b4_expected != $af_expected" || exit 1
+    test "$b4_expected" != "$af_expected" || exit 1
 
     b4_actual=$($SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "getfacl $fname" 2>/dev/null) || exit 1
+    echo "${b4_actual}" | grep -q "^# group:" || exit 1
     b4_actual=$(echo "$b4_actual" | sed -rn 's/^# group: (.*)/\1/p')
     $SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD -G domadmins 2>/dev/null || exit 1
     af_actual=$($SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "getfacl $fname" 2>/dev/null) || exit 1
+    echo "${af_actual}" | grep -q "^# group:" || exit 1
     af_actual=$(echo "$af_actual" | sed -rn 's/^# group: (.*)/\1/p')
     echo "before: $b4_actual"
     echo "after: $af_actual"
-    test "$b4_expected" = "$b4_actual" && test "$af_expected" = "$af_actual"
+    test "$af_expected" != "$b4_actual" && test "$af_expected" = "$af_actual"
 }
 
 testit "setup remote file tmp" setup_remote_file tmp
@@ -121,5 +130,5 @@ testit "nt_affects_chown tmp" nt_affects_chown tmp
 testit "nt_affects_chown ign_sysacls" nt_affects_chown ign_sysacls
 testit "setup remote file tmp" setup_remote_file tmp
 testit "setup remote file ign_sysacls" setup_remote_file ign_sysacls
-testit "nt_affects_chgrp tmp" nt_affects_chown tmp
-testit "nt_affects_chgrp ign_sysacls" nt_affects_chown ign_sysacls
+testit "nt_affects_chgrp tmp" nt_affects_chgrp tmp
+testit "nt_affects_chgrp ign_sysacls" nt_affects_chgrp ign_sysacls