Patch incorporates review comments from Amarsri and Ravi. Changes are:
- I am now using ClusterWithLinuxTaskController.taskTrackerSpecialGroup as the expected group for private distributed cache files.
- Added ownership and group ownership checks for public distributed cache files. Group owner for public distributed cache is the primary owner of the tasktracker. I added a ClusterWithLinuxTaskController.taskTrackerPrimaryGroup on similar lines as ClusterWithLinuxTaskController.taskTrackerSpecialGroup.
Once we add that also to the checks of public distributed cache files, then ClusterWithLinuxTaskController.checkPermissionsOnDir() can be reused for these checks also and can avoid TestTrackerDistributedCacheManager.checkPublicFilePermissions() possibly.
I have not done the above. This is because the checks for permissions of private distributed cache files includes exact match of all the permissions for owner, group and others. For public distributed cache files, the code only adds 'read' and 'execute' bits for all users. Specifically, it does not modify the 'write' bits. This means that the write permissions are indeterminate (for e.g. they could depend on permissions of files in an archive which are unarchived in distributed cache). Hence, instead of reusing the model for checking permissions, I have retained the original model for checking permissions of the public cache files.
I ran all task-controller tests on this, and they passed.