s3: tests: smbclient test to ensure we can create and see a :foobar stream on the...
authorJeremy Allison <jra@samba.org>
Wed, 16 Sep 2015 23:12:15 +0000 (16:12 -0700)
committerRalph Böhme <slow@samba.org>
Fri, 18 Sep 2015 09:00:44 +0000 (11:00 +0200)
Regression test for:

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11522

Remember to remove the ARCHIVE attribute from the toplevel
share when done (can only be done over SMB2+).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Sep 18 11:00:44 CEST 2015 on sn-devel-104

source3/script/tests/test_smbclient_s3.sh

index 69c7452c1f54abc1af8a04e979cf68efc75acde9..c073b43de604061e39c62b8e7f72d215c5596d55 100755 (executable)
@@ -971,6 +971,38 @@ EOF
     fi
 }
 
+# Test creating a stream on the root of the share directory filname - :foobar
+test_toplevel_stream()
+{
+    tmpfile=$PREFIX/smbclient_interactive_prompt_commands
+    cat > $tmpfile <<EOF
+put ${PREFIX}/smbclient_interactive_prompt_commands :foobar
+allinfo \\
+setmode \\ -a
+quit
+EOF
+    cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP -mSMB3 $ADDARGS < $tmpfile 2>&1'
+    eval echo "$cmd"
+    out=`eval $cmd`
+    ret=$?
+    rm -f $tmpfile
+
+    if [ $ret != 0 ] ; then
+       echo "$out"
+       echo "failed creating toplevel stream :foobar with error $ret"
+       false
+       return
+    fi
+
+    echo "$out" | grep '^stream:.*:foobar'
+    ret=$?
+    if [ $ret != 0 ] ; then
+       echo "$out"
+       echo "failed creating toplevel stream :foobar"
+       false
+    fi
+}
+
 
 LOGDIR_PREFIX=test_smbclient_s3
 
@@ -1059,6 +1091,10 @@ testit "server-side file copy" \
     test_scopy || \
     failed=`expr $failed + 1`
 
+testit "creating a :stream at root of share" \
+    test_toplevel_stream || \
+    failed=`expr $failed + 1`
+
 testit "rm -rf $LOGDIR" \
     rm -rf $LOGDIR || \
     failed=`expr $failed + 1`