]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
testprogs: Reformat test_rpcclient_schannel.sh
authorAndreas Schneider <asn@samba.org>
Fri, 22 Apr 2022 13:46:05 +0000 (15:46 +0200)
committerPavel Filipensky <pfilipensky@samba.org>
Wed, 10 Aug 2022 09:22:30 +0000 (09:22 +0000)
shfmt -w -p -i 0 -fn testprogs/blackbox/test_rpcclient_schannel.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
testprogs/blackbox/test_rpcclient_schannel.sh

index 9981d4dab5f329833d85facecfe3465a0ef96257..798d23506a59faa20251fe567cfda332cfdfa617 100755 (executable)
@@ -3,10 +3,10 @@
 # Copyright (c) 2021      Andreas Schneider <asn@samba.org>
 
 if [ $# -lt 8 ]; then
-    cat << EOF
+       cat <<EOF
 Usage: test_rpcclient_schannel.sh DOMAIN REALM USERNAME PASSWORD SERVER PREFIX CONFIGURATION TESTENV
 EOF
-    exit 1
+       exit 1
 fi
 
 DOMAIN=$1
@@ -30,65 +30,65 @@ samba_rpcclient="${samba_bindir}/rpcclient"
 
 test_rpc_getusername()
 {
-    cmd="$samba_rpcclient ncacn_np:${SERVER}[schannel] --machine-pass --configfile=${CONFIGURATION} -c getusername 2>&1"
-    out=$(eval "$cmd")
-    ret=$?
-    if [ $ret -ne 0 ]; then
-        echo "Failed to connect! Error: $ret"
-        echo "$out"
-        return 1
-    fi
-
-    echo "$out" | grep -q "Account Name: ANONYMOUS LOGON, Authority Name: NT AUTHORITY"
-    ret=$?
-    if [ $ret -ne 0 ]; then
-        echo "Incorrect account/authority name! Error: $ret"
-        echo "$out"
-        return 1
-    fi
-
-    return 0
+       cmd="$samba_rpcclient ncacn_np:${SERVER}[schannel] --machine-pass --configfile=${CONFIGURATION} -c getusername 2>&1"
+       out=$(eval "$cmd")
+       ret=$?
+       if [ $ret -ne 0 ]; then
+               echo "Failed to connect! Error: $ret"
+               echo "$out"
+               return 1
+       fi
+
+       echo "$out" | grep -q "Account Name: ANONYMOUS LOGON, Authority Name: NT AUTHORITY"
+       ret=$?
+       if [ $ret -ne 0 ]; then
+               echo "Incorrect account/authority name! Error: $ret"
+               echo "$out"
+               return 1
+       fi
+
+       return 0
 }
 
 test_rpc_lookupsids()
 {
-    cmd="$samba_rpcclient ncacn_ip_tcp:${SERVER}[schannel] --machine-pass --configfile=${CONFIGURATION} -c 'lookupsids3 S-1-1-0' 2>&1"
-    out=$(eval "$cmd")
-    ret=$?
-    if [ $ret -ne 0 ]; then
-        echo "Failed to connect! Error: $ret"
-        echo "$out"
-        return 1
-    fi
-
-    echo "$out" | grep -q "S-1-1-0 Everyone"
-    ret=$?
-    if [ $ret -ne 0 ]; then
-        echo "Incorrect account/authority name! Error: $ret"
-        echo "$out"
-        return 1
-    fi
-
-    return 0
+       cmd="$samba_rpcclient ncacn_ip_tcp:${SERVER}[schannel] --machine-pass --configfile=${CONFIGURATION} -c 'lookupsids3 S-1-1-0' 2>&1"
+       out=$(eval "$cmd")
+       ret=$?
+       if [ $ret -ne 0 ]; then
+               echo "Failed to connect! Error: $ret"
+               echo "$out"
+               return 1
+       fi
+
+       echo "$out" | grep -q "S-1-1-0 Everyone"
+       ret=$?
+       if [ $ret -ne 0 ]; then
+               echo "Incorrect account/authority name! Error: $ret"
+               echo "$out"
+               return 1
+       fi
+
+       return 0
 }
 
 testit "ncacn_np.getusername" \
-    test_rpc_getusername || \
-    failed=$((failed + 1))
+       test_rpc_getusername ||
+       failed=$((failed + 1))
 
 if [[ "$TESTENV" == "ad_member_fips"* ]]; then
-    unset GNUTLS_FORCE_FIPS_MODE
+       unset GNUTLS_FORCE_FIPS_MODE
 
-    testit "ncacn_np.getusername.fips" \
-        test_rpc_getusername || \
-        failed=$((failed + 1))
+       testit "ncacn_np.getusername.fips" \
+               test_rpc_getusername ||
+               failed=$((failed + 1))
 
-    GNUTLS_FORCE_FIPS_MODE=1
-    export GNUTLS_FORCE_FIPS_MODE
+       GNUTLS_FORCE_FIPS_MODE=1
+       export GNUTLS_FORCE_FIPS_MODE
 fi
 
 testit "ncacn_ip_tcp.lookupsids" \
-    test_rpc_lookupsids || \
-    failed=$((failed + 1))
+       test_rpc_lookupsids ||
+       failed=$((failed + 1))
 
 exit ${failed}