ctdb tests

Martin Schwenke martin at meltin.net
Thu Feb 16 05:17:08 UTC 2017

On Wed, 15 Feb 2017 18:32:09 +0100, Andreas Schneider <asn at samba.org>

> On Tuesday, 14 February 2017 22:41:22 CET Martin Schwenke wrote:

> > On Tue, 14 Feb 2017 18:31:10 +0100, Andreas Schneider <asn at samba.org>
> > wrote:  
> > > I've just packaged Samba 4.6rc3 and the list of added ctdb tests is huge.
> > > Attached is the diff of the spec file. I just want to make sure.
> > > 
> > > You want all these tests installed in the system, and you can run them
> > > installed there?  
> > 
> > The CTDB tests were not being installed by a top level Samba install:
> > 
> >   https://bugzilla.samba.org/show_bug.cgi?id=12547
> > 
> > They were being installed as part of a standalone CTDB install, which
> > is why we didn't notice.  
> thanks for the clarification.
> Another issue:
> New file /usr/share/ctdb/tests/simple/nodes is a dangling symlink (to /etc/
> ctdb/nodes) on all architectures
> /etc/ctdb/nodes doesn't exist, also not in the upstream ctdb.spec.in.
> You might want to look into that.

This is due to the directory path mangling I mentioned.  It doesn't
matter too much...

In the ctdb_run_cluster_tests case, where tests are run against a real
cluster, we expect /etc/ctdb/nodes on the test node to be configured
identically to the cluster nodes.  This lets the tests run on the test
node access the cluster nodes using the onnode command.

In the ctdb_run_tests case, where tests are run against local daemons
on the test node, the local daemons setup overrides the nodes file, so
this is not used.

This way of doing things allows the same tests to be run in-tree or
when installed.  It took a bit of fiddling to get this right...  ;-)

We could install an empty nodes file when we install CTDB.  The normal
convention when doing this would be to put some comments in the "empty"
file as a hint to the user.  However, comment lines are significant in
the CTDB nodes files, so I'm reluctant to do that.  Nobody important
uses the upstream ctdb.spec.in so I'm ambivalent about the dangling

If you want to resolve a packaging dilemma then you could create an
empty nodes file (with or without comments) in the main ctdb package.

Alternatively, following Amitay's suggestion, you could decide not to
package ctdb-tests when packaging Samba for a distro.  Part of this
alternative might be to do surgery on ctdb/wscript so that test code
isn't built/installed if, say, --enable-selftest isn't set.  If
everything is sane, that should just mean putting:

      if not bld.env.standalone_ctdb:
        if not conf.CONFIG_GET('ENABLE_SELFTEST'):

in ctdb/wscript:build() before the test stuff.

Standalone CTDB builds would always build the test stuff and no other
changes should be needed... and we can keep our nasty dangling
symlink... because that's the way we like it...  :-)


peace & happiness,

More information about the samba-technical mailing list