diff --git a/azure_jumpstart_arcbox/artifacts/DevOpsLogonScript.ps1 b/azure_jumpstart_arcbox/artifacts/DevOpsLogonScript.ps1 index be92a3ed0a..531473d363 100644 --- a/azure_jumpstart_arcbox/artifacts/DevOpsLogonScript.ps1 +++ b/azure_jumpstart_arcbox/artifacts/DevOpsLogonScript.ps1 @@ -4,6 +4,7 @@ $Env:ArcBoxDir = "C:\ArcBox" $Env:ArcBoxLogsDir = "C:\ArcBox\Logs" $Env:ArcBoxKVDir = "C:\ArcBox\KeyVault" $Env:ArcBoxIconDir = "C:\ArcBox\Icons" +$Env:ArcBoxTestsDir = "$Env:ArcBoxDir\Tests" $namingPrefix = ($Env:namingPrefix).toLower() $osmReleaseVersion = "1.1.1-1" @@ -514,6 +515,10 @@ if ($null -ne (Get-ScheduledTask -TaskName "DevOpsLogonScript" -ErrorAction Sile Start-Sleep -Seconds 5 +Write-Header "Running tests to verify infrastructure" + +& "$Env:ArcBoxTestsDir\Invoke-Test.ps1" + Write-Header "Creating deployment logs bundle" $RandomString = -join ((48..57) + (97..122) | Get-Random -Count 6 | % {[char]$_}) diff --git a/azure_jumpstart_arcbox/artifacts/tests/devops.tests.ps1 b/azure_jumpstart_arcbox/artifacts/tests/devops.tests.ps1 index e69de29bb2..01666fb69f 100644 --- a/azure_jumpstart_arcbox/artifacts/tests/devops.tests.ps1 +++ b/azure_jumpstart_arcbox/artifacts/tests/devops.tests.ps1 @@ -0,0 +1,26 @@ + +BeforeDiscovery { + + $k3sArcDataClusterName = $env:k3sArcDataClusterName + $k3sArcClusterName = $env:k3sArcClusterName + + $clusters = @($k3sArcDataClusterName, $k3sArcClusterName) + $VMs = @($k3sArcDataClusterName, $k3sArcClusterName) + + $null = Connect-AzAccount -Identity -Tenant $env:tenantId -Subscription $env:subscriptionId + az config set extension.use_dynamic_install=yes_without_prompt +} + +Describe "" -ForEach $clusters { + BeforeAll { + $cluster = $_ + } + It "Cluster exists" { + $clusterObject = Get-AzConnectedKubernetes -ClusterName $cluster -ResourceGroupName $env:resourceGroup -SubscriptionId $env:subscriptionId + $clusterObject | Should -Not -BeNullOrEmpty + } + It "Azure Arc Connected cluster is connected" { + $connectedCluster = Get-AzConnectedKubernetes -Name $cluster -ResourceGroupName $env:resourceGroup -SubscriptionId $env:subscriptionId + $connectedCluster.ConnectivityStatus | Should -Be "Connected" + } +} \ No newline at end of file