Skip to content

Commit

Permalink
Merge pull request #29 from wastoresh/testupdate
Browse files Browse the repository at this point in the history
Update regression tests
  • Loading branch information
yifanz0 authored Mar 15, 2023
2 parents b03208a + 851f6eb commit e8e228d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/Storage/RegressionTests/adls_setaclresusive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ BeforeAll {
Add-AzAccount -ServicePrincipal -Tenant $globalNode.tenantId -SubscriptionId $globalNode.subscriptionId -Credential $cred

$resourceGroupName = $globalNode.resourceGroupName
$storageAccountKey = $testNode.accountKey
$storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $resourceGroupName -Name $testNode.accountName)[0].Value

$ctx = New-AzStorageContext $testNode.accountName -StorageAccountKey $storageAccountKey
$ctx2 = New-AzStorageContext $testNode.accountName

$filesystemName = "adlstest2"
$localSrcFile = ".\data\testfile_1024K_0" #The file needs to exist before tests, and should be 512 bytes aligned
$localSrcFile = ".\data\testfile_1K_0" #The file needs to exist before tests, and should be 512 bytes aligned
$id = $globalNode.applicationId

# for lease blob to make set acl recusive fail
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/RegressionTests/dataplane.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ BeforeAll {

$localSrcFile = ".\data\testfile_10240K_0" # The file needs to exist before tests, and the size should be 10240K
$localSmallSrcFile = ".\data\testfile_1K_0" # The file needs to exist before tests, abd the size should be 1K
$localBigSrcFile = ".\data\testfile_300000K_0"# The file needs to exist before tests, and the size should be 300000K
$localBigSrcFile = ".\data\testfile_300M" # The file needs to exist before tests, and the size should be 300000K

$localDestFile = ".\created\test1.txt" # test will create the file
$containerName = GetRandomContainerName
Expand Down
12 changes: 5 additions & 7 deletions src/Storage/RegressionTests/dataplane_preview.ps1
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
BeforeAll {
# Modify the path to your own
Import-Module D:\code\azure-powershell\src\Storage\RegressionTests\utils.ps1
Import-Module .\utils.ps1

[xml]$config = Get-Content D:\code\azure-powershell\src\Storage\RegressionTests\config.xml
[xml]$config = Get-Content .\config.xml
$globalNode = $config.SelectSingleNode("config/section[@id='global']")
$testNode = $config.SelectSingleNode("config/section[@id='dataplanePreview']")

cd C:\temp # This directory should exist before tests

$resourceGroupName = $globalNode.resourceGroupName
$storageAccountName = $testNode.accountName

$key = (Get-AzStorageAccountKey -ResourceGroupName $resourceGroupName -Name $storageAccountName)[0].Value
$ctx = New-AzStorageContext -StorageAccountName weirp1 -StorageAccountKey $key
$localSrcFile = "C:\temp\testfile_10240K_0" #The file need exist before test, and should be 512 bytes aligned
$localDestFile = "C:\temp\testpreview.txt" # test will create the file
$ctx = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $key
$localSrcFile = ".\data\testfile_1K_0" #The file need exist before test, and should be 512 bytes aligned
$localDestFile = ".\created\testpreview.txt" # test will create the file
$containerName = GetRandomContainerName
# $containerName = "weitestpreview"

Expand Down
25 changes: 12 additions & 13 deletions src/Storage/RegressionTests/runPreview.ps1
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@

Import-Module C:\code\PSH_Dev\artifacts\Debug\Az.Accounts\Az.Accounts.psd1
Import-Module C:\code\PSH_Dev\artifacts\Debug\Az.Storage\Az.Storage.psd1
# Import-Module C:\code\PSH_Dev\artifacts\Debug\Az.Accounts\Az.Accounts.psd1
# Import-Module C:\code\PSH_Dev\artifacts\Debug\Az.Storage\Az.Storage.psd1


$preview = $true

Import-Module C:\Users\weiwei\Desktop\PSH_Script\Assert.ps1
Import-Module C:\Users\weiwei\Desktop\PSH_Script\PSHTest\utils.ps1
cd $PSScriptRoot
Import-Module $PSScriptRoot\utils.ps1

# GA feature
Invoke-Pester C:\Users\weiwei\Desktop\PSH_Script\PSHTest\dataplane.ps1 -Show All -Strict # -TagFilter blobversion # -TagFilter ToTest
Invoke-Pester C:\Users\weiwei\Desktop\PSH_Script\PSHTest\adls.ps1 -Show All -Strict
Invoke-Pester C:\Users\weiwei\Desktop\PSH_Script\PSHTest\adls_setaclresusive.ps1 -Show All -Strict
Invoke-Pester C:\Users\weiwei\Desktop\PSH_Script\PSHTest\srp.ps1 -Show All -Strict -ExcludeTagFilter "longrunning" # -TagFilter "fail"
Invoke-Pester $PSScriptRoot\dataplane.ps1 -Show All -Strict # -TagFilter blobversion # -TagFilter ToTest
Invoke-Pester $PSScriptRoot\adls.ps1 -Show All -Strict
Invoke-Pester $PSScriptRoot\adls_setaclresusive.ps1 -Show All -Strict
Invoke-Pester $PSScriptRoot\srp.ps1 -Show All -Strict -ExcludeTagFilter "longrunning" # -TagFilter "fail"


#preview feature
Invoke-Pester C:\Users\weiwei\Desktop\PSH_Script\PSHTest\dataplane_preview.ps1 -Show All -Strict #-TagFilter "Totest"
Invoke-Pester C:\Users\weiwei\Desktop\PSH_Script\PSHTest\srp_preview.ps1 -Show All -Strict -ExcludeTagFilter "longrunning" # -TagFilter "VLW"
Invoke-Pester $PSScriptRoot\dataplane_preview.ps1 -Show All -Strict #-TagFilter "Totest"
Invoke-Pester $PSScriptRoot\srp_preview.ps1 -Show All -Strict -ExcludeTagFilter "longrunning" # -TagFilter "VLW"

# long running
Invoke-Pester C:\Users\weiwei\Desktop\PSH_Script\PSHTest\srp_preview.ps1 -Show All -Strict -TagFilter "longrunning"
Invoke-Pester C:\Users\weiwei\Desktop\PSH_Script\PSHTest\srp.ps1 -Show All -Strict -TagFilter "longrunning"
Invoke-Pester $PSScriptRoot\srp_preview.ps1 -Show All -Strict -TagFilter "longrunning"
Invoke-Pester $PSScriptRoot\srp.ps1 -Show All -Strict -TagFilter "longrunning"

0 comments on commit e8e228d

Please sign in to comment.