From fd3f1ec19a934d55fa68725db2aaf51146c82dc4 Mon Sep 17 00:00:00 2001 From: Andrey Golovizin Date: Sun, 21 Mar 2021 21:12:32 +0100 Subject: [PATCH] nixos/tests/podman: test podman run --init --- nixos/tests/podman.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nixos/tests/podman.nix b/nixos/tests/podman.nix index 4985ff60365..6078a936ede 100644 --- a/nixos/tests/podman.nix +++ b/nixos/tests/podman.nix @@ -96,6 +96,15 @@ 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")) + + with subtest("Run container with init"): + podman.succeed( + "tar cv -C ${pkgs.pkgsStatic.busybox} . | podman import - busybox" + ) + pid = podman.succeed("podman run --rm busybox readlink /proc/self").strip() + assert pid == "1" + pid = podman.succeed("podman run --rm --init busybox readlink /proc/self").strip() + assert pid == "2" ''; } )