From: Martin Schwenke Date: Mon, 16 Jan 2017 00:08:51 +0000 (+1100) Subject: ctdb-tests: Add "13.per_ip_routing shutdown" test X-Git-Tag: talloc-2.1.9~373 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eaa508b82650197a7d473a24b3362e9e9c329937;p=thirdparty%2Fsamba.git 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 Reviewed-by: Amitay Isaacs Autobuild-User(master): Amitay Isaacs Autobuild-Date(master): Tue Jan 17 06:02:23 CET 2017 on sn-devel-144 --- 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 00000000000..7daacbb70fe --- /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 <