def test_fsimage_from_config_withot_acls(self): config = Configuration.create(readonly=False, accepts_nulls=True) config.set(section=CONFIG_HDFS_DIRS_KEY, key='/raw/sales', value=None) snapshot = FsSnapshot.load_from_config(config=config, fs_section=CONFIG_HDFS_DIRS_KEY) files = snapshot.files self.assertTrue('/raw/sales' in files, 'File was not added to fs snapshot') self.assertTrue( len(files['/raw/sales']) == 0, 'ACL should be ignored for current configuration')
def test_fsimage_from_config_withot_acls(self): config = Configuration.create(readonly=False, accepts_nulls=True) config.set(section=CONFIG_HDFS_DIRS_KEY, key='/raw/sales', value=None) snapshot = FsSnapshot.load_from_config(config=config, fs_section=CONFIG_HDFS_DIRS_KEY) files = snapshot.files self.assertTrue('/raw/sales' in files, 'File was not added to fs snapshot') self.assertTrue(len(files['/raw/sales']) == 0, 'ACL should be ignored for current configuration')
def test_fsimage_from_config(self): config = Configuration.create(readonly=False, accepts_nulls=True) config.set(section=CONFIG_ACLS_KEY, key='confidential', value='user:su:rwx') config.set(section=CONFIG_ACLS_KEY, key='sales', value='group:sales:r-x') config.set(section=CONFIG_HDFS_DIRS_KEY, key='/raw/sales', value='confidential,sales') snapshot = FsSnapshot.load_from_config(config=config, fs_section=CONFIG_HDFS_DIRS_KEY, acl_section=CONFIG_ACLS_KEY) files = snapshot.files self.assertTrue('/raw/sales' in files, 'File was not added to fs snapshot') self.assertTrue('user:su:rwx' in files['/raw/sales'], '\'confidential\' access lvl was not mapped to file') self.assertTrue('group:sales:r-x' in files['/raw/sales'], '\'sales\' access lvl was not mapped to file') self.assertFalse('default:fake:r-x' in files['/raw/sales'], 'Error in access lvl mapping')