Skip to content

Merge Adls data plane to preview #5787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 56 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
b2ea51e
Replaced the old filesystem sdk with the current adls dotnetsdk
rahuldutta90 Oct 13, 2017
4e6c491
Fixes to the warning messages, Documented changes and breaking changes
rahuldutta90 Oct 18, 2017
7581898
Updated the markdown files
rahuldutta90 Oct 18, 2017
38a2a72
Merge branch 'preview' into preview
rahuldutta90 Oct 18, 2017
26253c1
Fix the markdown file for NEw-AzureRmDataLakeStoreItem
rahuldutta90 Oct 19, 2017
c12f7dc
Merge branch 'preview' of https://github.com/rahuldutta90/azure-power…
rahuldutta90 Oct 19, 2017
655d3e5
1) Deprecated clean parameter in Remove-AzureRmDataLakeStoreItem 2) D…
rahuldutta90 Oct 19, 2017
b950e87
Updated breaking changes, examples for New-AzureRmDataLakeStoreItem a…
rahuldutta90 Oct 19, 2017
bdadfae
1) Restored parameters resume and forcebinary for Import and export 2…
rahuldutta90 Nov 14, 2017
201ab30
Merge from https://github.com/Azure/azure-powershell.git
rahuldutta90 Nov 15, 2017
4d717fe
1) Resolve the merge for parametersetname 2) Restore the help message…
rahuldutta90 Nov 15, 2017
0a6c68c
Add management reference
rahuldutta90 Nov 15, 2017
d3cfbf5
Make the parameter for setExpiry singular
rahuldutta90 Nov 21, 2017
b5245f0
Remove unecessary dependencies like NLog.config, remove space from pa…
rahuldutta90 Nov 22, 2017
efdd22f
Changed ADLS SDK version to be signed by Microsoft certificate
rahuldutta90 Nov 30, 2017
8ce1349
Merge branch 'preview' into preview
twitchax Nov 30, 2017
1918a61
Make FileType enum nullable, add exceptions for static code analysis
rahuldutta90 Dec 1, 2017
eecb58f
Merge branch 'preview' of https://github.com/rahuldutta90/azure-power…
rahuldutta90 Dec 1, 2017
1b72d24
Add build exceptions, Remove nullable type from parameter, MAke a par…
rahuldutta90 Dec 1, 2017
c3ca135
Added exception for Changing type of Expiration to non nullable in Se…
rahuldutta90 Dec 1, 2017
e2360f9
Merge branch 'adls-data-plane' into preview
cormacpayne Dec 14, 2017
ad92197
Merge branch 'adls-data-plane' into preview
cormacpayne Dec 14, 2017
d003249
Merge pull request #4986 from rahuldutta90/preview
markcowl Dec 16, 2017
4c1b506
1) Update the ModuleVersion in AzureRM.DataLakeStore.psd1 to 5.0.1 2)…
rahuldutta90 Dec 18, 2017
4d79571
Merge branch 'preview' of https://github.com/rahuldutta90/azure-power…
rahuldutta90 Dec 18, 2017
885bbf7
Fixed the change log
rahuldutta90 Dec 18, 2017
092c96b
Merge branch 'adls-data-plane' into preview
rahuldutta90 Dec 19, 2017
ed850de
Update CheckSignature Authenticde check to exclude NLog dependency
markcowl Dec 20, 2017
1168fb4
Merge pull request #5160 from rahuldutta90/preview
markcowl Dec 20, 2017
5163f64
Merge pull request #5164 from Azure/nlogauth
markcowl Dec 20, 2017
6e81d3d
Update versions and metadata for preview
markcowl Jan 23, 2018
6196eb8
Merge pull request #5340 from markcowl/adlsprev
markcowl Jan 25, 2018
ecc8e6d
First commit of the target logger
rahuldutta90 Feb 1, 2018
9da683c
Merged from preview
rahuldutta90 Feb 1, 2018
e320c64
Merged preview
rahuldutta90 Feb 1, 2018
ee51e58
Change the version of datalakestore to 5.2.0-preview
rahuldutta90 Feb 1, 2018
a83d38a
Merging branch with preview
markcowl Feb 2, 2018
b614b69
Merge pull request #5419 from markcowl/updatesign
markcowl Feb 3, 2018
ae32c54
Merge branch 'preview' of https://github.com/Azure/azure-powershell i…
cormacpayne Feb 16, 2018
f354a06
Merge branch 'preview' into adls-data-plane-task-updateversion
rahuldutta90 Feb 16, 2018
3933e2c
Merge pull request #5567 from cormacpayne/adls-data-plane
cormacpayne Feb 16, 2018
cc40cdc
Merged preview changes to adls-data-branch
rahuldutta90 Feb 16, 2018
2c4bac2
Update the adls sdk version to 1.1.2
rahuldutta90 Feb 16, 2018
30b29dd
Remove duplicate in changelog
rahuldutta90 Feb 16, 2018
c030dd1
Merge adls-data-plane to this branch
rahuldutta90 Feb 17, 2018
b599d75
Fix the change log and merge issues
rahuldutta90 Feb 17, 2018
4732e2f
Revert changes in release notes of psd1 file
rahuldutta90 Feb 22, 2018
d4ae4f6
revert some formating changes ion psd1
rahuldutta90 Feb 22, 2018
8cf6bb9
Revert the psd1 file, address other comments of review
rahuldutta90 Feb 22, 2018
2686057
Remove unused usings and make the target class internal
rahuldutta90 Feb 22, 2018
9da0af4
Merge pull request #5570 from Azure/adls-data-plane-task-updateversion
Feb 26, 2018
dd92629
Change changelog
Mar 2, 2018
104a29c
Merge adls-data-plane
rahuldutta90 Mar 5, 2018
97935bd
Update the ADLS version to include logging details
rahuldutta90 Mar 15, 2018
26239e0
Merge pull request #5573 from Azure/adls-data-plane-task-addDebugFunc…
cormacpayne Mar 20, 2018
4884c7a
Merge branch 'preview' into adls-data-plane
cormacpayne Mar 29, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,28 @@ function Assert-AreEqual

