public async Task CreateNewDir() { client = new WebHdfsClient(DataTestUtility.HdfsConnStr); var dirPath = $"{DataTestUtility.HdfsRootDir}/{nameof(CreateNewDir)}/MakeDirTest"; var result = await client.MakeDirectory(dirPath, "770"); Assert.True(result); }
public async Task RemoveDirectory() { client = new WebHdfsClient(DataTestUtility.HdfsConnStr); var filePath = $"{DataTestUtility.HdfsRootDir}/{nameof(RemoveDirectory)}/"; await client.MakeDirectory(filePath, "770"); await client.Delete(filePath, Recursive : true); await Assert.ThrowsAsync <System.InvalidOperationException>(() => client.GetFileStatus(filePath)); }
public async Task GetStatusOfDirectory() { client = new WebHdfsClient(DataTestUtility.HdfsConnStr); var dirPath = $"{DataTestUtility.HdfsRootDir}/{nameof(GetStatusOfDirectory)}"; await client.MakeDirectory(dirPath, "755"); var fileStat = await client.GetFileStatus(dirPath); Assert.True(fileStat.Length == 0); Assert.True(fileStat.Type == "DIRECTORY"); Assert.True(fileStat.Permission == "755"); }
public async Task CreateNewDirWithControl() { client = new WebHdfsClient(DataTestUtility.HdfsConnStr); var dirPath = $"{DataTestUtility.HdfsRootDir}/{nameof(CreateNewDirWithControl)}/MakeDirTest"; await client.Delete(dirPath, Recursive : true); var result = await client.MakeDirectory(dirPath, "770"); var dirStatus = await client.GetFileStatus(dirPath); Assert.True(dirStatus.Type == "DIRECTORY" && dirStatus.Permission == "770"); Assert.True(result); }
public async Task CreateSnapshot() { client = new WebHdfsClient(DataTestUtility.HdfsConnStr); var dirPath = $"{DataTestUtility.HdfsRootDir}/{nameof(CreateSnapshot)}/"; await client.MakeDirectory(dirPath, "770"); var result = await client.CreateSnapshot(dirPath); var fileStat = await client.GetFileStatus($"{dirPath}SNAPSHOT"); Assert.True(false); }
public async Task SetPermissOfDirectory() { client = new WebHdfsClient(DataTestUtility.HdfsConnStr); var dirPath = $"{DataTestUtility.HdfsRootDir}/{nameof(SetPermissOfDirectory)}"; await client.Delete(dirPath, Recursive : true); await client.MakeDirectory(dirPath, "750"); await client.SetPermission(dirPath, 700); var fileStat = await client.GetFileStatus(dirPath); Assert.True(fileStat.Permission == "700"); }