@BeforeClass public static void setup() throws Exception { kerberos = true; pooled = true; beforeSetup(); setupConf(); startSentryService(); afterSetup(); }
protected static void assertOK(TSentryResponseStatus resp) { assertStatus(Status.OK, resp); }
public static void setupConf() throws Exception { if (kerberos) { setupKdc(); kdc = getKdc(); kdcWorkDir = getWorkDir(); serverKeytab = new File(kdcWorkDir, "server.keytab"); clientKeytab = new File(kdcWorkDir, "client.keytab"); kdc.createPrincipal(serverKeytab, SERVER_PRINCIPAL); kdc.createPrincipal(clientKeytab, CLIENT_PRINCIPAL); conf.set(ServerConfig.PRINCIPAL, getServerKerberosName()); conf.set(ServerConfig.KEY_TAB, serverKeytab.getPath()); conf.set(ServerConfig.ALLOW_CONNECT, CLIENT_KERBEROS_SHORT_NAME); conf.set(ServerConfig.SERVER_HA_ZOOKEEPER_CLIENT_PRINCIPAL, getServerKerberosName()); conf.set(ServerConfig.SERVER_HA_ZOOKEEPER_CLIENT_KEYTAB, serverKeytab.getPath()); zkServer = getZKServer(); conf.set(ServerConfig.SENTRY_HA_ENABLED, "true"); conf.set(ServerConfig.SENTRY_HA_ZOOKEEPER_QUORUM, zkServer.getConnectString());
@AfterClass public static void tearDown() throws Exception { beforeTeardown(); if(clientLoginContext != null) { try { clientLoginContext.logout(); } catch (Exception e) { LOGGER.warn("Error logging client out", e); } } if(server != null) { server.stop(); } if (dbDir != null) { FileUtils.deleteQuietly(dbDir); } stopMiniKdc(); afterTeardown(); }
@BeforeClass public static void setup() throws Exception { webServerEnabled = true; webSecurity = false; SentryServiceIntegrationBase.setup(); REQUEST_URL= "http://" + SERVER_HOST + ":" + webServerPort + "/admin/publishMessage?topic=%s&message=%s"; }
@AfterClass public static void tearDown() throws Exception { beforeTeardown(); if(server != null) { server.stop(); } if (dbDir != null) { FileUtils.deleteQuietly(dbDir); } SentryMiniKdcTestcase.stopMiniKdc(); afterTeardown(); }
public static void setupConf() throws Exception { if (kerberos) { setupKdc(); kdc = SentryMiniKdcTestcase.getKdc(); kdcWorkDir = SentryMiniKdcTestcase.getWorkDir(); kdc.createPrincipal(serverKeytab, SERVER_PRINCIPAL); kdc.createPrincipal(clientKeytab, CLIENT_PRINCIPAL); conf.set(ServerConfig.PRINCIPAL, getServerKerberosName()); conf.set(ServerConfig.KEY_TAB, serverKeytab.getPath()); conf.set(ServerConfig.ALLOW_CONNECT, CLIENT_KERBEROS_SHORT_NAME); conf.set(ServerConfig.SERVER_HA_ZOOKEEPER_CLIENT_PRINCIPAL, getServerKerberosName()); conf.set(ServerConfig.SERVER_HA_ZOOKEEPER_CLIENT_KEYTAB, serverKeytab.getPath());
@Before public void preparePolicyFile() throws Exception { super.before(); String requestorUserName = ADMIN_USER; Set<String> requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP); setLocalGroupMapping(requestorUserName, requestorUserGroupNames); writePolicyFile(); }
@Before public void before() throws Exception { policyFilePath = new File(dbDir, "local_policy_file.ini"); conf.set(ServerConfig.SENTRY_STORE_GROUP_MAPPING_RESOURCE, policyFilePath.getPath()); policyFile = new PolicyFile(); connectToSentryService(); }
@After public void after() { try { runTestAsSubject(new TestOperation() { @Override public void runTestAsSubject() throws Exception { if (client != null) { Set<TSentryRole> tRoles = client.listAllRoles(ADMIN_USER); if (tRoles != null) { for (TSentryRole tRole : tRoles) { client.dropRole(ADMIN_USER, tRole.getRoleName()); } } client.close(); } } }); } catch (Exception e) { LOGGER.error(e.getMessage(), e); } finally { policyFilePath.delete(); } }
@BeforeClass public static void setup() throws Exception { webServerEnabled = true; webSecurity = false; SentryServiceIntegrationBase.setup(); }
@Before public void preparePolicyFile() throws Exception { super.before(); String requestorUserName = ADMIN_USER; Set<String> requestorUserGroupNames = Sets.newHashSet(ADMIN_GROUP); setLocalGroupMapping(requestorUserName, requestorUserGroupNames); writePolicyFile(); }
@Before public void before() throws Exception { policyFilePath = new File(dbDir, "local_policy_file.ini"); conf.set(ServerConfig.SENTRY_STORE_GROUP_MAPPING_RESOURCE, policyFilePath.getPath()); policyFile = new PolicyFile(); connectToSentryService(); }
@After public void after() { try { runTestAsSubject(new TestOperation() { @Override public void runTestAsSubject() throws Exception { if (client != null) { Set<TSentryRole> tRoles = client.listRoles(ADMIN_USER); if (tRoles != null) { for (TSentryRole tRole : tRoles) { client.dropRole(ADMIN_USER, tRole.getRoleName()); } } client.close(); } } }); } catch (Exception e) { LOGGER.error(e.getMessage(), e); } finally { policyFilePath.delete(); } }
@BeforeClass public static void setup() throws Exception { kerberos = true; pooled = true; beforeSetup(); setupConf(); startSentryService(); afterSetup(); }
@BeforeClass public static void setup() throws Exception { SERVER_KERBEROS_NAME = "sentry/_HOST@" + REALM; SentryServiceIntegrationBase.setup(); }
protected static void assertOK(TSentryResponseStatus resp) { assertStatus(Status.OK, resp); }
@BeforeClass public static void setup() throws Exception { SentryServiceIntegrationBase.beforeSetup(); SentryServiceIntegrationBase.setupConf(); SentryServiceIntegrationBase.startSentryService(); SentryServiceIntegrationBase.afterSetup(); SentryServiceIntegrationBase.kerberos = false; }
@BeforeClass public static void setup() throws Exception { SentryServiceIntegrationBase.webServerEnabled = true; SentryServiceIntegrationBase.webSecurity = true; SentryServiceIntegrationBase.setup(); }
@BeforeClass public static void setup() throws Exception { SentryServiceIntegrationBase.beforeSetup(); SentryServiceIntegrationBase.setupConf(); SentryServiceIntegrationBase.startSentryService(); SentryServiceIntegrationBase.afterSetup(); SentryServiceIntegrationBase.kerberos = false; }