[SCM] Samba Shared Repository - branch master updated
Ralph Böhme
slow at samba.org
Tue Oct 22 21:03:02 UTC 2019
The branch, master has been updated
via aa376682180 ctdb-tests: Add -l option to set number of local daemons
via fe80038d074 ctdb-tests: Prefix remaining environment variables with CTDB_
via e8dc125ed2e ctdb-tests: Drop setting of test state directory for testonly target
via fc16b8dbc69 ctdb-tests: Enable printing of logs on failure in autobuild
via 787662604d4 ctdb-tests: Add run_tests.sh option to print logs on test failure
via 5ae330e5a56 ctdb-tests: Avoid running valgrind under valgrind
via b8461b422d9 ctdb-tests: Simplify tool unit test runner
via ce3fdc4dee3 samba-tool domain: fix an unhandled exception
via 799b05cf7f9 net: 'net ads gpo getgpo' command not dumping gpo
from 6ebd0ba735e s3/libsmb: clang: Fix 'the left operand of '-' is a garbage value'
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit aa37668218024aff6bb6518386d4e17a91407633
Author: Martin Schwenke <martin at meltin.net>
Date: Thu Oct 17 16:42:36 2019 +1100
ctdb-tests: Add -l option to set number of local daemons
This is the only place where setting an environment variable by hand
is recommended, so remove the anomaly.
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Tue Oct 22 21:02:11 UTC 2019 on sn-devel-184
commit fe80038d074d220487782dc837ea4bd779a6aad0
Author: Martin Schwenke <martin at meltin.net>
Date: Thu Oct 17 16:33:48 2019 +1100
ctdb-tests: Prefix remaining environment variables with CTDB_
Now they are clearly all part of CTDB.
TEST_SOCKET_WRAPPER_SO_PATH gets too long in
integration_local_daemons.bash, so change it to
CTDB_TEST_SWRAP_SO_PATH instead of just prefixing.
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit e8dc125ed2e502234135e12fe32fb387baa11a79
Author: Martin Schwenke <martin at meltin.net>
Date: Thu Oct 17 16:19:58 2019 +1100
ctdb-tests: Drop setting of test state directory for testonly target
This is the default and deciding this should be left to run_tests.sh.
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit fc16b8dbc69130a039f8492563fcc5ffded2000e
Author: Martin Schwenke <martin at meltin.net>
Date: Thu Oct 17 16:19:33 2019 +1100
ctdb-tests: Enable printing of logs on failure in autobuild
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit 787662604d4f578f10981845997ccd995f11d853
Author: Martin Schwenke <martin at meltin.net>
Date: Thu Oct 17 15:53:09 2019 +1100
ctdb-tests: Add run_tests.sh option to print logs on test failure
Implement this for local daemons integration tests, dumping last 100
lines of logs. This makes it possible to debug some failures in
automated tests where the logs are unavailable for analysis.
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit 5ae330e5a56553b8809f710230101acf044c98e3
Author: Martin Schwenke <martin at meltin.net>
Date: Wed Oct 16 17:21:51 2019 +1100
ctdb-tests: Avoid running valgrind under valgrind
When run from integration tests $CTDB already includes $VALGRIND, if
set. So only add $VALGRIND if $CTDB is not set.
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit b8461b422d94b836eb952a3a5363cf03eb347e95
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Oct 14 10:15:07 2019 +1100
ctdb-tests: Simplify tool unit test runner
There is no good reason why the code needs to be this way. The
intervening code was removed years ago leaving a more complex version
of something very simple.
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
commit ce3fdc4dee373a2f9ab55ffa83a97ac690109b09
Author: Amit Kumar <amitkuma at redhat.com>
Date: Mon Sep 2 04:26:08 2019 -0500
samba-tool domain: fix an unhandled exception
Uncaught exception on running 'samba-tool domain schemaupgrade'
ERROR(<class 'ModuleNotFoundError'>): uncaught exception - No module named
'markdown' File "/usr/lib64/python3.7/site-packages/samba/netcmd/__init__.py",
line 185, in _run return self.run(*args, **kwargs) File
"/usr/lib64/python3.7/site-packages/samba/netcmd/domain.py", line 4157, in run
from samba.ms_schema_markdown import read_ms_markdown File
"/usr/lib64/python3.7/site-packages/samba/ms_schema_markdown.py", line 26, in
<module> import markdown
Signed-off-by: Amit Kumar amitkuma at redhat.com
Reviewed-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 799b05cf7f9e49db71a731fdf9264311703fd3cf
Author: Amit Kumar <amitkuma at redhat.com>
Date: Tue Jul 16 02:29:44 2019 +0530
net: 'net ads gpo getgpo' command not dumping gpo
We have passed dump_gpo(debuglevel=1), hence gpo is not
dumped at debuglevel=0. But end user will expect gpo
to be dumped without setting debug flag.
Signed-off-by: Amit Kumar <amitkuma at redhat.com>
Reviewed-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Noel Power <noel.power at suse.com>
-----------------------------------------------------------------------
Summary of changes:
ctdb/tests/README | 2 --
ctdb/tests/UNIT/eventd/scripts/local.sh | 2 +-
ctdb/tests/UNIT/eventscripts/scripts/60.nfs.sh | 2 +-
ctdb/tests/UNIT/eventscripts/scripts/local.sh | 2 +-
ctdb/tests/UNIT/onnode/scripts/local.sh | 2 +-
ctdb/tests/UNIT/takeover_helper/scripts/local.sh | 2 +-
ctdb/tests/UNIT/tool/scripts/local.sh | 6 ++--
ctdb/tests/local_daemons.sh | 2 +-
ctdb/tests/run_tests.sh | 36 +++++++++++++----------
ctdb/tests/scripts/integration.bash | 2 +-
ctdb/tests/scripts/integration_local_daemons.bash | 23 +++++++++++++--
ctdb/tests/scripts/unit.sh | 14 ++++-----
ctdb/wscript | 4 +--
python/samba/netcmd/domain.py | 6 +++-
source3/utils/net_ads_gpo.c | 14 ++++++++-
15 files changed, 76 insertions(+), 43 deletions(-)
Changeset truncated at 500 lines:
diff --git a/ctdb/tests/README b/ctdb/tests/README
index fbf10d898c2..eaca954b758 100644
--- a/ctdb/tests/README
+++ b/ctdb/tests/README
@@ -23,8 +23,6 @@ By default:
* INTEGRATION tests are run against 3 local daemons
- Set TEST_LOCAL_DAEMONS to a different number if desired
-
* When testing is complete, a summary showing a list is printed
showing the tests run and their results
diff --git a/ctdb/tests/UNIT/eventd/scripts/local.sh b/ctdb/tests/UNIT/eventd/scripts/local.sh
index 2cb1115fcf9..9b8ebf18074 100644
--- a/ctdb/tests/UNIT/eventd/scripts/local.sh
+++ b/ctdb/tests/UNIT/eventd/scripts/local.sh
@@ -4,7 +4,7 @@
PATH="$PATH:$CTDB_SCRIPTS_TOOLS_HELPER_DIR"
-if "$TEST_VERBOSE" ; then
+if "$CTDB_TEST_VERBOSE" ; then
debug () { echo "$@" ; }
else
debug () { : ; }
diff --git a/ctdb/tests/UNIT/eventscripts/scripts/60.nfs.sh b/ctdb/tests/UNIT/eventscripts/scripts/60.nfs.sh
index 59cdeda9b96..2a269910826 100644
--- a/ctdb/tests/UNIT/eventscripts/scripts/60.nfs.sh
+++ b/ctdb/tests/UNIT/eventscripts/scripts/60.nfs.sh
@@ -389,7 +389,7 @@ EOF
fi
_out=$(simple_test 2>&1)
_ret=$?
- if "$TEST_VERBOSE" || [ $_ret -ne 0 ] ; then
+ if "$CTDB_TEST_VERBOSE" || [ $_ret -ne 0 ] ; then
cat <<EOF
##################################################
Iteration ${_iteration}:
diff --git a/ctdb/tests/UNIT/eventscripts/scripts/local.sh b/ctdb/tests/UNIT/eventscripts/scripts/local.sh
index e1b92b41fbe..14017e95365 100644
--- a/ctdb/tests/UNIT/eventscripts/scripts/local.sh
+++ b/ctdb/tests/UNIT/eventscripts/scripts/local.sh
@@ -49,7 +49,7 @@ mkdir -p "$FAKE_NETWORK_STATE"
######################################################################
-if "$TEST_VERBOSE" ; then
+if "$CTDB_TEST_VERBOSE" ; then
debug ()
{
if [ -n "$1" ] ; then
diff --git a/ctdb/tests/UNIT/onnode/scripts/local.sh b/ctdb/tests/UNIT/onnode/scripts/local.sh
index 4cb797031c4..5b830c87697 100644
--- a/ctdb/tests/UNIT/onnode/scripts/local.sh
+++ b/ctdb/tests/UNIT/onnode/scripts/local.sh
@@ -48,7 +48,7 @@ simple_test ()
_sort="sort"
fi
- if $TEST_COMMAND_TRACE ; then
+ if $CTDB_TEST_COMMAND_TRACE ; then
_onnode=$(which "$1") ; shift
_out=$(bash -x "$_onnode" "$@" 2>&1)
else
diff --git a/ctdb/tests/UNIT/takeover_helper/scripts/local.sh b/ctdb/tests/UNIT/takeover_helper/scripts/local.sh
index d15ec93f03f..d36d4e49500 100644
--- a/ctdb/tests/UNIT/takeover_helper/scripts/local.sh
+++ b/ctdb/tests/UNIT/takeover_helper/scripts/local.sh
@@ -1,6 +1,6 @@
# Hey Emacs, this is a -*- shell-script -*- !!! :-)
-if "$TEST_VERBOSE" ; then
+if "$CTDB_TEST_VERBOSE" ; then
debug () { echo "$@" ; }
else
debug () { : ; }
diff --git a/ctdb/tests/UNIT/tool/scripts/local.sh b/ctdb/tests/UNIT/tool/scripts/local.sh
index 61313504f11..618fa36cd87 100644
--- a/ctdb/tests/UNIT/tool/scripts/local.sh
+++ b/ctdb/tests/UNIT/tool/scripts/local.sh
@@ -6,7 +6,7 @@ PATH="${PATH}:${CTDB_SCRIPTS_HELPER_BINDIR}"
setup_ctdb_base "$CTDB_TEST_TMP_DIR" "ctdb-etc" \
functions
-if "$TEST_VERBOSE" ; then
+if "$CTDB_TEST_VERBOSE" ; then
debug () { echo "$@" ; }
else
debug () { : ; }
@@ -103,9 +103,7 @@ setup_nodes ()
simple_test_other ()
{
- (unit_test $CTDB -d $CTDB_DEBUGLEVEL "$@")
- status=$?
- [ $status -eq 0 ] || exit $status
+ unit_test $CTDB -d $CTDB_DEBUGLEVEL "$@"
}
simple_test ()
diff --git a/ctdb/tests/local_daemons.sh b/ctdb/tests/local_daemons.sh
index 6217e54332d..3f5729b5a24 100755
--- a/ctdb/tests/local_daemons.sh
+++ b/ctdb/tests/local_daemons.sh
@@ -356,7 +356,7 @@ local_daemons_stop ()
onnode_common
- onnode -p "$_nodes" "${VALGRIND:-} ${CTDB:-ctdb} shutdown"
+ onnode -p "$_nodes" "${CTDB:-${VALGRIND:-} ctdb} shutdown"
}
local_daemons_onnode_usage ()
diff --git a/ctdb/tests/run_tests.sh b/ctdb/tests/run_tests.sh
index c162aa54bc4..d7c33f1865a 100755
--- a/ctdb/tests/run_tests.sh
+++ b/ctdb/tests/run_tests.sh
@@ -12,6 +12,8 @@ Options:
-e Exit on the first test failure
-H No headers - for running single test with other wrapper
-I <count> Iterate tests <count> times, exiting on failure (implies -e, -N)
+ -l <count> Use <count> daemons for local daemon integration tests
+ -L Print daemon logs on test failure (only some tests)
-N Don't print summary of tests results after running all tests
-q Quiet - don't show tests being run (still displays summary)
-S <lib> Use socket wrapper library <lib> for local integration tests
@@ -40,31 +42,33 @@ test_state_dir=""
cleanup=false
test_time_limit=3600
-export TEST_VERBOSE=false
-export TEST_COMMAND_TRACE=false
-export TEST_CAT_RESULTS_OPTS=""
-export TEST_DIFF_RESULTS=false
-export TEST_LOCAL_DAEMONS
-[ -n "$TEST_LOCAL_DAEMONS" ] || TEST_LOCAL_DAEMONS=3
-export TEST_SOCKET_WRAPPER_SO_PATH=""
+export CTDB_TEST_VERBOSE=false
+export CTDB_TEST_COMMAND_TRACE=false
+export CTDB_TEST_CAT_RESULTS_OPTS=""
+export CTDB_TEST_DIFF_RESULTS=false
+export CTDB_TEST_PRINT_LOGS_ON_ERROR=false
+export CTDB_TEST_LOCAL_DAEMONS=3
+export CTDB_TEST_SWRAP_SO_PATH=""
-while getopts "AcCDehHI:NqS:T:vV:xX?" opt ; do
+while getopts "AcCDehHI:l:LNqS:T:vV:xX?" opt ; do
case "$opt" in
- A) TEST_CAT_RESULTS_OPTS="-A" ;;
- c) TEST_LOCAL_DAEMONS="" ;;
+ A) CTDB_TEST_CAT_RESULTS_OPTS="-A" ;;
+ c) CTDB_TEST_LOCAL_DAEMONS="" ;;
C) cleanup=true ;;
- D) TEST_DIFF_RESULTS=true ;;
+ D) CTDB_TEST_DIFF_RESULTS=true ;;
e) exit_on_fail=true ;;
H) no_header=true ;;
I) max_iterations="$OPTARG" ; exit_on_fail=true ; with_summary=false ;;
+ l) CTDB_TEST_LOCAL_DAEMONS="$OPTARG" ;;
+ L) CTDB_TEST_PRINT_LOGS_ON_ERROR=true ;;
N) with_summary=false ;;
q) quiet=true ;;
- S) TEST_SOCKET_WRAPPER_SO_PATH="$OPTARG" ;;
+ S) CTDB_TEST_SWRAP_SO_PATH="$OPTARG" ;;
T) test_time_limit="$OPTARG" ;;
- v) TEST_VERBOSE=true ;;
+ v) CTDB_TEST_VERBOSE=true ;;
V) test_state_dir="$OPTARG" ;;
x) set -x ;;
- X) TEST_COMMAND_TRACE=true ;;
+ X) CTDB_TEST_COMMAND_TRACE=true ;;
\?|h) usage ;;
esac
done
@@ -73,7 +77,7 @@ shift $((OPTIND - 1))
case $(basename "$0") in
*run_cluster_tests*)
# Running on a cluster... same as -c
- TEST_LOCAL_DAEMONS=""
+ CTDB_TEST_LOCAL_DAEMONS=""
;;
esac
@@ -318,7 +322,7 @@ export TEST_SCRIPTS_DIR="${CTDB_TEST_DIR}/scripts"
# If no tests specified then run some defaults
if [ -z "$1" ] ; then
- if [ -n "$TEST_LOCAL_DAEMONS" ] ; then
+ if [ -n "$CTDB_TEST_LOCAL_DAEMONS" ] ; then
set -- UNIT INTEGRATION
else
set -- INTEGRATION CLUSTER
diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash
index 55b5deb7023..bbb3a64ea5a 100644
--- a/ctdb/tests/scripts/integration.bash
+++ b/ctdb/tests/scripts/integration.bash
@@ -25,7 +25,7 @@ PATH="${TEST_SCRIPTS_DIR}:${PATH}"
ctdb_test_on_cluster ()
{
- [ -z "$TEST_LOCAL_DAEMONS" ]
+ [ -z "$CTDB_TEST_LOCAL_DAEMONS" ]
}
ctdb_test_exit ()
diff --git a/ctdb/tests/scripts/integration_local_daemons.bash b/ctdb/tests/scripts/integration_local_daemons.bash
index 327c69a9ea9..0e7e07d540c 100644
--- a/ctdb/tests/scripts/integration_local_daemons.bash
+++ b/ctdb/tests/scripts/integration_local_daemons.bash
@@ -24,9 +24,9 @@ setup_ctdb ()
esac
$ctdb_local_daemons setup "$@" \
- -n "$TEST_LOCAL_DAEMONS" \
+ -n "$CTDB_TEST_LOCAL_DAEMONS" \
${CTDB_USE_IPV6:+-6} \
- ${TEST_SOCKET_WRAPPER_SO_PATH:+-S ${TEST_SOCKET_WRAPPER_SO_PATH}}
+ ${CTDB_TEST_SWRAP_SO_PATH:+-S ${CTDB_TEST_SWRAP_SO_PATH}}
# Burying the above in an if-statement condition reduces readability.
# shellcheck disable=SC2181
if [ $? -ne 0 ] ; then
@@ -35,10 +35,14 @@ setup_ctdb ()
if $no_event_scripts ; then
local pnn
- for pnn in $(seq 0 $((TEST_LOCAL_DAEMONS - 1))) ; do
+ for pnn in $(seq 0 $((CTDB_TEST_LOCAL_DAEMONS - 1))) ; do
rm -vf "${CTDB_BASE}/events/legacy/"*
done
fi
+
+ if $CTDB_TEST_PRINT_LOGS_ON_ERROR ; then
+ ctdb_test_exit_hook_add _print_logs_on_test_failure
+ fi
}
start_ctdb_1 ()
@@ -75,3 +79,16 @@ onnode ()
{
$ctdb_local_daemons onnode "$@"
}
+
+_print_logs_on_test_failure ()
+{
+ # This is called from ctdb_test_exit() where $status is available
+ # shellcheck disable=SC2154
+ if [ "$status" -eq 0 ] ; then
+ return
+ fi
+
+ echo "*** LOG START --------------------"
+ $ctdb_local_daemons print-log all | tail -n 100
+ echo "*** LOG END --------------------"
+}
diff --git a/ctdb/tests/scripts/unit.sh b/ctdb/tests/scripts/unit.sh
index 7713496cf57..00f7fe9cb48 100644
--- a/ctdb/tests/scripts/unit.sh
+++ b/ctdb/tests/scripts/unit.sh
@@ -74,7 +74,7 @@ result_print ()
_out="$2"
_rc="$3"
- if "$TEST_VERBOSE" || ! $_passed ; then
+ if "$CTDB_TEST_VERBOSE" || ! $_passed ; then
extra_header
cat <<EOF
@@ -83,7 +83,7 @@ Output (Exit status: ${_rc}):
--------------------------------------------------
EOF
# Avoid echo, which might expand unintentional escapes
- printf '%s\n' "$_out" | result_filter | cat $TEST_CAT_RESULTS_OPTS
+ printf '%s\n' "$_out" | result_filter | cat $CTDB_TEST_CAT_RESULTS_OPTS
fi
if ! $_passed ; then
@@ -93,9 +93,9 @@ Required output (Exit status: ${required_rc}):
--------------------------------------------------
EOF
# Avoid echo, which might expand unintentional escapes
- printf '%s\n' "$required_output" | cat $TEST_CAT_RESULTS_OPTS
+ printf '%s\n' "$required_output" | cat $CTDB_TEST_CAT_RESULTS_OPTS
- if $TEST_DIFF_RESULTS ; then
+ if $CTDB_TEST_DIFF_RESULTS ; then
_outr=$(mktemp)
# Avoid echo, which might expand unintentional escapes
printf '%s\n' "$required_output" >"$_outr"
@@ -119,7 +119,7 @@ result_footer ()
{
_passed="$1"
- if "$TEST_VERBOSE" || ! $_passed ; then
+ if "$CTDB_TEST_VERBOSE" || ! $_passed ; then
extra_footer
fi
@@ -196,7 +196,7 @@ unit_test ()
test_header "$@"
_wrapper="$VALGRIND"
- if $TEST_COMMAND_TRACE ; then
+ if $CTDB_TEST_COMMAND_TRACE ; then
_wrapper="strace"
fi
_out=$($_wrapper "$@" 2>&1)
@@ -210,7 +210,7 @@ script_test ()
test_header "$@"
_shell=""
- if ${TEST_COMMAND_TRACE} ; then
+ if ${CTDB_TEST_COMMAND_TRACE} ; then
_shell="sh -x"
else
_shell="sh"
diff --git a/ctdb/wscript b/ctdb/wscript
index 05137c64fdd..d1ebb2e2417 100644
--- a/ctdb/wscript
+++ b/ctdb/wscript
@@ -1116,7 +1116,7 @@ def build(bld):
def testonly(ctx):
- cmd = 'tests/run_tests.sh -V tests/var'
+ cmd = 'tests/run_tests.sh'
ret = samba_utils.RUN_COMMAND(cmd)
if ret != 0:
print('tests exited with exit status %d' % ret)
@@ -1130,7 +1130,7 @@ def test(ctx):
def autotest(ctx):
env = samba_utils.LOAD_ENVIRONMENT()
- cmd = 'tests/run_tests.sh -e -S %s' % env.SOCKET_WRAPPER_SO_PATH
+ cmd = 'tests/run_tests.sh -eL -S %s' % env.SOCKET_WRAPPER_SO_PATH
ret = samba_utils.RUN_COMMAND(cmd)
if ret != 0:
print('autotest exited with exit status %d' % ret)
diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py
index 9d44d6d5ea4..80811154d4d 100644
--- a/python/samba/netcmd/domain.py
+++ b/python/samba/netcmd/domain.py
@@ -4110,7 +4110,11 @@ class cmd_domain_schema_upgrade(Command):
return count
def run(self, **kwargs):
- from samba.ms_schema_markdown import read_ms_markdown
+ try:
+ from samba.ms_schema_markdown import read_ms_markdown
+ except ImportError as e:
+ self.outf.write("Exception in importing markdown: %s" % e)
+ raise CommandError('Failed to import module markdown')
from samba.schema import Schema
updates_allowed_overridden = False
diff --git a/source3/utils/net_ads_gpo.c b/source3/utils/net_ads_gpo.c
index 3be0beef3d0..cd77f93ffd3 100644
--- a/source3/utils/net_ads_gpo.c
+++ b/source3/utils/net_ads_gpo.c
@@ -585,6 +585,18 @@ out:
#endif
+/*
+Arguments:
+- struct net_context *: Pointer to net_context*
+- argc: Number of command line arguments passed to 'net ads gpo getgpo' command
+- **argv: Command line argument string passed to 'net ads gpo getgpo' command
+
+This function performs following operations:
+1. Create talloc context using talloc_init
+2. Preform ads_startup()
+3. Call ads_get_gpo() to retrieve gpo details inside 'struct GROUP_POLICY_OBJECT'
+4. Call dumps_gpo() to dump GPO on stdout
+*/
static int net_ads_gpo_get_gpo(struct net_context *c, int argc, const char **argv)
{
ADS_STRUCT *ads;
@@ -623,7 +635,7 @@ static int net_ads_gpo_get_gpo(struct net_context *c, int argc, const char **arg
goto out;
}
- dump_gpo(&gpo, 1);
+ dump_gpo(&gpo, 0);
out:
talloc_destroy(mem_ctx);
--
Samba Shared Repository
More information about the samba-cvs
mailing list