diff options
| author | nzbr <mail@nzbr.de> | 2023-01-27 06:19:20 +0100 |
|---|---|---|
| committer | nzbr <mail@nzbr.de> | 2023-01-27 06:19:20 +0100 |
| commit | a80f487b2d19f5afcad74253dac9d8a6859a1b64 (patch) | |
| tree | 6e4ce6664c28948322ad061f5cc5987487d3187c /tests | |
| parent | bdd482a186c2dd11af383d7079038aa32b7ef4ee (diff) | |
add a test to ensure that there are no failed units
Diffstat (limited to 'tests')
| -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() + } +} |
