The branch, master has been updated via 8e701978a70 s3:tests: Reformat test_rpcclientsrvsvc.sh via c4b343e54b6 s3:tests: Reformat test_rpcclient_samlogon.sh via 48e1458bdbf s3:tests: Reformat test_rpcclient_pw_nt_hash.sh via b923da58578 s3:tests: Reformat test_rpcclient_netsessenum.sh via 24638a2e5e3 s3:tests: Reformat test_rpcclient_lookup.sh via 66577ad12db s3:tests: Reformat test_rpcclient_dfs.sh via 7f3b7a38e80 s3:tests: Reformat test_rpcclient.sh via e4eecb31d61 s3:tests: Reformat test_resolvconf.sh via e6225d77a60 s3:tests: Reformat test_registry_upgrade.sh via 3b6558d4e38 s3:tests: Reformat test_pthreadpool.sh via 07875d85696 s3:tests: Reformat test_printing_var_exp.sh via 162a803d2a7 s3:tests: Reformat test_preserve_case.sh via e01f7d72507 s3:tests: Reformat test_open_eintr.sh via 478ed598f9e s3:tests: Reformat test_offline.sh via ae8f5dec1fa s3:tests: Reformat test_netfileenum.sh from 1b6d675feb5 lib/smbconf: expose smbconf error codes to python wrapper
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 8e701978a70d8323e0004be86e448c8c02341aa8 Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:10 2022 +0200 s3:tests: Reformat test_rpcclientsrvsvc.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Guenther Deschner <g...@samba.org> Autobuild-User(master): Andreas Schneider <a...@cryptomilk.org> Autobuild-Date(master): Wed Jun 8 14:13:35 UTC 2022 on sn-devel-184 commit c4b343e54b66207ca9b6cfb1d63cb3558d69a5a0 Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:10 2022 +0200 s3:tests: Reformat test_rpcclient_samlogon.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Guenther Deschner <g...@samba.org> commit 48e1458bdbfacbc1d37bc9e9e197f5e7e6b0e238 Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:10 2022 +0200 s3:tests: Reformat test_rpcclient_pw_nt_hash.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Guenther Deschner <g...@samba.org> commit b923da58578d28424781378072f3d38a69fb9756 Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:10 2022 +0200 s3:tests: Reformat test_rpcclient_netsessenum.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Guenther Deschner <g...@samba.org> commit 24638a2e5e3cd669d8488618d94059b977f6172b Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:10 2022 +0200 s3:tests: Reformat test_rpcclient_lookup.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Guenther Deschner <g...@samba.org> commit 66577ad12db1cdf61ff5ba479a1992073ef19929 Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:10 2022 +0200 s3:tests: Reformat test_rpcclient_dfs.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Guenther Deschner <g...@samba.org> commit 7f3b7a38e80ce3f03c7caa728e0880fe080b9647 Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:10 2022 +0200 s3:tests: Reformat test_rpcclient.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Guenther Deschner <g...@samba.org> commit e4eecb31d61de5ba66216ec9486faca87b82682f Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:10 2022 +0200 s3:tests: Reformat test_resolvconf.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Guenther Deschner <g...@samba.org> commit e6225d77a60e3da41d7a456885a2e48a574f907c Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:10 2022 +0200 s3:tests: Reformat test_registry_upgrade.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Guenther Deschner <g...@samba.org> commit 3b6558d4e38f9d56de871240514db7ac66e9960a Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:10 2022 +0200 s3:tests: Reformat test_pthreadpool.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Guenther Deschner <g...@samba.org> commit 07875d856969847d017e40fcefc123188c9838b7 Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:10 2022 +0200 s3:tests: Reformat test_printing_var_exp.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Guenther Deschner <g...@samba.org> commit 162a803d2a7f7e7933e2b2e1a4d3f23d7b6b2804 Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:10 2022 +0200 s3:tests: Reformat test_preserve_case.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Guenther Deschner <g...@samba.org> commit e01f7d72507ea4f48103682d79d7a5f852b6cd1e Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:10 2022 +0200 s3:tests: Reformat test_open_eintr.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Guenther Deschner <g...@samba.org> commit 478ed598f9e8c59d69975f4f8c8c2db74efc357d Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:10 2022 +0200 s3:tests: Reformat test_offline.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Guenther Deschner <g...@samba.org> commit ae8f5dec1fa2633763e75b1204e2f239a6c833d7 Author: Andreas Schneider <a...@samba.org> Date: Fri Apr 22 15:34:10 2022 +0200 s3:tests: Reformat test_netfileenum.sh shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Guenther Deschner <g...@samba.org> ----------------------------------------------------------------------- Summary of changes: source3/script/tests/test_netfileenum.sh | 54 ++-- source3/script/tests/test_offline.sh | 10 +- source3/script/tests/test_open_eintr.sh | 38 +-- source3/script/tests/test_preserve_case.sh | 35 +-- source3/script/tests/test_printing_var_exp.sh | 41 +-- source3/script/tests/test_pthreadpool.sh | 12 +- source3/script/tests/test_registry_upgrade.sh | 279 ++++++++++----------- source3/script/tests/test_resolvconf.sh | 12 +- source3/script/tests/test_rpcclient.sh | 8 +- source3/script/tests/test_rpcclient_dfs.sh | 4 +- source3/script/tests/test_rpcclient_lookup.sh | 4 +- source3/script/tests/test_rpcclient_netsessenum.sh | 8 +- source3/script/tests/test_rpcclient_pw_nt_hash.sh | 8 +- source3/script/tests/test_rpcclient_samlogon.sh | 14 +- source3/script/tests/test_rpcclientsrvsvc.sh | 22 +- 15 files changed, 281 insertions(+), 268 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/script/tests/test_netfileenum.sh b/source3/script/tests/test_netfileenum.sh index ab0eb925dbb..3afc74b210c 100755 --- a/source3/script/tests/test_netfileenum.sh +++ b/source3/script/tests/test_netfileenum.sh @@ -5,16 +5,21 @@ # Copyright (C) 2020 Volker Lendecke if [ $# -lt 5 ]; then - echo Usage: $0 \ - SMBCLIENT RPCCLIENT NET SERVER SHARE -exit 1 + echo Usage: $0 \ + SMBCLIENT RPCCLIENT NET SERVER SHARE + exit 1 fi -SMBCLIENT="$1"; shift 1 -RPCCLIENT="$1"; shift 1 -NET="$1"; shift 1 -SERVER="$1"; shift 1 -SHARE="$1"; shift 1 +SMBCLIENT="$1" +shift 1 +RPCCLIENT="$1" +shift 1 +NET="$1" +shift 1 +SERVER="$1" +shift 1 +SHARE="$1" +shift 1 # Do not let deprecated option warnings muck this up SAMBA_DEPRECATED_SUPPRESS=1 @@ -30,10 +35,11 @@ cd $SELFTEST_TMPDIR || exit 1 rm -f smbclient-stdin smbclient-stdout smbclient-stderr mkfifo smbclient-stdin smbclient-stdout smbclient-stderr -CLI_FORCE_INTERACTIVE=1; export CLI_FORCE_INTERACTIVE +CLI_FORCE_INTERACTIVE=1 +export CLI_FORCE_INTERACTIVE ${SMBCLIENT} //${SERVER}/${SHARE} ${CONF} -U${USER}%${PASSWORD} \ - < smbclient-stdin > smbclient-stdout 2>smbclient-stderr & + <smbclient-stdin >smbclient-stdout 2>smbclient-stderr & CLIENT_PID=$! sleep 1 @@ -50,29 +56,29 @@ printf "open %s\\n" "$FILE" >&100 sleep 1 testit "Create builtin\\administrators group" \ - "${NET}" groupmap add \ - sid=S-1-5-32-544 unixgroup="${USER}"-group type=builtin || \ - failed=$((failed+1)) + "${NET}" groupmap add \ + sid=S-1-5-32-544 unixgroup="${USER}"-group type=builtin || + failed=$((failed + 1)) testit "Add ${USER} to builtin\\administrators" \ - "${NET}" groupmap addmem S-1-5-32-544 \ - $("${NET}" lookup name "${USER}" | cut -d' ' -f1) || \ - failed=$((failed+1)) + "${NET}" groupmap addmem S-1-5-32-544 \ + $("${NET}" lookup name "${USER}" | cut -d' ' -f1) || + failed=$((failed + 1)) "${RPCCLIENT}" "${SERVER}" -U"${USER}"%"${PASSWORD}" -c netfileenum | - grep "$FILE"\$ + grep "$FILE"\$ RC=$? -testit "netfileenum" test $RC = 0 || failed=$((failed+1)) +testit "netfileenum" test $RC = 0 || failed=$((failed + 1)) kill ${CLIENT_PID} rm -f smbclient-stdin smbclient-stdout smbclient-stderr testit "Remove ${USER} from builtin\\administrators" \ - "${NET}" groupmap delmem S-1-5-32-544 \ - $("${NET}" lookup name "${USER}" | cut -d' ' -f1) || \ - failed=$((failed+1)) + "${NET}" groupmap delmem S-1-5-32-544 \ + $("${NET}" lookup name "${USER}" | cut -d' ' -f1) || + failed=$((failed + 1)) testit "Remove builtin\\administrators group" \ - "${NET}" groupmap delete \ - sid=S-1-5-32-544 || \ - failed=$((failed+1)) + "${NET}" groupmap delete \ + sid=S-1-5-32-544 || + failed=$((failed + 1)) testok $0 $failed diff --git a/source3/script/tests/test_offline.sh b/source3/script/tests/test_offline.sh index 9809f1bf9c9..5e06b1f9d97 100755 --- a/source3/script/tests/test_offline.sh +++ b/source3/script/tests/test_offline.sh @@ -3,10 +3,10 @@ # Blackbox test for the offline VFS module. # if [ $# -lt 7 ]; then -cat <<EOF + cat <<EOF Usage: test_offline SERVER SERVER_IP DOMAIN USERNAME PASSWORD WORKDIR SMBCLIENT EOF -exit 1; + exit 1 fi SERVER=${1} @@ -20,14 +20,14 @@ shift 7 SMBCLIENT="$VALGRIND ${SMBCLIENT}" ADDARGS="$*" -incdir=`dirname $0`/../../../testprogs/blackbox +incdir=$(dirname $0)/../../../testprogs/blackbox . $incdir/subunit.sh touch $WORKDIR/foo failed=0 -attribs=`$SMBCLIENT -U$USERNAME%$PASSWORD "//$SERVER/offline" -I $SERVER_IP -c "allinfo foo" | sed -n 's/^attributes:.*(\([^)]*\)).*/\1/p'` -testit "file has offline attribute" test "x$attribs" = "x1000" || failed=`expr $failed + 1` +attribs=$($SMBCLIENT -U$USERNAME%$PASSWORD "//$SERVER/offline" -I $SERVER_IP -c "allinfo foo" | sed -n 's/^attributes:.*(\([^)]*\)).*/\1/p') +testit "file has offline attribute" test "x$attribs" = "x1000" || failed=$(expr $failed + 1) exit $failed diff --git a/source3/script/tests/test_open_eintr.sh b/source3/script/tests/test_open_eintr.sh index c7dec2c77da..31aa26dda4c 100755 --- a/source3/script/tests/test_open_eintr.sh +++ b/source3/script/tests/test_open_eintr.sh @@ -5,23 +5,28 @@ # Copyright (C) 2020 Volker Lendecke if [ $# -lt 5 ]; then - echo Usage: test_open_eintr.sh \ - --configfile=SERVERCONFFILE SMBCLIENT SMBCONTROL SERVER SHARE -exit 1 + echo Usage: test_open_eintr.sh \ + --configfile=SERVERCONFFILE SMBCLIENT SMBCONTROL SERVER SHARE + exit 1 fi -CONF=$1; shift 1 -SMBCLIENT=$1; shift 1 -SMBCONTROL=$1; shift 1 -SERVER=$1; shift 1 -SHARE=$1; shift 1 +CONF=$1 +shift 1 +SMBCLIENT=$1 +shift 1 +SMBCONTROL=$1 +shift 1 +SERVER=$1 +shift 1 +SHARE=$1 +shift 1 # Do not let deprecated option warnings muck this up SAMBA_DEPRECATED_SUPPRESS=1 export SAMBA_DEPRECATED_SUPPRESS error_inject_conf=$(dirname ${SERVERCONFFILE})/error_inject.conf -> ${error_inject_conf} +>${error_inject_conf} incdir=$(dirname $0)/../../../testprogs/blackbox . $incdir/subunit.sh @@ -33,10 +38,11 @@ cd $SELFTEST_TMPDIR || exit 1 rm -f smbclient-stdin smbclient-stdout smbclient-stderr mkfifo smbclient-stdin smbclient-stdout smbclient-stderr -CLI_FORCE_INTERACTIVE=1; export CLI_FORCE_INTERACTIVE +CLI_FORCE_INTERACTIVE=1 +export CLI_FORCE_INTERACTIVE ${SMBCLIENT} //${SERVER}/${SHARE} ${CONF} -U${USER}%${PASSWORD} \ - < smbclient-stdin > smbclient-stdout 2>smbclient-stderr & + <smbclient-stdin >smbclient-stdout 2>smbclient-stderr & CLIENT_PID=$! sleep 1 @@ -46,26 +52,26 @@ exec 100>smbclient-stdin 101<smbclient-stdout 102<smbclient-stderr # consume the smbclient startup messages head -n 1 <&101 -echo "error_inject:openat = EINTR" > ${error_inject_conf} +echo "error_inject:openat = EINTR" >${error_inject_conf} ${SMBCONTROL} ${CONF} 0 reload-config sleep 1 -> ${error_inject_conf} +>${error_inject_conf} echo 'get badnames/blank.txt -' >&100 sleep 1 -> ${error_inject_conf} +>${error_inject_conf} ${SMBCONTROL} ${CONF} 0 reload-config -head -n 1 <&102 | grep 'getting file' > /dev/null +head -n 1 <&102 | grep 'getting file' >/dev/null GREP_RET=$? kill ${CLIENT_PID} rm -f smbclient-stdin smbclient-stdout smbclient-stderr testit "Verify that we could get the file" \ - test $GREP_RET -eq 0 || failed=$(expr $failed + 1) + test $GREP_RET -eq 0 || failed=$(expr $failed + 1) testok $0 $failed diff --git a/source3/script/tests/test_preserve_case.sh b/source3/script/tests/test_preserve_case.sh index 28da484b52d..bafc50f2d8b 100755 --- a/source3/script/tests/test_preserve_case.sh +++ b/source3/script/tests/test_preserve_case.sh @@ -5,10 +5,10 @@ # https://bugzilla.samba.org/show_bug.cgi?id=10650 if [ $# -lt 6 ]; then -cat <<EOF + cat <<EOF Usage: test_preserve_case.sh SERVER DOMAIN USERNAME PASSWORD PREFIX SMBCLIENT EOF -exit 1; + exit 1 fi SERVER=$1 @@ -26,12 +26,13 @@ else fi failed=0 -incdir=`dirname $0`/../../../testprogs/blackbox +incdir=$(dirname $0)/../../../testprogs/blackbox . $incdir/subunit.sh cd $SELFTEST_TMPDIR || exit 1 -test_smbclient() { +test_smbclient() +{ name="$1" share="$2" cmd="$3" @@ -51,34 +52,34 @@ test_smbclient() { SHARE="lowercase" for PROTOCOL in $PROTOCOL_LIST; do - test_smbclient "Test lowercase ls 1 ($PROTOCOL)" $SHARE "ls 1" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=`expr $failed + 1` - test_smbclient "Test lowercase get 1 ($PROTOCOL)" $SHARE "get 1 LOCAL_1" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=`expr $failed + 1` + test_smbclient "Test lowercase ls 1 ($PROTOCOL)" $SHARE "ls 1" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=$(expr $failed + 1) + test_smbclient "Test lowercase get 1 ($PROTOCOL)" $SHARE "get 1 LOCAL_1" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=$(expr $failed + 1) rm -f LOCAL_1 - test_smbclient "Test lowercase ls A ($PROTOCOL)" $SHARE "ls A" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=`expr $failed + 1` - test_smbclient "Test lowercase get A ($PROTOCOL)" $SHARE "get A LOCAL_A" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=`expr $failed + 1` + test_smbclient "Test lowercase ls A ($PROTOCOL)" $SHARE "ls A" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=$(expr $failed + 1) + test_smbclient "Test lowercase get A ($PROTOCOL)" $SHARE "get A LOCAL_A" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=$(expr $failed + 1) rm -f LOCAL_A - test_smbclient "Test lowercase ls z ($PROTOCOL)" $SHARE "ls z" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=`expr $failed + 1` - test_smbclient "Test lowercase get z ($PROTOCOL)" $SHARE "get z LOCAL_Z" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=`expr $failed + 1` + test_smbclient "Test lowercase ls z ($PROTOCOL)" $SHARE "ls z" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=$(expr $failed + 1) + test_smbclient "Test lowercase get z ($PROTOCOL)" $SHARE "get z LOCAL_Z" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=$(expr $failed + 1) rm -f LOCAL_Z done SHARE="lowercase-30000" for PROTOCOL in $PROTOCOL_LIST; do - test_smbclient "Test lowercase ls 25839 ($PROTOCOL)" $SHARE "ls 25839" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=`expr $failed + 1` + test_smbclient "Test lowercase ls 25839 ($PROTOCOL)" $SHARE "ls 25839" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=$(expr $failed + 1) - test_smbclient "Test lowercase ls 1 ($PROTOCOL)" $SHARE "ls 1" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=`expr $failed + 1` - test_smbclient "Test lowercase get 1 ($PROTOCOL)" $SHARE "get 1 LOCAL_1" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=`expr $failed + 1` + test_smbclient "Test lowercase ls 1 ($PROTOCOL)" $SHARE "ls 1" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=$(expr $failed + 1) + test_smbclient "Test lowercase get 1 ($PROTOCOL)" $SHARE "get 1 LOCAL_1" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=$(expr $failed + 1) rm -f LOCAL_1 - test_smbclient "Test lowercase ls A ($PROTOCOL)" $SHARE "ls A" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=`expr $failed + 1` - test_smbclient "Test lowercase get A ($PROTOCOL)" $SHARE "get A LOCAL_A" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=`expr $failed + 1` + test_smbclient "Test lowercase ls A ($PROTOCOL)" $SHARE "ls A" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=$(expr $failed + 1) + test_smbclient "Test lowercase get A ($PROTOCOL)" $SHARE "get A LOCAL_A" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=$(expr $failed + 1) rm -f LOCAL_A - test_smbclient "Test lowercase ls z ($PROTOCOL)" $SHARE "ls z" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=`expr $failed + 1` - test_smbclient "Test lowercase get z ($PROTOCOL)" $SHARE "get z LOCAL_Z" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=`expr $failed + 1` + test_smbclient "Test lowercase ls z ($PROTOCOL)" $SHARE "ls z" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=$(expr $failed + 1) + test_smbclient "Test lowercase get z ($PROTOCOL)" $SHARE "get z LOCAL_Z" -U$USERNAME%$PASSWORD -m$PROTOCOL || failed=$(expr $failed + 1) rm -f LOCAL_Z done diff --git a/source3/script/tests/test_printing_var_exp.sh b/source3/script/tests/test_printing_var_exp.sh index 12231c82c41..3a5925045d2 100755 --- a/source3/script/tests/test_printing_var_exp.sh +++ b/source3/script/tests/test_printing_var_exp.sh @@ -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 diff --git a/source3/script/tests/test_pthreadpool.sh b/source3/script/tests/test_pthreadpool.sh index b1c7c6da11c..b3d24f79a1a 100755 --- a/source3/script/tests/test_pthreadpool.sh +++ b/source3/script/tests/test_pthreadpool.sh @@ -1,20 +1,20 @@ #!/bin/sh -incdir=`dirname $0`/../../../testprogs/blackbox +incdir=$(dirname $0)/../../../testprogs/blackbox . $incdir/subunit.sh -if [ ! -x $BINDIR/pthreadpooltest ] ; then - # Some machines don't have /bin/true, simulate it - cat >$BINDIR/pthreadpooltest <<EOF +if [ ! -x $BINDIR/pthreadpooltest ]; then + # Some machines don't have /bin/true, simulate it + cat >$BINDIR/pthreadpooltest <<EOF #!/bin/sh exit 0 EOF - chmod +x $BINDIR/pthreadpooltest + chmod +x $BINDIR/pthreadpooltest fi failed=0 testit "pthreadpool" $VALGRIND $BINDIR/pthreadpooltest || - failed=`expr $failed + 1` + failed=$(expr $failed + 1) testok $0 $failed diff --git a/source3/script/tests/test_registry_upgrade.sh b/source3/script/tests/test_registry_upgrade.sh index 066adf883ec..ac4a9db3c6c 100755 --- a/source3/script/tests/test_registry_upgrade.sh +++ b/source3/script/tests/test_registry_upgrade.sh @@ -5,8 +5,8 @@ # Copyright (C) 2011 Björn Baumbach <b...@sernet.de> if [ $# -lt 2 ]; then - echo "Usage: test_registry_upgrade.sh NET DBWRAP_TOOL" - exit 1 + echo "Usage: test_registry_upgrade.sh NET DBWRAP_TOOL" + exit 1 fi SCRIPT_DIR=$(dirname $0) @@ -34,145 +34,145 @@ LOGDIR_PREFIX="registry_upgrade" registry_check() ( - CHECKNO="$1" - CHECKDIFF="$2" - REGVER="" - ALLOWEDERR="INFO: version =|Check database:|overwrite registry format version 0 with 1|no INFO/version found" - - test "x$CHECKNO" = "x0" && { - REGVER="--reg-version=1" - } - - echo "Registry check $CHECKNO" | tee -a $LOG - CHECK="$($NETCMD registry check $REGVER 2>&1)" - RC=$? - - ERRORSTR="$(echo "$CHECK" | grep -vE $ALLOWEDERR )" - test "x$RC" = "x0" || { - echo "upgrade check $CHECKNO failed:" | tee -a $LOG - return 1 - } - - test "x$ERRORSTR" = "x" || { - echo "upgrade check $CHECKNO failed:" | tee -a $LOG - echo "reason: $CHECK" | tee -a $LOG - return 1 - } - - test "x$CHECKDIFF" = "xcheckdiff" && { - $NETCMD registry export 'HKLM' $WORKSPACE/export_${CHECKNO}.reg >> $LOG - test "x$?" = "x0" || { - echo "Error: 'net registry export HKLM' failed" | tee -a $LOG - } - - diff -q $WORKSPACE/export_0.reg $WORKSPACE/export_${CHECKNO}.reg >> $LOG - test "x$?" = "x0" || { - echo "Error: $WORKSPACE/export_0.reg differs from $WORKSPACE/export_${CHECKNO}.reg" | tee -a $LOG - return 1 - } - } - - return 0 + CHECKNO="$1" + CHECKDIFF="$2" + REGVER="" + ALLOWEDERR="INFO: version =|Check database:|overwrite registry format version 0 with 1|no INFO/version found" + + test "x$CHECKNO" = "x0" && { + REGVER="--reg-version=1" + } + + echo "Registry check $CHECKNO" | tee -a $LOG + CHECK="$($NETCMD registry check $REGVER 2>&1)" + RC=$? + + ERRORSTR="$(echo "$CHECK" | grep -vE $ALLOWEDERR)" + test "x$RC" = "x0" || { + echo "upgrade check $CHECKNO failed:" | tee -a $LOG + return 1 + } + + test "x$ERRORSTR" = "x" || { + echo "upgrade check $CHECKNO failed:" | tee -a $LOG + echo "reason: $CHECK" | tee -a $LOG + return 1 + } + + test "x$CHECKDIFF" = "xcheckdiff" && { + $NETCMD registry export 'HKLM' $WORKSPACE/export_${CHECKNO}.reg >>$LOG + test "x$?" = "x0" || { + echo "Error: 'net registry export HKLM' failed" | tee -a $LOG + } + + diff -q $WORKSPACE/export_0.reg $WORKSPACE/export_${CHECKNO}.reg >>$LOG -- Samba Shared Repository