about summary refs log tree commit diff
path: root/nixos/tests/systemd.nix
diff options
context:
space:
mode:
authorJanne Heß <janne@hess.ooo>2022-03-23 15:56:23 +0100
committerJanne Heß <janne@hess.ooo>2022-03-30 20:24:27 +0200
commita3e0698bf6fd676d96b89bdb4cd54c73ea502746 (patch)
tree750875589062bfee5f9fcefa7b7a5e691ae3e347 /nixos/tests/systemd.nix
parentd56076aa39859f675bbdc64ea148664406db3278 (diff)
nixos/systemd: Switch to ManagerEnvironment=
This accomplishes multiple things:
- Allows us to start systemd without stage-2-init.sh. This was not
  possible before because the environment would have been wrong
- `systemctl daemon-reexec` also changes the environment, giving us
  newer tools for the fs packages
- Starts systemd in a fully clean environment, making everything more
  consistent and pure
Diffstat (limited to 'nixos/tests/systemd.nix')
-rw-r--r--nixos/tests/systemd.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/nixos/tests/systemd.nix b/nixos/tests/systemd.nix
index f86daa5eea974..94805ee5781a1 100644
--- a/nixos/tests/systemd.nix
+++ b/nixos/tests/systemd.nix
@@ -192,5 +192,9 @@ import ./make-test-python.nix ({ pkgs, ... }: {
     with subtest("systemd per-unit accounting works"):
         assert "IP traffic received: 84B" in output_ping
         assert "IP traffic sent: 84B" in output_ping
+
+    with subtest("systemd environment is properly set"):
+        machine.systemctl("daemon-reexec")  # Rewrites /proc/1/environ
+        machine.succeed("grep -q TZDIR=/etc/zoneinfo /proc/1/environ")
   '';
 })