More regression tests
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-win (push) Waiting to run
CodeQL / Analyze (push) Waiting to run

This commit is contained in:
Andrea Mazzoleni 2025-10-28 00:05:49 +01:00
parent f4f386983a
commit d452b109bc
17 changed files with 1023 additions and 666 deletions

View file

@ -186,7 +186,11 @@ void state_thermal(struct snapraid_state* state, time_t now)
}
}
ret = devquery(&high, &low, DEVICE_SMART, 0 /* only disks in the array */);
if (state->opt.fake_device) {
ret = devtest(&high, &low, DEVICE_SMART);
} else {
ret = devquery(&high, &low, DEVICE_SMART, 0 /* only disks in the array */);
}
/* on error, just disable thermal gathering */
if (ret != 0)
@ -265,6 +269,21 @@ void state_thermal(struct snapraid_state* state, time_t now)
found->data[found->count].time = now - state->thermal_first;
++found->count;
if (state->opt.fake_device) {
/* fill with fake data */
found->data[0].time = 0;
found->data[0].temperature = 27;
found->data[1].time = 100;
found->data[1].temperature = 28;
found->data[2].time = 300;
found->data[2].temperature = 29;
found->data[3].time = 700;
found->data[3].temperature = 30;
found->data[4].time = 1500;
found->data[4].temperature = 31;
found->count = 5;
}
/* log the new data */
log_tag("thermal:heat:%s:%" PRIu64 ":%u:", devinfo->name, devinfo->device, found->count);
for (k = 0; k < found->count; ++k)