Commit graph

12 commits

Author SHA1 Message Date
Achilleas Koutsou
8d9f52cf1f go.mod: update osbuild/images (v0.172.0) and osbuild/blueprint (v1.12.0)
The internal blueprint implementation has been removed from
osbuild/images.  Conversion from osbuild/blueprint blueprints to
osbuild/images blueprints is no longer necessary.
2025-08-07 20:15:33 +02:00
Tomáš Hozza
a0cad4f9a6 client/compose_test: fix error message checked by the test
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-08-23 13:10:53 +02:00
Ondřej Budai
cac9327b44 update to go 1.19
UBI and the oldest support Fedora (37) now all have go 1.19, so we are
cleared to switch.

gofmt now reformats comments in certain cases, so that explains the formatting
changes in this commit.
See https://go.dev/doc/go1.19#go-doc

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-07-21 19:18:00 +02:00
Brian C. Lane
7a4bb863dd Update deprecated io/ioutil functions
ioutil has been deprecated since go 1.16, this fixes all of the
deprecated functions we are using:

ioutil.ReadFile -> os.ReadFile
ioutil.ReadAll -> io.ReadAll
ioutil.WriteFile -> os.WriteFile
ioutil.TempFile -> os.CreateTemp
ioutil.TempDir -> os.MkdirTemp

All of the above are a simple name change, the function arguments and
results are exactly the same as before.

ioutil.ReadDir -> os.ReadDir

now returns a os.DirEntry but the IsDir and Name functions work the
same. The difference is that the FileInfo must be retrieved with the
Info() function which can also return an error.

These were identified by running:
golangci-lint run --build-tags=integration ./...
2023-03-07 09:22:23 -08:00
Christian Kellner
b562d144ca distro/*: allow /boot to be customized
Since the LVM support was added to all distros, our disk
related code is adaptive, i.e. we will set the correct BLS
and grub2 prefix if there a `boot` partiton is present in
the layout after all customizations happen, which includes
LVMification.
One thing that was not yet fully working was layouts that
do not yet have a `/boot` partition but allow LVMification.
In that case `NewPartitionTable` and if `/boot` was the
first (or only) customization, would LVMify the partition
which in turn would create the `/boot` partition; but after
`newPT.ensureLVM()` the call to `newPT.createFilesystem`
with `/boot` would try to create another `/boot` mountpoint.
In order to deal with this situation correctly we are now
using a two phase approach: 1) enlarge existing mountpoints
and collect new ones. 2) if there are new ones and LMVify
was allowed, switch to LVM layout. Do a second pass and now
create or enlarge existing partitions, handling `/boot` in
the process.
2022-08-08 18:05:05 +02:00
Brian C. Lane
52e9d45e58 client: Add Cancel function and tests
NOTE that the tests against the rpmmd fixure for running and waiting are
a bit of a kludge. It is impossible to mock up a running or waiting that
will allow an actual cancel, so the tests check for the internal server
error generated by using the fixure data.

Getting this error means that the API code did it's job and tried to
cancel the compose so that should be a good compromise.
2022-02-18 09:31:07 +01:00
Gianluca Zuccarelli
7408be580c client: test supported and unsupported mountpoints 2021-07-28 21:44:03 +01:00
Tomas Hozza
f7f064274a Tests: remove fedoratest and replace it with test_distro
fedoratest was yet another dummy distribution used by unit tests. After
the rework of test_distro, there is no reason to not use it as the only
distro implementation for testing purposes.

Remove fedoratest distro and replace it with test_distro in all affected
tests.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-05-14 15:43:00 +02:00
Brian C. Lane
508e7b40f7 tests: lorax-composer returns 2 errors for these tests
TestComposeEmptyBlueprintV0
TestComposeInvalidCharsBlueprintV0
2020-05-28 08:28:11 +02:00
Brian C. Lane
49ca489efa client: Add functions to handle Metadata and Results requests
Includes basic tests to check for errors, but not content.
2020-05-28 00:39:10 +02:00
Brian C. Lane
369312989f blueprints: Fix handling of invalid blueprint names in the API code
Empty names are not allowed, and blueprint names should only contain
characters matching: ^[a-zA-Z0-9._-]+$

This also adds tests for the various places where the blueprint name
could potentially be wrong.
2020-05-13 20:00:52 +02:00
Brian C. Lane
f960985c17 client: Add functions to support compose testing
Also adds new types to weldr/json.go to support them.
ComposeEntry had to be duplicated instead of used as-is because it
enforces image type strings that do not match what the API uses (the API
types are all lower case, the internal names are capitalized).
2020-04-15 11:35:05 +02:00