diff --git itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithDBTokenStore.java itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithDBTokenStore.java index 272c745a8f..7b8ae3bd57 100644 --- itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithDBTokenStore.java +++ itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithDBTokenStore.java @@ -51,13 +51,11 @@ public static void beforeTest() throws Exception { MetastoreConf.getVar(hiveConf, MetastoreConf.ConfVars.WAREHOUSE)); System.setProperty(HiveConf.ConfVars.METASTORECONNECTURLKEY.varname, MetastoreConf.getVar(hiveConf, MetastoreConf.ConfVars.CONNECT_URL_KEY)); - // Before this patch, the Embedded MetaStore was used here not the one started by the MiniHS2 - // The below 3 lines would change the tests to use the Remote MetaStore, but it will cause a - // failure. By removing the thrift MetaStore uris, the tests are passing again. - // I think this is an valid problem here, but not really sure about the - // tests original intention, so keep everything as it was originally. -// System.setProperty(HiveConf.ConfVars.METASTOREURIS.varname, -// MetastoreConf.getVar(hiveConf, MetastoreConf.ConfVars.THRIFT_URIS)); -// Thread.sleep(2000); + System.setProperty(ConfVars.METASTORE_USE_THRIFT_SASL.varname, + String.valueOf(MetastoreConf.getBoolVar(hiveConf, MetastoreConf.ConfVars.USE_THRIFT_SASL))); + System.setProperty(HiveConf.ConfVars.METASTORE_KERBEROS_PRINCIPAL.varname, + MetastoreConf.getVar(hiveConf, MetastoreConf.ConfVars.KERBEROS_PRINCIPAL)); + System.setProperty(ConfVars.METASTORE_KERBEROS_KEYTAB_FILE.varname, + MetastoreConf.getVar(hiveConf, MetastoreConf.ConfVars.KERBEROS_KEYTAB_FILE)); } } \ No newline at end of file diff --git itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithDBTokenStoreNoDoAs.java itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithDBTokenStoreNoDoAs.java index 5b7fb7ea5d..973714fe32 100644 --- itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithDBTokenStoreNoDoAs.java +++ itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithDBTokenStoreNoDoAs.java @@ -41,7 +41,7 @@ public static void beforeTest() throws Exception { HiveConf hiveConf = new HiveConf(); hiveConf.setVar(ConfVars.METASTORE_CLUSTER_DELEGATION_TOKEN_STORE_CLS, "org.apache.hadoop.hive.thrift.DBTokenStore"); hiveConf.setBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS, false); - miniHS2 = MiniHiveKdc.getMiniHS2WithKerbWithRemoteHMS(miniHiveKdc, hiveConf); + miniHS2 = MiniHiveKdc.getMiniHS2WithKerbWithRemoteHMSWithKerb(miniHiveKdc, hiveConf); miniHS2.start(confOverlay); String metastorePrincipal = miniHS2.getConfProperty(ConfVars.METASTORE_KERBEROS_PRINCIPAL.varname); String hs2Principal = miniHS2.getConfProperty(ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL.varname); @@ -53,6 +53,11 @@ public static void beforeTest() throws Exception { MetastoreConf.getVar(hiveConf, MetastoreConf.ConfVars.CONNECT_URL_KEY)); System.setProperty(HiveConf.ConfVars.METASTOREURIS.varname, MetastoreConf.getVar(hiveConf, MetastoreConf.ConfVars.THRIFT_URIS)); - Thread.sleep(2000); + System.setProperty(ConfVars.METASTORE_USE_THRIFT_SASL.varname, + String.valueOf(MetastoreConf.getBoolVar(hiveConf, MetastoreConf.ConfVars.USE_THRIFT_SASL))); + System.setProperty(HiveConf.ConfVars.METASTORE_KERBEROS_PRINCIPAL.varname, + MetastoreConf.getVar(hiveConf, MetastoreConf.ConfVars.KERBEROS_PRINCIPAL)); + System.setProperty(ConfVars.METASTORE_KERBEROS_KEYTAB_FILE.varname, + MetastoreConf.getVar(hiveConf, MetastoreConf.ConfVars.KERBEROS_KEYTAB_FILE)); } } \ No newline at end of file