From: Andrew Bartlett Date: Mon, 23 Nov 2020 07:54:29 +0000 (+1300) Subject: selftest: Print dns_update_cache path into the logs X-Git-Tag: talloc-2.3.3~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=595d12ca7b13b7ef7a00a77117841178422bc46f;p=thirdparty%2Fsamba.git selftest: Print dns_update_cache path into the logs This sometimes get stuck in a loop and this may help debug it. Signed-off-by: Andrew Bartlett Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Thu Jul 8 12:44:49 UTC 2021 on sn-devel-184 --- diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index f15daa54e59..cb462794df6 100755 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -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); } }