Skip to content

Commit 4c2c694

Browse files
author
begoldsm
committed
Update PowerShell to latest package for ADL
This includes a rework of the PowerShell friendly client and smart settings for file and folder upload/download. I also re-ran all tests to ensure that they are all still passing, which resulted in discovering that the MASK is now properly populated immediately when creating an account, so had to update the permissions tests.
1 parent e5b96d7 commit 4c2c694

24 files changed

+4393
-4068
lines changed

src/ResourceManager/DataLakeStore/Commands.DataLakeStore.Test/Commands.DataLakeStore.Test.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@
6262
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
6363
<Private>True</Private>
6464
</Reference>
65-
<Reference Include="Microsoft.Azure.Management.DataLake.Store">
66-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.DataLake.Store.1.0.3\lib\net45\Microsoft.Azure.Management.DataLake.Store.dll</HintPath>
65+
<Reference Include="Microsoft.Azure.Management.DataLake.Store, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
66+
<SpecificVersion>False</SpecificVersion>
67+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.DataLake.Store.2.0.0-preview\lib\net45\Microsoft.Azure.Management.DataLake.Store.dll</HintPath>
6768
<Private>True</Private>
6869
</Reference>
6970
<Reference Include="Microsoft.Azure.Management.DataLake.StoreUploader">

src/ResourceManager/DataLakeStore/Commands.DataLakeStore.Test/ScenarioTests/AdlsAliasTests.ps1

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,8 @@ function Test-DataLakeStoreFileSystemPermissions
566566

567567
Set-AdlStoreItemAcl -Account $accountName -path "/" -Acl $result
568568
$result = Get-AdlStoreItemAclEntry -Account $accountName -path "/"
569-
# mask gets added as part of adding the user
570-
Assert-AreEqual $($currentCount+2) $result.Count
569+
570+
Assert-AreEqual $($currentCount+1) $result.Count
571571
$found = $false
572572
for($i = 0; $i -lt $result.Count; $i++)
573573
{
@@ -581,27 +581,26 @@ function Test-DataLakeStoreFileSystemPermissions
581581

582582
Assert-True { $found } "Failed to remove the element: $($toRemove.Entry)"
583583

584-
# remove the account
585584
Set-AdlStoreItemAcl -Account $accountName -path "/" -Acl $result
586585
$result = Get-AdlStoreItemAclEntry -Account $accountName -path "/"
587-
Assert-AreEqual $($currentCount+1) $result.Count
586+
Assert-AreEqual $($currentCount) $result.Count
588587

589588
# Set and get a specific permission with friendly sets
590589
Set-AdlStoreItemAclEntry -Account $accountName -path "/" -AceType User -Id $aceUserId -Permissions All
591590
$result = Get-AdlStoreItemAclEntry -Account $accountName -path "/"
592-
Assert-AreEqual $($currentCount+2) $result.Count
591+
Assert-AreEqual $($currentCount+1) $result.Count
593592
# remove a specific permission with friendly remove
594593
Remove-AdlStoreItemAclEntry -Account $accountName -path "/" -AceType User -Id $aceUserId
595594
$result = Get-AdlStoreItemAclEntry -Account $accountName -path "/"
596-
Assert-AreEqual $($currentCount+1) $result.Count
595+
Assert-AreEqual $($currentCount) $result.Count
597596
# set and get a specific permission with the ACE string
598597
Set-AdlStoreItemAclEntry -Account $accountName -path "/" -Acl $([string]::Format("user:{0}:rwx", $aceUserId))
599598
$result = Get-AdlStoreItemAclEntry -Account $accountName -path "/"
600-
Assert-AreEqual $($currentCount+2) $result.Count
599+
Assert-AreEqual $($currentCount+1) $result.Count
601600
# remove a specific permission with the ACE string
602601
Remove-AdlStoreItemAclEntry -Account $accountName -path "/" -Acl $([string]::Format("user:{0}:---", $aceUserId))
603602
$result = Get-AdlStoreItemAclEntry -Account $accountName -path "/"
604-
Assert-AreEqual $($currentCount+1) $result.Count
603+
Assert-AreEqual $($currentCount) $result.Count
605604

606605
# Validate full ACL removal
607606
Remove-AdlStoreItemAcl -Account $accountName -Path "/" -Force -Default

src/ResourceManager/DataLakeStore/Commands.DataLakeStore.Test/ScenarioTests/AdlsTests.ps1

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,8 @@ function Test-DataLakeStoreFileSystemPermissions
565565

566566
Set-AzureRMDataLakeStoreItemAcl -Account $accountName -path "/" -Acl $result
567567
$result = Get-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/"
568-
# it is +2 because the mask gets computed when the first user is added.
569-
Assert-AreEqual $($currentCount+2) $result.Count
568+
569+
Assert-AreEqual $($currentCount+1) $result.Count
570570
$found = $false
571571
for($i = 0; $i -lt $result.Count; $i++)
572572
{
@@ -584,25 +584,24 @@ function Test-DataLakeStoreFileSystemPermissions
584584
Set-AzureRMDataLakeStoreItemAcl -Account $accountName -path "/" -Acl $result
585585
$result = Get-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/"
586586

587-
# mask does not get removed when removing the user
588-
Assert-AreEqual $($currentCount+1) $result.Count
587+
Assert-AreEqual $($currentCount) $result.Count
589588

590589
# Set and get a specific permission with friendly sets
591590
Set-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/" -AceType User -Id $aceUserId -Permissions All
592591
$result = Get-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/"
593-
Assert-AreEqual $($currentCount+2) $result.Count
592+
Assert-AreEqual $($currentCount+1) $result.Count
594593
# remove a specific permission with friendly remove
595594
Remove-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/" -AceType User -Id $aceUserId
596595
$result = Get-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/"
597-
Assert-AreEqual $($currentCount+1) $result.Count
596+
Assert-AreEqual $($currentCount) $result.Count
598597
# set and get a specific permission with the ACE string
599598
Set-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/" -Acl $([string]::Format("user:{0}:rwx", $aceUserId))
600599
$result = Get-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/"
601-
Assert-AreEqual $($currentCount+2) $result.Count
600+
Assert-AreEqual $($currentCount+1) $result.Count
602601
# remove a specific permission with the ACE string
603602
Remove-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/" -Acl $([string]::Format("user:{0}:---", $aceUserId))
604603
$result = Get-AzureRMDataLakeStoreItemAclEntry -Account $accountName -path "/"
605-
Assert-AreEqual $($currentCount+1) $result.Count
604+
Assert-AreEqual $($currentCount) $result.Count
606605

607606
# Validate full ACL removal
608607
Remove-AzureRMDataLakeStoreItemAcl -Account $accountName -Path "/" -Force -Default

0 commit comments

Comments
 (0)