nixos/podman: Add test with podman without runc
This commit is contained in:
@@ -32,6 +32,12 @@ import ../make-test-python.nix (
|
||||
boot.supportedFilesystems = [ "zfs" ];
|
||||
networking.hostId = "00000000";
|
||||
};
|
||||
rootful_norunc =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
virtualisation.podman.enable = true;
|
||||
virtualisation.podman.extraRuntimes = [ ];
|
||||
};
|
||||
rootless =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
@@ -80,6 +86,7 @@ import ../make-test-python.nix (
|
||||
|
||||
|
||||
rootful.wait_for_unit("sockets.target")
|
||||
rootful_norunc.wait_for_unit("sockets.target")
|
||||
rootless.wait_for_unit("sockets.target")
|
||||
dns.wait_for_unit("sockets.target")
|
||||
docker.wait_for_unit("sockets.target")
|
||||
@@ -112,6 +119,31 @@ import ../make-test-python.nix (
|
||||
rootful.succeed("podman stop sleeping")
|
||||
rootful.succeed("podman rm sleeping")
|
||||
|
||||
# now without installed runc
|
||||
with subtest("Run runc-less container as root with runc"):
|
||||
rootful_norunc.succeed("tar cv --files-from /dev/null | podman import - scratchimg")
|
||||
rootful_norunc.fail(
|
||||
"podman run --runtime=runc -d --name=sleeping -v /nix/store:/nix/store -v /run/current-system/sw/bin:/bin scratchimg /bin/sleep 10"
|
||||
)
|
||||
|
||||
with subtest("Run runc-less container as root with crun"):
|
||||
rootful_norunc.succeed("tar cv --files-from /dev/null | podman import - scratchimg")
|
||||
rootful_norunc.succeed(
|
||||
"podman run --runtime=crun -d --name=sleeping -v /nix/store:/nix/store -v /run/current-system/sw/bin:/bin scratchimg /bin/sleep 10"
|
||||
)
|
||||
rootful_norunc.succeed("podman ps | grep sleeping")
|
||||
rootful_norunc.succeed("podman stop sleeping")
|
||||
rootful_norunc.succeed("podman rm sleeping")
|
||||
|
||||
with subtest("Run runc-less container as root with the default backend"):
|
||||
rootful_norunc.succeed("tar cv --files-from /dev/null | podman import - scratchimg")
|
||||
rootful_norunc.succeed(
|
||||
"podman run -d --name=sleeping -v /nix/store:/nix/store -v /run/current-system/sw/bin:/bin scratchimg /bin/sleep 10"
|
||||
)
|
||||
rootful_norunc.succeed("podman ps | grep sleeping")
|
||||
rootful_norunc.succeed("podman stop sleeping")
|
||||
rootful_norunc.succeed("podman rm sleeping")
|
||||
|
||||
# start systemd session for rootless
|
||||
rootless.succeed("loginctl enable-linger alice")
|
||||
rootless.succeed(su_cmd("whoami"))
|
||||
|
||||
Reference in New Issue
Block a user