selftest:Samba4: use 'smbcontrol samba shutdown'
authorStefan Metzmacher <metze@samba.org>
Thu, 17 Jan 2019 22:50:45 +0000 (23:50 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 5 Feb 2019 14:33:29 +0000 (15:33 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13752

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Baumbach <bbaumbach@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jan 30 01:51:48 CET 2019 on sn-devel-144

(cherry picked from commit d03991f569b54ae0a11911b622107fbae701715d)

selftest/target/Samba4.pm

index a21ada84eb21adc5f2c42c0576d0be817bf240f4..b565d4664776c46afd964fa5076d7a2f46abe015 100755 (executable)
@@ -2033,6 +2033,15 @@ sub teardown_env_terminate($$)
        my ($self, $envvars) = @_;
        my $pid;
 
+       # This should cause samba to terminate gracefully
+       my $smbcontrol = Samba::bindir_path($self, "smbcontrol");
+       my $cmd = "";
+       $cmd .= "$smbcontrol samba shutdown $envvars->{CONFIGURATION}";
+       my $ret = system($cmd);
+       if ($ret != 0) {
+               warn "'$cmd' failed with '$ret'\n";
+       }
+
        # This should cause samba to terminate gracefully
        close($envvars->{STDIN_PIPE});