return $true
}

###################
#
# Verify that if actual falls in an acceptable range of expected
#
# param [long] $expected : The expected number
# param [long] $actual : The actual number
# param [long] $interval : The acceptable offset either side of the expected
# param [string] $message : The message to return if the given objects are not equal
####################
function Assert-NumAreInRange
{
param([long] $expected, [long] $actual, [long] $interval, [string] $message)
if (!$message)
{
$message = "Assertion failed because expected '$expected' does not fall in accepted range of 'interval' of actual '$actual'"
}
if(!($actual -ge ($expected-$interval) -and $actual -le ($expected+$interval)))
{
throw $message
}
return $true
}
###################
#
# Verify that two given arrays are equal
Expand Down
23 changes: 13 additions & 10 deletions src/ResourceManager/DataLakeStore/AzureRM.DataLakeStore.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# RootModule = ''

# Version number of this module.
ModuleVersion = '5.1.1'
ModuleVersion = '5.2.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -54,7 +54,7 @@ CLRVersion = '4.0'
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '4.5.0'; })

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = '.\Microsoft.Azure.Management.DataLake.Store.dll'
RequiredAssemblies = '.\Microsoft.Azure.Management.DataLake.Store.dll','.\Microsoft.Azure.DataLake.Store.dll','.\NLog.dll'

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()
Expand All @@ -63,8 +63,7 @@ RequiredAssemblies = '.\Microsoft.Azure.Management.DataLake.Store.dll'
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess =
'.\Microsoft.Azure.Commands.DataLakeStoreFileSystem.format.ps1xml'
FormatsToProcess = '.\Microsoft.Azure.Commands.DataLakeStoreFileSystem.format.ps1xml'

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
NestedModules = @('.\Microsoft.Azure.Commands.DataLakeStore.dll')
Expand Down Expand Up @@ -152,12 +151,16 @@ PrivateData = @{
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '* Corrected usage of ''Login-AzureRmAccount'' to use ''Connect-AzureRmAccount''
* Corrected the error message of ''Test-AzureRmDataLakeStoreAccount'' when running this cmdlet without having logged in with ''Login-AzureRmAccount'''

# Prerelease string of this module
# Prerelease = ''

ReleaseNotes = '
* Export-AzureRmDataLakeStoreItem (https://github.com/Azure/azure-powershell/blob/adls-data-plane/src/ResourceManager/DataLakeStore/documentation/upcoming-breaking-changes.md) - Deprecated parameters PerFileThreadCount, ConcurrentFileCount and introduced parameter Concurrency
* Import-AzureRMDataLakeStoreItem (https://github.com/Azure/azure-powershell/blob/adls-data-plane/src/ResourceManager/DataLakeStore/documentation/upcoming-breaking-changes.md) -Deprecated parametersPerFileThreadCount, ConcurrentFileCount and introduced parameter Concurrency
* Get-AzureRMDataLakeStoreItemContent - Fixed the tail behavior for contents greater than 4MB
* Set-AzureRMDataLakeStoreItemExpiry - Introduced new parameter set SetRelativeExpiry for setting relative expiration time
* Remove-AzureRmDataLakeStoreItem (https://github.com/Azure/azure-powershell/blob/adls-data-plane/src/ResourceManager/DataLakeStore/documentation/upcoming-breaking-changes.md) - Deprecated parameter Clean.
'

# Prerelease string of this module
Prerelease = 'preview'
# Flag to indicate whether the module requires explicit user acceptance for install/update
# RequireLicenseAcceptance = $false

Expand Down
11 changes: 7 additions & 4 deletions src/ResourceManager/DataLakeStore/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
-->
## Current Release
* Updated to the latest version of the Azure ClientRuntime

## Version 5.1.1
* Corrected usage of 'Login-AzureRmAccount' to use 'Connect-AzureRmAccount'
* Corrected the error message of 'Test-AzureRmDataLakeStoreAccount' when running this cmdlet without having logged in with 'Login-AzureRmAccount'
* Add debug functionality
* Update the version of the ADLS dataplane SDK to 1.1.2
* Export-AzureRmDataLakeStoreItem (https://github.com/Azure/azure-powershell/blob/adls-data-plane/src/ResourceManager/DataLakeStore/documentation/upcoming-breaking-changes.md) - Deprecated parameters PerFileThreadCount, ConcurrentFileCount and introduced parameter Concurrency
* Import-AzureRMDataLakeStoreItem (https://github.com/Azure/azure-powershell/blob/adls-data-plane/src/ResourceManager/DataLakeStore/documentation/upcoming-breaking-changes.md) -Deprecated parametersPerFileThreadCount, ConcurrentFileCount and introduced parameter Concurrency
* Get-AzureRMDataLakeStoreItemContent - Fixed the tail behavior for contents greater than 4MB
* Set-AzureRMDataLakeStoreItemExpiry - Introduced new parameter set SetRelativeExpiry for setting relative expiration time
* Remove-AzureRmDataLakeStoreItem (https://github.com/Azure/azure-powershell/blob/adls-data-plane/src/ResourceManager/DataLakeStore/documentation/upcoming-breaking-changes.md) - Deprecated parameter Clean.

## Version 5.1.0
* Added Location Completer to -Location parameters allowing tab completion through valid Locations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@
<Project>{5ee72c53-1720-4309-b54b-5fb79703195f}</Project>
<Name>Commands.Common</Name>
</ProjectReference>
<ProjectReference Include="..\Commands.DataLakeStore\Commands.DataLakeStore.csproj">
<Project>{8aab43e6-e8f6-4f91-af8a-6a63cd78ef1e}</Project>
<Name>Commands.DataLakeStore</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="MSSharedLibKey.snk" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;

namespace Microsoft.Azure.Commands.DataLakeStore.Test.ScenarioTests
{
using Microsoft.WindowsAzure.Commands.ScenarioTest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,38 +424,46 @@ function Test-DataLakeStoreFileSystem
$result = Get-AdlStoreItem -Account $accountName -path $folderToCreate
Assert-NotNull $result "No value was returned on folder get"
Assert-AreEqual "Directory" $result.Type

# Create and get Empty File
$result = New-AdlStoreItem -Account $accountName -path $emptyFilePath
Assert-NotNull $result "No value was returned on empty file creation"
$result = Get-AdlStoreItem -Account $accountName -path $emptyFilePath
$emptyFileCreationDate=$result.LastWriteTime # To be used later
Assert-NotNull $result "No value was returned on empty file get"
Assert-AreEqual "File" $result.Type
Assert-AreEqual 0 $result.Length

# Create and get file with content
$result = New-AdlStoreItem -Account $accountName -path $contentFilePath -Value $content
Assert-NotNull $result "No value was returned on content file creation"
$result = Get-AdlStoreItem -Account $accountName -path $contentFilePath
Assert-NotNull $result "No value was returned on content file get"
Assert-AreEqual "File" $result.Type
Assert-AreEqual $content.length $result.Length
# set and validate expiration for a file

# set absolute expiration for content file
Assert-True {253402300800000 -ge $result.ExpirationTime -or 0 -le $result.ExpirationTime} # validate that expiration is currently max value
[DateTimeOffset]$timeToUse = [Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::GetVariable("absoluteTime", [DateTimeOffset]::UtcNow.AddSeconds(120))
$result = Set-AdlStoreItemExpiry -Account $accountName -path $contentFilePath -Expiration $timeToUse
Assert-AreEqual $timeToUse.UtcTicks $result.Expiration.UtcTicks
Assert-NumAreInRange $timeToUse.UtcTicks $result.Expiration.UtcTicks 500000 # range of 50 milliseconds

# set it back to "never expire"
$result = Set-AdlStoreItemExpiry -Account $accountName -path $contentFilePath
Assert-True {253402300800000 -ge $result.ExpirationTime -or 0 -le $result.ExpirationTime} # validate that expiration is currently max value

# list files
$result = Get-AdlStoreChildItem -Account $accountName -path $folderToCreate
Assert-NotNull $result "No value was returned on folder list"
Assert-AreEqual 2 $result.length

# add content to empty file
Add-AdlStoreItemContent -Account $accountName -Path $emptyFilePath -Value $content
$result = Get-AdlStoreItem -Account $accountName -path $emptyFilePath
Assert-NotNull $result "No value was returned on empty file get with content added"
Assert-AreEqual "File" $result.Type
Assert-AreEqual $content.length $result.Length

# concat files
$result = Join-AdlStoreItem -Account $accountName -Paths $emptyFilePath,$contentFilePath -Destination $concatFile
Assert-NotNull $result "No value was returned on concat file"
Expand Down Expand Up @@ -506,6 +514,7 @@ function Test-DataLakeStoreFileSystem
Assert-NotNull $result "No value was returned on import file get"
Assert-AreEqual "File" $result.Type
Assert-AreEqual $localFileInfo.length $result.Length

# download file
$currentDir = Split-Path $fileToCopy
$targetFile = Join-Path $currentDir "adlspstestdownload.txt"
Expand All @@ -527,6 +536,7 @@ function Test-DataLakeStoreFileSystem
Assert-AreEqual "File" $result.Type
Assert-AreEqual $($content.length*2) $result.Length
Assert-Throws {Get-AdlStoreItem -Account $accountName -path $concatFile}

# move a folder
$result = Move-AdlStoreItem -Account $accountName -Path $folderToCreate -Destination $moveFolder
Assert-NotNull $result "No value was returned on move folder"
Expand All @@ -535,9 +545,11 @@ function Test-DataLakeStoreFileSystem
Assert-AreEqual "Directory" $result.Type
Assert-AreEqual 0 $result.Length
Assert-Throws {Get-AdlStoreItem -Account $accountName -path $folderToCreate}

# delete a file
Assert-True {Remove-AdlStoreItem -Account $accountName -paths "$moveFolder/movefile.txt" -force -passthru } "Remove File Failed"
Assert-Throws {Get-AdlStoreItem -Account $accountName -path $moveFile}

# delete a folder
Assert-True {Remove-AdlStoreItem -Account $accountName -paths $moveFolder -force -recurse -passthru} "Remove folder failed"
Assert-Throws {Get-AdlStoreItem -Account $accountName -path $moveFolder}
Expand Down Expand Up @@ -601,6 +613,17 @@ function Test-DataLakeStoreFileSystemPermissions
# define the permissions to add/remove
$aceUserId = "027c28d5-c91d-49f0-98c5-d10134b169b3"

#set owner
New-AdlStoreItem -Account $accountName -Path "/temp"
$prevOwner=Get-AdlStoreItemOwner -Account $accountName -Path "/temp" -Type User
$prevGroup=Get-AdlStoreItemOwner -Account $accountName -Path "/temp" -Type Group
$currentOwner=Set-AdlStoreItemOwner -Account $accountName -Path "/temp" -Type User -Id $aceUserId -PassThru
$currentGroup=Get-AdlStoreItemOwner -Account $accountName -Path "/temp" -Type Group
Assert-AreEqual $aceUserId $currentOwner
Assert-AreNotEqual $prevOwner $currentOwner
Assert-AreEqual $prevGroup $currentGroup
Remove-AdlStoreItem -Account $accountName -paths "/temp" -force

# Set and get all the permissions
$result = Get-AdlStoreItemAclEntry -Account $accountName -path "/"
Assert-NotNull $result "Did not get any result from ACL get"
Expand Down Expand Up @@ -635,14 +658,17 @@ function Test-DataLakeStoreFileSystemPermissions
Set-AdlStoreItemAclEntry -Account $accountName -path "/" -AceType User -Id $aceUserId -Permissions All
$result = Get-AdlStoreItemAclEntry -Account $accountName -path "/"
Assert-AreEqual $($currentCount+1) $result.Count

# remove a specific permission with friendly remove
Remove-AdlStoreItemAclEntry -Account $accountName -path "/" -AceType User -Id $aceUserId
$result = Get-AdlStoreItemAclEntry -Account $accountName -path "/"
Assert-AreEqual $($currentCount) $result.Count

# set and get a specific permission with the ACE string
Set-AdlStoreItemAclEntry -Account $accountName -path "/" -Acl $([string]::Format("user:{0}:rwx", $aceUserId))
$result = Get-AdlStoreItemAclEntry -Account $accountName -path "/"
Assert-AreEqual $($currentCount+1) $result.Count

# remove a specific permission with the ACE string
Remove-AdlStoreItemAclEntry -Account $accountName -path "/" -Acl $([string]::Format("user:{0}:---", $aceUserId))
$result = Get-AdlStoreItemAclEntry -Account $accountName -path "/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,38 +423,46 @@ function Test-DataLakeStoreFileSystem
$result = Get-AzureRMDataLakeStoreItem -Account $accountName -path $folderToCreate
Assert-NotNull $result "No value was returned on folder get"
Assert-AreEqual "Directory" $result.Type

# Create and get Empty File
$result = New-AzureRMDataLakeStoreItem -Account $accountName -path $emptyFilePath
Assert-NotNull $result "No value was returned on empty file creation"
$result = Get-AzureRMDataLakeStoreItem -Account $accountName -path $emptyFilePath
$emptyFileCreationDate=$result.LastWriteTime # To be used later
Assert-NotNull $result "No value was returned on empty file get"
Assert-AreEqual "File" $result.Type
Assert-AreEqual 0 $result.Length

# Create and get file with content
$result = New-AzureRMDataLakeStoreItem -Account $accountName -path $contentFilePath -Value $content
Assert-NotNull $result "No value was returned on content file creation"
$result = Get-AzureRMDataLakeStoreItem -Account $accountName -path $contentFilePath
Assert-NotNull $result "No value was returned on content file get"
Assert-AreEqual "File" $result.Type
Assert-AreEqual $content.length $result.Length
# set and validate expiration for a file

# set absolute expiration for content file
Assert-True {253402300800000 -ge $result.ExpirationTime -or 0 -le $result.ExpirationTime} # validate that expiration is currently max value
[DateTimeOffset]$timeToUse = [Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::GetVariable("absoluteTime", [DateTimeOffset]::UtcNow.AddSeconds(120))
$result = Set-AzureRmDataLakeStoreItemExpiry -Account $accountName -path $contentFilePath -Expiration $timeToUse
Assert-AreEqual $timeToUse.UtcTicks $result.Expiration.UtcTicks
$result = Set-AdlStoreItemExpiry -Account $accountName -path $contentFilePath -Expiration $timeToUse
Assert-NumAreInRange $timeToUse.UtcTicks $result.Expiration.UtcTicks 500000 # range of 50 milliseconds

# set it back to "never expire"
$result = Set-AzureRmDataLakeStoreItemExpiry -Account $accountName -path $contentFilePath
$result = Set-AdlStoreItemExpiry -Account $accountName -path $contentFilePath
Assert-True {253402300800000 -ge $result.ExpirationTime -or 0 -le $result.ExpirationTime} # validate that expiration is currently max value

# list files
$result = Get-AzureRMDataLakeStoreChildItem -Account $accountName -path $folderToCreate
Assert-NotNull $result "No value was returned on folder list"
Assert-AreEqual 2 $result.length

# add content to empty file
Add-AzureRMDataLakeStoreItemContent -Account $accountName -Path $emptyFilePath -Value $content
$result = Get-AzureRMDataLakeStoreItem -Account $accountName -path $emptyFilePath
Assert-NotNull $result "No value was returned on empty file get with content added"
Assert-AreEqual "File" $result.Type
Assert-AreEqual $content.length $result.Length

# concat files
$result = Join-AzureRMDataLakeStoreItem -Account $accountName -Paths $emptyFilePath,$contentFilePath -Destination $concatFile
Assert-NotNull $result "No value was returned on concat file"
Expand Down Expand Up @@ -505,6 +513,7 @@ function Test-DataLakeStoreFileSystem
Assert-NotNull $result "No value was returned on import file get"
Assert-AreEqual "File" $result.Type
Assert-AreEqual $localFileInfo.length $result.Length

# download file
$currentDir = Split-Path $fileToCopy
$targetFile = Join-Path $currentDir "adlspstestdownload.txt"
Expand All @@ -517,7 +526,7 @@ function Test-DataLakeStoreFileSystem
$downloadedFileInfo = Get-ChildItem $targetFile
Assert-AreEqual $($content.length*2) $downloadedFileInfo.length
Remove-Item -path $targetFile -force -confirm:$false

# move a file
$result = Move-AzureRMDataLakeStoreItem -Account $accountName -Path $concatFile -Destination $moveFile
Assert-NotNull $result "No value was returned on move file"
Expand All @@ -526,6 +535,7 @@ function Test-DataLakeStoreFileSystem
Assert-AreEqual "File" $result.Type
Assert-AreEqual $($content.length*2) $result.Length
Assert-Throws {Get-AzureRMDataLakeStoreItem -Account $accountName -path $concatFile}

# move a folder
$result = Move-AzureRMDataLakeStoreItem -Account $accountName -Path $folderToCreate -Destination $moveFolder
Assert-NotNull $result "No value was returned on move folder"
Expand All @@ -534,9 +544,11 @@ function Test-DataLakeStoreFileSystem
Assert-AreEqual "Directory" $result.Type
Assert-AreEqual 0 $result.Length
Assert-Throws {Get-AzureRMDataLakeStoreItem -Account $accountName -path $folderToCreate}

# delete a file
Assert-True {Remove-AzureRMDataLakeStoreItem -Account $accountName -paths "$moveFolder/movefile.txt" -force -passthru } "Remove File Failed"
Assert-Throws {Get-AzureRMDataLakeStoreItem -Account $accountName -path $moveFile}

# delete a folder
Assert-True {Remove-AzureRMDataLakeStoreItem -Account $accountName -paths $moveFolder -force -recurse -passthru} "Remove folder failed"
Assert-Throws {Get-AzureRMDataLakeStoreItem -Account $accountName -path $moveFolder}
Expand Down Expand Up @@ -600,6 +612,17 @@ function Test-DataLakeStoreFileSystemPermissions
# define the permissions to add/remove
$aceUserId = "027c28d5-c91d-49f0-98c5-d10134b169b3"

#set owner
New-AdlStoreItem -Account $accountName -Path "/temp"
$prevOwner=Get-AdlStoreItemOwner -Account $accountName -Path "/temp" -Type User
$prevGroup=Get-AdlStoreItemOwner -Account $accountName -Path "/temp" -Type Group
$currentOwner=Set-AdlStoreItemOwner -Account $accountName -Path "/temp" -Type User -Id $aceUserId -PassThru
$currentGroup=Get-AdlStoreItemOwner -Account $accountName -Path "/temp" -Type Group
Assert-AreEqual $aceUserId $currentOwner
Assert-AreNotEqual $prevOwner $currentOwner
Assert-AreEqual $prevGroup $currentGroup
Remove-AdlStoreItem -Account $accountName -paths "/temp" -force

# Set and get all the permissions
$result = Get-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/"
Assert-NotNull $result "Did not get any result from ACL get"
Expand Down Expand Up @@ -636,14 +659,17 @@ function Test-DataLakeStoreFileSystemPermissions
Set-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/" -AceType User -Id $aceUserId -Permissions All
$result = Get-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/"
Assert-AreEqual $($currentCount+1) $result.Count

# remove a specific permission with friendly remove
Remove-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/" -AceType User -Id $aceUserId
$result = Get-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/"
Assert-AreEqual $($currentCount) $result.Count

# set and get a specific permission with the ACE string
Set-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/" -Acl $([string]::Format("user:{0}:rwx", $aceUserId))
$result = Get-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/"
Assert-AreEqual $($currentCount+1) $result.Count

# remove a specific permission with the ACE string
Remove-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/" -Acl $([string]::Format("user:{0}:---", $aceUserId))
$result = Get-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/"
Expand Down
Loading