@@ -47,16 +47,19 @@ Describe "dataplane test" {
47
47
# $dir11 = New-AzDataLakeGen2Item -Context $ctx -FileSystem $filesystemName -Path $dirname11 -Directory
48
48
49
49
# Create File, and show properties/matadata in console (Note, Permission/Umask is not supported)
50
- $file1 = New-AzDataLakeGen2Item - Context $ctx - FileSystem $filesystemName - Path $filepath11 - Source $localSrcFile - Permission rwxrwxrwx - Umask --- rwx--- - Property @ {" ContentEncoding" = " UDF8" ; " CacheControl" = " READ" } - Metadata @ {" tag1" = " value1" ; " tag2" = " value2" }
51
- $file1.IsDirectory | should - Be $false
50
+ $sas = New-AzStorageContainerSASToken - Name $filesystemName - Permission rwdl - Context $ctx
51
+ $sasctx = New-AzStorageContext - StorageAccountName $ctx.StorageAccountName - SasToken $sas
52
+ $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" } $file1.IsDirectory | should - Be $false
52
53
$file1.Permissions.ToSymbolicPermissions () | should - be " rwx---rwx"
53
54
$file1.Properties.Metadata.Count | should - Be 2
54
55
$file1.Properties.ContentEncoding | should - Be " UDF8"
56
+ $file1.Properties.ContentLength | should - Be (Get-Item $localSrcFile ).Length
55
57
# # create a file with task
56
58
$task = New-AzDataLakeGen2Item - Context $ctx - FileSystem $filesystemName - Path $filepath12 - Source $localSrcFile - Force - asjob
57
59
$task | Wait-Job
58
60
$task.State | should - be " Completed"
59
61
$task.Output [0 ].IsDirectory | should - be $false
62
+ $task.Output [0 ].Properties.ContentLength | should - Be (Get-Item $localSrcFile ).Length
60
63
# # create a Datalake gen2 file and with the source file name
61
64
$destPath = $dirname1 + " \" + (Get-Item $localSrcFile ).Name
62
65
$file2 = New-AzDataLakeGen2Item - Context $ctx - FileSystem $filesystemName - Path $destPath - Source $localSrcFile - Force
@@ -107,7 +110,8 @@ Describe "dataplane test" {
107
110
108
111
# Get an Item (Will always fetch ACL/permission/owner)
109
112
# # Get a folder, and show properties with dfs SAS
110
- $sas = New-AzDataLakeGen2SasToken - FileSystem $filesystemName - Path $dirname1 - Permission rw - Context $ctx - Protocol Https - IPAddressOrRange 0.0 .0.0 - 255.255 .255.0 - StartTime (Get-Date ) - ExpiryTime (Get-Date ).AddDays(6 )
113
+ $sas = New-AzDataLakeGen2SasToken - FileSystem $filesystemName - Path $dirname1 - Permission rw - Context $ctx - Protocol Https - IPAddressOrRange 0.0 .0.0 - 255.255 .255.0 - StartTime (Get-Date ) - ExpiryTime (Get-Date ).AddDays(6 ) - EncryptionScope scope1
114
+ $sas | should - BeLike " *ses=scope1*"
111
115
$ctxsas = New-AzStorageContext - StorageAccountName $ctx.StorageAccountName - SasToken $sas
112
116
$dir1 = Get-AzDataLakeGen2Item - Context $ctxsas - FileSystem $filesystemName - Path $dirname1
113
117
$dir1.Name | should - be $dirname1
0 commit comments