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

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

index fcd266d904b607618fffd7cd000a036e07627514..8bcd7cbc680e4255ebee45d85e1fd9758dadb743 100755 (executable)
@@ -6,10 +6,10 @@
 #
 
 if [ $# -lt 7 ]; then
-cat <<EOF
+       cat <<EOF
 Usage: $0 SERVER USERNAME PASSWORD REALM DOMAIN PREFIX
 EOF
-exit 1;
+       exit 1
 fi
 
 SERVER=$1
@@ -22,7 +22,7 @@ CONFIGURATION=$7
 shift 7
 
 failed=0
-. `dirname $0`/subunit.sh
+. $(dirname $0)/subunit.sh
 
 samba_bindir="$BINDIR"
 samba_testparm="$BINDIR/testparm"
@@ -33,30 +33,30 @@ configuration="${CONFIGURATION##*=}"
 
 test_weak_crypto_allowed()
 {
-    local testparm_stderr_output_path="$PREFIX/testparm_stderr_output"
+       local testparm_stderr_output_path="$PREFIX/testparm_stderr_output"
 
-    $samba_testparm --suppress-prompt $configuration 2>$testparm_stderr_output_path >/dev/null
+       $samba_testparm --suppress-prompt $configuration 2>$testparm_stderr_output_path >/dev/null
 
-    grep "Weak crypto is allowed" $testparm_stderr_output_path >/dev/null 2>&1
-    if [ $ret -ne 0 ]; then
-        echo "Invalid crypto state:"
-        cat $testparm_stderr_output_path
-        rm -f $testparm_stderr_output_path
-        return 1
-    fi
+       grep "Weak crypto is allowed" $testparm_stderr_output_path >/dev/null 2>&1
+       if [ $ret -ne 0 ]; then
+               echo "Invalid crypto state:"
+               cat $testparm_stderr_output_path
+               rm -f $testparm_stderr_output_path
+               return 1
+       fi
 
-    rm -f $testparm_stderr_output_path
+       rm -f $testparm_stderr_output_path
 
-    return 0
+       return 0
 }
 
 unset GNUTLS_FORCE_FIPS_MODE
 
 # Checks that testparm reports: Weak crypto is disallowed
-testit "testparm-weak-crypto" test_weak_crypto_allowed || failed=`expr $failed + 1`
+testit "testparm-weak-crypto" test_weak_crypto_allowed || failed=$(expr $failed + 1)
 
 # We should not be allowed to use NTLM for connecting
-testit_expect_failure "rpclient.ntlm" $samba_rpcclient ncacn_np:$SERVER_IP[ntlm] -U$USERNAME%$PASSWORD -c "getusername" && failed=`expr $failed + 1`
+testit_expect_failure "rpclient.ntlm" $samba_rpcclient ncacn_np:$SERVER_IP[ntlm] -U$USERNAME%$PASSWORD -c "getusername" && failed=$(expr $failed + 1)
 
 GNUTLS_FORCE_FIPS_MODE=1
 export GNUTLS_FORCE_FIPS_MODE