Skip to content

Commit

Permalink
Merge pull request Azure#28 from wastoresh/testupdate
Browse files Browse the repository at this point in the history
Update regression tests
  • Loading branch information
yifanz0 authored Feb 3, 2023
2 parents e50dee2 + a102f8c commit b03208a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions src/Storage/RegressionTests/adls.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@

BeforeAll {
# Modify the path to your own
Import-Module $PSScriptRoot\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='adls']")

# Create the directory C:\temp locally before tests
$rootFolder = "C:\temp"
cd $rootFolder
#$rootFolder = "C:\temp"
#cd $rootFolder

$rgname = $globalNode.resourceGroupName
$accountName = $testNode.accountName
$ctx = (Get-AzStorageAccount -ResourceGroupName $rgname -Name $accountName).Context

$localSrcFile = "C:\temp\testfile_1K_0" #The file need exist before test, and should be 512 bytes aligned
$localDestFile = "C:\temp\test1.txt" # test will create the file
$localSrcFile = ".\data\testfile_1K_0" #The file need exist before test, and should be 512 bytes aligned
$localDestFile = ".\created\test1.txt" # test will create the file
$filesystemName = "filesystem1"
$dirname1 = "dir1"
$dirname2 = "dir2/"
Expand Down
8 changes: 4 additions & 4 deletions src/Storage/RegressionTests/adls_setaclresusive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ function ResetFileToSuccess

BeforeAll {
# Modify the path to your own
Import-Module $PSScriptRoot\utils.ps1
Import-Module .\utils.ps1

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

Expand All @@ -44,13 +44,13 @@ BeforeAll {
Add-AzAccount -ServicePrincipal -Tenant $globalNode.tenantId -SubscriptionId $globalNode.subscriptionId -Credential $cred

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

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

$filesystemName = "adlstest2"
$localSrcFile = "C:\temp\testfile_1K_0" #The file needs to exist before tests, and should be 512 bytes aligned
$localSrcFile = ".\data\testfile_1024K_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
4 changes: 2 additions & 2 deletions src/Storage/RegressionTests/srp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ Describe "Management plan test" {
$properties = Get-AzStorageBlobServiceProperty -ResourceGroupName $rgname -StorageAccountName $accountNamePITR
$properties.RestorePolicy.Enabled | should -Be $false

Remove-AzStorageAccount -ResourceGroupName $globalNode.resourceGroupName -Name $accountNamePITR
Remove-AzStorageAccount -ResourceGroupName $globalNode.resourceGroupName -Name $accountNamePITR -Force -AsJob

$Error.Clear()
$Error.Count | should -be 0
Expand All @@ -1233,7 +1233,7 @@ Describe "Management plan test" {

$shareName1 = "test01"
$shareName2 = "test02"
$accountNameSSD = $accountName + "sharesoftdel"
$accountNameSSD = $accountName + "sdel"

New-AzStorageAccount -ResourceGroupName $rgname -Name $accountNameSSD -SkuName Standard_LRS -Location eastus

Expand Down
4 changes: 2 additions & 2 deletions src/Storage/RegressionTests/srp_preview.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Invoke-Pester C:\Users\weiwei\Desktop\PSH_Script\PSHTest\dataplane.ps1 -Show All -Strict -ExcludeTagFilter "Preview"

BeforeAll {
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='srp']")

Expand Down

0 comments on commit b03208a

Please sign in to comment.