]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:tests: Reformat test_printing_var_exp.sh
authorAndreas Schneider <asn@samba.org>
Fri, 22 Apr 2022 13:34:10 +0000 (15:34 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 8 Jun 2022 13:14:47 +0000 (13:14 +0000)
shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source3/script/tests/test_printing_var_exp.sh

index 12231c82c41ee29054f3c264a1826d90c6f1144b..3a5925045d2da9bc28166c7e2aa4c49aab377d05 100755 (executable)
@@ -1,10 +1,10 @@
 #!/bin/sh
 
 if [ $# -lt 4 ]; then
-cat <<EOF
+       cat <<EOF
 Usage: test_smbspool.sh SERVER SERVER_IP DOMAIN USERNAME PASSWORD
 EOF
-exit 1;
+       exit 1
 fi
 
 SERVER="$1"
@@ -15,38 +15,39 @@ PASSWORD="$5"
 shift 5
 ADDARGS="$@"
 
-incdir=`dirname $0`/../../../testprogs/blackbox
+incdir=$(dirname $0)/../../../testprogs/blackbox
 . $incdir/subunit.sh
 . $incdir/common_test_fns.inc
 
 smbclient="$BINDIR/smbclient"
 
-test_var_expansion() {
+test_var_expansion()
+{
        logfile="${SELFTEST_TMPDIR}/${USER}_printing_var_exp.log"
 
        $smbclient -U $DOMAIN/$USERNAME%$PASSWORD \
-                  //$SERVER_IP/print_var_exp \
-                  -c "print $SRCDIR/testdata/printing/example.ps"
-       if [ $? -ne 0 ] ; then
-           rm -f "$logfile"
-           return 1
+               //$SERVER_IP/print_var_exp \
+               -c "print $SRCDIR/testdata/printing/example.ps"
+       if [ $? -ne 0 ]; then
+               rm -f "$logfile"
+               return 1
        fi
        cat "$logfile"
 
        grep "Windows user: $USERNAME" "$logfile"
-       if [ $? -ne 0 ] ; then
-           rm -f "$logfile"
-           return 1
+       if [ $? -ne 0 ]; then
+               rm -f "$logfile"
+               return 1
        fi
        grep "UNIX user: $USERNAME" "$logfile"
-       if [ $? -ne 0 ] ; then
-           rm -f "$logfile"
-           return 1
+       if [ $? -ne 0 ]; then
+               rm -f "$logfile"
+               return 1
        fi
        grep "Domain: $DOMAIN" "$logfile"
-       if [ $? -ne 0 ] ; then
-           rm -f "$logfile"
-           return 1
+       if [ $? -ne 0 ]; then
+               rm -f "$logfile"
+               return 1
        fi
 
        rm -f "$logfile"
@@ -54,7 +55,7 @@ test_var_expansion() {
 }
 
 testit "Test variable expansion for '%U', '%u' and '%D'" \
-       test_var_expansion \
-       || failed=$(expr $failed + 1)
+       test_var_expansion ||
+       failed=$(expr $failed + 1)
 
 exit $failed