[SCM] Samba Shared Repository - branch master updated

Matthieu Patou mat at samba.org
Sun Oct 31 17:11:01 MDT 2010


The branch, master has been updated
       via  3cef97a unit tests: remove trailling white spaces
       via  fda0f61 unit tests: allow make test to correctly and quickly exit in case of problem while provisionning a test environment
      from  d5883c8 replace/talloc: Avoid automatically pulling in new configure/Makefile, as these files are checked in, and the source might not be available.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 3cef97ad0e7008e3732cb32348761a4482c772be
Author: Matthieu Patou <mat at matws.net>
Date:   Mon Nov 1 01:05:03 2010 +0300

    unit tests: remove trailling white spaces
    
    Autobuild-User: Matthieu Patou <mat at samba.org>
    Autobuild-Date: Sun Oct 31 23:10:55 UTC 2010 on sn-devel-104

commit fda0f614d5267f27722a642c84091d5f9c5b6ac4
Author: Matthieu Patou <mat at matws.net>
Date:   Mon Nov 1 01:00:46 2010 +0300

    unit tests: allow make test to correctly and quickly exit in case of problem while provisionning a test environment

-----------------------------------------------------------------------

Summary of changes:
 selftest/target/Samba4.pm |  190 ++++++++++++++++++++++++---------------------
 1 files changed, 100 insertions(+), 90 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index e152426..e310f37 100644
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -13,10 +13,10 @@ use POSIX;
 sub new($$$$$) {
 	my ($classname, $bindir, $ldap, $setupdir, $exeext) = @_;
 	$exeext = "" unless defined($exeext);
-	my $self = { 
-		vars => {}, 
-		ldap => $ldap, 
-		bindir => $bindir, 
+	my $self = {
+		vars => {},
+		ldap => $ldap,
+		bindir => $bindir,
 		setupdir => $setupdir,
 		exeext => $exeext
 	};
@@ -79,7 +79,7 @@ sub slapd_stop($$)
 	return 1;
 }
 
-sub check_or_start($$$) 
+sub check_or_start($$$)
 {
 	my ($self, $env_vars, $max_time) = @_;
 	return 0 if ( -p $env_vars->{SAMBA_TEST_FIFO});
@@ -104,9 +104,9 @@ sub check_or_start($$$)
 		my $valgrind = "";
 		if (defined($ENV{SAMBA_VALGRIND})) {
 		    $valgrind = $ENV{SAMBA_VALGRIND};
-		} 
+		}
 
-		$ENV{KRB5_CONFIG} = $env_vars->{KRB5_CONFIG}; 
+		$ENV{KRB5_CONFIG} = $env_vars->{KRB5_CONFIG};
 		$ENV{WINBINDD_SOCKET_DIR} = $env_vars->{WINBINDD_SOCKET_DIR};
 
 		$ENV{NSS_WRAPPER_PASSWD} = $env_vars->{NSS_WRAPPER_PASSWD};
@@ -133,7 +133,7 @@ sub check_or_start($$$)
 
 		# allow selection of the process model using
 		# the environment varibale SAMBA_PROCESS_MODEL
-		# that allows us to change the process model for 
+		# that allows us to change the process model for
 		# individual machines in the build farm
 		my $model = "single";
 		if (defined($ENV{SAMBA_PROCESS_MODEL})) {
@@ -175,8 +175,8 @@ sub wait_for_start($$)
 	print "delaying for nbt name registration\n";
 	sleep 2;
 
-	# This will return quickly when things are up, but be slow if we 
-	# need to wait for (eg) SSL init 
+	# This will return quickly when things are up, but be slow if we
+	# need to wait for (eg) SSL init
 	my $nmblookup = $self->bindir_path("nmblookup");
 	system("$nmblookup $testenv_vars->{CONFIGURATION} $testenv_vars->{SERVER}");
 	system("$nmblookup $testenv_vars->{CONFIGURATION} -U $testenv_vars->{SERVER_IP} $testenv_vars->{SERVER}");
@@ -270,7 +270,7 @@ YX70obsCAQI=
 EOF
 	close(DHFILE);
 
-	#Likewise, we pregenerate the key material.  This allows the 
+	#Likewise, we pregenerate the key material.  This allows the
 	#other certificates to be pre-generated
 	open(KEYFILE, ">$keyfile");
 	print KEYFILE <<EOF;
@@ -312,7 +312,7 @@ yoZeAErTALjyZYZEPcECQQDlUi0N8DFxQ/lOwWyR3Hailft+mPqoPCa8QHlQZnlG
 -----END RSA PRIVATE KEY-----
 EOF
 
-	#generated with 
+	#generated with
 	# hxtool issue-certificate --self-signed --issue-ca \
 	# --ca-private-key="FILE:$KEYFILE" \
 	# --subject="CN=CA,DC=samba,DC=example,DC=com" \
@@ -336,7 +336,7 @@ HTLk2sGigsWwrJ2N99sG/cqSJLJ1MFwLrs6koweBnYU0f/g=
 -----END CERTIFICATE-----
 EOF
 
-	#generated with GNUTLS internally in Samba.  
+	#generated with GNUTLS internally in Samba.
 
 	open(CERTFILE, ">$certfile");
 	print CERTFILE <<EOF;
@@ -452,7 +452,7 @@ EOF
 
 sub provision_raw_prepare($$$$$$$$$$)
 {
-	my ($self, $prefix, $server_role, $netbiosname, $netbiosalias, 
+	my ($self, $prefix, $server_role, $netbiosname, $netbiosalias,
 	    $domain, $realm, $functional_level,
 	    $swiface, $password, $kdc_ipv4) = @_;
 	my $ctx;
@@ -697,7 +697,6 @@ nogroup:x:65534:nobody
 		warn("Failed to create a valid smb.conf configuration $testparm!");
 		return undef;
 	}
-
 	unless (system("($testparm $configuration -v --suppress-prompt --parameter-name=\"netbios name\" --section-name=global 2> /dev/null | grep -i \"^$ctx->{netbiosname}\" ) >/dev/null 2>&1") == 0) {
 		warn("Failed to create a valid smb.conf configuration! $testparm $configuration -v --suppress-prompt --parameter-name=\"netbios name\" --section-name=global");
 		return undef;
@@ -750,8 +749,8 @@ sub provision_raw_step2($$$)
 
 sub provision($$$$$$$$$)
 {
-	my ($self, $prefix, $server_role, $netbiosname, $netbiosalias, 
-	    $domain, $realm, $functional_level, 
+	my ($self, $prefix, $server_role, $netbiosname, $netbiosalias,
+	    $domain, $realm, $functional_level,
 	    $swiface, $password, $kdc_ipv4, $extra_smbconf_options) = @_;
 
 	my $ctx = $self->provision_raw_prepare($prefix, $server_role,
@@ -836,7 +835,8 @@ sub provision($$$$$$$$$)
 	}
 
 	my $ret = $self->provision_raw_step1($ctx);
-	unless ($ret) {
+	unless (defined $ret) {
+		print "coin coin\n";
 		return undef;
 	}
 
@@ -868,8 +868,8 @@ sub provision_member($$$)
 				   "member server",
 				   "localmember",
 				   "member3",
-				   "SAMBADOMAIN", 
-				   "samba.example.com", 
+				   "SAMBADOMAIN",
+				   "samba.example.com",
 				   "2008",
 				   3,
 				   "locMEMpass3",
@@ -922,8 +922,8 @@ sub provision_rpc_proxy($$$)
 				   "member server",
 				   "localrpcproxy",
 				   "rpcproxy4",
-				   "SAMBADOMAIN", 
-				   "samba.example.com", 
+				   "SAMBADOMAIN",
+				   "samba.example.com",
 				   "2008",
 				   4,
 				   "locRPCproxypass4",
@@ -965,8 +965,8 @@ sub provision_vampire_dc($$$)
 	my $ctx = $self->provision_raw_prepare($prefix, "domain controller",
 					       "localvampiredc",
 					       "dc2",
-					       "SAMBADOMAIN", 
-					       "samba.example.com", 
+					       "SAMBADOMAIN",
+					       "samba.example.com",
 					       "2008",
 					       2, $dcvars->{PASSWORD},
 					       $dcvars->{SERVER_IP});
@@ -1026,13 +1026,14 @@ sub provision_dc($$)
 				   "domain controller",
 				   "localdc",
 				   "dc1",
-				   "SAMBADOMAIN", 
-				   "samba.example.com", 
+				   "SAMBADOMAIN",
+				   "samba.example.com",
 				   "2008",
 				   1,
 				   "locDCpass1",
 				   "127.0.0.1", "");
 
+	return undef unless(defined $ret);
 	unless($self->add_wins_config("$prefix/private")) {
 		warn("Unable to add wins configuration");
 		return undef;
@@ -1057,8 +1058,8 @@ sub provision_fl2000dc($$)
 				   "domain controller",
 				   "dc5",
 				   "localfl2000dc",
-				   "SAMBA2000", 
-				   "samba2000.example.com", 
+				   "SAMBA2000",
+				   "samba2000.example.com",
 				   "2000",
 				   5,
 				   "locDCpass5",
@@ -1249,7 +1250,7 @@ sub getlog_env($$)
 	close(LOG);
 
 	return "" if $out eq $title;
- 
+
 	return $out;
 }
 
@@ -1357,11 +1358,13 @@ sub setup_member($$$)
 
 	my $env = $self->provision_member($path, $dc_vars);
 
-	$self->check_or_start($env, ($ENV{SMBD_MAXTIME} or 7500));
+	if (defined $env) {
+		$self->check_or_start($env, ($ENV{SMBD_MAXTIME} or 7500));
 
-	$self->wait_for_start($env);
+		$self->wait_for_start($env);
 
-	$self->{vars}->{member} = $env;
+		$self->{vars}->{member} = $env;
+	}
 
 	return $env;
 }
@@ -1372,12 +1375,13 @@ sub setup_rpc_proxy($$$)
 
 	my $env = $self->provision_rpc_proxy($path, $dc_vars);
 
+	if (defined $env) {
 	$self->check_or_start($env, ($ENV{SMBD_MAXTIME} or 7500));
 
 	$self->wait_for_start($env);
 
 	$self->{vars}->{rpc_proxy} = $env;
-
+	}
 	return $env;
 }
 
@@ -1386,14 +1390,14 @@ sub setup_dc($$)
 	my ($self, $path) = @_;
 
 	my $env = $self->provision_dc($path);
+	if (defined $env) {
+		$self->check_or_start($env,
+			($ENV{SMBD_MAXTIME} or 7500));
 
-	$self->check_or_start($env, 
-		($ENV{SMBD_MAXTIME} or 7500));
-
-	$self->wait_for_start($env);
-
-	$self->{vars}->{dc} = $env;
+		$self->wait_for_start($env);
 
+		$self->{vars}->{dc} = $env;
+	}
 	return $env;
 }
 
@@ -1402,13 +1406,14 @@ sub setup_fl2000dc($$)
 	my ($self, $path) = @_;
 
 	my $env = $self->provision_fl2000dc($path);
+	if (defined $env) {
+		$self->check_or_start($env,
+			($ENV{SMBD_MAXTIME} or 7500));
 
-	$self->check_or_start($env, 
-		($ENV{SMBD_MAXTIME} or 7500));
-
-	$self->wait_for_start($env);
+		$self->wait_for_start($env);
 
-	$self->{vars}->{fl2000dc} = $env;
+		$self->{vars}->{fl2000dc} = $env;
+	}
 
 	return $env;
 }
@@ -1419,13 +1424,14 @@ sub setup_fl2003dc($$)
 
 	my $env = $self->provision_fl2003dc($path);
 
-	$self->check_or_start($env,
-		($ENV{SMBD_MAXTIME} or 7500));
+	if (defined $env) {
+		$self->check_or_start($env,
+			($ENV{SMBD_MAXTIME} or 7500));
 
-	$self->wait_for_start($env);
-
-	$self->{vars}->{fl2003dc} = $env;
+		$self->wait_for_start($env);
 
+		$self->{vars}->{fl2003dc} = $env;
+	}
 	return $env;
 }
 
@@ -1435,12 +1441,14 @@ sub setup_fl2008r2dc($$)
 
 	my $env = $self->provision_fl2008r2dc($path);
 
-	$self->check_or_start($env,
-		($ENV{SMBD_MAXTIME} or 7500));
+	if (defined $env) {
+		$self->check_or_start($env,
+			($ENV{SMBD_MAXTIME} or 7500));
 
-	$self->wait_for_start($env);
+		$self->wait_for_start($env);
 
-	$self->{vars}->{fl2008r2dc} = $env;
+		$self->{vars}->{fl2008r2dc} = $env;
+	}
 
 	return $env;
 }
