]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
selftest: Print dns_update_cache path into the logs
authorAndrew Bartlett <abartlet@samba.org>
Mon, 23 Nov 2020 07:54:29 +0000 (20:54 +1300)
committerStefan Metzmacher <metze@samba.org>
Thu, 8 Jul 2021 12:44:49 +0000 (12:44 +0000)
This sometimes get stuck in a loop and this may help debug it.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jul  8 12:44:49 UTC 2021 on sn-devel-184

selftest/target/Samba4.pm

index f15daa54e59106f4791fb15d9805e8c12bf69a03..cb462794df656caeee3d9373aff7426ae5a79f60 100755 (executable)
@@ -204,28 +204,29 @@ sub wait_for_start($$)
        # Ensure we registered all our names
        if ($testenv_vars->{SERVER_ROLE} eq "domain controller") {
                my $max_wait = 120;
-               print "Waiting for dns_update_cache to be created.\n";
+               my $dns_update_cache = "$testenv_vars->{PRIVATEDIR}/dns_update_cache";
+               print "Waiting for $dns_update_cache to be created.\n";
                $count = 0;
-               while (not -e "$testenv_vars->{PRIVATEDIR}/dns_update_cache") {
+               while (not -e $dns_update_cache) {
                        $count++;
                        if ($count > $max_wait) {
                                teardown_env($self, $testenv_vars);
-                               warn("Timed out ($max_wait sec) waiting for dns_update_cache PID $testenv_vars->{SAMBA_PID}");
+                               warn("Timed out ($max_wait sec) waiting for $dns_update_cache PID $testenv_vars->{SAMBA_PID}");
                                return -1;
                        }
-                       print "Waiting for dns_update_cache to be created...\n";
+                       print "Waiting for $dns_update_cache to be created...\n";
                        sleep(1);
                }
-               print "Waiting for dns_update_cache to be filled.\n";
+               print "Waiting for $dns_update_cache to be filled.\n";
                $count = 0;
-               while ((-s "$testenv_vars->{PRIVATEDIR}/dns_update_cache") == 0) {
+               while ((-s "$dns_update_cache") == 0) {
                        $count++;
                        if ($count > $max_wait) {
                                teardown_env($self, $testenv_vars);
-                               warn("Timed out ($max_wait sec) waiting for dns_update_cache PID $testenv_vars->{SAMBA_PID}");
+                               warn("Timed out ($max_wait sec) waiting for $dns_update_cache PID $testenv_vars->{SAMBA_PID}");
                                return -1;
                        }
-                       print "Waiting for dns_update_cache to be filled...\n";
+                       print "Waiting for $dns_update_cache to be filled...\n";
                        sleep(1);
                }
        }