@@ -172,7 +172,8 @@ Describe "dataplane test" {
172
172
$ctxsas = New-AzStorageContext - StorageAccountName $ctx.StorageAccountName - SasToken $sas
173
173
$a = Set-AzStorageBlobContent - File $localSrcFile - Container $containerName - Blob test.txt - Force - Properties @ {" ContentType" = " image/jpeg" ; " ContentMD5" = " i727sP7HigloQDsqadNLHw==" } - Metadata @ {" tag1" = " value1" ; " tag2" = " value22" } - Context $ctxsas
174
174
$a = Set-AzStorageBlobContent - File testfile_2048K - Container $containerName - Blob test.txt - Force - Properties @ {" ContentType" = " image/jpeg" ; " ContentMD5" = " i727sP7HigloQDsqadNLHw==" } - Metadata @ {" tag1" = " value1" ; " tag2" = " value22" } - Context $ctxsas
175
- $a = Set-AzStorageBlobContent - File .\testfile_2048K - Container $containerName - Blob test.txt - Force - Context $ctxsas - StandardBlobTier cool
175
+ # upload blob with access tier
176
+ $a = Set-AzStorageBlobContent - File .\testfile_2048K - Container $containerName - Blob test.txt - Force - Context $ctx - StandardBlobTier cool
176
177
$a.ICloudBlob.Properties.StandardBlobTier | should - Be " Cool"
177
178
$b = Get-AzStorageContainer - Name $containerName - Context $ctx | Get-AzStorageBlob
178
179
$b.Count | Should - BeGreaterOrEqual 1
@@ -1153,14 +1154,16 @@ Describe "dataplane test" {
1153
1154
$containerSAS = New-AzStorageContainerSASToken - Name $containerName - Permission rwdl - ExpiryTime (Get-Date ).AddDays(100 ) - Context $ctx
1154
1155
$sasctx = New-AzStorageContext - StorageAccountName $ctx.StorageAccountName - SasToken $containerSAS
1155
1156
1157
+ $blobCopySrcFile10M = $localSrcFile
1158
+
1156
1159
# Create the containers and upload the src blobs
1157
- if ($false ) {
1158
- New-AzStorageContainer - Name $containerName - Context $ctx
1159
- New-AzStorageContainer - Name $containerName - Context $ctx2
1160
+ if ($true ) {
1161
+ # New-AzStorageContainer -Name $containerName -Context $ctx
1162
+ # New-AzStorageContainer -Name $containerName -Context $ctx2
1160
1163
1161
1164
foreach ($srcType in $blobTypes ) {
1162
- $smallSrcBlob = Set-AzStorageBlobContent - File $blobCopySrcFile10M - Container $containerName - Blob " $ ( $srctype ) SmallSource" - Context $ctx - BlobType $srctype - Properties @ {" ContentType" = " image/jpeg" } - Metadata @ {" tag1" = " value1" ; " tag2" = " value2" }
1163
- $largeSrcBlob = Set-AzStorageBlobContent - File $localBigSrcFile - Container $containerName - Blob " $ ( $srctype ) LargeSource" - Context $ctx - BlobType $srctype - Properties @ {" ContentType" = " image/jpeg" } - Metadata @ {" tag1" = " value1" ; " tag2" = " value2" }
1165
+ $smallSrcBlob = Set-AzStorageBlobContent - File $blobCopySrcFile10M - Container $containerName - Blob " $ ( $srctype ) SmallSource" - Context $ctx - BlobType $srctype - Properties @ {" ContentType" = " image/jpeg" } - Metadata @ {" tag1" = " value1" ; " tag2" = " value2" } - Force
1166
+ $largeSrcBlob = Set-AzStorageBlobContent - File $localBigSrcFile - Container $containerName - Blob " $ ( $srctype ) LargeSource" - Context $ctx - BlobType $srctype - Properties @ {" ContentType" = " image/jpeg" } - Metadata @ {" tag1" = " value1" ; " tag2" = " value2" } - Force
1164
1167
}
1165
1168
}
1166
1169
@@ -1177,7 +1180,7 @@ Describe "dataplane test" {
1177
1180
1178
1181
# compare content
1179
1182
$smallDestBlob | Get-AzStorageBlobContent - Destination $localDestFile - Force
1180
- CompareFileMD5 $localBigSrcFile $localDestFile
1183
+ CompareFileMD5 $blobCopySrcFile10M $localDestFile
1181
1184
del $localDestFile
1182
1185
$smallDestBlob | Remove-AzStorageBlob
1183
1186
@@ -1186,11 +1189,11 @@ Describe "dataplane test" {
1186
1189
$smallDestBlob2.Name | Should - Be " $ ( $srctype ) TO$ ( $desttype ) SmallDest2"
1187
1190
$smallDestBlob2.BlobProperties.ContentType | Should - Be " image/jpeg"
1188
1191
$smallDestBlob2.BlobProperties.ContentLength | Should - Be (Get-Item $blobCopySrcFile10M ).Length
1189
- $smallDestBlob2.BlobProperties.Metadata | Should - Be 2
1192
+ $smallDestBlob2.BlobProperties.Metadata.Count | Should - Be 2
1190
1193
$smallDestBlob2.BlobBaseClient.AccountName | Should - Be $storageAccountName
1191
1194
1192
1195
$smallDestBlob2 | Get-AzStorageBlobContent - Destination $localDestFile - Force
1193
- CompareFileMD5 $localBigSrcFile $localDestFile
1196
+ CompareFileMD5 $blobCopySrcFile10M $localDestFile
1194
1197
del $localDestFile
1195
1198
$smallDestBlob2 | Remove-AzStorageBlob
1196
1199
@@ -1199,19 +1202,19 @@ Describe "dataplane test" {
1199
1202
$smallDestBlob3.Name | Should - Be " $ ( $srctype ) TO$ ( $desttype ) SmallDest3"
1200
1203
$smallDestBlob3.BlobProperties.ContentType | Should - Be " image/jpeg"
1201
1204
$smallDestBlob3.BlobProperties.ContentLength | Should - Be (Get-Item $blobCopySrcFile10M ).Length
1202
- $smallDestBlob3.BlobProperties.Metadata | Should - Be 2
1205
+ $smallDestBlob3.BlobProperties.Metadata.Count | Should - Be 2
1203
1206
$smallDestBlob3.BlobBaseClient.AccountName | Should - Be $storageAccountName2
1204
1207
1205
1208
$smallDestBlob3 | Get-AzStorageBlobContent - Destination $localDestFile - Force
1206
- CompareFileMD5 $localBigSrcFile $localDestFile
1209
+ CompareFileMD5 $blobCopySrcFile10M $localDestFile
1207
1210
del $localDestFile
1208
1211
$smallDestBlob3 | Remove-AzStorageBlob
1209
1212
1210
- $largeDestBlob = Copy-AzStorageBlob - SrcContainer $containerName - SrcBlob " $ ( $srcType ) BigSource " - Context $ctx - DestContainer $containerName - DestBlob " $ ( $srcType ) TO$ ( $destType ) BigDest" - DestContext $ctxoauth1 - DestBlobType $destType - Force
1213
+ $largeDestBlob = Copy-AzStorageBlob - SrcContainer $containerName - SrcBlob " $ ( $srcType ) LargeSource " - Context $ctx - DestContainer $containerName - DestBlob " $ ( $srcType ) TO$ ( $destType ) BigDest" - DestContext $ctxoauth1 - DestBlobType $destType - Force
1211
1214
$largeDestBlob.Name | Should - Be " $ ( $srcType ) TO$ ( $destType ) BigDest"
1212
1215
$largeDestBlob.BlobProperties.ContentType | Should - Be " image/jpeg"
1213
- $largeDestBlob.BlobProperties.ContentLength | Should - Be (Get-Item $blobCopySrcFile10M ).Length
1214
- $largeDestBlob.BlobProperties.Metadata | Should - Be 2
1216
+ $largeDestBlob.BlobProperties.ContentLength | Should - Be (Get-Item $localBigSrcFile ).Length
1217
+ $largeDestBlob.BlobProperties.Metadata.Count | Should - Be 2
1215
1218
$largeDestBlob.BlobBaseClient.AccountName | Should - Be $storageAccountName
1216
1219
1217
1220
$largeDestBlob | Get-AzStorageBlobContent - Destination $localDestFile - Force
@@ -1222,14 +1225,14 @@ Describe "dataplane test" {
1222
1225
}
1223
1226
1224
1227
# Block to block with access tier and rehydrate priority set
1225
- $blockToBlock1 = Copy-AzStorageBlob - SrcContainer $containerName - SrcBlob " BlockSmallSource" - Context $ctx - DestContainer $containerName - DestBlob " BlockToBlockWithAccessTier" - DestContext $ctx2 - DestBlobType $destType - StandardBlobTier " Cool" - RehydratePriority High - Force
1228
+ $blockToBlock1 = Copy-AzStorageBlob - SrcContainer $containerName - SrcBlob " BlockSmallSource" - Context $ctx - DestContainer $containerName - DestBlob " BlockToBlockWithAccessTier" - DestContext $ctx2 - DestBlobType Block - StandardBlobTier " Cool" - RehydratePriority High - Force
1226
1229
$blockToBlock1.AccessTier | Should - Be " Cool"
1227
1230
1228
1231
# blob version
1229
- $smallSrcBlob = Set-AzStorageBlobContent - File $blobCopySrcFile10M - Container $containerName - Blob " $ ( $srctype ) SmallSource" - Context $ctx - BlobType $srctype - Properties @ {" ContentType" = " image/jpeg" } - Metadata @ {" tag1" = " value1" ; " tag2" = " value2" }
1230
- $blobs = Get-AzStorageBlob - Container $containerName - Context $ctx - IncludeVersion
1231
- $blobVersion = $blob [1 ]
1232
- $destBlob = $blobVersion | Copy-AzStorageBlob - DestBlob " blobVersionToBlock" - DestBlobType Block - DestContext $ctx2 - Force
1232
+ $smallSrcBlob = Set-AzStorageBlobContent - File $blobCopySrcFile10M - Container $containerName - Blob " $ ( $srctype ) SmallSource" - Context $ctx - BlobType $srctype - Properties @ {" ContentType" = " image/jpeg" } - Metadata @ {" tag1" = " value1" ; " tag2" = " value2" } - Force
1233
+ $blobs = Get-AzStorageBlob - Container $containerName - Context $ctx - IncludeVersion - Prefix " $ ( $srctype ) SmallSource "
1234
+ $blobVersion = $blobs [1 ]
1235
+ $destBlob = $blobVersion | Copy-AzStorageBlob - DestContainer $containerName - DestBlob " blobVersionToBlock" - DestBlobType Block - DestContext $ctx2 - Force
1233
1236
$destBlob.Name | Should - Be " blobVersionToBlock"
1234
1237
1235
1238
$Error.Count | should - be 0
0 commit comments