-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35817/
-----------------------------------------------------------
Review request for sentry and shen guoquan.
Bugs: SENTRY-777
https://issues.apache.org/jira/browse/SENTRY-777
Repository: sentry
Description
-------
````java
...........
@After
public void after() 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();
}
policyFilePath.delete();
}
..........
````
client in after() isn't run under client subject, if client need client
subject, such as in Kerberos mode, it may throw an exception.
policyFilePath.delete(); may not execute if the client throws an exception when
it does operations like clean db or close, there should be a try-catch-finally
statement
Diffs
-----
sentry-hdfs/sentry-hdfs-common/src/test/java/org/apache/sentry/hdfs/SentryHdfsServiceIntegrationBase.java
7c75be9
sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/generic/service/thrift/TestSentryGenericServiceIntegration.java
ae354d9
sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceFailureCase.java
2fd34bd
sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceForHAWithKerberos.java
cfe09b5
sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceWithKerberos.java
7b1eab1
sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryWebServerWithKerberos.java
ffbb585
sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryWebServerWithoutSecurity.java
27e518b
sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/SentryServiceIntegrationBase.java
1b9691e
Diff: https://reviews.apache.org/r/35817/diff/
Testing
-------
Unit Tests passed
Thanks,
Dapeng Sun