diff options
author | zowoq <59103226+zowoq@users.noreply.github.com> | 2021-01-19 09:16:13 +1000 |
---|---|---|
committer | zowoq <59103226+zowoq@users.noreply.github.com> | 2021-01-21 06:57:51 +1000 |
commit | b46b3d928d781a394d0069b8443ca42c9b75e06a (patch) | |
tree | 3b223be2ec195f88c9d94af5f8897b558c9611ff | |
parent | 5313326b7ff260e86416f86cd12b66b6ba5d4012 (diff) |
nixos/podman: readd rootless runc test
use `loginctl enable-linger` to create systemd session
-rw-r--r-- | nixos/tests/podman.nix | 15 |
1 files changed, 14 insertions, 1 deletions
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")) |