From: Ralph Boehme Date: Sun, 26 Oct 2025 11:00:33 +0000 (+0100) Subject: selftest: add clusteredmember env ctdb management hooks X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=41ab9a61864748fdb4e1c01ea2b5941ddb073350;p=thirdparty%2Fsamba.git selftest: add clusteredmember env ctdb management hooks Signed-off-by: Ralph Boehme Reviewed-by: Anoop C S --- diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 7b931241748..a8abe7c2322 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -552,6 +552,11 @@ sub setup_clusteredmember dbwrap_tdb_mutexes:* = yes ${require_mutexes} sync machine password to keytab = $node_prefix/keytab0:account_name:machine_password:sync_kvno + persistent handles = yes + smb3 directory leases = yes + smbd:FSCTL_SMBTORTURE = yes + clusteredmember:stop_node = $prefix/stop_node.sh + clusteredmember:start_node = $prefix/start_node.sh "; my $node_ret = $self->provision( @@ -4266,6 +4271,8 @@ sub provision_ctdb($$$$) { my ($self, $prefix, $num_nodes) = @_; my $rc; + my $abs_prefix = abs_path($prefix); + my $ctdb = abs_path(Samba::bindir_path($self, "ctdb")); print "PROVISIONING CTDB...\n"; @@ -4371,6 +4378,34 @@ sub provision_ctdb($$$$) $nodes[$i]->{NODE_PREFIX} = "$out"; } + my $srcdir_abs = abs_path($self->{srcdir}); + + unless (open(SCRIPT, ">$abs_prefix/stop_node.sh")) { + warn("Unable to open '$abs_prefix/stop_node.sh'"); + return undef; + } + print SCRIPT " +#!/bin/sh +cmd=\"$srcdir_abs/ctdb/tests/local_daemons.sh $prefix onnode \$1 $srcdir_abs/bin/ctdb stop\" +echo Running cmd = \$cmd >&2 +\$cmd +"; + close(SCRIPT); + chmod 0755, "$abs_prefix/stop_node.sh"; + + unless (open(SCRIPT, ">$abs_prefix/start_node.sh")) { + warn("Unable to open '$abs_prefix/start_node.sh'"); + return undef; + } + print SCRIPT " +#!/bin/sh +cmd=\"$srcdir_abs/ctdb/tests/local_daemons.sh $prefix onnode \$1 $srcdir_abs/bin/ctdb continue\" +echo Running cmd = \$cmd >&2 +\$cmd +"; + close(SCRIPT); + chmod 0755, "$abs_prefix/start_node.sh"; + my %ret = (); $ret{CTDB_PREFIX} = "$prefix";