Skip to content

Commit

Permalink
selftest: Add check customdc has valid realm/domain
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
  • Loading branch information
tlbeale authored and abartlet committed May 31, 2019
1 parent f2f0ebb commit 6defc1f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions selftest/target/Samba4.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6defc1f

Please sign in to comment.