diff options
Diffstat (limited to 'tests/systemd-services.Tests.ps1')
| -rw-r--r-- | tests/systemd-services.Tests.ps1 | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/systemd-services.Tests.ps1 b/tests/systemd-services.Tests.ps1 new file mode 100644 index 0000000..428bf65 --- /dev/null +++ b/tests/systemd-services.Tests.ps1 @@ -0,0 +1,24 @@ +BeforeAll { + . $PSScriptRoot/lib/lib.ps1 +} + +Describe "Systemd Services" { + BeforeAll { + $distro = Install-Distro + } + + It "should boot" { + $distro.Launch(@("true")) + $LASTEXITCODE | Should -Be 0 + } + + It "should not have any failed unit" { + $output = $distro.Launch(@("sudo", "systemctl", "list-units", "--failed")) | Remove-Escapes + $output | Where-Object { $_.trim() -ne "" } | Select-Object -Last 1 | Should -BeExactly "0 loaded units listed." + $LASTEXITCODE | Should -Be 0 + } + + AfterAll { + $distro.Uninstall() + } +} |
