From b44f4325bb454b10323f1d4576343a9d3e6260ab Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 27 Apr 2011 22:18:18 +1000 Subject: selftest: Don't die() when the join fails This kills off everything without a proper shutdown, and is difficult to debug. Andrew Bartlett --- selftest/target/Samba3.pm | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'selftest') diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index d6dbe0cfa3..1c158f9341 100644 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -178,7 +178,10 @@ sub setup_member($$$) $cmd .= "$net join $ret->{CONFIGURATION} $s3dcvars->{DOMAIN} member"; $cmd .= " -U$s3dcvars->{USERNAME}\%$s3dcvars->{PASSWORD}"; - system($cmd) == 0 or die("Join failed\n$cmd"); + if (system($cmd) != 0) { + warn("Join failed\n$cmd"); + return undef; + } $self->check_or_start($ret, "yes", "yes", "yes"); @@ -239,7 +242,10 @@ sub setup_admember($$$$) $cmd .= "$net join $ret->{CONFIGURATION}"; $cmd .= " -U$dcvars->{USERNAME}\%$dcvars->{PASSWORD}"; - system($cmd) == 0 or die("Join failed\n$cmd"); + if (system($cmd) != 0) { + warn("Join failed\n$cmd"); + return undef; + } $self->check_or_start($ret, "yes", "yes", "yes"); @@ -251,10 +257,13 @@ sub setup_admember($$$$) $cmd = ""; $cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$ret->{SOCKET_WRAPPER_DEFAULT_IFACE}\" "; $cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" "; - $cmd .= "$smbcacls //127.0.0.29/tmp / -U$ret->{USERNAME}%$ret->{PASSWORD} "; - $cmd .= "$ret->{CONFIGURATION} -S ACL:$dcvars->{DOMAIN}\\\\Domain\\ Users:ALLOWED/0x0/FULL"; + $cmd .= "$smbcacls $ret->{CONFIGURATION} //127.0.0.29/tmp / -U$ret->{USERNAME}%$ret->{PASSWORD} "; + $cmd .= "-S ACL:$dcvars->{DOMAIN}\\\\Domain\\ Users:ALLOWED/0x0/FULL"; - system($cmd) == 0 or die("Join failed\n$cmd"); + if (system($cmd) != 0) { + warn("smbcacls failed\n$cmd"); + return undef; + } $ret->{DC_SERVER} = $dcvars->{SERVER}; $ret->{DC_SERVER_IP} = $dcvars->{SERVER_IP}; -- cgit