Ignore:
Timestamp:
Nov 25, 2016, 8:04:54 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.7

Location:
vendor/current/source3/script/tests
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/script/tests/test_dfree_quota.sh

    r988 r989  
    66if [ $# -lt 6 ]; then
    77cat <<EOF
    8 Usage: test_dfree_quota.sh SERVER DOMAIN USERNAME PASSWORD LOCAL_PATH SMBCLIENT SMBCQUOTAS
     8Usage: test_dfree_quota.sh SERVER DOMAIN USERNAME PASSWORD LOCAL_PATH SMBCLIENT SMBCQUOTAS SMBCACLS
    99EOF
    1010exit 1;
     
    1919smbclient=$6
    2020smbcquotas=$7
    21 shift 7
     21smbcacls=$8
     22shift 8
    2223failed=0
    2324
     
    3637    uid=$(id -u $USERNAME)
    3738    gid=$(id -g $USERNAME)
     39    uid1=$(id -u user1)
     40    uid2=$(id -u user2)
    3841cat <<ABC
    3942conf1:df:block size = 512:disk free = 10:disk size = 20
     
    6568trygrp2:u$uid:block size = 4096:hard limit = 0:soft limit = 0:cur blocks = 41
    6669trygrp2:g$gid:block size = 4096:hard limit = 60:soft limit = 60:cur blocks = 56
     70notenforce:df:block size = 4096:disk free = 10:disk size = 80
     71notenforce:u$uid:block size = 4096:hard limit = 40:soft limit = 40:cur blocks = 37
     72notenforce:udflt:block size = 4096:qflags = 0
     73nfs:df:block size = 4096:disk free = 10:disk size = 80
     74nfs:u$uid:block size = 4096:hard limit = 40:soft limit = 40:cur blocks = 37
     75nfs:udflt:nosys = 1
     76confdfqp:df:block size = 4096:disk free = 10:disk size = 80
     77confdfqp:u$uid1:block size = 4096:hard limit = 40:soft limit = 40:cur blocks = 36
     78confdfqp:u$uid2:block size = 4096:hard limit = 41:soft limit = 41:cur blocks = 36
    6779ABC
    6880}
     
    94106test_smbclient_dfree() {
    95107        name="$1"
    96         dir="$2"
    97     confs="$3"
    98     expected="$4"
    99         shift
     108    share="$2"
     109    dir="$3"
     110    confs="$4"
     111    expected="$5"
     112    shift
    100113    shift
    101114    shift
     
    103116    subunit_start_test "$name"
    104117    setup_conf $confs
    105         output=$($VALGRIND $smbclient //$SERVER/dfq -c "cd $dir; l" $@ 2>&1)
     118    output=$($VALGRIND $smbclient //$SERVER/$share -c "cd $dir; l" $@ 2>&1)
    106119    status=$?
    107120    if [ "$status" = "0" ]; then
     
    145158
    146159#basic disk-free tests
    147 test_smbclient_dfree "Test dfree share root SMB3 no quota" "." "conf1 ." "10 1024. 5" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
    148 test_smbclient_dfree "Test dfree subdir SMB3 no quota" "subdir1" "conf1 . conf2 subdir1" "20 1024. 10" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
    149 test_smbclient_dfree "Test dfree subdir NT1 no quota" "subdir1" "conf1 . conf2 subdir1" "10 1024. 5" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=NT1 || failed=`expr $failed + 1`
    150 test_smbclient_dfree "Test large disk" "." "conf3 ." "1125899906842624 1024. 3000" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     160test_smbclient_dfree "Test dfree share root SMB3 no quota" dfq "." "conf1 ." "10 1024. 5" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     161test_smbclient_dfree "Test dfree subdir SMB3 no quota" dfq "subdir1" "conf1 . conf2 subdir1" "20 1024. 10" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     162test_smbclient_dfree "Test dfree subdir NT1 no quota" dfq "subdir1" "conf1 . conf2 subdir1" "10 1024. 5" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=NT1 || failed=`expr $failed + 1`
     163test_smbclient_dfree "Test large disk" dfq "." "conf3 ." "1125899906842624 1024. 3000" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
    151164#basic quota test (SMB1 only)
    152165test_smbcquotas "Test user quota" confq1 $USERNAME "40960/4096000/3072000" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=NT1 || failed=`expr $failed + 1`
    153166
    154167#quota limit > disk size, remaining quota > disk free
    155 test_smbclient_dfree "Test dfree share root df vs quota case 1" "." "confdfq1 ." "80 1024. 40" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     168test_smbclient_dfree "Test dfree share root df vs quota case 1" dfq "." "confdfq1 ." "80 1024. 40" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
    156169#quota limit > disk size, remaining quota < disk free
    157 test_smbclient_dfree "Test dfree share root df vs quota case 2" "." "confdfq2 ." "80 1024. 12" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     170test_smbclient_dfree "Test dfree share root df vs quota case 2" dfq "." "confdfq2 ." "80 1024. 12" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
    158171#quota limit < disk size, remaining quota > disk free
    159 test_smbclient_dfree "Test dfree share root df vs quota case 3" "." "confdfq3 ." "160 1024. 40" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     172test_smbclient_dfree "Test dfree share root df vs quota case 3" dfq "." "confdfq3 ." "160 1024. 40" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
    160173#quota limit < disk size, remaining quota < disk free
    161 test_smbclient_dfree "Test dfree share root df vs quota case 4" "." "confdfq4 ." "160 1024. 12" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
    162 test_smbclient_dfree "Test dfree subdir df vs quota case 4" "subdir1" "confdfq4 subdir1" "160 1024. 12" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     174test_smbclient_dfree "Test dfree share root df vs quota case 4" dfq "." "confdfq4 ." "160 1024. 12" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     175test_smbclient_dfree "Test dfree subdir df vs quota case 4" dfq "subdir1" "confdfq4 subdir1" "160 1024. 12" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
    163176
    164177#quota-->disk free special cases
    165 test_smbclient_dfree "Test quota->dfree edquot" "subdir1" "edquot subdir1" "164 1024. 0" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
    166 test_smbclient_dfree "Test quota->dfree soft limit" "subdir1" "slimit subdir1" "168 1024. 0" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
    167 test_smbclient_dfree "Test quota->dfree hard limit" "subdir1" "hlimit subdir1" "180 1024. 0" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
    168 test_smbclient_dfree "Test quota->dfree inode soft limit" "subdir1" "islimit subdir1" "148 1024. 0" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
    169 test_smbclient_dfree "Test quota->dfree inode hard limit" "subdir1" "ihlimit subdir1" "148 1024. 0" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
    170 test_smbclient_dfree "Test quota->dfree err try group" "subdir1" "trygrp1 subdir1" "240 1024. 20" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
    171 test_smbclient_dfree "Test quota->dfree no-quota try group" "subdir1" "trygrp2 subdir1" "240 1024. 16" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     178test_smbclient_dfree "Test quota->dfree edquot" dfq "subdir1" "edquot subdir1" "164 1024. 0" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     179test_smbclient_dfree "Test quota->dfree soft limit" dfq "subdir1" "slimit subdir1" "168 1024. 0" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     180test_smbclient_dfree "Test quota->dfree hard limit" dfq "subdir1" "hlimit subdir1" "180 1024. 0" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     181test_smbclient_dfree "Test quota->dfree inode soft limit" dfq "subdir1" "islimit subdir1" "148 1024. 0" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     182test_smbclient_dfree "Test quota->dfree inode hard limit" dfq "subdir1" "ihlimit subdir1" "148 1024. 0" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     183test_smbclient_dfree "Test quota->dfree err try group" dfq "subdir1" "trygrp1 subdir1" "240 1024. 20" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     184test_smbclient_dfree "Test quota->dfree no-quota try group" dfq "subdir1" "trygrp2 subdir1" "240 1024. 16" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     185
     186#quota configured but not enforced
     187test_smbclient_dfree "Test dfree share root quota not enforced" dfq "." "notenforce ." "320 1024. 40" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     188
     189#FS quota not implemented (NFS case)
     190test_smbclient_dfree "Test dfree share root FS quota not implemented" dfq "." "nfs ." "160 1024. 12" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     191
     192#test for dfree when owner is inherited
     193#setup two folders with different owners
     194rm -rf $WORKDIR/subdir3/*
     195for d in / subdir3
     196do
     197    $VALGRIND $smbcacls -U$USERNAME%$PASSWORD -D "ACL:$SERVER\user1:ALLOWED/0x0/FULL" //$SERVER/dfq $d > /dev/null 2>&1
     198    $VALGRIND $smbcacls -U$USERNAME%$PASSWORD -a "ACL:$SERVER\user1:ALLOWED/0x0/FULL" //$SERVER/dfq $d || failed=`expr $failed + 1`
     199    $VALGRIND $smbcacls -U$USERNAME%$PASSWORD -D "ACL:$SERVER\user2:ALLOWED/0x0/FULL" //$SERVER/dfq $d > /dev/null 2>&1
     200    $VALGRIND $smbcacls -U$USERNAME%$PASSWORD -a "ACL:$SERVER\user2:ALLOWED/0x0/FULL" //$SERVER/dfq $d || failed=`expr $failed + 1`
     201done
     202
     203$VALGRIND $smbclient //$SERVER/dfq -c "cd subdir3; mkdir user1" -Uuser1%$PASSWORD --option=clientmaxprotocol=SMB3 > /dev/null 2>&1 || failed=`expr $failed + 1`
     204$VALGRIND $smbclient //$SERVER/dfq -c "cd subdir3; mkdir user2" -Uuser2%$PASSWORD --option=clientmaxprotocol=SMB3 > /dev/null 2>&1 || failed=`expr $failed + 1`
     205#test quotas
     206test_smbclient_dfree "Test dfree without inherit owner - user1 at user1" \
     207    dfq "subdir3/user1" "confdfqp subdir3/user1 confdfqp subdir3/user2" "160 1024. 16" \
     208    -Uuser1%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     209test_smbclient_dfree "Test dfree without inherit owner - user1 at user2" \
     210    dfq "subdir3/user2" "confdfqp subdir3/user1 confdfqp subdir3/user2" "160 1024. 16" \
     211    -Uuser1%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     212test_smbclient_dfree "Test dfree with inherit owner - user1 at user1" \
     213    dfq_owner "subdir3/user1" "confdfqp subdir3/user1 confdfqp subdir3/user2" "160 1024. 16" \
     214    -Uuser1%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
     215test_smbclient_dfree "Test dfree with inherit owner - user1 at user2" \
     216    dfq_owner "subdir3/user2" "confdfqp subdir3/user1 confdfqp subdir3/user2" "164 1024. 20" \
     217    -Uuser1%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
    172218
    173219setup_conf
  • vendor/current/source3/script/tests/test_shadow_copy.sh

    r988 r989  
    4343    local version
    4444    local destdir
     45    local content
    4546    rootdir=$1
    4647    prefix=$2
    4748    version=$3
     49    content=$4
    4850    if [ -n "$prefix" ] ; then
    4951        destdir=$rootdir/$prefix
     
    5759        # for non-snapshot version, create legit files
    5860        # so that wide-link checks focus on snapshot files
    59         touch $destdir/foo
     61        echo "$content" > $destdir/foo
    6062        mkdir -p $destdir/bar
    61         touch $destdir/bar/baz
    62         touch $destdir/bar/lfoo
    63         touch $destdir/bar/letcpasswd
    64         touch $destdir/bar/loutside
     63        echo "$content" > $destdir/bar/baz
     64        echo "$content" > $destdir/bar/lfoo
     65        echo "$content" > $destdir/bar/letcpasswd
     66        echo "$content" > $destdir/bar/loutside
    6567    elif [ "$version" = "fullsnap" ] ; then
    6668        #snapshot files
    67         touch $destdir/foo
     69        echo "$content" > $destdir/foo
    6870        mkdir -p $destdir/bar
    69         touch $destdir/bar/baz
     71        echo "$content" > $destdir/bar/baz
    7072        ln -fs ../foo $destdir/bar/lfoo
    7173        ln -fs /etc/passwd $destdir/bar/letcpasswd
    7274        ln -fs ../../outside $destdir/bar/loutside
    73         touch `dirname $destdir`/outside
     75        echo "$content" > `dirname $destdir`/outside
    7476    else #subshare snapshot - at bar
    75         touch $destdir/baz
     77        echo "$content" > $destdir/baz
    7678        ln -fs ../foo $destdir/lfoo
    7779        ln -fs /etc/passwd $destdir/letcpasswd
    7880        ln -fs ../../outside $destdir/loutside
    79         touch `dirname $destdir`/../outside
     81        echo "$content" > `dirname $destdir`/../outside
    8082    fi
    8183
     
    118120        snapname=${SNAPSHOTS[$i]}
    119121        mkdir $snapdir/$snapname
    120         build_files $snapdir/$snapname "$prefix" $version
     122        build_files $snapdir/$snapname "$prefix" $version "$snapname"
    121123    done
    122124}
     
    128130    local path
    129131    local expected_count
     132    local skip_content
    130133    local versions
     134    local tstamps
     135    local tstamp
     136    local content
     137    local is_dir
    131138
    132139    share=$1
    133140    path=$2
    134141    expected_count=$3
     142    skip_content=$4
    135143    versions=`$SMBCLIENT -U$USERNAME%$PASSWORD "//$SERVER/$share" -I $SERVER_IP -c "allinfo $path" | grep "^create_time:" | wc -l`
    136     if [ "$versions" = "$expected_count" ] ; then
    137         true
    138     else
     144    if [ "$versions" != "$expected_count" ] ; then
    139145        echo "expected $expected_count versions of $path, got $versions"
    140         false
    141     fi
     146        return 1
     147    fi
     148
     149    is_dir=0
     150    $SMBCLIENT -U$USERNAME%$PASSWORD "//$SERVER/$share" -I $SERVER_IP -c "allinfo $path" | grep "^attributes:.*D" && is_dir=1
     151    if [ $is_dir = 1 ] ; then
     152        skip_content=1
     153    fi
     154
     155    #readable snapshots
     156    tstamps=`$SMBCLIENT -U$USERNAME%$PASSWORD "//$SERVER/$share" -I $SERVER_IP -c "allinfo $path" | awk '/^@GMT-/ {snapshot=$1} /^create_time:/ {printf "%s\n", snapshot}'`
     157    for tstamp in $tstamps ; do
     158        if [ $is_dir = 0 ] ;
     159        then
     160            if ! $SMBCLIENT -U$USERNAME%$PASSWORD "//$SERVER/$share" -I $SERVER_IP -c "get $tstamp\\$path $WORKDIR/foo" ; then
     161                echo "Failed getting \\\\$SERVER\\$share\\$tstamp\\$path"
     162                return 1
     163            fi
     164        else
     165            if ! $SMBCLIENT -U$USERNAME%$PASSWORD "//$SERVER/$share" -I $SERVER_IP -c "ls $tstamp\\$path\\*" ; then
     166                echo "Failed listing \\\\$SERVER\\$share\\$tstamp\\$path"
     167                return 1
     168            fi
     169        fi
     170
     171        #also check the content, but not for wide links
     172        if [ "x$skip_content" != "x1" ] ; then
     173            content=`cat $WORKDIR/foo`
     174            if [ "$content" != "$tstamp" ] ; then
     175                echo "incorrect content of \\\\$SERVER\\$share\\$tstamp\\$path expected [$tstamp]  got [$content]"
     176                return 1
     177            fi
     178        fi
     179    done
     180
     181    #non-readable snapshots
     182    tstamps=`$SMBCLIENT -U$USERNAME%$PASSWORD "//$SERVER/$share" -I $SERVER_IP -c "allinfo $path" | \
     183        awk '/^@GMT-/ {if (snapshot!=""){printf "%s\n", snapshot} ; snapshot=$1} /^create_time:/ {snapshot=""} END {if (snapshot!=""){printf "%s\n", snapshot}}'`
     184    for tstamp in $tstamps ; do
     185        if [ $is_dir = 0 ] ;
     186        then
     187            if $SMBCLIENT -U$USERNAME%$PASSWORD "//$SERVER/$share" -I $SERVER_IP -c "get $tstamp\\$path $WORKDIR/foo" ; then
     188                echo "Unexpected success getting \\\\$SERVER\\$share\\$tstamp\\$path"
     189                return 1
     190            fi
     191        else
     192            if $SMBCLIENT -U$USERNAME%$PASSWORD "//$SERVER/$share" -I $SERVER_IP -c "ls $tstamp\\$path\\*" ; then
     193                echo "Unexpected success listing \\\\$SERVER\\$share\\$tstamp\\$path"
     194                return 1
     195            fi
     196        fi
     197    done
    142198}
    143199
     
    195251
    196252    testit "$msg - abs symlink outside" \
    197         test_count_versions $share bar/letcpasswd $ncopies_blocked || \
     253        test_count_versions $share bar/letcpasswd $ncopies_blocked  1 || \
    198254        failed=`expr $failed + 1`
    199255
    200256    testit "$msg - rel symlink outside" \
    201         test_count_versions $share bar/loutside $ncopies_blocked || \
     257        test_count_versions $share bar/loutside $ncopies_blocked 1 || \
     258        failed=`expr $failed + 1`
     259
     260    testit "$msg - list directory" \
     261        test_count_versions $share bar $ncopies_allowed || \
    202262        failed=`expr $failed + 1`
    203263}
     
    263323
    264324#build "latest" files
    265 build_files $WORKDIR/mount base/share "latest"
     325build_files $WORKDIR/mount base/share "latest" "latest"
    266326
    267327failed=0
  • vendor/current/source3/script/tests/test_smbclient_ntlm.sh

    r988 r989  
    3838        testit "smbclient baduser.badpassword.NT1NEW.guest" $SMBCLIENT //$SERVER/IPC\$ $CONFIGURATION -Ubaduser%badpassword -mNT1 -c quit $ADDARGS
    3939        testit "smbclient baduser.badpassword.SMB3.guest" $SMBCLIENT //$SERVER/IPC\$ $CONFIGURATION -Ubaduser%badpassword -mSMB3 -c quit $ADDARGS
     40
     41        testit_expect_failure "smbclient baduser.badpassword.NT1OLD.signfail" $SMBCLIENT //$SERVER/IPC\$ $CONFIGURATION -Ubaduser%badpassword -mNT1 --option=clientusespnego=no --option=clientntlmv2auth=no --signing=required -c quit $ADDARGS
     42        testit_expect_failure "smbclient baduser.badpassword.NT1NEW.signfail" $SMBCLIENT //$SERVER/IPC\$ $CONFIGURATION -Ubaduser%badpassword -mNT1 --signing=required -c quit $ADDARGS
     43        testit_expect_failure "smbclient baduser.badpassword.SMB3.signfail" $SMBCLIENT //$SERVER/IPC\$ $CONFIGURATION -Ubaduser%badpassword -mSMB3 --signing=required -c quit $ADDARGS
    4044fi
Note: See TracChangeset for help on using the changeset viewer.