]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
selftest: add clusteredmember env ctdb management hooks
authorRalph Boehme <slow@samba.org>
Sun, 26 Oct 2025 11:00:33 +0000 (12:00 +0100)
committerRalph Boehme <slow@samba.org>
Fri, 17 Jul 2026 10:18:37 +0000 (10:18 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
selftest/target/Samba3.pm

index 7b9312417481ef05cbe064908e348c57b569c6bd..a8abe7c23224e37e1f4bde4dfd16fa8258bda0a2 100755 (executable)
@@ -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";