Skip to content

Commit

Permalink
Livetest (#21460)
Browse files Browse the repository at this point in the history
* Limit container app live test running on latest ps version due to quota (15) set in one single subscription

* add test for connectedk8s

* revise livetest

* revise livetest

* Update TestLiveScenarios.ps1

---------

Co-authored-by: Vincent Dai <[email protected]>
  • Loading branch information
Nickcandy and vidai-msft authored Apr 7, 2023
1 parent 901dc41 commit 58b5a0b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/ConnectedKubernetes/LiveTests/TestLiveScenarios.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Invoke-LiveTestScenario -Name "Test ConnectedKubernetes" -Description "Test New-AzConnectedKubernetes" -Platform "Windows" -ScenarioScript `
{
param ($rg)
$rgName = $rg.ResourceGroupName
$ckName = New-LiveTestResourceName
kind create cluster --name $ckName
$ckLocation = "westus"
$actual = New-AzConnectedKubernetes -ClusterName $ckName -ResourceGroupName $rgName -Location $ckLocation
Assert-AreEqual $ckName $actual.Name
Assert-AreEqual $ckLocation $actual.Location

$actual = Get-AzConnectedKubernetes -ResourceGroupName $rgName
Assert-True { $actual.Count -ge 1 }

$actual = Get-AzConnectedKubernetes -ResourceGroupName $rgName -ClusterName $ckName
Assert-AreEqual $ckName $actual.Name

$tag = @{'key'='1'}
$null = Update-AzConnectedKubernetes -ClusterName $ckName -ResourceGroupName $rgName -Tag $tag
$actual = Get-AzConnectedKubernetes -ResourceGroupName $rgName -ClusterName $ckName
Assert-AreEqual $actual.Tag["key"] "1"

Remove-AzConnectedKubernetes -ResourceGroupName $rgName -Name $ckName
$GetServiceList = Get-AzConnectedKubernetes -ResourceGroupName $rgName
Assert-False { $GetServiceList.Name -contains $rgName}
}

0 comments on commit 58b5a0b

Please sign in to comment.