nixos/tests/machinectl: Disable tmpfs for /tmp

This commit is contained in:
Christian Kögler 2022-10-22 13:07:09 +02:00
parent 6d31353099
commit 9bb2a979d4

View file

@ -44,6 +44,14 @@ import ./make-test-python.nix ({ pkgs, ... }:
# not needed, but we want to test the nspawn file generation
systemd.nspawn.${containerName} = { };
systemd.services."systemd-nspawn@${containerName}" = {
serviceConfig.Environment = [
# Disable tmpfs for /tmp
"SYSTEMD_NSPAWN_TMPFS_TMP=0"
];
overrideStrategy = "asDropin";
};
};
testScript = ''
@ -95,6 +103,9 @@ import ./make-test-python.nix ({ pkgs, ... }:
machine.succeed("machinectl stop ${containerName}");
machine.wait_until_succeeds("test $(systemctl is-active systemd-nspawn@${containerName}) = inactive");
# Test tmpfs for /tmp
machine.fail("mountpoint /tmp");
# Show to to delete the container
machine.succeed("chattr -i ${containerRoot}/var/empty");
machine.succeed("rm -rf ${containerRoot}");