[SCM] Samba Shared Repository - branch master updated

Amitay Isaacs amitay at samba.org
Tue Jan 17 05:03:02 UTC 2017


The branch, master has been updated
       via  eaa508b ctdb-tests: Add "13.per_ip_routing shutdown" test
       via  f9368f8 ctdb-scripts: Fix regression when cleaning up routing table IDs
       via  5e00a6b ctdb-scripts: Fix remaining uses of "ctdb gratiousarp"
      from  ed722c3 ctdb-common: Add wait_send/wait_recv to sock_daemon_funcs

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit eaa508b82650197a7d473a24b3362e9e9c329937
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jan 16 11:08:51 2017 +1100

    ctdb-tests: Add "13.per_ip_routing shutdown" test
    
    Ensure that it doesn't mangle the rt_tables file.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12516
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
    Autobuild-Date(master): Tue Jan 17 06:02:23 CET 2017 on sn-devel-144

commit f9368f8e129cb32ee30cb6501a6fe728db37e1d5
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jan 16 07:24:15 2017 +1100

    ctdb-scripts: Fix regression when cleaning up routing table IDs
    
    Commit 0ca00267cd2620a14968961738bcd2a69b597e95 removed explicit
    continuations in strings for awk programs.  In one case this causes a
    disconnect between condition and action, where an implicit
    continuation does not work.  This results in duplicate lines in the
    rt_tables file.
    
    Move the opening brace for the action to make the implicit
    continuation work as expected.
    
    An alternative would be to revert the removal of the explicit
    continuations and add shellcheck tags.  However, that doesn't mean
    that an author of future code will necessarily use explicit
    continuations, so the same mistake might still be make in the future.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12516
    
    Reported-by: Barry Evans <bevans at pixitmedia.com>
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 5e00a6b346325f52e35b9785eaffd72239aebcf5
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jan 16 13:38:50 2017 +1100

    ctdb-scripts: Fix remaining uses of "ctdb gratiousarp"
    
    This changed to "ctdb gratarp" some time ago but the scripts were
    never updated.
    
    Fix the documentation for the ctdb tool too.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12512
    
    Reported-by: Ralph Böhme <slow at samba.org>
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

-----------------------------------------------------------------------

Summary of changes:
 ctdb/config/events.d/10.interface                |  4 +--
 ctdb/config/events.d/13.per_ip_routing           |  8 +++---
 ctdb/config/events.d/91.lvs                      |  2 +-
 ctdb/doc/ctdb.1.xml                              |  4 +--
 ctdb/tests/eventscripts/13.per_ip_routing.024.sh | 31 ++++++++++++++++++++++++
 ctdb/tests/eventscripts/stubs/ctdb               |  2 +-
 6 files changed, 41 insertions(+), 10 deletions(-)
 create mode 100755 ctdb/tests/eventscripts/13.per_ip_routing.024.sh


Changeset truncated at 500 lines:

diff --git a/ctdb/config/events.d/10.interface b/ctdb/config/events.d/10.interface
index 073bc85..97227e8 100755
--- a/ctdb/config/events.d/10.interface
+++ b/ctdb/config/events.d/10.interface
@@ -215,7 +215,7 @@ updateip)
 	# 2) remove the IP from the old interface (and new interface, to be sure)
 	# 3) add the IP to the new interface
 	# 4) remove the firewall rule
-	# 5) use ctdb gratiousarp to propagate the new mac address
+	# 5) use ctdb gratarp to propagate the new mac address
 	# 6) use netstat -tn to find existing connections, and tickle them
 	_oiface=$2
 	niface=$3
@@ -247,7 +247,7 @@ updateip)
 	flush_route_cache
 
 	# propagate the new mac address
-	$CTDB gratiousarp "$ip" "$niface"
+	$CTDB gratarp "$ip" "$niface"
 
 	# tickle all existing connections, so that dropped packets
 	# are retransmited and the tcp streams work
diff --git a/ctdb/config/events.d/13.per_ip_routing b/ctdb/config/events.d/13.per_ip_routing
index c4b2535..4fff73b 100755
--- a/ctdb/config/events.d/13.per_ip_routing
+++ b/ctdb/config/events.d/13.per_ip_routing
@@ -184,8 +184,8 @@ clean_up_table_ids ()
 	    -v pre="$table_id_prefix" \
 	    '/^#/ ||
 	     !(min <= $1 && $1 <= max) &&
