Skip to content

Commit 376dac3

Browse files
authored
Lengthen name suffix to reduce conflict (#13800)
* Lengthen name suffix to reduce conflict
1 parent cfa3c8e commit 376dac3

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

tools/Test/SmokeTest/RmCoreSmokeTests.ps1

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,18 @@ $testInfo = @{
2323
FailureDetails = @();
2424
Times = @()
2525
}
26-
$randomValue = Get-Random -Minimum 1000 -Maximum 10000
27-
$resourceGroupName = "smokergtest$randomValue"
28-
$storageAccountName = "smokesatest$randomValue"
26+
27+
# Generate random suffix ^\d[\da-z]{9}$
28+
$strarray = "0123456789abcdefghijklmnopqurstuvxxyz"
29+
$randomValue = $strarray[(Get-Random -Maximum 10)]
30+
for($i=0; $i -lt 9; $i++)
31+
{
32+
$randomValue += $strarray[(Get-Random -Maximum $strarray.Length)]
33+
}
34+
# The name of resource group is 1~90 charactors complying with ^[-\w\._\(\)]+$
35+
$resourceGroupName = "azpssmokerg$randomValue"
36+
# The name of storage account should be 3~24 lowercase letters and numbers.
37+
$storageAccountName = "azpssmokesa$randomValue"
2938

3039
$resourceSetUpCommands=@(
3140
@{Name = "Az.Resources"; Command = {New-AzureRmResourceGroup -Name $resourceGroupName -Location westus -ErrorAction Stop}}

0 commit comments

Comments
 (0)