From 9d2d1a4c06c7ac2e92f6227a476588af1658c7e6 Mon Sep 17 00:00:00 2001 From: sergei-pyshnoi <121864472+sergei-pyshnoi@users.noreply.github.com> Date: Tue, 5 Mar 2024 00:10:31 +0100 Subject: [PATCH] [macOS] update webservers pester test (#9444) --- images/macos/scripts/tests/WebServers.Tests.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/images/macos/scripts/tests/WebServers.Tests.ps1 b/images/macos/scripts/tests/WebServers.Tests.ps1 index a132ba06..18c6bbb2 100644 --- a/images/macos/scripts/tests/WebServers.Tests.ps1 +++ b/images/macos/scripts/tests/WebServers.Tests.ps1 @@ -8,7 +8,8 @@ Describe "Apache" -Skip:($os.IsVentura -or $os.IsSonoma) { } It "Apache Service" { - brew services list | Out-String | Should -Match "httpd\s+(stopped|none)" + $service = brew services list --json | ConvertFrom-Json | Where-Object { $_.name -eq "httpd" } + $service.status | Should -Match "(stopped|none)" } } @@ -18,6 +19,7 @@ Describe "Nginx" -Skip:($os.IsVentura -or $os.IsSonoma) { } It "Nginx Service" { - brew services list | Out-String | Should -Match "nginx\s+(stopped|none)" + $service = brew services list --json | ConvertFrom-Json | Where-Object { $_.name -eq "nginx" } + $service.status | Should -Match "(stopped|none)" } }