功能:补充固定场景助手与GPU健康诊断能力

This commit is contained in:
songyiming committed 2026-11-12 17:33:07 +08:00
1 parent 9f05aa20ea
commit b6026f9759
29 files changed
+1333 -22

No files matched your search

@@ -119,6 +119,23 @@ func TestExclusiveGPUAuthorizationAndOccupiedGroup(t *testing.T) {
}
}
func TestExclusiveGPUStatusPreflightIsReadOnly(t *testing.T) {
f, p := exclusiveFixture(t, "normal")
admin := f.login("admin")
code, out := f.request("GET", "/resources/gpu-exclusive?node=gpu-node", admin, nil, "")
expect(t, 200, code, out)
if out["enabled"] != true || out["groupComplete"] != true || out["allocationReady"] != false || out["releaseReady"] != false {
t.Fatalf("unexpected preflight: %#v", out)
}
if len(p.actions) != 0 {
t.Fatalf("preflight changed power: %#v", p.actions)
}
code, _ = f.request("POST", "/resources/gpu-exclusive", admin, nil, "")
if code != 404 {
t.Fatalf("exclusive GPU status unexpectedly exposes write route: %d", code)
}
}
func TestExclusiveGPUReservationBlocksAdministrativePower(t *testing.T) {
f, p := exclusiveFixture(t, "normal")
prepareExclusive(t, f)