@@ -18,11 +18,20 @@ func TestDeviceContractCompatibilityGuardrails(t *testing.T) {
|
||||
if len(versions) < 10 {
|
||||
t.Fatalf("found only %d versioned device paths; contract scan likely stopped matching", len(versions))
|
||||
}
|
||||
v2Count, v3Count := 0, 0
|
||||
for _, match := range versions {
|
||||
if match[1] != "2" {
|
||||
t.Fatalf("device path %q bypasses the current v2 compatibility baseline", match[0])
|
||||
switch match[1] {
|
||||
case "2":
|
||||
v2Count++
|
||||
case "3":
|
||||
v3Count++
|
||||
default:
|
||||
t.Fatalf("device path %q uses an unsupported compatibility generation", match[0])
|
||||
}
|
||||
}
|
||||
if v2Count < 10 || v3Count < 2 {
|
||||
t.Fatalf("device contract must preserve v2 and publish hardware-agent v3; v2=%d v3=%d", v2Count, v3Count)
|
||||
}
|
||||
for _, required := range []string{
|
||||
"rtc_credential_renewal:",
|
||||
"省略时保持旧版v2终端行为",
|
||||
|
||||
Reference in New Issue
Block a user