|
@@ -50,6 +50,7 @@ import org.apache.hadoop.security.AccessControlException;
|
|
|
import org.apache.hadoop.security.UserGroupInformation;
|
|
|
import org.junit.After;
|
|
|
import org.junit.AfterClass;
|
|
|
+import org.junit.Assert;
|
|
|
import org.junit.Before;
|
|
|
import org.junit.Rule;
|
|
|
import org.junit.Test;
|
|
@@ -120,10 +121,16 @@ public abstract class FSAclBaseTest {
|
|
|
aclEntry(ACCESS, OTHER, NONE),
|
|
|
aclEntry(DEFAULT, USER, "foo", ALL));
|
|
|
fs.setAcl(path, aclSpec);
|
|
|
+ Assert.assertTrue(path + " should have ACLs in FileStatus!",
|
|
|
+ fs.getFileStatus(path).hasAcl());
|
|
|
+
|
|
|
aclSpec = Lists.newArrayList(
|
|
|
aclEntry(ACCESS, USER, "foo", READ_EXECUTE),
|
|
|
aclEntry(DEFAULT, USER, "foo", READ_EXECUTE));
|
|
|
fs.modifyAclEntries(path, aclSpec);
|
|
|
+ Assert.assertTrue(path + " should have ACLs in FileStatus!",
|
|
|
+ fs.getFileStatus(path).hasAcl());
|
|
|
+
|
|
|
AclStatus s = fs.getAclStatus(path);
|
|
|
AclEntry[] returned = s.getEntries().toArray(new AclEntry[0]);
|
|
|
assertArrayEquals(new AclEntry[] {
|
|
@@ -561,8 +568,18 @@ public abstract class FSAclBaseTest {
|
|
|
aclEntry(ACCESS, GROUP, READ_EXECUTE),
|
|
|
aclEntry(ACCESS, OTHER, NONE),
|
|
|
aclEntry(DEFAULT, USER, "foo", ALL));
|
|
|
+
|
|
|
fs.setAcl(path, aclSpec);
|
|
|
+ Assert.assertTrue(path + " should have ACLs in FileStatus!",
|
|
|
+ fs.getFileStatus(path).hasAcl());
|
|
|
+ Assert.assertTrue(path + " should have ACLs in FileStatus#toString()!",
|
|
|
+ fs.getFileStatus(path).toString().contains("hasAcl=true"));
|
|
|
fs.removeAcl(path);
|
|
|
+ Assert.assertFalse(path + " should not have ACLs in FileStatus!",
|
|
|
+ fs.getFileStatus(path).hasAcl());
|
|
|
+ Assert.assertTrue(path + " should not have ACLs in FileStatus#toString()!",
|
|
|
+ fs.getFileStatus(path).toString().contains("hasAcl=false"));
|
|
|
+
|
|
|
AclStatus s = fs.getAclStatus(path);
|
|
|
AclEntry[] returned = s.getEntries().toArray(new AclEntry[0]);
|
|
|
assertArrayEquals(new AclEntry[] { }, returned);
|
|
@@ -968,8 +985,14 @@ public abstract class FSAclBaseTest {
|
|
|
List<AclEntry> aclSpec = Lists.newArrayList(
|
|
|
aclEntry(DEFAULT, USER, "foo", ALL));
|
|
|
fs.setAcl(path, aclSpec);
|
|
|
+ Assert.assertTrue(path + " should have ACLs in FileStatus!",
|
|
|
+ fs.getFileStatus(path).hasAcl());
|
|
|
+
|
|
|
Path dirPath = new Path(path, "dir1");
|
|
|
fs.mkdirs(dirPath);
|
|
|
+ Assert.assertTrue(dirPath + " should have ACLs in FileStatus!",
|
|
|
+ fs.getFileStatus(dirPath).hasAcl());
|
|
|
+
|
|
|
AclStatus s = fs.getAclStatus(dirPath);
|
|
|
AclEntry[] returned = s.getEntries().toArray(new AclEntry[0]);
|
|
|
assertArrayEquals(new AclEntry[] {
|