Unverified Commit c1479242 authored by Will Fancher's avatar Will Fancher Committed by GitHub
Browse files

Remove unnecessary loop in stc-ng (#348668)

parents 67611066 7c828e9e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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
      '';
    };
  };
+0 −16
Original line number Diff line number Diff line
@@ -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(