From a45ac73ef854fc5afb5e727288136574acd52d64 Mon Sep 17 00:00:00 2001 From: asreekumar Date: Mon, 22 Sep 2014 15:57:56 -0700 Subject: [PATCH] Update TestDriverCurl.pm and build.xml to accomodate AD-MIT authentication --- hcatalog/src/test/e2e/templeton/build.xml | 4 ++++ hcatalog/src/test/e2e/templeton/drivers/TestDriverCurl.pm | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/hcatalog/src/test/e2e/templeton/build.xml b/hcatalog/src/test/e2e/templeton/build.xml index b817d21..657f7a9 100644 --- a/hcatalog/src/test/e2e/templeton/build.xml +++ b/hcatalog/src/test/e2e/templeton/build.xml @@ -111,6 +111,7 @@ + @@ -148,6 +149,7 @@ + @@ -186,6 +188,7 @@ + @@ -216,6 +219,7 @@ + diff --git a/hcatalog/src/test/e2e/templeton/drivers/TestDriverCurl.pm b/hcatalog/src/test/e2e/templeton/drivers/TestDriverCurl.pm index 23a472e..1c61bcc 100644 --- a/hcatalog/src/test/e2e/templeton/drivers/TestDriverCurl.pm +++ b/hcatalog/src/test/e2e/templeton/drivers/TestDriverCurl.pm @@ -193,6 +193,7 @@ sub globalSetup $globalHash->{'db_password'} = $ENV{'DB_PASSWORD'}; $globalHash->{'is_secure_mode'} = $ENV{'SECURE_MODE'}; + $globalHash->{'user_realm'} = $ENV{'USER_REALM'}; # add libexec location to the path if (defined($ENV{'PATH'})) { @@ -491,7 +492,14 @@ () } elsif(scalar @files > 1){ die "More than one keytab file found for user $user_name in $keytab_dir"; } - my @cmd = ('kinit', '-k', '-t', $files[0], $user_name); + my @cmd = (); + if (defined $testCmd->{'user_realm'}){ + my $user_name_with_realm_name = $user_name.'@'.$testCmd->{'user_realm'}; + @cmd = ('kinit', '-k', '-t', $files[0], $user_name_with_realm_name); + } + else{ + @cmd = ('kinit', '-k', '-t', $files[0], $user_name); + } print $log "Command @cmd"; IPC::Run::run(\@cmd, \undef, $log, $log) or die "Could not kinit as $user_name using " . $files[0] . " $ERRNO"; -- 1.8.5.2 (Apple Git-48)