You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jo...@apache.org on 2019/10/03 04:34:02 UTC

[impala] 02/02: IMPALA-8960: Fix test_owner_privileges::test_drop_if_exists on S3

This is an automated email from the ASF dual-hosted git repository.

joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 88cc930a94c600a87c3fc034733a298a37df9bfc
Author: Joe McDonnell <jo...@cloudera.com>
AuthorDate: Fri Sep 27 12:04:57 2019 -0700

    IMPALA-8960: Fix test_owner_privileges::test_drop_if_exists on S3
    
    hdfs:// URIs do not work on Impala's S3 tests. The fix is to drop
    the hdfs:// part of the URI. Our tests run against the default
    filesystem, so dropping the hdfs:// works on both HDFS test setups
    and S3 test setups.
    
    Testing:
     - Ran tests on S3
     - Ran test_owner_privileges.py on HDFS locally
    
    Change-Id: Ibfe15ac2d5ba0d8a6d4383be8d01395c74d67332
    Reviewed-on: http://gerrit.cloudera.org:8080/14334
    Reviewed-by: Michael Ho <kw...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 tests/authorization/test_owner_privileges.py | 5 +++--
 tests/common/sentry_cache_test_suite.py      | 6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/tests/authorization/test_owner_privileges.py b/tests/authorization/test_owner_privileges.py
index 0c3fd44..4bc4fde 100644
--- a/tests/authorization/test_owner_privileges.py
+++ b/tests/authorization/test_owner_privileges.py
@@ -25,6 +25,7 @@ from os import getenv
 from tests.common.sentry_cache_test_suite import SentryCacheTestSuite, TestObject
 from tests.common.test_dimensions import create_uncompressed_text_dimension
 from tests.common.skip import SkipIfHive3
+from tests.util.filesystem_utils import FILESYSTEM_PREFIX
 
 # Sentry long polling frequency to make Sentry refresh not run.
 SENTRY_LONG_POLLING_FREQUENCY_S = 3600
@@ -169,8 +170,8 @@ class TestOwnerPrivileges(SentryCacheTestSuite):
     # oo_user1 needs permissions to create a view based of functional.alltypes
     self.execute_query("grant select on database functional to oo_user1_role")
     # oo_user1 needs permissions to create a function based of libTestUdfs.so
-    self.execute_query("grant all on uri 'hdfs:///test-warehouse/libTestUdfs.so' to"
-        " oo_user1_role")
+    self.execute_query("grant all on uri '{0}/test-warehouse/libTestUdfs.so' to"
+        " oo_user1_role".format(FILESYSTEM_PREFIX))
     # We need to provide explicit privileges to drop functions
     self.execute_query("grant drop on database {0} to "
         "oo_user1_role".format(unique_database))
diff --git a/tests/common/sentry_cache_test_suite.py b/tests/common/sentry_cache_test_suite.py
index 2f0096a..15c99b7 100644
--- a/tests/common/sentry_cache_test_suite.py
+++ b/tests/common/sentry_cache_test_suite.py
@@ -19,7 +19,7 @@
 # cache as well as Sentry privilege refresh.
 
 from tests.common.custom_cluster_test_suite import CustomClusterTestSuite
-
+from tests.util.filesystem_utils import FILESYSTEM_PREFIX
 
 class SentryCacheTestSuite(CustomClusterTestSuite):
   @staticmethod
@@ -120,8 +120,8 @@ class TestObject(object):
       self.table_def = "(col1 int)"
     elif obj_type == TestObject.FUNCTION:
       self.grant_name = TestObject.FUNCTION
-      self.func_def = "RETURNS INT LOCATION 'hdfs:///test-warehouse/libTestUdfs.so'\
-       SYMBOL='Fn'"
+      self.func_def = "RETURNS INT LOCATION '{0}/test-warehouse/libTestUdfs.so'\
+       SYMBOL='Fn'".format(FILESYSTEM_PREFIX)
     else:
       self.grant_name = obj_type
     self.grant = grant