@@ -1451,44 +1459,46 @@ sub setup_vampire_dc($$$)
 
 	my $env = $self->provision_vampire_dc($path, $dc_vars);
 
-	$self->check_or_start($env,
-		($ENV{SMBD_MAXTIME} or 7500));
-
-	$self->wait_for_start($env);
-
-	$self->{vars}->{vampire_dc} = $env;
-
-	# force replicated DC to update repsTo/repsFrom
-	# for vampired partitions
-	my $samba_tool = $self->bindir_path("samba-tool");
-	my $cmd = "";
-	$cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$env->{SOCKET_WRAPPER_DEFAULT_IFACE}\"";
-	$cmd .= " KRB5_CONFIG=\"$env->{KRB5_CONFIG}\"";
-	$cmd .= " $samba_tool drs kcc $env->{DC_SERVER}";
-	$cmd .= " -U$dc_vars->{DC_USERNAME}\%$dc_vars->{DC_PASSWORD}";
-	unless (system($cmd) == 0) {
-		warn("Failed to exec kcc\n$cmd");
-		return undef;
-	}
+	if (defined $env) {
+		$self->check_or_start($env,
+			($ENV{SMBD_MAXTIME} or 7500));
+
+		$self->wait_for_start($env);
+
+		$self->{vars}->{vampire_dc} = $env;
+
+		# force replicated DC to update repsTo/repsFrom
+		# for vampired partitions
+		my $samba_tool = $self->bindir_path("samba-tool");
+		my $cmd = "";
+		$cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$env->{SOCKET_WRAPPER_DEFAULT_IFACE}\"";
+		$cmd .= " KRB5_CONFIG=\"$env->{KRB5_CONFIG}\"";
+		$cmd .= " $samba_tool drs kcc $env->{DC_SERVER}";
+		$cmd .= " -U$dc_vars->{DC_USERNAME}\%$dc_vars->{DC_PASSWORD}";
+		unless (system($cmd) == 0) {
+			warn("Failed to exec kcc\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 = "SOCKET_WRAPPER_DEFAULT_IFACE=\"$env->{SOCKET_WRAPPER_DEFAULT_IFACE}\"";
-	$cmd .= " KRB5_CONFIG=\"$env->{KRB5_CONFIG}\"";
-	$cmd .= " $samba_tool drs replicate $env->{DC_SERVER} $env->{VAMPIRE_DC_SERVER}";
-	$cmd .= " -U$dc_vars->{DC_USERNAME}\%$dc_vars->{DC_PASSWORD}";
-	# replicate Configuration NC
-	my $cmd_repl = "$cmd \"CN=Configuration,$base_dn\"";
-	unless(system($cmd_repl) == 0) {
-		warn("Failed to replicate\n$cmd_repl");
-		return undef;
-	}
-	# replicate Default NC
-	$cmd_repl = "$cmd \"$base_dn\"";
-	unless(system($cmd_repl) == 0) {
-		warn("Failed to replicate\n$cmd_repl");
-		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 = "SOCKET_WRAPPER_DEFAULT_IFACE=\"$env->{SOCKET_WRAPPER_DEFAULT_IFACE}\"";
+		$cmd .= " KRB5_CONFIG=\"$env->{KRB5_CONFIG}\"";
+		$cmd .= " $samba_tool drs replicate $env->{DC_SERVER} $env->{VAMPIRE_DC_SERVER}";
+		$cmd .= " -U$dc_vars->{DC_USERNAME}\%$dc_vars->{DC_PASSWORD}";
+		# replicate Configuration NC
+		my $cmd_repl = "$cmd \"CN=Configuration,$base_dn\"";
+		unless(system($cmd_repl) == 0) {
+			warn("Failed to replicate\n$cmd_repl");
+			return undef;
+		}
+		# replicate Default NC
+		$cmd_repl = "$cmd \"$base_dn\"";
+		unless(system($cmd_repl) == 0) {
+			warn("Failed to replicate\n$cmd_repl");
+			return undef;
+		}
 	}
 
 	return $env;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list