From b46b3d928d781a394d0069b8443ca42c9b75e06a Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Tue, 19 Jan 2021 09:16:13 +1000 Subject: [PATCH] nixos/podman: readd rootless runc test use `loginctl enable-linger` to create systemd session --- nixos/tests/podman.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/nixos/tests/podman.nix b/nixos/tests/podman.nix index bccd2de7c9b9..4985ff60365c 100644 --- a/nixos/tests/podman.nix +++ b/nixos/tests/podman.nix @@ -61,6 +61,20 @@ import ./make-test-python.nix ( podman.succeed("podman stop sleeping") podman.succeed("podman rm sleeping") + # create systemd session for rootless + podman.succeed("loginctl enable-linger alice") + + with subtest("Run container rootless with runc"): + podman.succeed(su_cmd("tar cv --files-from /dev/null | podman import - scratchimg")) + podman.succeed( + su_cmd( + "podman run --runtime=runc -d --name=sleeping -v /nix/store:/nix/store -v /run/current-system/sw/bin:/bin scratchimg /bin/sleep 10" + ) + ) + podman.succeed(su_cmd("podman ps | grep sleeping")) + podman.succeed(su_cmd("podman stop sleeping")) + podman.succeed(su_cmd("podman rm sleeping")) + with subtest("Run container rootless with crun"): podman.succeed(su_cmd("tar cv --files-from /dev/null | podman import - scratchimg")) podman.succeed( @@ -71,7 +85,6 @@ import ./make-test-python.nix ( podman.succeed(su_cmd("podman ps | grep sleeping")) podman.succeed(su_cmd("podman stop sleeping")) podman.succeed(su_cmd("podman rm sleeping")) - # As of 2020-11-20, the runc backend doesn't work with cgroupsv2 yet, so we don't run that test. with subtest("Run container rootless with the default backend"): podman.succeed(su_cmd("tar cv --files-from /dev/null | podman import - scratchimg"))