[PATCH] Reduce flapping tests (kcc at vampire_dc and promoted_dc startup)

Andrew Bartlett abartlet at samba.org
Fri Jun 30 21:30:30 UTC 2017


Now that we have the main ldb locking tests fixed, it becomes easier to
isolate other flapping tests[1]. 

This patch removes the manual KCC run at startup, which races against
the internal run and sometimes causes spurious 'failed to startup env'
test failures.

Please review and push!

[1] Other flapping tests recently isolated and fixed include the
posixacl test, dns, the schema rename issue and replica_sync.

Andrew Bartlett
-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba
-------------- next part --------------
From c5131aff021223a48dfcd23f4e45d8ccae8bc2ff Mon Sep 17 00:00:00 2001
From: Bob Campbell <bobcampbell at catalyst.net.nz>
Date: Tue, 10 Jan 2017 09:20:47 +1300
Subject: [PATCH 1/2] selftest: Do not force run of kcc at start of selftest

This should help to avoid clashes between periodic and manual runs of
the KCC during autobuild.

Signed-off-by: Bob Campbell <bobcampbell at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12869
---
 selftest/target/Samba4.pm | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index ea81d7d..26ebf17 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -2289,27 +2289,11 @@ sub setup_vampire_dc($$$$)
 		# force replicated DC to update repsTo/repsFrom
 		# for vampired partitions
 		my $samba_tool =  Samba::bindir_path($self, "samba-tool");
-		my $cmd = "";
-		$cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$env->{SOCKET_WRAPPER_DEFAULT_IFACE}\" ";
-		if (defined($env->{RESOLV_WRAPPER_CONF})) {
-			$cmd .= "RESOLV_WRAPPER_CONF=\"$env->{RESOLV_WRAPPER_CONF}\" ";
-		} else {
-			$cmd .= "RESOLV_WRAPPER_HOSTS=\"$env->{RESOLV_WRAPPER_HOSTS}\" ";
-		}
-		$cmd .= " KRB5_CONFIG=\"$env->{KRB5_CONFIG}\"";
-		$cmd .= "KRB5CCNAME=\"$env->{KRB5_CCACHE}\" ";
-		$cmd .= " $samba_tool drs kcc -k no $env->{DC_SERVER}";
-		$cmd .= " $env->{CONFIGURATION}";
-		$cmd .= " -U$dc_vars->{DC_USERNAME}\%$dc_vars->{DC_PASSWORD}";
-		unless (system($cmd) == 0) {
-			warn("Failed to exec kcc on remote DC\n$cmd");
-			return undef;
-		}
 
 		# as 'vampired' dc may add data in its local replica
 		# we need to synchronize data between DCs
 		my $base_dn = "DC=".join(",DC=", split(/\./, $dc_vars->{REALM}));
-		$cmd = "";
+		my $cmd = "";
 		$cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$env->{SOCKET_WRAPPER_DEFAULT_IFACE}\" ";
 		if (defined($env->{RESOLV_WRAPPER_CONF})) {
 			$cmd .= "RESOLV_WRAPPER_CONF=\"$env->{RESOLV_WRAPPER_CONF}\" ";
-- 
2.9.4


From 7b8500ab290db9fc94b829bbfd1508b78ac8f022 Mon Sep 17 00:00:00 2001
From: Andrew Bartlett <abartlet at samba.org>
Date: Fri, 30 Jun 2017 13:42:50 +1200
Subject: [PATCH 2/2] selftest: No longer run the KCC at startup

This just raced against the KCC run internally and caused spurious environment startup failures

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12869
---
 selftest/target/Samba4.pm | 35 -----------------------------------
 1 file changed, 35 deletions(-)

diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 26ebf17..7d9fe3c 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -2366,30 +2366,6 @@ sub setup_promoted_dc($$$)
 		# for vampired partitions
 		my $samba_tool =  Samba::bindir_path($self, "samba-tool");
 		my $cmd = "";
-		$cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$env->{SOCKET_WRAPPER_DEFAULT_IFACE}\"";
-		$cmd .= " KRB5_CONFIG=\"$env->{KRB5_CONFIG}\"";
-		$cmd .= "KRB5CCNAME=\"$env->{KRB5_CCACHE}\" ";
-		$cmd .= " $samba_tool drs kcc $env->{DC_SERVER}";
-		$cmd .= " $env->{CONFIGURATION}";
-		$cmd .= " -U$dc_vars->{DC_USERNAME}\%$dc_vars->{DC_PASSWORD}";
-		unless (system($cmd) == 0) {
-			warn("Failed to exec kcc on remote DC\n$cmd");
-			return undef;
-		}
-
-		my $samba_tool =  Samba::bindir_path($self, "samba-tool");
-		my $cmd = "";
-		$cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$env->{SOCKET_WRAPPER_DEFAULT_IFACE}\"";
-		$cmd .= " KRB5_CONFIG=\"$env->{KRB5_CONFIG}\"";
-		$cmd .= "KRB5CCNAME=\"$env->{KRB5_CCACHE}\" ";
-		$cmd .= " $samba_tool drs kcc $env->{SERVER}";
-		$cmd .= " $env->{CONFIGURATION}";
-		$cmd .= " -U$dc_vars->{DC_USERNAME}\%$dc_vars->{DC_PASSWORD}";
-		unless (system($cmd) == 0) {
-			warn("Failed to exec kcc on promoted DC\n$cmd");
-			return undef;
-		}
-
 		# as 'vampired' dc may add data in its local replica
 		# we need to synchronize data between DCs
 		my $base_dn = "DC=".join(",DC=", split(/\./, $dc_vars->{REALM}));
@@ -2433,17 +2409,6 @@ sub setup_subdom_dc($$$)
 		# for primary domain partitions
 		my $samba_tool =  Samba::bindir_path($self, "samba-tool");
 		my $cmd = "";
-		$cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$env->{SOCKET_WRAPPER_DEFAULT_IFACE}\"";
-		$cmd .= " KRB5_CONFIG=\"$env->{KRB5_CONFIG}\"";
-		$cmd .= "KRB5CCNAME=\"$env->{KRB5_CCACHE}\" ";
-		$cmd .= " $samba_tool drs kcc $env->{DC_SERVER}";
-		$cmd .= " $env->{CONFIGURATION}";
-		$cmd .= " -U$dc_vars->{DC_USERNAME}\%$dc_vars->{DC_PASSWORD} --realm=$dc_vars->{DC_REALM}";
-		unless (system($cmd) == 0) {
-			warn("Failed to exec kcc on remote DC\n$cmd");
-			return undef;
-		}
-
 		# as 'subdomain' dc may add data in its local replica
 		# we need to synchronize data between DCs
 		my $base_dn = "DC=".join(",DC=", split(/\./, $env->{REALM}));
-- 
2.9.4



More information about the samba-technical mailing list