try { dt.decodeFromUrlString(tokenToRenew); long expirationTime = tokenManager.renewToken(dt, requestUgi.getShortUserName()); map = new HashMap();
try { dt.decodeFromUrlString(tokenToRenew); long expirationTime = tokenManager.renewToken(dt, requestUgi.getShortUserName()); map = new HashMap();
try { dt.decodeFromUrlString(tokenToRenew); long expirationTime = tokenManager.renewToken(dt, requestUgi.getShortUserName()); map = new HashMap();
try { dt.decodeFromUrlString(tokenToRenew); long expirationTime = tokenManager.renewToken(dt, requestUgi.getShortUserName()); map = new HashMap();
try { dt.decodeFromUrlString(tokenToRenew); long expirationTime = tokenManager.renewToken(dt, requestUgi.getShortUserName()); map = new HashMap();
@SuppressWarnings("unchecked") @Test public void testDTManager() throws Exception { Configuration conf = new Configuration(false); conf.setLong(DelegationTokenManager.UPDATE_INTERVAL, DAY_IN_SECS); conf.setLong(DelegationTokenManager.MAX_LIFETIME, DAY_IN_SECS); conf.setLong(DelegationTokenManager.RENEW_INTERVAL, DAY_IN_SECS); conf.setLong(DelegationTokenManager.REMOVAL_SCAN_INTERVAL, DAY_IN_SECS); conf.getBoolean(DelegationTokenManager.ENABLE_ZK_KEY, enableZKKey); DelegationTokenManager tm = new DelegationTokenManager(conf, new Text("foo")); tm.init(); Token<DelegationTokenIdentifier> token = (Token<DelegationTokenIdentifier>) tm.createToken( UserGroupInformation.getCurrentUser(), "foo"); Assert.assertNotNull(token); tm.verifyToken(token); Assert.assertTrue(tm.renewToken(token, "foo") > System.currentTimeMillis()); tm.cancelToken(token, "foo"); try { tm.verifyToken(token); Assert.fail(); } catch (IOException ex) { //NOP } catch (Exception ex) { Assert.fail(); } tm.destroy(); }
@SuppressWarnings("unchecked") @Test public void testDTManager() throws Exception { Configuration conf = new Configuration(false); conf.setLong(DelegationTokenManager.UPDATE_INTERVAL, DAY_IN_SECS); conf.setLong(DelegationTokenManager.MAX_LIFETIME, DAY_IN_SECS); conf.setLong(DelegationTokenManager.RENEW_INTERVAL, DAY_IN_SECS); conf.setLong(DelegationTokenManager.REMOVAL_SCAN_INTERVAL, DAY_IN_SECS); conf.getBoolean(DelegationTokenManager.ENABLE_ZK_KEY, enableZKKey); DelegationTokenManager tm = new DelegationTokenManager(conf, new Text("foo")); tm.init(); Token<DelegationTokenIdentifier> token = (Token<DelegationTokenIdentifier>) tm.createToken( UserGroupInformation.getCurrentUser(), "foo"); Assert.assertNotNull(token); tm.verifyToken(token); Assert.assertTrue(tm.renewToken(token, "foo") > System.currentTimeMillis()); tm.cancelToken(token, "foo"); try { tm.verifyToken(token); Assert.fail(); } catch (IOException ex) { //NOP } catch (Exception ex) { Assert.fail(); } tm.destroy(); }
@SuppressWarnings("unchecked") @Test public void testRenewTokenSingleManager() throws Exception { for (int i = 0; i < TEST_RETRIES; i++) { DelegationTokenManager tm1 = null; String connectString = zkServer.getConnectString(); Configuration conf = getSecretConf(connectString); tm1 = new DelegationTokenManager(conf, new Text("foo")); tm1.init(); Token<DelegationTokenIdentifier> token = (Token<DelegationTokenIdentifier>) tm1.createToken(UserGroupInformation.getCurrentUser(), "foo"); Assert.assertNotNull(token); tm1.renewToken(token, "foo"); tm1.verifyToken(token); verifyDestroy(tm1, conf); } }
@SuppressWarnings("unchecked") @Test public void testRenewTokenSingleManager() throws Exception { for (int i = 0; i < TEST_RETRIES; i++) { DelegationTokenManager tm1 = null; String connectString = zkServer.getConnectString(); Configuration conf = getSecretConf(connectString); tm1 = new DelegationTokenManager(conf, new Text("foo")); tm1.init(); Token<DelegationTokenIdentifier> token = (Token<DelegationTokenIdentifier>) tm1.createToken(UserGroupInformation.getCurrentUser(), "foo"); Assert.assertNotNull(token); tm1.renewToken(token, "foo"); tm1.verifyToken(token); verifyDestroy(tm1, conf); } }
Assert.assertNotNull(token); tm2.verifyToken(token); tm2.renewToken(token, "foo"); tm1.verifyToken(token); tm1.cancelToken(token, "foo"); Assert.assertNotNull(token); tm1.verifyToken(token); tm1.renewToken(token, "bar"); tm2.verifyToken(token); tm2.cancelToken(token, "bar");
Assert.assertNotNull(token); tm2.verifyToken(token); tm2.renewToken(token, "foo"); tm1.verifyToken(token); tm1.cancelToken(token, "foo"); Assert.assertNotNull(token); tm1.verifyToken(token); tm1.renewToken(token, "bar"); tm2.verifyToken(token); tm2.cancelToken(token, "bar");