selftest: Create AD users alice and bob
authorAndreas Schneider <asn@samba.org>
Sun, 25 Sep 2016 16:41:50 +0000 (18:41 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 7 Oct 2016 10:09:09 +0000 (12:09 +0200)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
selftest/target/Samba4.pm

index a09abea59346e5da8c53f70d19b31ddfad03e713..40cca9451ec01af230ef9dc2ff35280d4d0ac044 100755 (executable)
@@ -805,6 +805,22 @@ userPrincipalName: testdenied_upn\@$ctx->{realm}.upn
                return undef;
        }
 
+       # Create to users alice and bob!
+       my $user_account_array = ["alice", "bob"];
+
+       foreach my $user_account (@{$user_account_array}) {
+               my $samba_tool_cmd = "";
+
+               $samba_tool_cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
+               $samba_tool_cmd .= "KRB5CCNAME=\"$ret->{KRB5_CCACHE}\" ";
+               $samba_tool_cmd .= Samba::bindir_path($self, "samba-tool")
+                   . " user create --configfile=$ctx->{smb_conf} $user_account Secret007";
+               unless (system($samba_tool_cmd) == 0) {
+                       warn("Unable to create user: $user_account\n$samba_tool_cmd\n");
+                       return undef;
+               }
+       }
+
        return $ret;
 }