|
@@ -4,6 +4,7 @@
|
|
|
use crate::json::JsonVal;
|
|
use crate::json::JsonVal;
|
|
|
use crate::lib;
|
|
use crate::lib;
|
|
|
use std::collections::{BTreeMap, BTreeSet, VecDeque};
|
|
use std::collections::{BTreeMap, BTreeSet, VecDeque};
|
|
|
|
|
+use std::path::PathBuf;
|
|
|
use std::time::{SystemTime, UNIX_EPOCH};
|
|
use std::time::{SystemTime, UNIX_EPOCH};
|
|
|
|
|
|
|
|
pub const RAW_RING_CAPACITY: usize = 16 * 1024 * 1024;
|
|
pub const RAW_RING_CAPACITY: usize = 16 * 1024 * 1024;
|
|
@@ -449,6 +450,7 @@ pub struct StationState {
|
|
|
pub active_amt_cpus: BTreeSet<i64>,
|
|
pub active_amt_cpus: BTreeSet<i64>,
|
|
|
pub mt_result: JsonVal,
|
|
pub mt_result: JsonVal,
|
|
|
pub mt_per_test_errs: BTreeMap<i32, i64>,
|
|
pub mt_per_test_errs: BTreeMap<i32, i64>,
|
|
|
|
|
+ pub mt_completed_test_ids: BTreeSet<i32>,
|
|
|
pub uip_overrides: Vec<JsonVal>,
|
|
pub uip_overrides: Vec<JsonVal>,
|
|
|
pub uip_raw_commands: Vec<String>,
|
|
pub uip_raw_commands: Vec<String>,
|
|
|
pub mt_selection: JsonVal,
|
|
pub mt_selection: JsonVal,
|
|
@@ -502,6 +504,9 @@ pub struct StationState {
|
|
|
pub in_internal_warm_reset: bool,
|
|
pub in_internal_warm_reset: bool,
|
|
|
pub amt_prefers_short_cmd: bool,
|
|
pub amt_prefers_short_cmd: bool,
|
|
|
pub amt_fallback_attempted: bool,
|
|
pub amt_fallback_attempted: bool,
|
|
|
|
|
+ pub power_seq_in_progress: bool,
|
|
|
|
|
+ pub power_seq_started_ms: i64,
|
|
|
|
|
+ pub debug_log_path: Option<PathBuf>,
|
|
|
pub dimm_seen_in_boot: [bool; 24],
|
|
pub dimm_seen_in_boot: [bool; 24],
|
|
|
pub had_bmc_sdr: [bool; 24],
|
|
pub had_bmc_sdr: [bool; 24],
|
|
|
pub sdr_absent_streak: [u8; 24],
|
|
pub sdr_absent_streak: [u8; 24],
|
|
@@ -643,6 +648,7 @@ impl StationState {
|
|
|
active_amt_cpus: BTreeSet::new(),
|
|
active_amt_cpus: BTreeSet::new(),
|
|
|
mt_result: JsonVal::obj(),
|
|
mt_result: JsonVal::obj(),
|
|
|
mt_per_test_errs: BTreeMap::new(),
|
|
mt_per_test_errs: BTreeMap::new(),
|
|
|
|
|
+ mt_completed_test_ids: BTreeSet::new(),
|
|
|
uip_overrides: Vec::new(),
|
|
uip_overrides: Vec::new(),
|
|
|
uip_raw_commands: Vec::new(),
|
|
uip_raw_commands: Vec::new(),
|
|
|
mt_selection: mt_sel,
|
|
mt_selection: mt_sel,
|
|
@@ -696,6 +702,9 @@ impl StationState {
|
|
|
in_internal_warm_reset: false,
|
|
in_internal_warm_reset: false,
|
|
|
amt_prefers_short_cmd: false,
|
|
amt_prefers_short_cmd: false,
|
|
|
amt_fallback_attempted: false,
|
|
amt_fallback_attempted: false,
|
|
|
|
|
+ power_seq_in_progress: false,
|
|
|
|
|
+ power_seq_started_ms: 0,
|
|
|
|
|
+ debug_log_path: None,
|
|
|
dimm_seen_in_boot: [false; 24],
|
|
dimm_seen_in_boot: [false; 24],
|
|
|
had_bmc_sdr: [false; 24],
|
|
had_bmc_sdr: [false; 24],
|
|
|
sdr_absent_streak: [0; 24],
|
|
sdr_absent_streak: [0; 24],
|
|
@@ -793,6 +802,13 @@ impl StationState {
|
|
|
self.sdr_absent_streak = [0; 24];
|
|
self.sdr_absent_streak = [0; 24];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ #[inline]
|
|
|
|
|
+ pub fn log_debug(&self, category: &str, msg: &str) {
|
|
|
|
|
+ if let Some(ref p) = self.debug_log_path {
|
|
|
|
|
+ crate::storage::append_debug_log_path(p, &self.station_id, category, msg);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
pub fn clear_for_external_restart(
|
|
pub fn clear_for_external_restart(
|
|
|
&mut self,
|
|
&mut self,
|
|
|
now: i64,
|
|
now: i64,
|
|
@@ -800,6 +816,29 @@ impl StationState {
|
|
|
force_new_boot_id: bool,
|
|
force_new_boot_id: bool,
|
|
|
) {
|
|
) {
|
|
|
let bp_state_now = self.boot_execution.get_str_or("state", "idle");
|
|
let bp_state_now = self.boot_execution.get_str_or("state", "idle");
|
|
|
|
|
+ let is_terminal_bp = matches!(
|
|
|
|
|
+ bp_state_now.as_str(),
|
|
|
|
|
+ "blocked" | "failed" | "completed" | "stopped" | "interrupted"
|
|
|
|
|
+ ) || matches!(
|
|
|
|
|
+ self.task_status.as_str(),
|
|
|
|
|
+ "failed" | "completed" | "interrupted"
|
|
|
|
|
+ );
|
|
|
|
|
+ let keep_active_run = self.power_seq_in_progress
|
|
|
|
|
+ || (self.is_run_active() && !self.has_any_failure_state() && !is_terminal_bp);
|
|
|
|
|
+ self.log_debug(
|
|
|
|
|
+ "RESET",
|
|
|
|
|
+ &format!(
|
|
|
|
|
+ "clear_for_external_restart reason={} force_new_boot_id={} keep_active_run={} run_active={} started={} ended={} bp_state={} task_status={}",
|
|
|
|
|
+ reason_detail,
|
|
|
|
|
+ force_new_boot_id,
|
|
|
|
|
+ keep_active_run,
|
|
|
|
|
+ self.is_run_active(),
|
|
|
|
|
+ self.run_started_unix_ms,
|
|
|
|
|
+ self.run_ended_unix_ms,
|
|
|
|
|
+ bp_state_now,
|
|
|
|
|
+ self.task_status
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
let had_active_or_finished_run = self.run_ended_unix_ms > 0
|
|
let had_active_or_finished_run = self.run_ended_unix_ms > 0
|
|
|
|| self.single_run_started_ms > 0
|
|
|| self.single_run_started_ms > 0
|
|
|
|| self.single_run_active
|
|
|| self.single_run_active
|
|
@@ -827,16 +866,19 @@ impl StationState {
|
|
|
self.amt_fallback_attempted = false;
|
|
self.amt_fallback_attempted = false;
|
|
|
self.mt_result = JsonVal::obj();
|
|
self.mt_result = JsonVal::obj();
|
|
|
self.mt_per_test_errs.clear();
|
|
self.mt_per_test_errs.clear();
|
|
|
|
|
+ self.mt_completed_test_ids.clear();
|
|
|
self.plan_configured.clear();
|
|
self.plan_configured.clear();
|
|
|
self.plan_done.clear();
|
|
self.plan_done.clear();
|
|
|
self.plan_amt_started.clear();
|
|
self.plan_amt_started.clear();
|
|
|
self.plan_mt_started = false;
|
|
self.plan_mt_started = false;
|
|
|
- self.single_run_active = false;
|
|
|
|
|
- self.single_run_id.clear();
|
|
|
|
|
- self.single_run_started_ms = 0;
|
|
|
|
|
- if had_active_or_finished_run {
|
|
|
|
|
- self.run_started_unix_ms = 0;
|
|
|
|
|
- self.run_ended_unix_ms = 0;
|
|
|
|
|
|
|
+ if !keep_active_run {
|
|
|
|
|
+ self.single_run_active = false;
|
|
|
|
|
+ self.single_run_id.clear();
|
|
|
|
|
+ self.single_run_started_ms = 0;
|
|
|
|
|
+ if had_active_or_finished_run {
|
|
|
|
|
+ self.run_started_unix_ms = 0;
|
|
|
|
|
+ self.run_ended_unix_ms = 0;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
self.mt_started_unix_ms = 0;
|
|
self.mt_started_unix_ms = 0;
|
|
|
self.mt_report_sync_pending = false;
|
|
self.mt_report_sync_pending = false;
|
|
@@ -863,39 +905,41 @@ impl StationState {
|
|
|
self.async_script.clear();
|
|
self.async_script.clear();
|
|
|
self.tx_pacer.clear();
|
|
self.tx_pacer.clear();
|
|
|
self.pending_complete_signal = None;
|
|
self.pending_complete_signal = None;
|
|
|
- self.task_status = "not_started".to_string();
|
|
|
|
|
- self.stage_intents.clear();
|
|
|
|
|
- self.last_uip_apply = None;
|
|
|
|
|
- self.last_amt_apply = None;
|
|
|
|
|
- self.last_amt_start = None;
|
|
|
|
|
- self.last_phase_action = None;
|
|
|
|
|
- self.command = JsonVal::Null;
|
|
|
|
|
- if bp_state_now != "idle"
|
|
|
|
|
- || !self.boot_execution.get_str_or("id", "").is_empty()
|
|
|
|
|
- || !self.boot_execution.get_str_or("boot_id", "").is_empty()
|
|
|
|
|
- || !self.boot_execution.get_str_or("error", "").is_empty()
|
|
|
|
|
- || !self.boot_execution.get_str_or("current_stage", "").is_empty()
|
|
|
|
|
- || !self.boot_execution.get_str_or("waiting_reason", "").is_empty()
|
|
|
|
|
- || self
|
|
|
|
|
- .boot_execution
|
|
|
|
|
- .get_arr("handled_inputs")
|
|
|
|
|
- .map(|a| !a.is_empty())
|
|
|
|
|
- .unwrap_or(false)
|
|
|
|
|
- || self
|
|
|
|
|
- .boot_execution
|
|
|
|
|
- .get_f64("started_unix_ms")
|
|
|
|
|
- .unwrap_or(0.0)
|
|
|
|
|
- > 0.0
|
|
|
|
|
- {
|
|
|
|
|
- self.boot_execution.set("id", JsonVal::Str(String::new()));
|
|
|
|
|
- self.boot_execution.set("boot_id", JsonVal::Str(String::new()));
|
|
|
|
|
- self.boot_execution.set("state", JsonVal::Str("idle".to_string()));
|
|
|
|
|
- self.boot_execution.set("current_stage", JsonVal::Str(String::new()));
|
|
|
|
|
- self.boot_execution.set("error", JsonVal::Str(String::new()));
|
|
|
|
|
- self.boot_execution.set("waiting_reason", JsonVal::Str(String::new()));
|
|
|
|
|
- self.boot_execution.set("handled_inputs", JsonVal::Arr(Vec::new()));
|
|
|
|
|
- self.boot_execution.set("started_unix_ms", JsonVal::Num(0.0));
|
|
|
|
|
- self.boot_execution.set("updated_unix_ms", JsonVal::Num(now as f64));
|
|
|
|
|
|
|
+ if !keep_active_run {
|
|
|
|
|
+ self.task_status = "not_started".to_string();
|
|
|
|
|
+ self.stage_intents.clear();
|
|
|
|
|
+ self.last_uip_apply = None;
|
|
|
|
|
+ self.last_amt_apply = None;
|
|
|
|
|
+ self.last_amt_start = None;
|
|
|
|
|
+ self.last_phase_action = None;
|
|
|
|
|
+ self.command = JsonVal::Null;
|
|
|
|
|
+ if bp_state_now != "idle"
|
|
|
|
|
+ || !self.boot_execution.get_str_or("id", "").is_empty()
|
|
|
|
|
+ || !self.boot_execution.get_str_or("boot_id", "").is_empty()
|
|
|
|
|
+ || !self.boot_execution.get_str_or("error", "").is_empty()
|
|
|
|
|
+ || !self.boot_execution.get_str_or("current_stage", "").is_empty()
|
|
|
|
|
+ || !self.boot_execution.get_str_or("waiting_reason", "").is_empty()
|
|
|
|
|
+ || self
|
|
|
|
|
+ .boot_execution
|
|
|
|
|
+ .get_arr("handled_inputs")
|
|
|
|
|
+ .map(|a| !a.is_empty())
|
|
|
|
|
+ .unwrap_or(false)
|
|
|
|
|
+ || self
|
|
|
|
|
+ .boot_execution
|
|
|
|
|
+ .get_f64("started_unix_ms")
|
|
|
|
|
+ .unwrap_or(0.0)
|
|
|
|
|
+ > 0.0
|
|
|
|
|
+ {
|
|
|
|
|
+ self.boot_execution.set("id", JsonVal::Str(String::new()));
|
|
|
|
|
+ self.boot_execution.set("boot_id", JsonVal::Str(String::new()));
|
|
|
|
|
+ self.boot_execution.set("state", JsonVal::Str("idle".to_string()));
|
|
|
|
|
+ self.boot_execution.set("current_stage", JsonVal::Str(String::new()));
|
|
|
|
|
+ self.boot_execution.set("error", JsonVal::Str(String::new()));
|
|
|
|
|
+ self.boot_execution.set("waiting_reason", JsonVal::Str(String::new()));
|
|
|
|
|
+ self.boot_execution.set("handled_inputs", JsonVal::Arr(Vec::new()));
|
|
|
|
|
+ self.boot_execution.set("started_unix_ms", JsonVal::Num(0.0));
|
|
|
|
|
+ self.boot_execution.set("updated_unix_ms", JsonVal::Num(now as f64));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -950,6 +994,15 @@ impl StationState {
|
|
|
|
|
|
|
|
pub fn reset_on_disconnect(&mut self) {
|
|
pub fn reset_on_disconnect(&mut self) {
|
|
|
let now = now_ms();
|
|
let now = now_ms();
|
|
|
|
|
+ self.log_debug(
|
|
|
|
|
+ "RESET",
|
|
|
|
|
+ &format!(
|
|
|
|
|
+ "reset_on_disconnect prev_started={} prev_ended={} task_status={} boot_id={}",
|
|
|
|
|
+ self.run_started_unix_ms, self.run_ended_unix_ms, self.task_status, self.boot_id
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ self.power_seq_in_progress = false;
|
|
|
|
|
+ self.power_seq_started_ms = 0;
|
|
|
self.console_online = false;
|
|
self.console_online = false;
|
|
|
self.hot.console_online = false;
|
|
self.hot.console_online = false;
|
|
|
self.hot.reset_for_new_boot(now);
|
|
self.hot.reset_for_new_boot(now);
|
|
@@ -1005,6 +1058,7 @@ impl StationState {
|
|
|
self.active_amt_cpus.clear();
|
|
self.active_amt_cpus.clear();
|
|
|
self.mt_result = JsonVal::obj();
|
|
self.mt_result = JsonVal::obj();
|
|
|
self.mt_per_test_errs.clear();
|
|
self.mt_per_test_errs.clear();
|
|
|
|
|
+ self.mt_completed_test_ids.clear();
|
|
|
self.unsupported_commands.clear();
|
|
self.unsupported_commands.clear();
|
|
|
self.last_err_stage.clear();
|
|
self.last_err_stage.clear();
|
|
|
for v in self.stage_errors.values_mut() {
|
|
for v in self.stage_errors.values_mut() {
|
|
@@ -1089,10 +1143,34 @@ impl StationState {
|
|
|
|| self.observed_stages.contains("mt")
|
|
|| self.observed_stages.contains("mt")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ #[inline]
|
|
|
|
|
+ pub fn start_run_timing(&mut self, now: i64, reason: &str) {
|
|
|
|
|
+ self.run_started_unix_ms = now;
|
|
|
|
|
+ self.run_ended_unix_ms = 0;
|
|
|
|
|
+ self.log_debug(
|
|
|
|
|
+ "TIMER",
|
|
|
|
|
+ &format!(
|
|
|
|
|
+ "START reason={} started_unix_ms={} boot_id={}",
|
|
|
|
|
+ reason, now, self.boot_id
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
#[inline]
|
|
#[inline]
|
|
|
pub fn freeze_run_timing(&mut self, now: i64) {
|
|
pub fn freeze_run_timing(&mut self, now: i64) {
|
|
|
if self.run_started_unix_ms > 0 && self.run_ended_unix_ms == 0 {
|
|
if self.run_started_unix_ms > 0 && self.run_ended_unix_ms == 0 {
|
|
|
self.run_ended_unix_ms = now.max(self.run_started_unix_ms);
|
|
self.run_ended_unix_ms = now.max(self.run_started_unix_ms);
|
|
|
|
|
+ self.log_debug(
|
|
|
|
|
+ "TIMER",
|
|
|
|
|
+ &format!(
|
|
|
|
|
+ "FREEZE started_unix_ms={} ended_unix_ms={} elapsed_ms={} task_status={} boot_id={}",
|
|
|
|
|
+ self.run_started_unix_ms,
|
|
|
|
|
+ self.run_ended_unix_ms,
|
|
|
|
|
+ self.run_ended_unix_ms - self.run_started_unix_ms,
|
|
|
|
|
+ self.task_status,
|
|
|
|
|
+ self.boot_id
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1104,9 +1182,9 @@ impl StationState {
|
|
|
/// Monotonic phase advance within the current boot (prevents stage regression during training/RMT/POST).
|
|
/// Monotonic phase advance within the current boot (prevents stage regression during training/RMT/POST).
|
|
|
fn advance_phase(&mut self, new_phase: &str, detail: &str, now: i64) {
|
|
fn advance_phase(&mut self, new_phase: &str, detail: &str, now: i64) {
|
|
|
if self.run_started_unix_ms == 0 && self.is_run_active() {
|
|
if self.run_started_unix_ms == 0 && self.is_run_active() {
|
|
|
- self.run_started_unix_ms = now;
|
|
|
|
|
- self.run_ended_unix_ms = 0;
|
|
|
|
|
|
|
+ self.start_run_timing(now, &format!("advance_phase:{}", new_phase));
|
|
|
}
|
|
}
|
|
|
|
|
+ let prev_phase = self.observed_phase.clone();
|
|
|
let stg = self.observed_uip_stage.unwrap_or(1);
|
|
let stg = self.observed_uip_stage.unwrap_or(1);
|
|
|
let new_rk = phase_rank(new_phase, stg);
|
|
let new_rk = phase_rank(new_phase, stg);
|
|
|
if new_rk >= self.hot.stage_rank || new_phase == "uefi" && self.hot.mt_pass_complete || new_phase == "uefi" && self.hot.mt_fail_complete {
|
|
if new_rk >= self.hot.stage_rank || new_phase == "uefi" && self.hot.mt_pass_complete || new_phase == "uefi" && self.hot.mt_fail_complete {
|
|
@@ -1116,6 +1194,21 @@ impl StationState {
|
|
|
self.observed_phase = new_phase.to_string();
|
|
self.observed_phase = new_phase.to_string();
|
|
|
self.observed_detail = detail.to_string();
|
|
self.observed_detail = detail.to_string();
|
|
|
}
|
|
}
|
|
|
|
|
+ if prev_phase != self.observed_phase || detail == "rmt_completed" || detail == "mt_complete" {
|
|
|
|
|
+ self.log_debug(
|
|
|
|
|
+ "STAGE",
|
|
|
|
|
+ &format!(
|
|
|
|
|
+ "phase {}->{} detail={} rank={} run_started={} run_ended={} boot_id={}",
|
|
|
|
|
+ prev_phase,
|
|
|
|
|
+ self.observed_phase,
|
|
|
|
|
+ detail,
|
|
|
|
|
+ self.hot.stage_rank,
|
|
|
|
|
+ self.run_started_unix_ms,
|
|
|
|
|
+ self.run_ended_unix_ms,
|
|
|
|
|
+ self.boot_id
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
self.observed_stages.insert(new_phase.to_string());
|
|
self.observed_stages.insert(new_phase.to_string());
|
|
|
self.observed_unix_ms = now;
|
|
self.observed_unix_ms = now;
|
|
|
self.hot.observed_unix_ms = now;
|
|
self.hot.observed_unix_ms = now;
|
|
@@ -1258,6 +1351,13 @@ impl StationState {
|
|
|
err.set("message", JsonVal::Str(msg.to_string()));
|
|
err.set("message", JsonVal::Str(msg.to_string()));
|
|
|
err.set("observed_unix_ms", JsonVal::Str(now.to_string()));
|
|
err.set("observed_unix_ms", JsonVal::Str(now.to_string()));
|
|
|
list.push(err);
|
|
list.push(err);
|
|
|
|
|
+ self.log_debug(
|
|
|
|
|
+ "ERROR",
|
|
|
|
|
+ &format!(
|
|
|
|
|
+ "stage={} kind={} cpu={:?} ch={:?} msg={}",
|
|
|
|
|
+ stage, kind, cpu, ch, msg
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
pub fn record_stage_error(
|
|
pub fn record_stage_error(
|
|
@@ -1666,6 +1766,16 @@ impl StationState {
|
|
|
if let Some(tp) = report.get_str("tests_passed") {
|
|
if let Some(tp) = report.get_str("tests_passed") {
|
|
|
self.mt_result
|
|
self.mt_result
|
|
|
.set("tests_passed", JsonVal::Str(tp.to_string()));
|
|
.set("tests_passed", JsonVal::Str(tp.to_string()));
|
|
|
|
|
+ if let Some((p_s, t_s)) = tp.split_once('/') {
|
|
|
|
|
+ if let (Ok(p_n), Ok(t_n)) = (p_s.trim().parse::<i64>(), t_s.trim().parse::<i64>()) {
|
|
|
|
|
+ if t_n > 0 {
|
|
|
|
|
+ self.mt_result.set("tests_total", JsonVal::Num(t_n as f64));
|
|
|
|
|
+ self.mt_result.set("tests_completed", JsonVal::Num(p_n.max(0) as f64));
|
|
|
|
|
+ let pct = ((p_n.max(0) * 100) / t_n).clamp(0, 100);
|
|
|
|
|
+ self.mt_result.set("progress_pct", JsonVal::Num(pct as f64));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if let Some(el) = report.get_str("elapsed") {
|
|
if let Some(el) = report.get_str("elapsed") {
|
|
|
self.mt_result.set("elapsed", JsonVal::Str(el.to_string()));
|
|
self.mt_result.set("elapsed", JsonVal::Str(el.to_string()));
|
|
@@ -1700,6 +1810,20 @@ impl StationState {
|
|
|
self.hot.mt_pass_complete = true;
|
|
self.hot.mt_pass_complete = true;
|
|
|
self.hot.mt_fail_complete = false;
|
|
self.hot.mt_fail_complete = false;
|
|
|
self.mt_result.set("status", JsonVal::Str("pass".to_string()));
|
|
self.mt_result.set("status", JsonVal::Str("pass".to_string()));
|
|
|
|
|
+ let tot = self
|
|
|
|
|
+ .mt_result
|
|
|
|
|
+ .get_i64("tests_total")
|
|
|
|
|
+ .filter(|&t| t > 0)
|
|
|
|
|
+ .unwrap_or_else(|| crate::pxe::configured_mt_test_count(&self.mt_selection) as i64);
|
|
|
|
|
+ let done = self
|
|
|
|
|
+ .mt_result
|
|
|
|
|
+ .get_i64("tests_completed")
|
|
|
|
|
+ .filter(|&d| d > 0)
|
|
|
|
|
+ .unwrap_or(tot)
|
|
|
|
|
+ .max(tot);
|
|
|
|
|
+ self.mt_result.set("tests_total", JsonVal::Num(tot as f64));
|
|
|
|
|
+ self.mt_result.set("tests_completed", JsonVal::Num(done as f64));
|
|
|
|
|
+ self.mt_result.set("progress_pct", JsonVal::Num(100.0));
|
|
|
for idx in 0..24 {
|
|
for idx in 0..24 {
|
|
|
if self.dimms[idx].presence == "present"
|
|
if self.dimms[idx].presence == "present"
|
|
|
&& self.dimms[idx].enabled != "disabled"
|
|
&& self.dimms[idx].enabled != "disabled"
|
|
@@ -1746,6 +1870,13 @@ impl StationState {
|
|
|
self.boot_execution.set("waiting_reason", JsonVal::Str(reason.clone()));
|
|
self.boot_execution.set("waiting_reason", JsonVal::Str(reason.clone()));
|
|
|
self.boot_execution.set("error", JsonVal::Str(reason));
|
|
self.boot_execution.set("error", JsonVal::Str(reason));
|
|
|
self.boot_execution.set("updated_unix_ms", JsonVal::Num(now_ms() as f64));
|
|
self.boot_execution.set("updated_unix_ms", JsonVal::Num(now_ms() as f64));
|
|
|
|
|
+ self.log_debug(
|
|
|
|
|
+ "STAGE",
|
|
|
|
|
+ &format!(
|
|
|
|
|
+ "latched failure stage={} boot_id={} started={} ended={}",
|
|
|
|
|
+ stage, self.boot_id, self.run_started_unix_ms, self.run_ended_unix_ms
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
has_err
|
|
has_err
|
|
|
}
|
|
}
|
|
@@ -1763,8 +1894,11 @@ impl StationState {
|
|
|
self.plan_paused = false;
|
|
self.plan_paused = false;
|
|
|
if had_block_or_fail {
|
|
if had_block_or_fail {
|
|
|
let now = now_ms();
|
|
let now = now_ms();
|
|
|
|
|
+ self.log_debug("RESET", "confirm_dimm_replacement cleared blocked/failed run");
|
|
|
self.hot.reset_for_new_boot(now);
|
|
self.hot.reset_for_new_boot(now);
|
|
|
self.in_internal_warm_reset = false;
|
|
self.in_internal_warm_reset = false;
|
|
|
|
|
+ self.power_seq_in_progress = false;
|
|
|
|
|
+ self.power_seq_started_ms = 0;
|
|
|
self.latest_mt_report_path.clear();
|
|
self.latest_mt_report_path.clear();
|
|
|
self.run_started_unix_ms = 0;
|
|
self.run_started_unix_ms = 0;
|
|
|
self.run_ended_unix_ms = 0;
|
|
self.run_ended_unix_ms = 0;
|
|
@@ -1785,6 +1919,7 @@ impl StationState {
|
|
|
self.active_amt_cpus.clear();
|
|
self.active_amt_cpus.clear();
|
|
|
self.mt_result = JsonVal::obj();
|
|
self.mt_result = JsonVal::obj();
|
|
|
self.mt_per_test_errs.clear();
|
|
self.mt_per_test_errs.clear();
|
|
|
|
|
+ self.mt_completed_test_ids.clear();
|
|
|
self.async_script.clear();
|
|
self.async_script.clear();
|
|
|
self.prompt_ready = false;
|
|
self.prompt_ready = false;
|
|
|
self.prompt_kind.clear();
|
|
self.prompt_kind.clear();
|
|
@@ -1870,6 +2005,11 @@ impl StationState {
|
|
|
self.observe_clean_line(&line_bytes, tag_mask, now);
|
|
self.observe_clean_line(&line_bytes, tag_mask, now);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if self.power_seq_in_progress {
|
|
|
|
|
+ self.cleaner.clear_halfline();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// Check partial half-line tail for RMT dots or live prompts without trailing newline
|
|
// Check partial half-line tail for RMT dots or live prompts without trailing newline
|
|
|
let hl_opt = {
|
|
let hl_opt = {
|
|
|
let hl = self.cleaner.halfline_bytes();
|
|
let hl = self.cleaner.halfline_bytes();
|
|
@@ -1902,6 +2042,9 @@ impl StationState {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
let trimmed_bytes = &line_bytes[s..e];
|
|
let trimmed_bytes = &line_bytes[s..e];
|
|
|
|
|
+ if self.power_seq_in_progress {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
let ev = lib::re2c_parse_line(trimmed_bytes, tag_mask);
|
|
let ev = lib::re2c_parse_line(trimmed_bytes, tag_mask);
|
|
|
if ev.fw_family == 1 || ev.fw_family == 2 {
|
|
if ev.fw_family == 1 || ev.fw_family == 2 {
|
|
|
self.hot.fw_family = ev.fw_family;
|
|
self.hot.fw_family = ev.fw_family;
|
|
@@ -1939,6 +2082,31 @@ impl StationState {
|
|
|
self.amt_prefers_short_cmd = true;
|
|
self.amt_prefers_short_cmd = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Update MT completed test counter & accurate percentage from No-UI per-test execution summaries
|
|
|
|
|
+ if trimmed.contains("MtSupportRunAllTests - Test execution time:") {
|
|
|
|
|
+ if let Some(pos) = trimmed.find("(Test ") {
|
|
|
|
|
+ let tail = &trimmed[pos + "(Test ".len()..];
|
|
|
|
|
+ let digits: String = tail.chars().take_while(|c| c.is_ascii_digit()).collect();
|
|
|
|
|
+ if let Ok(tid) = digits.parse::<i32>() {
|
|
|
|
|
+ if (0..=25).contains(&tid) {
|
|
|
|
|
+ self.hot.mt_banner_seen = true;
|
|
|
|
|
+ self.mt_completed_test_ids.insert(tid);
|
|
|
|
|
+ let cfg_tot =
|
|
|
|
|
+ crate::pxe::configured_mt_test_count(&self.mt_selection) as i64;
|
|
|
|
|
+ let done = self.mt_completed_test_ids.len() as i64;
|
|
|
|
|
+ let tot = cfg_tot.max(done).max(1);
|
|
|
|
|
+ let pct = ((done * 100) / tot).clamp(0, 100);
|
|
|
|
|
+ self.mt_result
|
|
|
|
|
+ .set("tests_completed", JsonVal::Num(done as f64));
|
|
|
|
|
+ self.mt_result.set("tests_total", JsonVal::Num(tot as f64));
|
|
|
|
|
+ self.mt_result.set("progress_pct", JsonVal::Num(pct as f64));
|
|
|
|
|
+ self.mt_result
|
|
|
|
|
+ .set("observed_unix_ms", JsonVal::Str(now.to_string()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// Capture expected MemTest86 report filename emitted before/during TFTP upload
|
|
// Capture expected MemTest86 report filename emitted before/during TFTP upload
|
|
|
if let Some(pos) = trimmed.find("Saving test report to ") {
|
|
if let Some(pos) = trimmed.find("Saving test report to ") {
|
|
|
let cand = trimmed[pos + "Saving test report to ".len()..]
|
|
let cand = trimmed[pos + "Saving test report to ".len()..]
|
|
@@ -2096,6 +2264,7 @@ impl StationState {
|
|
|
self.amt_fallback_attempted = false;
|
|
self.amt_fallback_attempted = false;
|
|
|
self.mt_result = JsonVal::obj();
|
|
self.mt_result = JsonVal::obj();
|
|
|
self.mt_per_test_errs.clear();
|
|
self.mt_per_test_errs.clear();
|
|
|
|
|
+ self.mt_completed_test_ids.clear();
|
|
|
self.plan_configured.clear();
|
|
self.plan_configured.clear();
|
|
|
self.plan_done.clear();
|
|
self.plan_done.clear();
|
|
|
self.plan_amt_started.clear();
|
|
self.plan_amt_started.clear();
|
|
@@ -2116,19 +2285,22 @@ impl StationState {
|
|
|
self.task_status.as_str(),
|
|
self.task_status.as_str(),
|
|
|
"failed" | "completed" | "interrupted"
|
|
"failed" | "completed" | "interrupted"
|
|
|
);
|
|
);
|
|
|
|
|
+ let task_in_progress =
|
|
|
|
|
+ self.is_run_active() && !self.has_any_failure_state() && !is_terminal;
|
|
|
// Stage 2 (`Current stage is 2`) emits `STL_LK_ICT_BANNER_HOVSEE / CXMT`
|
|
// Stage 2 (`Current stage is 2`) emits `STL_LK_ICT_BANNER_HOVSEE / CXMT`
|
|
|
// inside the same boot right after Training/RMT/AMT (`started_unix_ms` must stay).
|
|
// inside the same boot right after Training/RMT/AMT (`started_unix_ms` must stay).
|
|
|
- // Only clear for external restart after entering Stage 2+ or when already terminal/blocked.
|
|
|
|
|
- if is_terminal
|
|
|
|
|
- || self.awaiting_dimm_replacement
|
|
|
|
|
- || self.hot.ict_stage2_complete
|
|
|
|
|
- || self.hot.uefi_complete
|
|
|
|
|
- || self.hot.mt_banner_seen
|
|
|
|
|
- || self.hot.mt_pass_complete
|
|
|
|
|
- || self.hot.mt_fail_complete
|
|
|
|
|
- || self.observed_stages.contains("uefi")
|
|
|
|
|
- || self.observed_stages.contains("mt")
|
|
|
|
|
- || self.observed_stages.contains("post")
|
|
|
|
|
|
|
+ // Only clear for external restart when NOT actively running a task or when already terminal/blocked.
|
|
|
|
|
+ if !task_in_progress
|
|
|
|
|
+ && (is_terminal
|
|
|
|
|
+ || self.awaiting_dimm_replacement
|
|
|
|
|
+ || self.hot.ict_stage2_complete
|
|
|
|
|
+ || self.hot.uefi_complete
|
|
|
|
|
+ || self.hot.mt_banner_seen
|
|
|
|
|
+ || self.hot.mt_pass_complete
|
|
|
|
|
+ || self.hot.mt_fail_complete
|
|
|
|
|
+ || self.observed_stages.contains("uefi")
|
|
|
|
|
+ || self.observed_stages.contains("mt")
|
|
|
|
|
+ || self.observed_stages.contains("post"))
|
|
|
{
|
|
{
|
|
|
self.clear_for_external_restart(now, "ict_banner_reboot", true);
|
|
self.clear_for_external_restart(now, "ict_banner_reboot", true);
|
|
|
}
|
|
}
|
|
@@ -2141,21 +2313,24 @@ impl StationState {
|
|
|
let cpu = if ev.cpu >= 0 { ev.cpu as i64 } else { 0 };
|
|
let cpu = if ev.cpu >= 0 { ev.cpu as i64 } else { 0 };
|
|
|
if stg == 1 {
|
|
if stg == 1 {
|
|
|
let bp_state_now = self.boot_execution.get_str_or("state", "idle");
|
|
let bp_state_now = self.boot_execution.get_str_or("state", "idle");
|
|
|
|
|
+ let is_terminal = matches!(
|
|
|
|
|
+ bp_state_now.as_str(),
|
|
|
|
|
+ "blocked" | "failed" | "completed" | "stopped" | "interrupted"
|
|
|
|
|
+ ) || matches!(
|
|
|
|
|
+ self.task_status.as_str(),
|
|
|
|
|
+ "failed" | "completed" | "interrupted"
|
|
|
|
|
+ );
|
|
|
|
|
+ let task_in_progress =
|
|
|
|
|
+ self.is_run_active() && !self.has_any_failure_state() && !is_terminal;
|
|
|
if self.has_any_failure_state()
|
|
if self.has_any_failure_state()
|
|
|
- || self.hot.training_complete
|
|
|
|
|
- || self.hot.rmt_complete
|
|
|
|
|
- || self.hot.amt_complete
|
|
|
|
|
- || self.hot.ict_stage2_complete
|
|
|
|
|
- || self.hot.uefi_complete
|
|
|
|
|
- || self.hot.mt_pass_complete
|
|
|
|
|
- || matches!(
|
|
|
|
|
- bp_state_now.as_str(),
|
|
|
|
|
- "blocked" | "failed" | "completed" | "stopped" | "interrupted"
|
|
|
|
|
- )
|
|
|
|
|
- || matches!(
|
|
|
|
|
- self.task_status.as_str(),
|
|
|
|
|
- "failed" | "completed" | "interrupted"
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ || is_terminal
|
|
|
|
|
+ || (!task_in_progress
|
|
|
|
|
+ && (self.hot.training_complete
|
|
|
|
|
+ || self.hot.rmt_complete
|
|
|
|
|
+ || self.hot.amt_complete
|
|
|
|
|
+ || self.hot.ict_stage2_complete
|
|
|
|
|
+ || self.hot.uefi_complete
|
|
|
|
|
+ || self.hot.mt_pass_complete))
|
|
|
{
|
|
{
|
|
|
self.clear_for_external_restart(now, "uip_stage1_reboot", true);
|
|
self.clear_for_external_restart(now, "uip_stage1_reboot", true);
|
|
|
}
|
|
}
|
|
@@ -2210,15 +2385,18 @@ impl StationState {
|
|
|
self.task_status.as_str(),
|
|
self.task_status.as_str(),
|
|
|
"failed" | "completed" | "interrupted"
|
|
"failed" | "completed" | "interrupted"
|
|
|
);
|
|
);
|
|
|
|
|
+ let task_in_progress =
|
|
|
|
|
+ self.is_run_active() && !self.has_any_failure_state() && !is_terminal;
|
|
|
if self.has_any_failure_state()
|
|
if self.has_any_failure_state()
|
|
|
|| is_terminal
|
|
|| is_terminal
|
|
|
- || self.hot.amt_complete
|
|
|
|
|
- || self.hot.ict_stage2_complete
|
|
|
|
|
- || self.hot.uefi_complete
|
|
|
|
|
- || self.hot.mt_banner_seen
|
|
|
|
|
- || self.observed_stages.contains("amt")
|
|
|
|
|
- || self.observed_stages.contains("uefi")
|
|
|
|
|
- || self.observed_stages.contains("mt")
|
|
|
|
|
|
|
+ || (!task_in_progress
|
|
|
|
|
+ && (self.hot.amt_complete
|
|
|
|
|
+ || self.hot.ict_stage2_complete
|
|
|
|
|
+ || self.hot.uefi_complete
|
|
|
|
|
+ || self.hot.mt_banner_seen
|
|
|
|
|
+ || self.observed_stages.contains("amt")
|
|
|
|
|
+ || self.observed_stages.contains("uefi")
|
|
|
|
|
+ || self.observed_stages.contains("mt")))
|
|
|
{
|
|
{
|
|
|
self.clear_for_external_restart(now, "dram_inventory_reboot", true);
|
|
self.clear_for_external_restart(now, "dram_inventory_reboot", true);
|
|
|
}
|
|
}
|
|
@@ -2530,16 +2708,21 @@ impl StationState {
|
|
|
if let Some(cpu) = target_cpu {
|
|
if let Some(cpu) = target_cpu {
|
|
|
let entry = self.rmt_results.entry(cpu).or_insert(RmtCpuResult {
|
|
let entry = self.rmt_results.entry(cpu).or_insert(RmtCpuResult {
|
|
|
cpu,
|
|
cpu,
|
|
|
- state: "completed".to_string(),
|
|
|
|
|
|
|
+ state: "skipped".to_string(),
|
|
|
measurement_rows: 0,
|
|
measurement_rows: 0,
|
|
|
min_dq_width: i32::MAX,
|
|
min_dq_width: i32::MAX,
|
|
|
min_vref_width: i32::MAX,
|
|
min_vref_width: i32::MAX,
|
|
|
execution_supported: true,
|
|
execution_supported: true,
|
|
|
verdict_supported: false,
|
|
verdict_supported: false,
|
|
|
});
|
|
});
|
|
|
- entry.state = "completed".to_string();
|
|
|
|
|
entry.execution_supported = true;
|
|
entry.execution_supported = true;
|
|
|
- entry.verdict_supported = entry.measurement_rows > 0;
|
|
|
|
|
|
|
+ if entry.measurement_rows > 0 {
|
|
|
|
|
+ entry.state = "completed".to_string();
|
|
|
|
|
+ entry.verdict_supported = true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ entry.state = "skipped".to_string();
|
|
|
|
|
+ entry.verdict_supported = false;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
let present_cpus: Vec<i64> = (0..self.cpu_count as i64)
|
|
let present_cpus: Vec<i64> = (0..self.cpu_count as i64)
|
|
|
.filter(|c| {
|
|
.filter(|c| {
|
|
@@ -2551,12 +2734,15 @@ impl StationState {
|
|
|
present_cpus.iter().all(|c| {
|
|
present_cpus.iter().all(|c| {
|
|
|
self.rmt_results
|
|
self.rmt_results
|
|
|
.get(c)
|
|
.get(c)
|
|
|
- .map(|r| r.state == "completed")
|
|
|
|
|
|
|
+ .map(|r| matches!(r.state.as_str(), "completed" | "skipped"))
|
|
|
.unwrap_or(false)
|
|
.unwrap_or(false)
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
!self.rmt_results.is_empty()
|
|
!self.rmt_results.is_empty()
|
|
|
- && self.rmt_results.values().all(|r| r.state == "completed")
|
|
|
|
|
|
|
+ && self
|
|
|
|
|
+ .rmt_results
|
|
|
|
|
+ .values()
|
|
|
|
|
+ .all(|r| matches!(r.state.as_str(), "completed" | "skipped"))
|
|
|
};
|
|
};
|
|
|
self.prompt_ready = false;
|
|
self.prompt_ready = false;
|
|
|
self.hot.prompt_ready = false;
|
|
self.hot.prompt_ready = false;
|
|
@@ -2564,9 +2750,16 @@ impl StationState {
|
|
|
if all_done && has_rmt_rows {
|
|
if all_done && has_rmt_rows {
|
|
|
self.hot.rmt_complete = true;
|
|
self.hot.rmt_complete = true;
|
|
|
self.advance_phase("rmt", "rmt_completed", now);
|
|
self.advance_phase("rmt", "rmt_completed", now);
|
|
|
- } else {
|
|
|
|
|
|
|
+ } else if has_rmt_rows || self.observed_stages.contains("rmt") {
|
|
|
self.advance_phase("rmt", "rmt_running", now);
|
|
self.advance_phase("rmt", "rmt_running", now);
|
|
|
}
|
|
}
|
|
|
|
|
+ self.log_debug(
|
|
|
|
|
+ "STAGE",
|
|
|
|
|
+ &format!(
|
|
|
|
|
+ "RMT_STOP has_rmt_rows={} all_done={} rmt_complete={} line={}",
|
|
|
|
|
+ has_rmt_rows, all_done, self.hot.rmt_complete, trimmed
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
*self.stage_step_counts.entry("rmt".to_string()).or_insert(0) += 1;
|
|
*self.stage_step_counts.entry("rmt".to_string()).or_insert(0) += 1;
|
|
|
}
|
|
}
|
|
|
lib::STL_LK_AMT_BANNER => {
|
|
lib::STL_LK_AMT_BANNER => {
|
|
@@ -2798,15 +2991,47 @@ impl StationState {
|
|
|
self.prompt_ready = false;
|
|
self.prompt_ready = false;
|
|
|
self.hot.prompt_ready = false;
|
|
self.hot.prompt_ready = false;
|
|
|
self.advance_phase("mt", "mt_running", now);
|
|
self.advance_phase("mt", "mt_running", now);
|
|
|
|
|
+ let cfg_tot = crate::pxe::configured_mt_test_count(&self.mt_selection) as i64;
|
|
|
|
|
+ if self.mt_result.get_i64("tests_total").is_none() {
|
|
|
|
|
+ self.mt_result
|
|
|
|
|
+ .set("tests_total", JsonVal::Num(cfg_tot as f64));
|
|
|
|
|
+ self.mt_result.set("tests_completed", JsonVal::Num(0.0));
|
|
|
|
|
+ self.mt_result.set("progress_pct", JsonVal::Num(0.0));
|
|
|
|
|
+ }
|
|
|
if ev.kind == lib::STL_LK_MT_PROGRESS {
|
|
if ev.kind == lib::STL_LK_MT_PROGRESS {
|
|
|
- if ev.val0 >= 0 {
|
|
|
|
|
- self.mt_result.set("tests_completed", JsonVal::Num(ev.val0 as f64));
|
|
|
|
|
- }
|
|
|
|
|
- if ev.val1 > 0 {
|
|
|
|
|
- self.mt_result.set("tests_total", JsonVal::Num(ev.val1 as f64));
|
|
|
|
|
- }
|
|
|
|
|
- if ev.val2 >= 0 {
|
|
|
|
|
- self.mt_result.set("progress_pct", JsonVal::Num(ev.val2 as f64));
|
|
|
|
|
|
|
+ // `Running test #N` emits val0=tid, val1=25 from re2c; translate to configured test count
|
|
|
|
|
+ if trimmed.contains("Running test #") && ev.val1 == 25 {
|
|
|
|
|
+ let done = (self.mt_completed_test_ids.len() as i64).min(cfg_tot);
|
|
|
|
|
+ let tot = cfg_tot.max(done).max(1);
|
|
|
|
|
+ let cur_tid = (ev.val0 as i64).max(0);
|
|
|
|
|
+ let pct = if done > 0 {
|
|
|
|
|
+ ((done * 100) / tot).clamp(0, 100)
|
|
|
|
|
+ } else if tot > 1 {
|
|
|
|
|
+ ((cur_tid * 100) / tot).clamp(0, 99)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ 0
|
|
|
|
|
+ };
|
|
|
|
|
+ self.mt_result
|
|
|
|
|
+ .set("current_test_id", JsonVal::Num(cur_tid as f64));
|
|
|
|
|
+ self.mt_result
|
|
|
|
|
+ .set("tests_completed", JsonVal::Num(done as f64));
|
|
|
|
|
+ self.mt_result
|
|
|
|
|
+ .set("tests_total", JsonVal::Num(tot as f64));
|
|
|
|
|
+ self.mt_result
|
|
|
|
|
+ .set("progress_pct", JsonVal::Num(pct as f64));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if ev.val1 > 0 {
|
|
|
|
|
+ if ev.val0 >= 0 {
|
|
|
|
|
+ self.mt_result
|
|
|
|
|
+ .set("tests_completed", JsonVal::Num(ev.val0 as f64));
|
|
|
|
|
+ }
|
|
|
|
|
+ self.mt_result
|
|
|
|
|
+ .set("tests_total", JsonVal::Num(ev.val1 as f64));
|
|
|
|
|
+ }
|
|
|
|
|
+ if ev.val2 >= 0 {
|
|
|
|
|
+ self.mt_result
|
|
|
|
|
+ .set("progress_pct", JsonVal::Num(ev.val2 as f64));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if !self.hot.mt_pass_complete && !self.hot.mt_fail_complete {
|
|
if !self.hot.mt_pass_complete && !self.hot.mt_fail_complete {
|
|
@@ -2891,6 +3116,27 @@ impl StationState {
|
|
|
self.mark_present_channels_training_pass();
|
|
self.mark_present_channels_training_pass();
|
|
|
self.mt_result.set("status", JsonVal::Str("pass".to_string()));
|
|
self.mt_result.set("status", JsonVal::Str("pass".to_string()));
|
|
|
self.mt_result.set("complete", JsonVal::Bool(true));
|
|
self.mt_result.set("complete", JsonVal::Bool(true));
|
|
|
|
|
+ let tot = self
|
|
|
|
|
+ .mt_result
|
|
|
|
|
+ .get_i64("tests_total")
|
|
|
|
|
+ .filter(|&t| t > 0 && t != 25)
|
|
|
|
|
+ .unwrap_or_else(|| {
|
|
|
|
|
+ crate::pxe::configured_mt_test_count(&self.mt_selection) as i64
|
|
|
|
|
+ });
|
|
|
|
|
+ let done = (self.mt_completed_test_ids.len() as i64).max(tot);
|
|
|
|
|
+ let final_tot = tot.max(done).max(1);
|
|
|
|
|
+ self.mt_result
|
|
|
|
|
+ .set("tests_total", JsonVal::Num(final_tot as f64));
|
|
|
|
|
+ self.mt_result
|
|
|
|
|
+ .set("tests_completed", JsonVal::Num(final_tot as f64));
|
|
|
|
|
+ self.mt_result.set("progress_pct", JsonVal::Num(100.0));
|
|
|
|
|
+ self.log_debug(
|
|
|
|
|
+ "MT",
|
|
|
|
|
+ &format!(
|
|
|
|
|
+ "MT_PASS_COMPLETE tests={}/{} progress=100 run_started={} run_ended={} boot_id={}",
|
|
|
|
|
+ final_tot, final_tot, self.run_started_unix_ms, self.run_ended_unix_ms, self.boot_id
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
for idx in 0..24 {
|
|
for idx in 0..24 {
|
|
|
if self.dimms[idx].presence == "present"
|
|
if self.dimms[idx].presence == "present"
|
|
|
&& self.dimms[idx].enabled != "disabled"
|
|
&& self.dimms[idx].enabled != "disabled"
|
|
@@ -2957,28 +3203,32 @@ impl StationState {
|
|
|
self.task_status.as_str(),
|
|
self.task_status.as_str(),
|
|
|
"failed" | "completed" | "interrupted"
|
|
"failed" | "completed" | "interrupted"
|
|
|
);
|
|
);
|
|
|
- if ev.kind == lib::STL_LK_ICT_ENTER_HINT
|
|
|
|
|
- && (is_terminal
|
|
|
|
|
- || self.awaiting_dimm_replacement
|
|
|
|
|
- || self.hot.ict_stage2_complete
|
|
|
|
|
- || self.hot.uefi_complete
|
|
|
|
|
- || self.hot.mt_banner_seen
|
|
|
|
|
- || self.hot.mt_pass_complete
|
|
|
|
|
- || self.hot.mt_fail_complete
|
|
|
|
|
- || self.observed_stages.contains("uefi")
|
|
|
|
|
- || self.observed_stages.contains("mt")
|
|
|
|
|
- || self.observed_stages.contains("post"))
|
|
|
|
|
- {
|
|
|
|
|
- self.clear_for_external_restart(now, "uip_enter_reboot", true);
|
|
|
|
|
- } else if ev.kind == lib::STL_LK_ICT_PROMPT
|
|
|
|
|
- && (self.hot.uefi_complete
|
|
|
|
|
- || self.hot.mt_banner_seen
|
|
|
|
|
- || self.hot.mt_pass_complete
|
|
|
|
|
- || self.hot.mt_fail_complete
|
|
|
|
|
- || self.observed_stages.contains("uefi")
|
|
|
|
|
- || self.observed_stages.contains("mt"))
|
|
|
|
|
- {
|
|
|
|
|
- self.clear_for_external_restart(now, "uip_prompt_reboot", true);
|
|
|
|
|
|
|
+ let task_in_progress =
|
|
|
|
|
+ self.is_run_active() && !self.has_any_failure_state() && !is_terminal && !self.awaiting_dimm_replacement;
|
|
|
|
|
+ if !task_in_progress {
|
|
|
|
|
+ if ev.kind == lib::STL_LK_ICT_ENTER_HINT
|
|
|
|
|
+ && (is_terminal
|
|
|
|
|
+ || self.awaiting_dimm_replacement
|
|
|
|
|
+ || self.hot.ict_stage2_complete
|
|
|
|
|
+ || self.hot.uefi_complete
|
|
|
|
|
+ || self.hot.mt_banner_seen
|
|
|
|
|
+ || self.hot.mt_pass_complete
|
|
|
|
|
+ || self.hot.mt_fail_complete
|
|
|
|
|
+ || self.observed_stages.contains("uefi")
|
|
|
|
|
+ || self.observed_stages.contains("mt")
|
|
|
|
|
+ || self.observed_stages.contains("post"))
|
|
|
|
|
+ {
|
|
|
|
|
+ self.clear_for_external_restart(now, "uip_enter_reboot", true);
|
|
|
|
|
+ } else if ev.kind == lib::STL_LK_ICT_PROMPT
|
|
|
|
|
+ && (self.hot.uefi_complete
|
|
|
|
|
+ || self.hot.mt_banner_seen
|
|
|
|
|
+ || self.hot.mt_pass_complete
|
|
|
|
|
+ || self.hot.mt_fail_complete
|
|
|
|
|
+ || self.observed_stages.contains("uefi")
|
|
|
|
|
+ || self.observed_stages.contains("mt"))
|
|
|
|
|
+ {
|
|
|
|
|
+ self.clear_for_external_restart(now, "uip_prompt_reboot", true);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if self.hot.awaiting_reset_banner && self.bmc_enabled && !self.bmc_host.is_empty() {
|
|
if self.hot.awaiting_reset_banner && self.bmc_enabled && !self.bmc_host.is_empty() {
|
|
|
return;
|
|
return;
|
|
@@ -3069,6 +3319,27 @@ impl StationState {
|
|
|
self.hot.mt_pass_complete = true;
|
|
self.hot.mt_pass_complete = true;
|
|
|
self.mark_present_channels_training_pass();
|
|
self.mark_present_channels_training_pass();
|
|
|
self.mt_result.set("status", JsonVal::Str("pass".to_string()));
|
|
self.mt_result.set("status", JsonVal::Str("pass".to_string()));
|
|
|
|
|
+ let tot = self
|
|
|
|
|
+ .mt_result
|
|
|
|
|
+ .get_i64("tests_total")
|
|
|
|
|
+ .filter(|&t| t > 0 && t != 25)
|
|
|
|
|
+ .unwrap_or_else(|| {
|
|
|
|
|
+ crate::pxe::configured_mt_test_count(&self.mt_selection) as i64
|
|
|
|
|
+ });
|
|
|
|
|
+ let done = (self.mt_completed_test_ids.len() as i64).max(tot);
|
|
|
|
|
+ let final_tot = tot.max(done).max(1);
|
|
|
|
|
+ self.mt_result
|
|
|
|
|
+ .set("tests_total", JsonVal::Num(final_tot as f64));
|
|
|
|
|
+ self.mt_result
|
|
|
|
|
+ .set("tests_completed", JsonVal::Num(final_tot as f64));
|
|
|
|
|
+ self.mt_result.set("progress_pct", JsonVal::Num(100.0));
|
|
|
|
|
+ self.log_debug(
|
|
|
|
|
+ "MT",
|
|
|
|
|
+ &format!(
|
|
|
|
|
+ "UEFI_RETURN_PASS tests={}/{} progress=100 run_started={} run_ended={} boot_id={}",
|
|
|
|
|
+ final_tot, final_tot, self.run_started_unix_ms, self.run_ended_unix_ms, self.boot_id
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
for idx in 0..24 {
|
|
for idx in 0..24 {
|
|
|
if self.dimms[idx].presence == "present"
|
|
if self.dimms[idx].presence == "present"
|
|
|
&& self.dimms[idx].enabled != "disabled"
|
|
&& self.dimms[idx].enabled != "disabled"
|