]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:tests: Reformat test_dfree_command.sh
authorAndreas Schneider <asn@samba.org>
Fri, 22 Apr 2022 13:34:08 +0000 (15:34 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 5 May 2022 02:47:38 +0000 (02:47 +0000)
shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/script/tests/test_dfree_command.sh

index 715496d47d7fe64752b9d592a3d2571e5f591ec0..0a087aeccb549e4183a04e370139eb86846cb420 100755 (executable)
@@ -5,10 +5,10 @@
 #
 
 if [ $# -lt 6 ]; then
-cat <<EOF
+       cat <<EOF
 Usage: test_dfree_command.sh SERVER DOMAIN USERNAME PASSWORD PREFIX SMBCLIENT
 EOF
-exit 1;
+       exit 1
 fi
 
 SERVER=$1
@@ -22,17 +22,18 @@ protocol=$7
 shift 7
 failed=0
 
-incdir=`dirname $0`/../../../testprogs/blackbox
+incdir=$(dirname $0)/../../../testprogs/blackbox
 . $incdir/subunit.sh
 
-test_smbclient_dfree() {
+test_smbclient_dfree()
+{
        name="$1"
        share="$2"
        cmd="$3"
-    expected="$4"
+       expected="$4"
+       shift
        shift
        shift
-    shift
        subunit_start_test "$name"
        output=$($VALGRIND $smbclient //$SERVER/$share -c "$cmd" $@ 2>&1)
        status=$?
@@ -50,17 +51,17 @@ test_smbclient_dfree() {
 }
 
 if [ $protocol = "SMB3" ]; then
-       test_smbclient_dfree "Test dfree command share root SMB3" dfree "l" "2000 1024. 20" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
-       test_smbclient_dfree "Test dfree command subdir1 SMB3" dfree "cd subdir1; l" "8000 1024. 80" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
-       test_smbclient_dfree "Test dfree command subdir2 SMB3" dfree "cd subdir2; l" "32000 1024. 320" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=`expr $failed + 1`
+       test_smbclient_dfree "Test dfree command share root SMB3" dfree "l" "2000 1024. 20" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=$(expr $failed + 1)
+       test_smbclient_dfree "Test dfree command subdir1 SMB3" dfree "cd subdir1; l" "8000 1024. 80" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=$(expr $failed + 1)
+       test_smbclient_dfree "Test dfree command subdir2 SMB3" dfree "cd subdir2; l" "32000 1024. 320" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=SMB3 || failed=$(expr $failed + 1)
 
 elif [ $protocol = "NT1" ]; then
-       test_smbclient_dfree "Test dfree command share root NT1" dfree "l" "2000 1024. 20" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=NT1 || failed=`expr $failed + 1`
-#SMB1 queries disk usage stat on the share's root, regardless of working directory
-       test_smbclient_dfree "Test dfree command subdir1 NT1" dfree "cd subdir1; l" "2000 1024. 20" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=NT1 || failed=`expr $failed + 1`
+       test_smbclient_dfree "Test dfree command share root NT1" dfree "l" "2000 1024. 20" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=NT1 || failed=$(expr $failed + 1)
+       #SMB1 queries disk usage stat on the share's root, regardless of working directory
+       test_smbclient_dfree "Test dfree command subdir1 NT1" dfree "cd subdir1; l" "2000 1024. 20" -U$USERNAME%$PASSWORD --option=clientmaxprotocol=NT1 || failed=$(expr $failed + 1)
 
 else
-       echo "unsupported protocol $protocol" |  subunit_fail_test "Test dfree command"
-       $failed=`expr $failed + 1`
+       echo "unsupported protocol $protocol" | subunit_fail_test "Test dfree command"
+       $failed=$(expr $failed + 1)
 fi
 exit $failed