From: Tim Beale Date: Thu, 30 May 2019 02:46:35 +0000 (+1200) Subject: selftest: Add check customdc has valid realm/domain X-Git-Tag: ldb-2.0.5~520 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6defc1f183d6a9f24af1674d1dfee36d9e9bdc76;p=thirdparty%2Fsamba.git selftest: Add check customdc has valid realm/domain If we couldn't determine the realm/domain from the backup file, it's a lot nicer to fail early with a clear error message (rather than failing later on with a really obscure message). Signed-off-by: Tim Beale Reviewed-by: Andrew Bartlett --- diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index b1c6aa459c1..d647a5c29a0 100755 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -3310,6 +3310,10 @@ sub setup_customdc # work out the correct domain/realm env values from the backup-file my ($domain, $realm) = $self->get_backup_domain_realm($backup_file); + if ($domain eq '' or $realm eq '') { + warn("Could not determine domain or realm"); + return undef; + } # create a placeholder directory and smb.conf, as well as the env vars. my ($env, $ctx) = $self->prepare_dc_testenv($prefix, $dc_name,