Skip to content

Commit

Permalink
builconfig: add (failing) regression test for issue#655
Browse files Browse the repository at this point in the history
This commit adds a failing regression test for the following
customization:
```toml
[[customizations.filesystem]]
mountpoint = "/"
minsize = 1000
```
which yields an error now:
```
2024/09/24 09:08:34 error: cannot build manifest: cannot read config: cannot decode "/config.toml": unknown keys found: [customizations.filesystem.mountpoint customizations.filesystem.minsize customizations.filesystem.mountpoint customizations.filesystem.minsize]
```
  • Loading branch information
mvo5 committed Sep 24, 2024
1 parent 5ef7343 commit 0b966e4
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions bib/internal/buildconfig/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,24 @@ func TestJsonUnknownKeysError(t *testing.T) {

assert.ErrorContains(t, err, `json: unknown field "birds"`)
}

func TestReadConfigIsssue655(t *testing.T) {
fakeUserCnfPath := makeFakeConfig(t, "config.toml", `
[[customizations.filesystem]]
mountpoint = "/"
minsize = 1000
`)

conf, err := buildconfig.ReadWithFallback(fakeUserCnfPath)
assert.NoError(t, err)
assert.Equal(t, &buildconfig.BuildConfig{
Customizations: &blueprint.Customizations{
Filesystem: []blueprint.FilesystemCustomization{
{
Mountpoint: "/",
MinSize: 1000,
},
},
},
}, conf)
}

0 comments on commit 0b966e4

Please sign in to comment.