Skip to content

Commit 571f538

Browse files
georgeajitgeorgeajit
authored andcommitted
#995 - Test changes for principal user
1 parent bae6344 commit 571f538

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/functionaltest/TestDatabaseClientKerberosFromFile.java

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public class TestDatabaseClientKerberosFromFile extends BasicJavaClientREST {
124124
private static String appServerName = "REST-Java-Client-API-ServerKerberos";
125125
// External security name to be set for the App Server.
126126
private static String extSecurityName = "KerberosExtSec";
127-
private static String kdcPrincipalUser = "user2@MLTEST1.LOCAL";
127+
private static String kdcPrincipalUser = "builder@MLTEST1.LOCAL";
128128
private static String keytabFile;
129129
private static String principal;
130130

@@ -135,6 +135,19 @@ public static void setUpBeforeClass() throws Exception {
135135
System.out.println("In setup");
136136
loadGradleProperties();
137137
appServerHostName = getRestAppServerHostName();
138+
139+
// Modify default location if needed for services.keytab file.
140+
keytabFile = System.getProperty("keytabFile");
141+
principal = System.getProperty("principal", kdcPrincipalUser);
142+
143+
System.out.println("Location of key tab file is " + keytabFile);
144+
145+
if (keytabFile == null) {
146+
fail("Key tab file value from Gradle is null / incorrect");
147+
}
148+
if (!(new File(keytabFile).exists())) {
149+
fail("Key tab file does not exist or is invalid");
150+
}
138151

139152
setupJavaRESTServer(dbName, fNames[0], appServerName, appServerHostPort);
140153
createAutomaticGeoIndex();
@@ -145,30 +158,21 @@ public static void setUpBeforeClass() throws Exception {
145158
// Associate the external security with the App Server.
146159
associateRESTServerWithKerberosExtSecurity(appServerName, extSecurityName);
147160
createUserRolesWithPrevilages("test-evalKer", "xdbc:eval", "xdbc:eval-in", "xdmp:eval-in", "any-uri", "xdbc:invoke");
148-
createRESTKerberosUser("user2", "MarkLogic200", kdcPrincipalUser, "admin", "test-evalKer");
161+
createRESTKerberosUser("builder", "Welcome123", kdcPrincipalUser, "admin", "test-evalKer");
149162
createRESTUser("rest-admin", "x", "rest-admin");
150163
}
151164

152165
@AfterClass
153166
public static void tearDownAfterClass() throws Exception {
154167
System.out.println("In tear down");
155168
deleteUserRole("test-evalKer");
156-
deleteRESTUser("user2");
169+
deleteRESTUser("builder");
157170
tearDownJavaRESTServer(dbName, fNames, appServerName);
158171
}
159172

160173
@Before
161174
public void setUp() throws KeyManagementException, NoSuchAlgorithmException, Exception {
162175
SSLContext sslcontext = null;
163-
// Modify default location if needed for services.keytab file.
164-
keytabFile = System.getProperty("keytabFile", "/space/Jenkins/workspace/services.keytab");
165-
principal = System.getProperty("principal");
166-
167-
System.out.println("Location of key tab file is " + keytabFile);
168-
169-
if (keytabFile == null || !(new File(keytabFile).exists())) {
170-
fail("Key tab file does not exist or is invalid");
171-
}
172176

173177
if (IsSecurityEnabled()) {
174178
sslcontext = getSslContext();

0 commit comments

Comments
 (0)