about summary refs log tree commit diff
path: root/nixos/tests/podman.nix
blob: ccfe8334a160d4bf6c3681b0fd6617f1f25ac537 (plain) (blame)
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
# This test runs podman and checks if simple container starts

import ./make-test-python.nix (
  { pkgs, lib, ... }: {
    name = "podman";
    meta = {
      maintainers = lib.teams.podman.members;
    };

    nodes = {
      podman =
        { pkgs, ... }:
          {
            virtualisation.podman.enable = true;
          };
    };

    testScript = ''
      start_all()

      podman.wait_for_unit("sockets.target")
      podman.succeed("tar cv --files-from /dev/null | podman import - scratchimg")
      podman.succeed(
          "podman run -d --name=sleeping -v /nix/store:/nix/store -v /run/current-system/sw/bin:/bin scratchimg /bin/sleep 10"
      )
      podman.succeed("podman ps | grep sleeping")
      podman.succeed("podman stop sleeping")
    '';
  }
)