diff options
author | zowoq <59103226+zowoq@users.noreply.github.com> | 2020-05-13 15:12:59 +1000 |
---|---|---|
committer | zowoq <59103226+zowoq@users.noreply.github.com> | 2020-05-19 10:38:49 +1000 |
commit | 277b1da2ea524a38589017b1f408f1ff71e55f3e (patch) | |
tree | 17887ddc8e62fac192537a183bf92d0336dc83d4 /nixos | |
parent | 0f5ce2fac0c726036ca69a5524c59a49e2973dd4 (diff) | |
download | nixlib-277b1da2ea524a38589017b1f408f1ff71e55f3e.tar nixlib-277b1da2ea524a38589017b1f408f1ff71e55f3e.tar.gz nixlib-277b1da2ea524a38589017b1f408f1ff71e55f3e.tar.bz2 nixlib-277b1da2ea524a38589017b1f408f1ff71e55f3e.tar.lz nixlib-277b1da2ea524a38589017b1f408f1ff71e55f3e.tar.xz nixlib-277b1da2ea524a38589017b1f408f1ff71e55f3e.tar.zst nixlib-277b1da2ea524a38589017b1f408f1ff71e55f3e.zip |
nixos/podman: add crun to test
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/tests/podman.nix | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/nixos/tests/podman.nix b/nixos/tests/podman.nix index 283db71d9a49..9134a68ff386 100644 --- a/nixos/tests/podman.nix +++ b/nixos/tests/podman.nix @@ -38,23 +38,45 @@ import ./make-test-python.nix ( start_all() - with subtest("Run container as root"): + with subtest("Run container as root with runc"): 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 run --runtime=runc -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") + podman.succeed("podman rm sleeping") - with subtest("Run container rootless"): + with subtest("Run container as root with crun"): + podman.succeed("tar cv --files-from /dev/null | podman import - scratchimg") + podman.succeed( + "podman run --runtime=crun -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") + podman.succeed("podman rm sleeping") + + 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( su_cmd( - "podman run -d --name=sleeping -v /nix/store:/nix/store -v /run/current-system/sw/bin:/bin scratchimg /bin/sleep 10" + "podman run --runtime=crun -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")) ''; } ) |