[Pkg-samba-maint] [samba] 07/17: ctdb-tests: Add "13.per_ip_routing shutdown" test

Mathieu Parent sathieu at moszumanska.debian.org
Mon Mar 6 11:50:06 UTC 2017


This is an automated email from the git hooks/post-receive script.

sathieu pushed a commit to branch master
in repository samba.

commit 4426d4343710dded806e02b3d763614f3393dfb3
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
    
    (cherry picked from commit eaa508b82650197a7d473a24b3362e9e9c329937)
---
 ctdb/tests/eventscripts/13.per_ip_routing.024.sh | 31 ++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-samba/samba.git




More information about the Pkg-samba-maint mailing list