[WIP][PATCH] selftest: add clusteredmember (1-node) env

Michael Adam obnox at samba.org
Thu Jul 14 11:26:02 UTC 2016


ENOPATCH -- fixed

On 2016-07-14 at 13:23 +0200, Michael Adam wrote:
> On 2016-07-14 at 12:47 +0200, Michael Adam wrote:
> > On 2016-07-14 at 11:53 +0200, Ralph Boehme wrote:
> > > Hi Michael,
> > > 
> > > great work!
> > > 
> > > On Wed, Jul 13, 2016 at 02:52:02AM +0200, Michael Adam wrote:
> > > > On 2016-07-13 at 10:25 +1000, Martin Schwenke wrote:
> > > > > Hi Michael,
> > > > > 
> > > > > On Tue, 12 Jul 2016 16:41:11 +0200, Michael Adam <obnox at samba.org>
> > > > > wrote:
> > > > > 
> > > > > > here is the current WIP state of my clusteredmember
> > > > > > selftest environment.
> > > > > >
> > > > > > [...]
> > > > > >
> > > > > > But I appreciate any comments / hints!
> > > > > 
> > > > > I'm working on trying to understand this to see what common code we can
> > > > > use between this and ctdb/tests/simple/scripts/local_daemons.bash.  I
> > > > > figure we should be able to factor out all of the CTDB provisioning
> > > > > code...
> > > > 
> > > > Yeah in the long run, that might be the way to go.
> > > > 
> > > > But since this version of the patch seems to work
> > > > reliably for me now, we might want to bring it
> > > > upstream first and refactor later.
> > > 
> > > works until it breaks. :)
> > > 
> > > I have a pending patch that fixes restarting cleanupd in a cluster on
> > > a node that is banned.
> > 
> > Ok, cool.
> > 
> > > Branch with the fix, your patches and an added test for my patch on
> > > top:
> > > <https://git.samba.org/?p=slow/samba.git;a=shortlog;h=refs/heads/cleanupd>
> > > 
> > > On my system configured with --prefix=/opt/samba this breaks at:
> > > 
> > > $ make test TESTS=ctdb_ban
> > > ...
> > > UNEXPECTED(failure):
> > > samba3.blackbox.ctdb_ban(clusteredmember:local).ctdb_ban(clusteredmember:local)
> > > REASON: Exception: Exception: ../ctdb/client/ctdb_client.c:293 Failed
> > > to connect client socket to daemon. Errno:No such file or directory(2)
> > > ../ctdb/common/cmdline.c:167 Failed to connect to daemon
> > > Failed to init ctdb
> > > Failed to read nodes file "/opt/samba/etc/ctdb/nodes"
> > > Is this node part of a CTDB cluster?
> > 
> > > Guess we're still missing your patches for ctdb build with a prefix !=
> > > /usr ?
> > 
> > Well, as you can see in the Samba3.pm, you need to tell
> > ctdb this:
> >  - --socket=<location of ctdbd socket> as cmdline option
> >  - CTDB_NODES=<location of nodes file> in env
> >    or
> >    CTDB_BASE=<directory containing nodes file> in env
> > 
> > Will propose such an update to your test later.
> 
> Attached patch (to be squashed with yours) fixes
> the calling of ctdb.
> 
> But the test does not succeed currently, since this is about
> ip-reallocation, and the clusteredmember does not do public
> addresses (yet), and it also doe not to reallocations because
> it is currently a 1-node setup... ?! :-)
> 
> Cheers - Michael


-------------- next part --------------
From 4fb530d7e45b8597fa71e78236d92a499745df25 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Thu, 14 Jul 2016 13:10:29 +0200
Subject: [PATCH] SQ: fix ctdb_ban test: call ctdb correctly...

---
 source3/script/tests/test_ctdb_ban.sh | 20 +++++++++++++-------
 source3/selftest/tests.py             |  2 +-
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/source3/script/tests/test_ctdb_ban.sh b/source3/script/tests/test_ctdb_ban.sh
index f15599a..3853b48 100755
--- a/source3/script/tests/test_ctdb_ban.sh
+++ b/source3/script/tests/test_ctdb_ban.sh
@@ -5,19 +5,23 @@
 
 if [ $# -lt 4 ]; then
 cat <<EOF
-Usage: test_ctdb_ban.sh SERVER SERVER_IP USERNAME PASSWORD
+Usage: test_ctdb_ban.sh CTDB_NODES CTDB_SOCKET SERVER SERVER_IP USERNAME PASSWORD
 EOF
 exit 1;
 fi
 
-SERVER="$1"
-SERVER_IP="$2"
-USERNAME="$3"
-PASSWORD="$4"
-shift 4
+CTDB_NODES_FILE="$1"
+CTDB_SOCKET_FILE="$2"
+SERVER="$3"
+SERVER_IP="$4"
+USERNAME="$5"
+PASSWORD="$6"
+shift 6
 ADDARGS="$*"
 
-CTDB="$VALGRIND ${CTDB:-$BINDIR/ctdb}"
+export CTDB_NODES=$CTDB_NODES_FILE
+
+CTDB="$VALGRIND ${CTDB:-$BINDIR/ctdb} --socket=$CTDB_SOCKET_FILE"
 
 incdir=`dirname $0`/../../../testprogs/blackbox
 . $incdir/subunit.sh
@@ -32,4 +36,6 @@ echo New cleanupd: $CLEANUPD_PID
 CLEANUPD_PID=$(ps -e -o pid,comm | awk '/cleanupd/ {print $1}')
 testit "ctdb_cleanupd" test x"${CLEANUPD_PID}" != x"" || failed=`expr $failed + 1`
 
+export -n CTDB_NODES
+
 testok $0 $failed
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index d67fabe..9118903 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -137,7 +137,7 @@ for env in ["nt4_dc", "nt4_member", "ad_member", "clusteredmember"]:
     plantestsuite("samba3.blackbox.smbclient_auth.plain (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', smbclient3, configuration])
     plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) member creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$SERVER/$USERNAME', '$PASSWORD', smbclient3, configuration])
 
-plantestsuite("samba3.blackbox.ctdb_ban(clusteredmember:local)", "clusteredmember:local", [os.path.join(samba3srcdir, "script/tests/test_ctdb_ban.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', smbclient3, configuration])
+plantestsuite("samba3.blackbox.ctdb_ban(clusteredmember:local)", "clusteredmember:local", [os.path.join(samba3srcdir, "script/tests/test_ctdb_ban.sh"), '$SELFTEST_PREFIX/clusteredmember/ctdb/etc/ctdb/nodes', '$SELFTEST_PREFIX/clusteredmember/ctdb/var/ctdb.socket', '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', smbclient3, configuration])
 
 env="nt4_dc"
 plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) ipv6" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IPV6', '$SERVER/$USERNAME', '$PASSWORD', smbclient3, configuration])
-- 
2.5.5

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160714/bd971483/signature.sig>


More information about the samba-technical mailing list