mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-02 02:03:21 +00:00
Remove unnecessary loop in stc-ng (#348668)
This commit is contained in:
commit
c1479242ad
@ -18,16 +18,21 @@ makeTest {
|
||||
meta = with maintainers; {
|
||||
maintainers = [ urbas ];
|
||||
};
|
||||
nodes.machine = { ... }:
|
||||
nodes.machine = { lib, pkgs, ... }:
|
||||
{
|
||||
imports = [ ../modules/profiles/headless.nix ../modules/virtualisation/amazon-init.nix ];
|
||||
services.openssh.enable = true;
|
||||
system.switch.enable = true;
|
||||
networking.hostName = "";
|
||||
environment.etc."ec2-metadata/user-data" = {
|
||||
text = ''
|
||||
#!/usr/bin/bash
|
||||
|
||||
echo successful > /tmp/evidence
|
||||
|
||||
# Emulate running nixos-rebuild switch, just without any building.
|
||||
# https://github.com/nixos/nixpkgs/blob/4c62505847d88f16df11eff3c81bf9a453a4979e/nixos/modules/virtualisation/amazon-init.nix#L55
|
||||
/run/current-system/bin/switch-to-configuration test
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
@ -1082,22 +1082,6 @@ won't take effect until you reboot the system.
|
||||
.subscribe()
|
||||
.context("Failed to subscribe to systemd dbus messages")?;
|
||||
|
||||
// Wait for the system to have finished booting.
|
||||
loop {
|
||||
let system_state: String = systemd
|
||||
.get("org.freedesktop.systemd1.Manager", "SystemState")
|
||||
.context("Failed to get system state")?;
|
||||
|
||||
match system_state.as_str() {
|
||||
"running" | "degraded" | "maintenance" => break,
|
||||
_ => {
|
||||
_ = dbus_conn
|
||||
.process(Duration::from_millis(500))
|
||||
.context("Failed to process dbus messages")?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let _systemd_reload_status = systemd_reload_status.clone();
|
||||
let reloading_token = systemd
|
||||
.match_signal(
|
||||
|
Loading…
Reference in New Issue
Block a user