The branch, master has been updated via bf7f2b0 ctdb-tests: Do not run ip command if running against local daemons via 34be43d ctdb-build: fix wscript formatting as per PEP8 via 9163037 ctdb-build: Create ctdb only ctags via 34b4857 ctdb-build: Replace os.system with samba_utils.RUN_COMMAND via dd1f23d ctdb-build: Check the return value of RUN_COMMAND via e118a36 ctdb-tests: Shutdown local daemons if the tests exit abnormally from c324b9f s4: torture: Add a new lock test to show that the Samba SMB1 multi-lock implementation is (currently) correct.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit bf7f2b06e8e36710d0f9bf0684e70538e809dd16 Author: Amitay Isaacs <ami...@gmail.com> Date: Tue Jul 8 16:31:21 2014 +1000 ctdb-tests: Do not run ip command if running against local daemons Signed-off-by: Amitay Isaacs <ami...@gmail.com> Reviewed-by: Martin Schwenke <mar...@meltin.net> Autobuild-User(master): Amitay Isaacs <ami...@samba.org> Autobuild-Date(master): Tue Jul 8 12:48:06 CEST 2014 on sn-devel-104 commit 34be43d2018d5d76d4861992a0405bde22656fb2 Author: Amitay Isaacs <ami...@gmail.com> Date: Tue Jul 8 12:00:00 2014 +1000 ctdb-build: fix wscript formatting as per PEP8 Signed-off-by: Amitay Isaacs <ami...@gmail.com> Reviewed-by: Martin Schwenke <mar...@meltin.net> commit 916303792321e7309b3061a21161ce692656bb69 Author: Amitay Isaacs <ami...@gmail.com> Date: Tue Jul 8 14:04:29 2014 +1000 ctdb-build: Create ctdb only ctags CTDB does not use auto-generated files, there is no need to configure to generate ctags. Signed-off-by: Amitay Isaacs <ami...@gmail.com> Reviewed-by: Martin Schwenke <mar...@meltin.net> commit 34b4857231df9656eee1ad5e6aa639330403d2de Author: Amitay Isaacs <ami...@gmail.com> Date: Tue Jul 8 12:15:58 2014 +1000 ctdb-build: Replace os.system with samba_utils.RUN_COMMAND Signed-off-by: Amitay Isaacs <ami...@gmail.com> Reviewed-by: Martin Schwenke <mar...@meltin.net> commit dd1f23dc682c2e45950905cc4c13d032aef83698 Author: Amitay Isaacs <ami...@gmail.com> Date: Tue Jul 8 11:40:52 2014 +1000 ctdb-build: Check the return value of RUN_COMMAND RUN_COMMAND does not raise exceptions if the command fails, but returns non-zero status. Ensure that make terminates with non-zero status if RUN_COMMAND fails. Signed-off-by: Amitay Isaacs <ami...@gmail.com> Reviewed-by: Martin Schwenke <mar...@meltin.net> commit e118a36c4ce8299e270278e27c3a5f5f9afb0049 Author: Amitay Isaacs <ami...@gmail.com> Date: Fri Jul 4 17:04:10 2014 +1000 ctdb-tests: Shutdown local daemons if the tests exit abnormally Signed-off-by: Amitay Isaacs <ami...@gmail.com> Pair-Programmed-With: Martin Schwenke <mar...@meltin.net> Reviewed-by: Stefan Metzmacher <me...@samba.org> ----------------------------------------------------------------------- Summary of changes: ctdb/Makefile | 3 +- ctdb/tests/run_tests.sh | 30 ++++++++-- ctdb/tests/simple/16_ctdb_config_add_ip.sh | 9 ++- ctdb/wscript | 80 ++++++++++++++++++++-------- 4 files changed, 89 insertions(+), 33 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/Makefile b/ctdb/Makefile index 4d2f059..6d57b0c 100644 --- a/ctdb/Makefile +++ b/ctdb/Makefile @@ -67,7 +67,8 @@ etags: $(WAF) etags ctags: - $(WAF) ctags + touch .tmplock + WAFLOCK=.tmplock $(WAF) ctags pydoctor: $(WAF) pydoctor diff --git a/ctdb/tests/run_tests.sh b/ctdb/tests/run_tests.sh index 2ff11ff..d705ac1 100755 --- a/ctdb/tests/run_tests.sh +++ b/ctdb/tests/run_tests.sh @@ -261,6 +261,29 @@ if [ -z "$1" ] ; then fi fi +do_cleanup () +{ + if $TEST_CLEANUP ; then + echo "Removing TEST_VAR_DIR=$TEST_VAR_DIR" + rm -rf "$TEST_VAR_DIR" + else + echo "Not cleaning up TEST_VAR_DIR=$TEST_VAR_DIR" + fi +} + +cleanup_handler () +{ + if $TEST_CLEANUP ; then + if [ -n "$TEST_LOCAL_DAEMONS" -a "$f" = "simple" ] ; then + echo "***** shutting down daemons *****" + find_and_run_one_test simple/99_daemons_shutdown.sh "$tests_dir" + fi + fi + do_cleanup +} + +trap cleanup_handler SIGINT SIGTERM + for f ; do find_and_run_one_test "$f" @@ -295,12 +318,7 @@ rm -f "$sf" echo -if $TEST_CLEANUP ; then - echo "Removing TEST_VAR_DIR=$TEST_VAR_DIR" - rm -rf "$TEST_VAR_DIR" -else - echo "Not cleaning up TEST_VAR_DIR=$TEST_VAR_DIR" -fi +do_cleanup if $no_header || $exit_on_fail ; then exit $status diff --git a/ctdb/tests/simple/16_ctdb_config_add_ip.sh b/ctdb/tests/simple/16_ctdb_config_add_ip.sh index b770bd6..dc28130 100755 --- a/ctdb/tests/simple/16_ctdb_config_add_ip.sh +++ b/ctdb/tests/simple/16_ctdb_config_add_ip.sh @@ -64,9 +64,12 @@ echo "Selected node ${test_node} with IPs: $test_node_ips" # Try to find a free IP adddress. This is inefficient but should # succeed quickly. -try_command_on_node $test_node "ip addr show" -all_test_node_ips=$(echo "$out" | sed -rn -e 's@^[[:space:]]+inet[[:space:]]+([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+/[[:digit:]]+).*[[:space:]]([^[:space:]]+)+$@\1:\2@p') - +if [ -z "$TEST_LOCAL_DAEMONS" ] ; then + try_command_on_node $test_node "ip addr show" + all_test_node_ips=$(echo "$out" | sed -rn -e 's@^[[:space:]]+inet[[:space:]]+([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+/[[:digit:]]+).*[[:space:]]([^[:space:]]+)+$@\1:\2@p') +else + all_test_node_ips="" +fi add_ip="" # Use an IP already on one of the nodes, remove the last octet and diff --git a/ctdb/wscript b/ctdb/wscript index df7ce98..389afbb 100755 --- a/ctdb/wscript +++ b/ctdb/wscript @@ -17,9 +17,9 @@ import samba_utils, samba_version env = samba_utils.LOAD_ENVIRONMENT() if os.path.isfile('./VERSION'): - vdir='.' + vdir = '.' elif os.path.isfile('../VERSION'): - vdir='..' + vdir = '..' else: Logs.error("VERSION file not found") @@ -33,6 +33,7 @@ samba_dist.DIST_DIRS('''ctdb:. lib/replace:lib/replace lib/talloc:lib/talloc lib/socket_wrapper:lib/socket_wrapper buildtools:buildtools''') + def set_options(opt): opt.PRIVATE_EXTENSION_DEFAULT('ctdb') opt.RECURSE('lib/replace') @@ -51,8 +52,9 @@ def set_options(opt): help=("Path to log directory"), action="store", dest='ctdb_logdir', default=None) opt.add_option('--with-socketpath', - help=("path to CTDB daemon socket"), - action="store_true", dest='ctdb_sockpath', default=False) + help=("path to CTDB daemon socket"), + action="store_true", dest='ctdb_sockpath', default=False) + def configure(conf): @@ -150,6 +152,7 @@ def configure(conf): conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True) conf.SAMBA_CONFIG_H() + def build(bld): bld.RECURSE('lib/replace') bld.RECURSE('lib/popt') @@ -357,9 +360,9 @@ def build(bld): arg['file_list'].append([fl, mode]) def SUBDIR_MODE(path, trim_path=None): - pd = {'trim_path': trim_path, 'file_list': []} - os.path.walk(path, SUBDIR_MODE_callback, pd) - return pd['file_list'] + pd = {'trim_path': trim_path, 'file_list': []} + os.path.walk(path, SUBDIR_MODE_callback, pd) + return pd['file_list'] etc_subdirs = [ 'events.d', @@ -426,14 +429,14 @@ def build(bld): ] for t in ctdb_tests: - target = 'bin/' + t - src = 'tests/src/' + t + '.c' + target = 'bin/' + t + src = 'tests/src/' + t + '.c' - bld.SAMBA_BINARY(target, - source=src, - deps='''ctdb-client ctdb-common ctdb-common-util - ctdb-system ctdb-util ctdb-util-misc''', - install_path='${CTDB_TEST_LIBDIR}') + bld.SAMBA_BINARY(target, + source=src, + deps='''ctdb-client ctdb-common ctdb-common-util + ctdb-system ctdb-util ctdb-util-misc''', + install_path='${CTDB_TEST_LIBDIR}') bld.SAMBA_BINARY('bin/ctdb_takeover_tests', source='tests/src/ctdb_takeover_tests.c', @@ -528,32 +531,50 @@ def build(bld): def testonly(ctx): cmd = 'tests/run_tests.sh -V tests/var' - samba_utils.RUN_COMMAND(cmd) + ret = samba_utils.RUN_COMMAND(cmd) + if ret != 0: + print('tests exited with exit status %d' % ret) + sys.exit(ret) + def test(ctx): import Scripting Scripting.commands.append('build') Scripting.commands.append('testonly') + def autotest(ctx): cmd = 'LD_PRELOAD=bin/shared/libsocket-wrapper.so tests/run_tests.sh -e -S -C' - samba_utils.RUN_COMMAND(cmd) + ret = samba_utils.RUN_COMMAND(cmd) + if ret != 0: + print('autotest exited with exit status %d' % ret) + sys.exit(ret) + def show_version(ctx): print VERSION + def dist(): samba_dist.DIST_FILES('VERSION:VERSION', extend=True) t = 'include/ctdb_version.h' - out = os.system('packaging/mkversion.sh %s %s' % (t, VERSION)) + cmd = 'packaging/mkversion.sh %s %s' % (t, VERSION) + ret = samba_utils.RUN_COMMAND(cmd) + if ret != 0: + print('Command "%s" failed with exit status %d' % (cmd, ret)) + sys.exit(ret) samba_dist.DIST_FILES('ctdb/%s:%s' % (t, t), extend=True) t = 'ctdb.spec' sed_expr1 = 's/@VERSION@/%s/g' % VERSION sed_expr2 = 's/@RELEASE@/%s/g' % '1' - os.system('sed -e "%s" -e "%s" packaging/RPM/ctdb.spec.in > %s' % - (sed_expr1, sed_expr2, t)) + cmd = 'sed -e "%s" -e "%s" packaging/RPM/ctdb.spec.in > %s' % ( + sed_expr1, sed_expr2, t) + ret = samba_utils.RUN_COMMAND(cmd) + if ret != 0: + print('Command "%s" failed with exit status %d' % (cmd, ret)) + sys.exit(ret) samba_dist.DIST_FILES('ctdb/%s:%s' % (t, t), extend=True) manpages = [ @@ -566,7 +587,11 @@ def dist(): 'ltdbtool.1' ] - os.system('make -C doc') + cmd = 'make -C doc' + ret = samba_utils.RUN_COMMAND(cmd) + if ret != 0: + print('Command "%s" failed with exit status %d' % (cmd, ret)) + sys.exit(ret) for t in manpages: samba_dist.DIST_FILES('ctdb/doc/%s:doc/%s' % (t, t), extend=True) samba_dist.DIST_FILES('ctdb/doc/%s.html:doc/%s.html' % (t, t), @@ -574,19 +599,28 @@ def dist(): samba_dist.dist() + def rpmonly(ctx): cmd = 'rpmbuild -ta --clean --rmsource ctdb-%s.tar.gz' % VERSION - samba_utils.RUN_COMMAND(cmd) + ret = samba_utils.RUN_COMMAND(cmd) + if ret != 0: + print('rpmbuild exited with exit status %d' % ret) + sys.exit(ret) + def rpm(ctx): import Scripting Scripting.commands.append('dist') Scripting.commands.append('rpmonly') + def ctags(ctx): "build 'tags' file using ctags" import Utils source_root = os.path.dirname(Utils.g_module.root_path) - cmd = 'ctags $(find %s/.. -name "*.[ch]" | grep -v "*_proto\.h")' % source_root + cmd = 'ctags $(find %s -name "*.[ch]")' % source_root print("Running: %s" % cmd) - os.system(cmd) + ret = samba_utils.RUN_COMMAND(cmd) + if ret != 0: + print('ctags failed with exit status %d' % ret) + sys.exit(ret) -- Samba Shared Repository