Skip to content

Commit d912600

Browse files
ervczpothos
andcommitted
test: update package floor reason messages in tests
- Replace "Security fix" with "Filesystem upgrade" in package floor tests - Use more realistic reason messages to avoid misleading - Update backend/api/spec.yaml Co-authored-by: Kai Lüke <[email protected]> Signed-off-by: Ervin Rácz <[email protected]>
1 parent 6ccdc73 commit d912600

File tree

5 files changed

+95
-94
lines changed

5 files changed

+95
-94
lines changed

backend/api/spec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -786,9 +786,9 @@ paths:
786786
floor_reason:
787787
type: string
788788
nullable: true
789-
description: Optional reason for marking this package as a floor (e.g., "Security fix", "Critical update")
789+
description: Optional reason for marking this package as a floor (e.g., "Introduces needed filesystem support to handle new updates after this version")
790790
maxLength: 500
791-
example: "Security fix for CVE-2024-1234"
791+
example: "Introduces btrfs support in update-engine to handle new updates after this version"
792792
responses:
793793
"200":
794794
description: Floor package relationship created or updated successfully
@@ -1665,7 +1665,7 @@ components:
16651665
nullable: true
16661666
description: Optional reason for marking this package as a floor
16671667
maxLength: 500
1668-
example: "Security fix for CVE-2024-1234"
1668+
example: "Introduces needed filesystem support to handle new updates after this version"
16691669
created_ts:
16701670
type: string
16711671
format: date-time

backend/pkg/api/packages_floors_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func TestFloorOperations(t *testing.T) {
1919

2020
// Update floor reason for first floor
2121
assert.NoError(t, a.RemoveChannelPackageFloor(setup.Channel.ID, setup.Floors[0].ID))
22-
assert.NoError(t, a.AddChannelPackageFloor(setup.Channel.ID, setup.Floors[0].ID, null.StringFrom("Security fix")))
22+
assert.NoError(t, a.AddChannelPackageFloor(setup.Channel.ID, setup.Floors[0].ID, null.StringFrom("Filesystem upgrade")))
2323

2424
// Test wrong arch
2525
tTeam, err := a.AddTeam(&Team{Name: "test_team_arch"})
@@ -41,7 +41,7 @@ func TestFloorOperations(t *testing.T) {
4141
assert.NoError(t, err)
4242
assert.Len(t, floors, 2)
4343
assert.Equal(t, "1000.0.0", floors[0].Version)
44-
assert.Equal(t, "Security fix", floors[0].FloorReason.String)
44+
assert.Equal(t, "Filesystem upgrade", floors[0].FloorReason.String)
4545
assert.True(t, floors[0].IsFloor)
4646

4747
// Test required floors between versions
@@ -163,7 +163,7 @@ func TestFloorReason(t *testing.T) {
163163
assert.Equal(t, reason, floors[0].FloorReason.String)
164164

165165
// Update reason (UPSERT)
166-
newReason := "Updated: Security fix"
166+
newReason := "Updated: Filesystem upgrade"
167167
err = a.AddChannelPackageFloor(channel.ID, pkg.ID, null.StringFrom(newReason))
168168
assert.NoError(t, err)
169169

@@ -208,15 +208,15 @@ func TestTargetAsFloor(t *testing.T) {
208208

209209
// Mark the target as ALSO being a floor (critical version)
210210
err := a.AddChannelPackageFloor(setup.Channel.ID, setup.Target.ID,
211-
null.StringFrom("Critical security update - mandatory"))
211+
null.StringFrom("Filesystem support for usr dir - mandatory"))
212212
assert.NoError(t, err)
213213

214214
// Verify target is marked as floor
215215
floors, err := a.GetChannelFloorPackages(setup.Channel.ID)
216216
assert.NoError(t, err)
217217
assert.Len(t, floors, 3) // All three are floors now
218218
assert.Equal(t, "3000.0.0", floors[2].Version)
219-
assert.Equal(t, "Critical security update - mandatory", floors[2].FloorReason.String)
219+
assert.Equal(t, "Filesystem support for usr dir - mandatory", floors[2].FloorReason.String)
220220

221221
// Test required floors for different client versions
222222
testCases := map[string]struct {

backend/pkg/codegen/spec.gen.go

Lines changed: 81 additions & 80 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/pkg/codegen/types.gen.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/pkg/syncer/syncer_multimanifest_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
func createMultiManifestUpdateWithReasons() *omaha.UpdateResponse {
1515
update := createMultiManifestUpdate("1000.0.0", "2000.0.0", "3000.0.0")
1616
// Set specific floor reasons for testing
17-
update.Manifests[0].FloorReason = "Security fix"
17+
update.Manifests[0].FloorReason = "Filesystem support for usr dir"
1818
update.Manifests[1].FloorReason = "Critical update"
1919
return update
2020
}
@@ -54,7 +54,7 @@ func TestSyncer_MultiManifestWithExistingPackage(t *testing.T) {
5454
require.NoError(t, err)
5555
assert.Len(t, floors, 2)
5656
assert.Equal(t, "1000.0.0", floors[0].Version)
57-
assert.Equal(t, "Security fix", floors[0].FloorReason.String)
57+
assert.Equal(t, "Filesystem support for usr dir", floors[0].FloorReason.String)
5858
}
5959

6060
// TestSyncer_PackageVerificationErrors tests hash/size mismatch detection
@@ -154,7 +154,7 @@ func TestSyncer_TargetAsFloor(t *testing.T) {
154154
Packages: []*omaha.Package{{Name: "flatcar-1000.0.0.gz", SHA1: "hash1000", Size: 1000}},
155155
Actions: []*omaha.Action{{Event: "postinstall", SHA256: "dGVzdHNoYTI1Ng=="}},
156156
IsFloor: true,
157-
FloorReason: "Security update",
157+
FloorReason: "Critical bootloader update",
158158
},
159159
{
160160
Version: "2000.0.0",
@@ -177,7 +177,7 @@ func TestSyncer_TargetAsFloor(t *testing.T) {
177177
require.NoError(t, err)
178178
assert.Len(t, floors, 2)
179179
assert.Equal(t, "1000.0.0", floors[0].Version)
180-
assert.Equal(t, "Security update", floors[0].FloorReason.String)
180+
assert.Equal(t, "Critical bootloader update", floors[0].FloorReason.String)
181181
assert.Equal(t, "2000.0.0", floors[1].Version)
182182
assert.Equal(t, "Critical mandatory version", floors[1].FloorReason.String)
183183

@@ -313,7 +313,7 @@ func TestSyncer_ExplicitTargetPriority(t *testing.T) {
313313
Packages: []*omaha.Package{{Name: "flatcar-1000.0.0.gz", SHA1: "hash1000", Size: 1000}},
314314
Actions: []*omaha.Action{{Event: "postinstall", SHA256: "dGVzdHNoYTI1Ng=="}},
315315
IsFloor: true,
316-
FloorReason: "Security fix",
316+
FloorReason: "Filesystem support for usr dir",
317317
},
318318
{
319319
Version: "2000.0.0",

0 commit comments

Comments
 (0)