podman-linux: fix tests expected results and modules

Update the expected results to match changes in the podman generator
and fix not importing the podman stub overlay with module import
behind `mkIf` introduced in #6905.
This commit is contained in:
Timothy Gallion
2026-01-03 12:56:51 -05:00
committed by Robert Helgesson
parent 9bfca5b3a7
commit 38e187fd2f
12 changed files with 314 additions and 312 deletions

View File

@@ -26,5 +26,5 @@ Type=oneshot
Wants=podman-user-wait-network-online.service
After=podman-user-wait-network-online.service
Description=Service for build my-bld
RequiresMountsFor=%t/containers
SourcePath=/nix/store/00000000000000000000000000000000-home-build-podman-my-bld/quadlets/podman-my-bld.build
RequiresMountsFor=%t/containers

View File

@@ -4,10 +4,9 @@
pkgs,
...
}:
lib.mkIf config.test.enableLegacyIfd {
{
imports = [ ./podman-stubs.nix ];
config = lib.mkIf config.test.enableLegacyIfd {
services.podman = {
enable = true;
builds = {
@@ -50,4 +49,5 @@ lib.mkIf config.test.enableLegacyIfd {
assertFileContent $buildFile ${./build-expected.service}
'';
};
}

View File

@@ -27,18 +27,18 @@ WantedBy=default.target
WantedBy=multi-user.target
[Service]
Environment=PATH=/run/wrappers/bin:/run/current-system/sw/bin:/home/hm-user/.nix-profile/bin:@systemd@/bin
Environment=PATH=/run/wrappers/bin:/run/current-system/sw/bin:@nftables@/bin:/home/hm-user/.nix-profile/bin:@systemd@/bin
Restart=on-failure
TimeoutStopSec=30
Environment=PODMAN_SYSTEMD_UNIT=%n
KillMode=mixed
ExecStop=/nix/store/00000000000000000000000000000000-podman/bin/podman rm -v -f -i --cidfile=%t/%N.cid
ExecStopPost=-/nix/store/00000000000000000000000000000000-podman/bin/podman rm -v -f -i --cidfile=%t/%N.cid
ExecStop=/nix/store/00000000000000000000000000000000-podman/bin/podman rm -v -f -i my-container
ExecStopPost=-/nix/store/00000000000000000000000000000000-podman/bin/podman rm -v -f -i my-container
Delegate=yes
Type=notify
NotifyAccess=all
SyslogIdentifier=%N
ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman run --name my-container --cidfile=%t/%N.cid --replace --rm --cgroups=split --entrypoint /sleep.sh --network-alias test-alias-1 --network-alias test-alias-2 --read-only-tmpfs --network mynet --sdnotify=conmon -d --device /dev/null:/dev/null -v /tmp:/tmp --label io.containers.autoupdate=registry --publish 8080:80 --env VAL_A=A --env VAL_B=2 --env VAL_C=false --label nix.home-manager.managed=true --security-opt=no-new-privileges docker.io/alpine:latest
ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman run --name my-container --replace --rm --cgroups=split --entrypoint /sleep.sh --network-alias test-alias-1 --network-alias test-alias-2 --read-only-tmpfs --network mynet --sdnotify=conmon -d --device /dev/null:/dev/null -v /tmp:/tmp --label io.containers.autoupdate=registry --publish 8080:80 --env VAL_A=A --env VAL_B=2 --env VAL_C=false --label nix.home-manager.managed=true --security-opt=no-new-privileges docker.io/alpine:latest
[Unit]
Wants=podman-user-wait-network-online.service

View File

@@ -1,7 +1,7 @@
{ config, lib, ... }:
lib.mkIf config.test.enableLegacyIfd {
{
imports = [ ./podman-stubs.nix ];
config = lib.mkIf config.test.enableLegacyIfd {
services.podman = {
enable = true;
@@ -58,4 +58,5 @@ lib.mkIf config.test.enableLegacyIfd {
assertFileContent $containerFile ${./container-expected.service}
'';
};
}

View File

@@ -1,8 +1,7 @@
{ config, lib, ... }:
lib.mkIf config.test.enableLegacyIfd {
{
imports = [ ./podman-stubs.nix ];
config = lib.mkIf config.test.enableLegacyIfd {
services.podman = {
enable = true;
images = {
@@ -21,4 +20,5 @@ lib.mkIf config.test.enableLegacyIfd {
assertFileContent $imageFile ${./image-expected.service}
'';
};
}

View File

@@ -26,5 +26,5 @@ Type=oneshot
Wants=podman-user-wait-network-online.service
After=podman-user-wait-network-online.service
Description=Service for build my-bld
RequiresMountsFor=%t/containers
SourcePath=/nix/store/00000000000000000000000000000000-home-container-podman-my-container-bld/quadlets/podman-my-bld.build
RequiresMountsFor=%t/containers

View File

@@ -15,24 +15,24 @@ WantedBy=default.target
WantedBy=multi-user.target
[Service]
Environment=PATH=/run/wrappers/bin:/run/current-system/sw/bin:/home/hm-user/.nix-profile/bin:@systemd@/bin
Environment=PATH=/run/wrappers/bin:/run/current-system/sw/bin:@nftables@/bin:/home/hm-user/.nix-profile/bin:@systemd@/bin
Restart=always
TimeoutStopSec=30
Environment=PODMAN_SYSTEMD_UNIT=%n
KillMode=mixed
ExecStop=/nix/store/00000000000000000000000000000000-podman/bin/podman rm -v -f -i --cidfile=%t/%N.cid
ExecStopPost=-/nix/store/00000000000000000000000000000000-podman/bin/podman rm -v -f -i --cidfile=%t/%N.cid
ExecStop=/nix/store/00000000000000000000000000000000-podman/bin/podman rm -v -f -i my-container-bld
ExecStopPost=-/nix/store/00000000000000000000000000000000-podman/bin/podman rm -v -f -i my-container-bld
Delegate=yes
Type=notify
NotifyAccess=all
SyslogIdentifier=%N
ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman run --name my-container-bld --cidfile=%t/%N.cid --replace --rm --cgroups=split --sdnotify=conmon -d --label nix.home-manager.managed=true homemanager/my-bld
ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman run --name my-container-bld --replace --rm --cgroups=split --sdnotify=conmon -d --label nix.home-manager.managed=true homemanager/my-bld
[Unit]
Wants=podman-user-wait-network-online.service
After=podman-user-wait-network-online.service
Description=Service for container my-container-bld
SourcePath=/nix/store/00000000000000000000000000000000-home-container-podman-my-container-bld/quadlets/podman-my-container-bld.container
RequiresMountsFor=%t/containers
Requires=podman-my-bld-build.service
After=podman-my-bld-build.service
RequiresMountsFor=%t/containers

View File

@@ -18,27 +18,27 @@ WantedBy=default.target
WantedBy=multi-user.target
[Service]
Environment=PATH=/run/wrappers/bin:/run/current-system/sw/bin:/home/hm-user/.nix-profile/bin:@systemd@/bin
Environment=PATH=/run/wrappers/bin:/run/current-system/sw/bin:@nftables@/bin:/home/hm-user/.nix-profile/bin:@systemd@/bin
Restart=always
TimeoutStopSec=30
Environment=PODMAN_SYSTEMD_UNIT=%n
KillMode=mixed
ExecStop=/nix/store/00000000000000000000000000000000-podman/bin/podman rm -v -f -i --cidfile=%t/%N.cid
ExecStopPost=-/nix/store/00000000000000000000000000000000-podman/bin/podman rm -v -f -i --cidfile=%t/%N.cid
ExecStop=/nix/store/00000000000000000000000000000000-podman/bin/podman rm -v -f -i my-container
ExecStopPost=-/nix/store/00000000000000000000000000000000-podman/bin/podman rm -v -f -i my-container
Delegate=yes
Type=notify
NotifyAccess=all
SyslogIdentifier=%N
ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman run --name my-container --cidfile=%t/%N.cid --replace --rm --cgroups=split --network my-app --network externalnet --sdnotify=conmon -d -v my-app:/data --label nix.home-manager.managed=true docker.io/alpine:latest
ExecStart=/nix/store/00000000000000000000000000000000-podman/bin/podman run --name my-container --replace --rm --cgroups=split --network my-app --network externalnet --sdnotify=conmon -d -v my-app:/data --label nix.home-manager.managed=true docker.io/alpine:latest
[Unit]
Wants=podman-user-wait-network-online.service
After=podman-user-wait-network-online.service
Description=Service for container my-container
SourcePath=/nix/store/00000000000000000000000000000000-home-container-podman-my-container/quadlets/podman-my-container.container
RequiresMountsFor=%t/containers
Requires=podman-my-img-image.service
After=podman-my-img-image.service
RequiresMountsFor=%t/containers
Requires=podman-my-app-network.service
After=podman-my-app-network.service
Requires=podman-my-app-volume.service

View File

@@ -4,10 +4,10 @@
pkgs,
...
}:
lib.mkIf config.test.enableLegacyIfd {
{
imports = [ ./podman-stubs.nix ];
config = lib.mkIf config.test.enableLegacyIfd {
services.podman = {
enable = true;
builds."my-bld" = {
@@ -78,4 +78,5 @@ lib.mkIf config.test.enableLegacyIfd {
assertFileContent $networkFile ${./integration-network-expected.service}
assertFileContent $volumeFile ${./integration-volume-expected.service}
'';
};
}

View File

@@ -1,8 +1,7 @@
{ config, lib, ... }:
lib.mkIf config.test.enableLegacyIfd {
{
imports = [ ./podman-stubs.nix ];
config = lib.mkIf config.test.enableLegacyIfd {
services.podman = {
enable = true;
containers."my-container-1" = {
@@ -59,4 +58,5 @@ lib.mkIf config.test.enableLegacyIfd {
mynet-2
''}
'';
};
}

View File

@@ -1,8 +1,7 @@
{ config, lib, ... }:
lib.mkIf config.test.enableLegacyIfd {
{
imports = [ ./podman-stubs.nix ];
config = lib.mkIf config.test.enableLegacyIfd {
services.podman = {
enable = true;
networks = {
@@ -49,4 +48,5 @@ lib.mkIf config.test.enableLegacyIfd {
assertFileContent $networkFile ${./network-expected.service}
'';
};
}

View File

@@ -1,8 +1,7 @@
{ config, lib, ... }:
lib.mkIf config.test.enableLegacyIfd {
{
imports = [ ./podman-stubs.nix ];
config = lib.mkIf config.test.enableLegacyIfd {
services.podman = {
enable = true;
volumes = {
@@ -41,4 +40,5 @@ lib.mkIf config.test.enableLegacyIfd {
assertFileContent $volumeFile ${./volume-expected.service}
'';
};
}