selftest: Add check customdc has valid realm/domain
[samba.git] / selftest / target / Samba4.pm
index b1c6aa459c19502021702ff607aa91ed14062c68..d647a5c29a000ce451aacb68efb3973fa5b0b528 100755 (executable)
@@ -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,