Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arcbox 3.0 - add pester #2644

Merged
merged 8 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions azure_jumpstart_arcbox/artifacts/DevOpsLogonScript.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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]$_})
Expand Down
26 changes: 26 additions & 0 deletions azure_jumpstart_arcbox/artifacts/tests/devops.tests.ps1
Original file line number Diff line number Diff line change
@@ -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 "<cluster>" -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"
}
}
Loading