From 277b1da2ea524a38589017b1f408f1ff71e55f3e Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Wed, 13 May 2020 15:12:59 +1000 Subject: nixos/podman: add crun to test --- nixos/tests/podman.nix | 30 ++++++++++++++++++++++++++---- 1 file 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")) ''; } ) -- cgit 1.4.1 From 7eda9f6e30e2f8645073c97bcf09178a5ecb7a5c Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Tue, 19 May 2020 10:40:59 +1000 Subject: cni-plugins: add passthru.tests --- pkgs/applications/networking/cluster/cni/plugins.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/cluster/cni/plugins.nix b/pkgs/applications/networking/cluster/cni/plugins.nix index 6aaf67bd1d18..4aa15b218df7 100644 --- a/pkgs/applications/networking/cluster/cni/plugins.nix +++ b/pkgs/applications/networking/cluster/cni/plugins.nix @@ -1,4 +1,4 @@ -{ lib, fetchFromGitHub, buildGoModule }: +{ lib, fetchFromGitHub, buildGoModule, nixosTests }: buildGoModule rec { pname = "cni-plugins"; @@ -36,6 +36,8 @@ buildGoModule rec { "plugins/meta/tuning" ]; + passthru.tests.podman = nixosTests.podman; + meta = with lib; { description = "Some standard networking plugins, maintained by the CNI team"; homepage = "https://github.com/containernetworking/plugins"; -- cgit 1.4.1 From cd345dde5351efb5c882256400d7da22984a5b84 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Tue, 19 May 2020 10:40:59 +1000 Subject: conmon: add passthru.tests --- pkgs/applications/virtualization/conmon/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/applications/virtualization/conmon/default.nix b/pkgs/applications/virtualization/conmon/default.nix index 36e52ff1e465..bb693c121d82 100644 --- a/pkgs/applications/virtualization/conmon/default.nix +++ b/pkgs/applications/virtualization/conmon/default.nix @@ -4,6 +4,7 @@ , glib , glibc , systemd +, nixosTests }: stdenv.mkDerivation rec { @@ -23,6 +24,8 @@ stdenv.mkDerivation rec { installFlags = [ "PREFIX=$(out)" ]; + passthru.tests.podman = nixosTests.podman; + meta = with stdenv.lib; { homepage = "https://github.com/containers/conmon"; description = "An OCI container runtime monitor"; -- cgit 1.4.1 From e469b77bf0f5fceafc032085222c0935b277e723 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Tue, 19 May 2020 10:41:00 +1000 Subject: crun: add passthru.tests --- pkgs/applications/virtualization/crun/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/applications/virtualization/crun/default.nix b/pkgs/applications/virtualization/crun/default.nix index ded793449fc7..a11d5d356d14 100644 --- a/pkgs/applications/virtualization/crun/default.nix +++ b/pkgs/applications/virtualization/crun/default.nix @@ -9,6 +9,7 @@ , python3 , systemd , yajl +, nixosTests }: let @@ -62,6 +63,8 @@ stdenv.mkDerivation rec { doCheck = true; + passthru.tests.podman = nixosTests.podman; + meta = with lib; { description = "A fast and lightweight fully featured OCI runtime and C library for running containers"; license = licenses.gpl2Plus; -- cgit 1.4.1 From 032462fc9407e0d8406175a2e29cf2b79401bcd3 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Tue, 19 May 2020 10:41:00 +1000 Subject: runc: add passthru.tests --- pkgs/applications/virtualization/runc/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/applications/virtualization/runc/default.nix b/pkgs/applications/virtualization/runc/default.nix index 1bf6b3d574a9..367767c72a71 100644 --- a/pkgs/applications/virtualization/runc/default.nix +++ b/pkgs/applications/virtualization/runc/default.nix @@ -9,6 +9,7 @@ , apparmor-parser , libseccomp , libselinux +, nixosTests }: buildGoPackage rec { @@ -45,6 +46,8 @@ buildGoPackage rec { installManPage man/*/*.[1-9] ''; + passthru.tests.podman = nixosTests.podman; + meta = with lib; { homepage = "https://github.com/opencontainers/runc"; description = "A CLI tool for spawning and running containers according to the OCI specification"; -- cgit 1.4.1 From c3eef07b21608e3c4444061a7729d9cf820af756 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Tue, 19 May 2020 10:41:00 +1000 Subject: fuse-overlayfs: add passthru.tests --- pkgs/tools/filesystems/fuse-overlayfs/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/filesystems/fuse-overlayfs/default.nix b/pkgs/tools/filesystems/fuse-overlayfs/default.nix index c3b694c85554..f21f19eb7251 100644 --- a/pkgs/tools/filesystems/fuse-overlayfs/default.nix +++ b/pkgs/tools/filesystems/fuse-overlayfs/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, autoreconfHook, pkg-config, fuse3 }: +{ stdenv, fetchFromGitHub, autoreconfHook, pkg-config, fuse3, nixosTests }: stdenv.mkDerivation rec { pname = "fuse-overlayfs"; @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { buildInputs = [ fuse3 ]; + passthru.tests.podman = nixosTests.podman; + meta = with stdenv.lib; { description = "FUSE implementation for overlayfs"; longDescription = "An implementation of overlay+shiftfs in FUSE for rootless containers."; -- cgit 1.4.1 From 71dafd0239d20ae422b6862f54bda158999b8dbd Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Tue, 19 May 2020 10:41:01 +1000 Subject: slirp4netns: add passthru.tests --- pkgs/tools/networking/slirp4netns/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/tools/networking/slirp4netns/default.nix b/pkgs/tools/networking/slirp4netns/default.nix index 6b9279a8190f..5aa3219e5b10 100644 --- a/pkgs/tools/networking/slirp4netns/default.nix +++ b/pkgs/tools/networking/slirp4netns/default.nix @@ -6,6 +6,7 @@ , libcap , libseccomp , libslirp +, nixosTests }: stdenv.mkDerivation rec { @@ -25,6 +26,8 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + passthru.tests.podman = nixosTests.podman; + meta = with stdenv.lib; { homepage = "https://github.com/rootless-containers/slirp4netns"; description = "User-mode networking for unprivileged network namespaces"; -- cgit 1.4.1