summaryrefslogtreecommitdiff
path: root/tests/basic-functionality.Tests.ps1
blob: d62823b60ea7a03eeb000bcd9011ea028f556144 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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()
  }
}