diff options
author | Alyssa Ross <hi@alyssa.is> | 2024-06-23 00:32:22 +0200 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2024-06-23 00:32:22 +0200 |
commit | 6402b188ddd100b3cd6afe7b8a3e553365203f43 (patch) | |
tree | 676b85e4a6ffee092e413e723f7dce8ba01bb48f /nixpkgs/nixos/tests/podman | |
parent | 5a1826585861b32ce2509c0643e793196d81893e (diff) | |
parent | d603719ec6e294f034936c0d0dc06f689d91b6c3 (diff) | |
download | nixlib-6402b188ddd100b3cd6afe7b8a3e553365203f43.tar nixlib-6402b188ddd100b3cd6afe7b8a3e553365203f43.tar.gz nixlib-6402b188ddd100b3cd6afe7b8a3e553365203f43.tar.bz2 nixlib-6402b188ddd100b3cd6afe7b8a3e553365203f43.tar.lz nixlib-6402b188ddd100b3cd6afe7b8a3e553365203f43.tar.xz nixlib-6402b188ddd100b3cd6afe7b8a3e553365203f43.tar.zst nixlib-6402b188ddd100b3cd6afe7b8a3e553365203f43.zip |
Merge remote-tracking branch 'nixpkgs/nixos-unstable'
Diffstat (limited to 'nixpkgs/nixos/tests/podman')
-rw-r--r-- | nixpkgs/nixos/tests/podman/default.nix | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/nixpkgs/nixos/tests/podman/default.nix b/nixpkgs/nixos/tests/podman/default.nix index 3eea45832f0a..f57523cf5888 100644 --- a/nixpkgs/nixos/tests/podman/default.nix +++ b/nixpkgs/nixos/tests/podman/default.nix @@ -1,5 +1,22 @@ import ../make-test-python.nix ( - { pkgs, lib, ... }: { + { pkgs, lib, ... }: + let + quadletContainerFile = pkgs.writeText "quadlet.container" '' + [Unit] + Description=A test quadlet container + + [Container] + Image=localhost/scratchimg:latest + Exec=bash -c 'trap exit SIGTERM SIGINT; while true; do sleep 1; done' + ContainerName=quadlet + Volume=/nix/store:/nix/store + Volume=/run/current-system/sw/bin:/bin + + [Install] + WantedBy=default.target + ''; + in + { name = "podman"; meta = { maintainers = lib.teams.podman.members; @@ -174,6 +191,16 @@ import ../make-test-python.nix ( with subtest("A podman non-member can not use the docker cli"): docker.fail(su_cmd("docker version", user="mallory")) + with subtest("A rootless quadlet container service is created"): + dir = "/home/alice/.config/containers/systemd" + rootless.succeed(su_cmd("tar cv --files-from /dev/null | podman import - scratchimg")) + rootless.succeed(su_cmd(f"mkdir -p {dir}")) + rootless.succeed(su_cmd(f"cp -f ${quadletContainerFile} {dir}/quadlet.container")) + rootless.systemctl("daemon-reload", "alice") + rootless.systemctl("start quadlet", "alice") + rootless.wait_until_succeeds(su_cmd("podman ps | grep quadlet"), timeout=20) + rootless.systemctl("stop quadlet", "alice") + # TODO: add docker-compose test ''; |