-	     !(index($2, pre) == 1)
-	     { print $0 }' "$rt_tables" >"$_tmp"
+	     !(index($2, pre) == 1) {
+		print $0 }' "$rt_tables" >"$_tmp"
 
 	mv "$_tmp" "$rt_tables"
     ) 9>"$rt_tables_lock"
@@ -396,7 +396,7 @@ takeip)
 	# flush our route cache
 	set_proc sys/net/ipv4/route/flush 1
 
-	$CTDB gratiousarp "$ip" "$iface"
+	$CTDB gratarp "$ip" "$iface"
 	;;
 
 updateip)
@@ -414,7 +414,7 @@ updateip)
 	# flush our route cache
 	set_proc sys/net/ipv4/route/flush 1
 
-	$CTDB gratiousarp "$ip" "$niface"
+	$CTDB gratarp "$ip" "$niface"
 	tickle_tcp_connections "$ip"
 	;;
 
diff --git a/ctdb/config/events.d/91.lvs b/ctdb/config/events.d/91.lvs
index 052b509..9725ee8 100755
--- a/ctdb/config/events.d/91.lvs
+++ b/ctdb/config/events.d/91.lvs
@@ -110,7 +110,7 @@ ipreallocated)
 	ipvsadm -a -t "$CTDB_LVS_PUBLIC_IP" -r 127.0.0.1
 	ipvsadm -a -u "$CTDB_LVS_PUBLIC_IP" -r 127.0.0.1
 
-	$CTDB gratiousarp \
+	$CTDB gratarp \
 	     "$CTDB_LVS_PUBLIC_IP" "$CTDB_LVS_PUBLIC_IFACE" >/dev/null 2>&1
 
 	flush_route_cache
diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml
index 1d6979a..f24f8dd 100644
--- a/ctdb/doc/ctdb.1.xml
+++ b/ctdb/doc/ctdb.1.xml
@@ -1479,9 +1479,9 @@ dbid:0xb775fff6 name:secrets.tdb path:/usr/local/var/lib/ctdb/persistent/secrets
     </refsect2>
 
     <refsect2>
-      <title>gratiousarp <parameter>IPADDR</parameter> <parameter>INTERFACE</parameter></title>
+      <title>gratarp <parameter>IPADDR</parameter> <parameter>INTERFACE</parameter></title>
       <para>
-	Send out a gratious ARP for the specified interface through
+	Send out a gratuitous ARP for the specified interface through
 	the specified interface. This command is mainly used by the
 	ctdb eventscripts.
       </para>
diff --git a/ctdb/tests/eventscripts/13.per_ip_routing.024.sh b/ctdb/tests/eventscripts/13.per_ip_routing.024.sh
new file mode 100755
index 0000000..7daacbb
--- /dev/null
+++ b/ctdb/tests/eventscripts/13.per_ip_routing.024.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+. "${TEST_SCRIPTS_DIR}/unit.sh"
+
+define_test "Single IP, restores original rt_tables"
+
+setup_ctdb
+setup_ctdb_policy_routing
+
+create_policy_routing_config 1 default
+
+_rt_tables="$CTDB_SYS_ETCDIR/iproute2/rt_tables"
+_rt_orig=$(mktemp --tmpdir="$EVENTSCRIPTS_TESTS_VAR_DIR")
+cp "$_rt_tables" "$_rt_orig"
+
+ctdb_get_1_public_address | {
+	read dev ip bits
+
+	ok_null
+	simple_test_event "takeip" $dev $ip $bits
+
+	ok <<EOF
+Removing ip rule for public address ${ip} for routing table ctdb.${ip}
+EOF
+	simple_test_event "shutdown"
+}
+
+ok_null
+simple_test_command diff -u "$_rt_orig" "$_rt_tables"
+
+check_routes 0
diff --git a/ctdb/tests/eventscripts/stubs/ctdb b/ctdb/tests/eventscripts/stubs/ctdb
index 10a4859..c304dde 100755
--- a/ctdb/tests/eventscripts/stubs/ctdb
+++ b/ctdb/tests/eventscripts/stubs/ctdb
@@ -481,7 +481,7 @@ case "$1" in
 	    echo "|${2:-monitor}|${_b}|${_code}|${_status}|${_d1}|${_d2}|${_err_out}|"
 	done
 	;;
-    gratiousarp) : ;;  # Do nothing for now
+    gratarp) : ;;  # Do nothing for now
     ip)            ctdb_ip "$@" ;;
     pnn|xpnn)      ctdb_pnn ;;
     enable)        ctdb_enable "$@";;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list