Skip to content

Commit 956b245

Browse files
authored
Merge pull request Azure#36 from yifanz7/addencryptioncontexttest
Add encryption context test
2 parents 089a037 + 793307b commit 956b245

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Storage/RegressionTests/adls.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,15 @@ Describe "dataplane test" {
5151
#$dir11 = New-AzDataLakeGen2Item -Context $ctx -FileSystem $filesystemName -Path $dirname11 -Directory
5252

5353
# Create File, and show properties/matadata in console (Note, Permission/Umask is not supported)
54-
$sas = New-AzStorageContainerSASToken -Name $filesystemName -Permission rwdl -Context $ctx
54+
$sas = New-AzStorageContainerSASToken -Name $filesystemName -Permission rwdl -Context $ctx
5555
$sasctx = New-AzStorageContext -StorageAccountName $ctx.StorageAccountName -SasToken $sas
56-
$file1 = New-AzDataLakeGen2Item -Context $sasctx -FileSystem $filesystemName -Path $filepath11 -Source $localSrcFile -Permission rwxrwxrwx -Umask ---rwx--- -Property @{"ContentEncoding" = "UDF8"; "CacheControl" = "READ"} -Metadata @{"tag1" = "value1"; "tag2" = "value2" }
56+
$file1 = New-AzDataLakeGen2Item -Context $sasctx -FileSystem $filesystemName -Path $filepath11 -Source $localSrcFile -Permission rwxrwxrwx -Umask ---rwx--- -Property @{"ContentEncoding" = "UDF8"; "CacheControl" = "READ"} -Metadata @{"tag1" = "value1"; "tag2" = "value2" } -EncryptionContext encryptioncontext
5757
$file1.IsDirectory | should -Be $false
5858
$file1.Permissions.ToSymbolicPermissions() | should -be "rwx---rwx"
5959
$file1.Properties.Metadata.Count | should -Be 2
6060
$file1.Properties.ContentEncoding | should -Be "UDF8"
6161
$file1.Properties.ContentLength | should -Be (Get-Item $localSrcFile).Length
62+
$file1.Properties.EncryptionContext | Should -Be "encryptioncontext"
6263
## create a file with task
6364
$task = New-AzDataLakeGen2Item -Context $ctx -FileSystem $filesystemName -Path $filepath12 -Source $localSrcFile -Force -asjob
6465
$task | Wait-Job
@@ -70,6 +71,7 @@ Describe "dataplane test" {
7071
$file2 = New-AzDataLakeGen2Item -Context $ctx -FileSystem $filesystemName -Path $destPath -Source $localSrcFile -Force
7172
$file2.IsDirectory | should -Be $false
7273
$file2.Path | should -Be $destPath
74+
$file2.Properties.EncryptionContext | Should -Be $null
7375

7476
# download content of a file (add -Force to avoid prompt)
7577
Get-AzDataLakeGen2ItemContent -Context $ctx -FileSystem $filesystemName -Path $filepath11 -Destination $localDestFile -Force

0 commit comments

Comments
 (0)