Skip to content

Commit

Permalink
Merge master into staging-next
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Aug 16, 2022
2 parents 4a944df + 9050439 commit d4c5536
Show file tree
Hide file tree
Showing 50 changed files with 22,760 additions and 906 deletions.
2 changes: 1 addition & 1 deletion maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7262,7 +7262,7 @@
};
lassulus = {
email = "lassulus@gmail.com";
matrix = "@lassulus:nixos.dev";
matrix = "@lassulus:lassul.us";
github = "Lassulus";
githubId = 621759;
name = "Lassulus";
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/config/power-management.nix
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ in

systemd.services.post-resume =
{ description = "Post-Resume Actions";
after = [ "suspend.target" "hibernate.target" "hybrid-sleep.target" ];
after = [ "suspend.target" "hibernate.target" "hybrid-sleep.target" "suspend-then-hibernate.target" ];
script =
''
/run/current-system/systemd/bin/systemctl try-restart post-resume.target
Expand Down
27 changes: 23 additions & 4 deletions nixos/tests/systemd-machinectl.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ import ./make-test-python.nix (
networking.useNetworkd = true;
networking.useDHCP = false;

# open DHCP server on interface to container
networking.firewall.trustedInterfaces = [ "ve-+" ];

# do not try to access cache.nixos.org
nix.settings.substituters = lib.mkForce [ ];

# auto-start container
systemd.targets.machines.wants = [ "systemd-nspawn@${containerName}.service" ];

virtualisation.additionalPaths = [ containerSystem ];
};

Expand All @@ -59,8 +59,19 @@ import ./make-test-python.nix (
machine.succeed("machinectl start ${containerName}");
machine.wait_until_succeeds("systemctl -M ${containerName} is-active default.target");
# Test nss_mymachines without nscd
machine.succeed('LD_LIBRARY_PATH="/run/current-system/sw/lib" getent -s hosts:mymachines hosts ${containerName}');
# Test failing nss_mymachines via nscd
# nscd has not enough rights to connect to systemd bus
# via sd_bus_open_system() in
# https://github.com/systemd/systemd/blob/main/src/nss-mymachines/nss-mymachines.c#L287
machine.fail("getent hosts ${containerName}");
# Test systemd-nspawn network configuration
machine.succeed("ping -n -c 1 ${containerName}");
machine.succeed("systemctl stop nscd");
machine.succeed('LD_LIBRARY_PATH="/run/current-system/sw/lib" ping -n -c 1 ${containerName}');
machine.succeed("systemctl start nscd");
# Test systemd-nspawn uses a user namespace
machine.succeed("test $(machinectl status ${containerName} | grep 'UID Shift: ' | wc -l) = 1")
Expand All @@ -73,6 +84,14 @@ import ./make-test-python.nix (
machine.succeed("machinectl reboot ${containerName}");
machine.wait_until_succeeds("systemctl -M ${containerName} is-active default.target");
# Restart machine
machine.shutdown()
machine.start()
machine.wait_for_unit("default.target");
# Test auto-start
machine.succeed("machinectl show ${containerName}")
# Test machinectl stop
machine.succeed("machinectl stop ${containerName}");
machine.wait_until_succeeds("test $(systemctl is-active systemd-nspawn@${containerName}) = inactive");
Expand Down
Loading

0 comments on commit d4c5536

Please sign in to comment.