Skip to content

Commit 56e97a9

Browse files
Copilotjtracey93
andcommitted
feat: add PSGallery to network check endpoints and wire NetworkConnectivity into Deploy-Accelerator
Co-authored-by: jtracey93 <41163455+jtracey93@users.noreply.github.com> Agent-Logs-Url: https://github.com/Azure/ALZ-PowerShell-Module/sessions/f1695757-ab9f-4be9-a440-009ed85a14bd
1 parent cde87ae commit 56e97a9

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

src/ALZ/Private/Tools/Checks/Test-NetworkConnectivity.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ function Test-NetworkConnectivity {
1010
@{ Uri = "https://github.com"; Description = "GitHub (module downloads)" },
1111
@{ Uri = "https://api.releases.hashicorp.com"; Description = "HashiCorp Releases API (Terraform version)" },
1212
@{ Uri = "https://releases.hashicorp.com"; Description = "HashiCorp Releases (Terraform binary download)" },
13-
@{ Uri = "https://management.azure.com"; Description = "Azure Management API" }
13+
@{ Uri = "https://management.azure.com"; Description = "Azure Management API" },
14+
@{ Uri = "https://www.powershellgallery.com"; Description = "PowerShell Gallery (module installs/updates)" }
1415
)
1516

1617
foreach ($endpoint in $endpoints) {

src/ALZ/Public/Deploy-Accelerator.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@ function Deploy-Accelerator {
250250
$checks += "YamlModuleAutoInstall"
251251
}
252252
}
253+
if (-not $skip_internet_checks.IsPresent) {
254+
$checks += "NetworkConnectivity"
255+
}
253256
$toolingResult = Test-Tooling -Checks $checks -destroy:$destroy.IsPresent
254257
}
255258

src/Tests/Unit/Private/Test-NetworkConnectivity.Tests.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ InModuleScope 'ALZ' {
3737
}
3838
}
3939

40-
It 'returns one result per endpoint (5 total)' {
40+
It 'returns one result per endpoint (6 total)' {
4141
$result = Test-NetworkConnectivity
42-
$result.Results.Count | Should -Be 5
42+
$result.Results.Count | Should -Be 6
4343
}
4444
}
4545

@@ -74,7 +74,7 @@ InModuleScope 'ALZ' {
7474
It 'still returns Success results for the reachable endpoints' {
7575
$result = Test-NetworkConnectivity
7676
$successResults = @($result.Results | Where-Object { $_.result -eq "Success" })
77-
$successResults.Count | Should -Be 4
77+
$successResults.Count | Should -Be 5
7878
}
7979
}
8080

@@ -97,14 +97,14 @@ InModuleScope 'ALZ' {
9797
}
9898
}
9999

100-
It 'returns one result per endpoint (5 total)' {
100+
It 'returns one result per endpoint (6 total)' {
101101
$result = Test-NetworkConnectivity
102-
$result.Results.Count | Should -Be 5
102+
$result.Results.Count | Should -Be 6
103103
}
104104

105105
It 'checks all endpoints and does not stop at the first failure' {
106106
$result = Test-NetworkConnectivity
107-
Should -Invoke -CommandName Invoke-WebRequest -Times 5 -Scope It
107+
Should -Invoke -CommandName Invoke-WebRequest -Times 6 -Scope It
108108
}
109109
}
110110
}

0 commit comments

Comments
 (0)