libnet: Fix Coverity ID 1634803 Dereference after null check
[samba4-gss.git] / source3 / script / tests / test_fruit_resource_stream.sh
blob7e99ea3de5c68ae705076c2bf4354c390bb2deed
1 #!/bin/sh
3 # this tests copying a file and then deleting it
4 # to a share using fruit:resource = stream
5 # BUG: https://bugzilla.samba.org/show_bug.cgi?id=15099
7 if [ $# -lt 6 ]; then
8 cat <<EOF
9 Usage: $0 SERVER SHARE USERNAME PASSWORD LOCAL_PATH SMBCLIENT
10 EOF
11 exit 1
14 SERVER="${1}"
15 SHARE="${2}"
16 USERNAME="${3}"
17 PASSWORD="${4}"
18 LOCAL_PATH="${5}"
19 SMBCLIENT="${6}"
20 SMBCLIENT="$VALGRIND ${SMBCLIENT}"
22 incdir=$(dirname "$0")/../../../testprogs/blackbox
23 . "$incdir/subunit.sh"
25 failed=0
27 put_then_delete_file()
29 $SMBCLIENT //"$SERVER"/"$SHARE" -U"$USERNAME"%"$PASSWORD" -c "lcd $LOCAL_PATH; put src dst; rm dst" >/dev/null 2>&1
32 rm -f "$LOCAL_PATH/src"
33 rm -f "$LOCAL_PATH/dst"
34 touch "$LOCAL_PATH/src"
36 testit "resource_stream" put_then_delete_file || failed=$((failed + 1))
38 rm -f "$LOCAL_PATH/src"
39 rm -f "$LOCAL_PATH/dst"
41 testok "$0" "$failed"