From f06b07c2473816cf25058997f19e9515ee1808c6 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 8 Apr 2025 11:51:46 +0200 Subject: [PATCH] main: add disk customization to blueprint smoke test Adding the disk customization to the blueprint test helps to ensure that strict TOML checking works as expected. There was a (brief) regression because manifest generation with disk toml was not tested. --- cmd/image-builder/main_test.go | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/cmd/image-builder/main_test.go b/cmd/image-builder/main_test.go index 56b54b3..85f7062 100644 --- a/cmd/image-builder/main_test.go +++ b/cmd/image-builder/main_test.go @@ -130,24 +130,22 @@ func hasDepsolveDnf() bool { return err == nil } -var testBlueprint = `{ - "containers": [ - { - "source": "registry.gitlab.com/redhat/services/products/image-builder/ci/osbuild-composer/fedora-minimal" - } - ], - "customizations": { - "user": [ - { - "name": "alice" - } - ] - } -}` +var testBlueprint = ` +[[containers]] +source = "registry.gitlab.com/redhat/services/products/image-builder/ci/osbuild-composer/fedora-minimal" + +[[customizations.user]] +name = "alice" + +[[customizations.disk.partitions]] +type = "lvm" +name = "mainvg" +minsize = "20 GiB" +` func makeTestBlueprint(t *testing.T, testBlueprint string) string { tmpdir := t.TempDir() - blueprintPath := filepath.Join(tmpdir, "blueprint.json") + blueprintPath := filepath.Join(tmpdir, "blueprint.toml") err := os.WriteFile(blueprintPath, []byte(testBlueprint), 0644) assert.NoError(t, err) return blueprintPath