diff options
| author | nzbr <mail@nzbr.de> | 2022-11-25 19:17:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-25 19:17:05 +0100 |
| commit | bab9aa46a90a6be42fabdec8b22f3294c1ad4949 (patch) | |
| tree | f9e94e3e6eb8f01ff0686c398dec54a8ec6d17f0 /tests/basic-functionality.Tests.ps1 | |
| parent | e9e8d01c5a2f57d330d42c9a772cf67d89b43650 (diff) | |
Add CI Tests (#161)
* use systemd-run instead of machinectl
* fix systemd user sessions by launching through runuser
* skip mounting binfmt_misc if the kernel lacks support for it
* link syschdemd/installer to static location
* make check happy
* test tests
* add a simple installer test
* add second test for exit codes
* make tests responsible for checking exit code
* fix: add which to path
* overhaul actions workflow
* move checks out of flake.nix
* use GUID for image name
* Split flake checks into matrix job
* Check for side-effects
* reformat powershell scripts
* extend basic test
* use pester for tests
* "fix" (purposefully) failing test
* rename lib -> init
* Add test for systemd --user
* Add test for docker-native
* move release to separate workflow
* change downstream workflow path
* switch to a class
* Test running with different user shells
* Add lib implementation for Windows
* Add documentation for the tests
* readme: docker permissions
* remove empty files
Diffstat (limited to 'tests/basic-functionality.Tests.ps1')
| -rw-r--r-- | tests/basic-functionality.Tests.ps1 | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/basic-functionality.Tests.ps1 b/tests/basic-functionality.Tests.ps1 new file mode 100644 index 0000000..d62823b --- /dev/null +++ b/tests/basic-functionality.Tests.ps1 @@ -0,0 +1,44 @@ +BeforeAll { + . $PSScriptRoot/lib/lib.ps1 +} + +Describe "Basic Functionality" { + BeforeAll { + $distro = Install-Distro + } + + It "is possible to run a command through the installer" { + $distro.Launch("nixos-version") + $LASTEXITCODE | Should -Be 0 + } + + It "is possible to run a second command" { + $distro.Launch("true") + $LASTEXITCODE | Should -Be 0 + } + + It "is possible to run a command after restarting the container" { + $distro.Shutdown() + $distro.Launch("true") + $LASTEXITCODE | Should -Be 0 + } + + It "is possible to use nixos-rebuild" { + $distro.Launch("sudo nixos-rebuild switch") + $LASTEXITCODE | Should -Be 0 + } + + It "is possible to run a command through nix-shell" { + $distro.Launch("nix-shell -p neofetch --command neofetch") + $LASTEXITCODE | Should -Be 0 + } + + It "is possible to run a command through nix run" { + $distro.Launch("nix run nixpkgs#neofetch") + $LASTEXITCODE | Should -Be 0 + } + + AfterAll { + $distro.Uninstall() + } +} |
