[health-checker] Fix zedboot detection
Health checker would interpret fuchsia as being in zedboot.
Change-Id: I3feac64e35e7438f090d4fbb7dc3086ab1d9072a
diff --git a/cmd/health_checker/main.go b/cmd/health_checker/main.go
index 6617f6e..a04dda4 100644
--- a/cmd/health_checker/main.go
+++ b/cmd/health_checker/main.go
@@ -126,7 +126,9 @@
for ; time.Since(start) < zedbootWaitDuration; {
time.Sleep(zedbootCheckInterval)
if err := pingZedboot(n, device.Nodename()); err == nil {
- return nil
+ if err := ensureNotFuchsia(n, device.Nodename()); err == nil {
+ return nil
+ }
}
}
diff --git a/devices/power.go b/devices/power.go
index d94a9eb..af5371f 100644
--- a/devices/power.go
+++ b/devices/power.go
@@ -84,10 +84,10 @@
func (c PowerClient) Powercycle(nodename string, serial io.ReadWriter) error {
log.Printf("Attempting to powercycle device %s", nodename)
switch c.Type {
- case "amt":
+ case "AMT":
log.Printf("Using AMT to powercycle.")
return AMTReboot(c.Host, c.Username, c.Password)
- case "wol":
+ case "WOL":
if serial == nil {
return errors.New(fmt.Sprintf("WOL Reboot requires serial connection."))
}
@@ -95,7 +95,7 @@
if err := WOLReboot(botBroadcastAddr, botInterface, c.HostMACAddr); err != nil {
return err
}
- case "pdu":
+ case "PDU":
if serial == nil {
return errors.New(fmt.Sprintf("PDU Reboot requires serial connection."))
}
@@ -120,6 +120,9 @@
}
func (s *SerialRebooter) reboot() error {
+ // TODO(fxb/42761): This doesn't work on x86 due to issues in the serial
+ // implementation in tools/net/serial. We will need to solve this if we
+ // want to depend on serial to deliver messages reliably.
_, err := io.WriteString(s.serial, "\ndm reboot-recovery\n")
return err
}