From cfba0d022ac6c1f5d11c23d811f89bd0d90943ec Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Sun, 4 Oct 2026 13:18:43 +0200 Subject: [PATCH] contract: the desired-state golden gains host_release (byte-identical with hub v0.131.0); TestOSUpdateGolden_Decodes checks it Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS --- internal/hub/osupdate_contract_test.go | 8 +++++++- internal/hub/testdata/desired-state-osupdate.golden.json | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/internal/hub/osupdate_contract_test.go b/internal/hub/osupdate_contract_test.go index c5c94c7..2531838 100644 --- a/internal/hub/osupdate_contract_test.go +++ b/internal/hub/osupdate_contract_test.go @@ -23,8 +23,14 @@ func TestOSUpdateGolden_Decodes(t *testing.T) { t.Fatalf("os_update = %+v", o) } r := o.Release - if r.ID != "os-20261004-120000" || r.Snapshot != "20261004T120000Z" || len(r.Packages) != 2 || + if r.ID != "os-guest-20261004-120000" || r.Snapshot != "20261004T120000Z" || len(r.Packages) != 2 || r.Packages[1].Name != "openssl" || r.Packages[1].Version != "3.5.7-1~deb13u3" || r.Packages[1].Origin != "Debian-Security" { t.Fatalf("release = %+v", r) } + // v0.141.0: the host layer's own approved set (`11` ยง8 step 3). + h := o.HostRelease + if h == nil || h.ID != "os-host-20261004-120000" || h.Snapshot != "20261004T120000Z" || len(h.Packages) != 1 || + h.Packages[0].Name != "libssl3t64" || h.Packages[0].Origin != "Debian-Security" { + t.Fatalf("host_release = %+v", h) + } } diff --git a/internal/hub/testdata/desired-state-osupdate.golden.json b/internal/hub/testdata/desired-state-osupdate.golden.json index da28c48..cd3cbae 100644 --- a/internal/hub/testdata/desired-state-osupdate.golden.json +++ b/internal/hub/testdata/desired-state-osupdate.golden.json @@ -5,12 +5,19 @@ "ring": 1, "enabled": true, "release": { - "id": "os-20261004-120000", + "id": "os-guest-20261004-120000", "snapshot": "20261004T120000Z", "packages": [ {"name": "libc6", "version": "2.41-12+deb13u4", "origin": "Debian"}, {"name": "openssl", "version": "3.5.7-1~deb13u3", "origin": "Debian-Security"} ] + }, + "host_release": { + "id": "os-host-20261004-120000", + "snapshot": "20261004T120000Z", + "packages": [ + {"name": "libssl3t64", "version": "3.5.7-1~deb13u3", "origin": "Debian-Security"} + ] } } }