protected void setPermissions(String locn, String permissions) throws Exception {
    FileSystem fs = FileSystem.get(new URI(locn), clientHiveConf);
    fs.setPermission(new Path(locn), FsPermission.valueOf(permissions));
  }
TestStorageBasedMetastoreAuthorizationProvider. Test case for
StorageBasedAuthorizationProvider, by overriding methods defined in
TestMetastoreAuthorizationProvider

Note that while we do use the hive driver to test, that is mostly for test
writing ease, and it has the same effect as using a metastore client directly
because we disable hive client-side authorization for this test, and only
turn on server-side auth.
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/TestStorageBasedMetastoreAuthorizationProvider.java