ConnectionQueryServices connectionQueryServices = null; final ConnectionInfo normalizedConnInfo = connInfo.normalize(services.getProps(), info); try { connectionQueryServices =
public Void run() throws Exception { String url = joinUserAuthentication(BASE_URL, princ1, keytab1); connections.add(ConnectionInfo.create(url).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); return null; } });
public Void run() throws Exception { String url = joinUserAuthentication(BASE_URL, princ2, keytab2); connections.add(ConnectionInfo.create(url).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); return null; } });
ConnectionQueryServices connectionQueryServices = null; final ConnectionInfo normalizedConnInfo = connInfo.normalize(services.getProps(), info); try { connectionQueryServices =
ConnectionQueryServices connectionQueryServices = null; final ConnectionInfo normalizedConnInfo = connInfo.normalize(services.getProps(), info); try { connectionQueryServices =
connections.add(ConnectionInfo.create(url1).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); assertEquals(1, connections.size()); connections.add(ConnectionInfo.create(url1).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); assertEquals(1, connections.size()); connections.add(ConnectionInfo.create(url2).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); assertEquals(2, connections.size()); verifyAllConnectionsAreKerberosBased(connections); connections.add(ConnectionInfo.create(url2).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); assertEquals(2, connections.size()); verifyAllConnectionsAreKerberosBased(connections); connections.add(ConnectionInfo.create(url1).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); assertEquals(3, connections.size()); verifyAllConnectionsAreKerberosBased(connections);
@Test public void testAlternatingDestructiveLogins() throws Exception { final HashSet<ConnectionInfo> connections = new HashSet<>(); final String princ1 = getUserPrincipal(1); final File keytab1 = getUserKeytabFile(1); final String princ2 = getUserPrincipal(2); final File keytab2 = getUserKeytabFile(2); final String url1 = joinUserAuthentication(BASE_URL, princ1, keytab1); final String url2 = joinUserAuthentication(BASE_URL, princ2, keytab2); UserGroupInformation.loginUserFromKeytab(princ1, keytab1.getPath()); // Using the same UGI should result in two equivalent ConnectionInfo objects connections.add(ConnectionInfo.create(url1).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); assertEquals(1, connections.size()); // Sanity check verifyAllConnectionsAreKerberosBased(connections); UserGroupInformation.loginUserFromKeytab(princ2, keytab2.getPath()); connections.add(ConnectionInfo.create(url2).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); assertEquals(2, connections.size()); verifyAllConnectionsAreKerberosBased(connections); // Because the UGI instances are unique, so are the connections UserGroupInformation.loginUserFromKeytab(princ1, keytab1.getPath()); connections.add(ConnectionInfo.create(url1).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); assertEquals(3, connections.size()); verifyAllConnectionsAreKerberosBased(connections); }
@Test public void testAlternatingConnectionsWithoutLogin() throws Exception { final HashSet<ConnectionInfo> connections = new HashSet<>(); final String princ1 = getUserPrincipal(1); final File keytab1 = getUserKeytabFile(1); final String princ2 = getUserPrincipal(2); final File keytab2 = getUserKeytabFile(2); final String url1 = joinUserAuthentication(BASE_URL, princ1, keytab1); final String url2 = joinUserAuthentication(BASE_URL, princ2, keytab2); // Using the same UGI should result in two equivalent ConnectionInfo objects connections.add(ConnectionInfo.create(url1).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); assertEquals(1, connections.size()); // Sanity check verifyAllConnectionsAreKerberosBased(connections); // Because the UGI instances are unique, so are the connections connections.add(ConnectionInfo.create(url2).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); assertEquals(2, connections.size()); verifyAllConnectionsAreKerberosBased(connections); // Using the same UGI should result in two equivalent ConnectionInfo objects connections.add(ConnectionInfo.create(url1).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); assertEquals(3, connections.size()); // Sanity check verifyAllConnectionsAreKerberosBased(connections); }
@Test public void testMultipleConnectionsAsSameUser() throws Exception { final HashSet<ConnectionInfo> connections = new HashSet<>(); final String princ1 = getUserPrincipal(1); final File keytab1 = getUserKeytabFile(1); final String url = joinUserAuthentication(BASE_URL, princ1, keytab1); UserGroupInformation.loginUserFromKeytab(princ1, keytab1.getPath()); // Using the same UGI should result in two equivalent ConnectionInfo objects connections.add(ConnectionInfo.create(url).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); assertEquals(1, connections.size()); // Sanity check verifyAllConnectionsAreKerberosBased(connections); // Because the UGI instances are unique, so are the connections connections.add(ConnectionInfo.create(url).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); assertEquals(1, connections.size()); }
@Test public void testMultipleConnectionsAsSameUserWithoutLogin() throws Exception { final HashSet<ConnectionInfo> connections = new HashSet<>(); final String princ1 = getUserPrincipal(1); final File keytab1 = getUserKeytabFile(1); // Using the same UGI should result in two equivalent ConnectionInfo objects final String url = joinUserAuthentication(BASE_URL, princ1, keytab1); connections.add(ConnectionInfo.create(url).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); assertEquals(1, connections.size()); // Sanity check verifyAllConnectionsAreKerberosBased(connections); // Because the UGI instances are unique, so are the connections connections.add(ConnectionInfo.create(url).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); assertEquals(1, connections.size()); }
public Void run() throws Exception { String url = joinUserAuthentication(BASE_URL, princ1, keytab1); connections.add(ConnectionInfo.create(url).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); return null; } };
public Void run() throws Exception { String url = joinUserAuthentication(BASE_URL, princ1, keytab1); connections.add(ConnectionInfo.create(url).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); return null; } });
public Void run() throws Exception { String url = joinUserAuthentication(BASE_URL, princ1, keytab1); connections.add(ConnectionInfo.create(url).normalize(ReadOnlyProps.EMPTY_PROPS, EMPTY_PROPERTIES)); return null; } };