From 8a4a8b7a3a35b9445dd77794d9d04efed451cf37 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 22 Apr 2022 15:46:05 +0200 Subject: [PATCH] testprogs: Reformat test_net_ads_fips.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit shfmt -w -p -i 0 -fn testprogs/blackbox/test_net_ads_fips.sh Signed-off-by: Andreas Schneider Reviewed-by: Pavel Filipenský --- testprogs/blackbox/test_net_ads_fips.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/testprogs/blackbox/test_net_ads_fips.sh b/testprogs/blackbox/test_net_ads_fips.sh index 57df650eadd..8d21e73bb29 100755 --- a/testprogs/blackbox/test_net_ads_fips.sh +++ b/testprogs/blackbox/test_net_ads_fips.sh @@ -1,8 +1,8 @@ if [ $# -lt 4 ]; then -cat </dev/null | sha1sum | cut -b 1-10` +HOSTNAME=$(dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10) -RUNDIR=`pwd` +RUNDIR=$(pwd) cd $BASEDIR -WORKDIR=`mktemp -d -p .` -WORKDIR=`basename $WORKDIR` +WORKDIR=$(mktemp -d -p .) +WORKDIR=$(basename $WORKDIR) cp -a client/* $WORKDIR/ sed -ri "s@(dir|directory) = (.*)/client/@\1 = \2/$WORKDIR/@" $WORKDIR/client.conf sed -ri "s/netbios name = .*/netbios name = $HOSTNAME/" $WORKDIR/client.conf @@ -27,16 +27,16 @@ failed=0 net_tool="$BINDIR/net --configfile=$BASEDIR/$WORKDIR/client.conf --option=security=ads" # Load test functions -. `dirname $0`/subunit.sh +. $(dirname $0)/subunit.sh # This make sure we are able to join AD in FIPS mode with Kerberos (NTLM doesn't work in FIPS mode). -testit "join" $VALGRIND $net_tool ads join --use-kerberos=required -U$DC_USERNAME%$DC_PASSWORD || failed=`expr $failed + 1` +testit "join" $VALGRIND $net_tool ads join --use-kerberos=required -U$DC_USERNAME%$DC_PASSWORD || failed=$(expr $failed + 1) -testit "testjoin" $VALGRIND $net_tool ads testjoin -P --use-kerberos=required || failed=`expr $failed + 1` +testit "testjoin" $VALGRIND $net_tool ads testjoin -P --use-kerberos=required || failed=$(expr $failed + 1) -testit "changetrustpw" $VALGRIND $net_tool ads changetrustpw || failed=`expr $failed + 1` +testit "changetrustpw" $VALGRIND $net_tool ads changetrustpw || failed=$(expr $failed + 1) -testit "leave" $VALGRIND $net_tool ads leave --use-kerberos=required -U$DC_USERNAME%$DC_PASSWORD || failed=`expr $failed + 1` +testit "leave" $VALGRIND $net_tool ads leave --use-kerberos=required -U$DC_USERNAME%$DC_PASSWORD || failed=$(expr $failed + 1) rm -rf $BASEDIR/$WORKDIR