diff --git a/testprogs/blackbox/test_client_etypes.sh b/testprogs/blackbox/test_client_etypes.sh index 020df804075..0389cb39d67 100755 --- a/testprogs/blackbox/test_client_etypes.sh +++ b/testprogs/blackbox/test_client_etypes.sh @@ -1,8 +1,8 @@ if [ $# -lt 6 ]; then -cat < /dev/null 2>&1 || ! which sha1sum > /dev/null 2>&1 ; then - subunit_start_test "client encryption types" - subunit_skip_test "client encryption types" </dev/null 2>&1 || ! which sha1sum >/dev/null 2>&1; then + subunit_start_test "client encryption types" + subunit_skip_test "client encryption types" </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 @@ -48,36 +48,35 @@ net_tool="$BINDIR/net --configfile=$BASEDIR/$WORKDIR/client.conf --option=securi pcap_file=$BASEDIR/$WORKDIR/test.pcap export SOCKET_WRAPPER_PCAP_FILE=$pcap_file -testit "join" $VALGRIND $net_tool ads join -U$DC_USERNAME%$DC_PASSWORD --use-kerberos=required || failed=`expr $failed + 1` +testit "join" $VALGRIND $net_tool ads join -U$DC_USERNAME%$DC_PASSWORD --use-kerberos=required || 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) #The leave command does not use the locally-generated #krb5.conf export SOCKET_WRAPPER_PCAP_FILE= -testit "leave" $VALGRIND $net_tool ads leave -U$DC_USERNAME%$DC_PASSWORD || failed=`expr $failed + 1` +testit "leave" $VALGRIND $net_tool ads leave -U$DC_USERNAME%$DC_PASSWORD || failed=$(expr $failed + 1) # # Older versions of tshark do not support -Y option, # They use -R which cannot be used with recent versions... # -if ! tshark -r $pcap_file -nVY "kerberos" > /dev/null 2>&1 ; then - subunit_start_test "client encryption types" - subunit_skip_test "client encryption types" </dev/null 2>&1; then + subunit_start_test "client encryption types" + subunit_skip_test "client encryption types" <