Commit graph

27 commits

Author SHA1 Message Date
Alexander Todorov
66b80e0dac tests: Add reproducer for #524
see this comment:
https://github.com/osbuild/osbuild-composer/issues/524#issuecomment-632017769

depending on the answer we should probably add more tests for
dnf-json too.
2020-06-26 22:02:46 +02:00
Ondřej Budai
4958d15413 tests: build qcow2 instead of tar
Tar is only available on RHEL, switch to qcow2, that's everywhere.
2020-06-12 10:00:50 +02:00
Lars Karlitski
40b65144d1 osbuild-tests: add compose cancel test 2020-06-12 10:00:50 +02:00
Alexander Todorov
6d904f062c tests: composer-cli blueprints undo. Closes #615
the remaining test for composer-cli compose cancel is part of #757
2020-06-12 06:30:54 +02:00
Tom Gundersen
52273756d4 tests/compose: use qcow2 rather than ami for tests
qcow2, unlike ami, is guaranteed to exist on all the architectures we
support.

Also, now that we preserve the cache, make two composes, rather than
just one. This verifies that nothing breaks horribly just because the
cache not being cold. The fact that we have a cache at all should make
this tolerably fast.

This should fix #693.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-06-08 18:06:43 +02:00
Tom Gundersen
b8f4b9eae9 tests: split up TestEverything
This is not a functional change, just helps to make the output more
readable to indicate which sub-command is being tested.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-06-07 19:25:33 +02:00
Alexander Todorov
099f0abeb3 tests: composer-cli sanity tests for compose metadata|results
Refs #643, #644
2020-06-07 19:25:33 +02:00
Alexander Todorov
a70b47ebb6 Enable composer-cli tests for blueprints commands. Refs #356, #615 2020-06-07 19:25:33 +02:00
Alexander Todorov
9d1d4e44ce tests: Don't pass --json to composer-cli unless needed. Refs #356
most invocations of composer-cli do not need to parse JSON so use
the canonical invocation instead. I've left existing functions
which assert on the returned results intact.

'quiet' parameter has been removed b/c it was never used
2020-06-07 19:25:33 +02:00
Alexander Todorov
b51b80f35c tests: rename functions 2020-06-07 19:25:33 +02:00
Brian C. Lane
ddd2010815 weldr: Add support for the v1 API to /projects/source/new
This commit changes the store.PushSource function to take the key as
well as the SourceConfig so that it can be used for v0 or v1.

It adds helper functions for decoding the toml/json into a new
SourceConfig interface type which lets the core source/new code be
shared between the versions.

It also adds tests for the new API behavior.
2020-06-03 21:24:47 +02:00
Alexander Todorov
7c0d384fde tests: split compose sanity tests and add more. Refs #356, #615
`quiet` parameter for runComposerCLIPlainText is not actually used
anywhere so I've removed it
2020-05-25 12:13:26 +03:00
Alexander Todorov
8ab1712796 tests: update name of test func, Refs #356
composer-cli sources list is already covered in the existing test
2020-05-25 12:13:26 +03:00
Alexander Todorov
d8de74a7d1 tests: add runComposerCLIPlainText(). Refs #356
see this comment from @teg:
https://github.com/osbuild/osbuild-composer/issues/356#issuecomment-630766947

Most of the calls within these tests should be converted to
use the plain text version. However some functions need the
JSON b/c they parse it and return a response, e.g. startCompose(),
getComposeStatus().
2020-05-25 12:13:26 +03:00
Ondřej Budai
8a25d045d9 tests: add a smoke test that logs exist
Our current tests cannot currently check if the logs can reach all the way
from the worker to the weldr API. This commit adds a simple check that
the /compose/log route returns at least something.

Also the logs are printed when the compose fails.
2020-05-19 22:20:20 +02:00
Alexander Todorov
b9c5942976 tests: swap the places of expected-actual results in asserts
This results in better output. Output before this swap can be
seen at https://github.com/osbuild/osbuild-composer/issues/611.
It looks like we wanted a compose to FAIL and it FINISHED instead
which is making the error log confusing.
2020-05-15 17:01:02 +03:00
Alexander Todorov
7967ecbbf8 tests: Make TestSources distro independent. Refs #315
by calling `composer-cli sources info` on a user defined repository
2020-03-25 16:30:52 +01:00
Alexander Todorov
5a0ccd55db tests: Add sanity tests for sources. Refs #315, #356 2020-03-23 21:10:46 +01:00
Jiri Kortus
48027293cb Use testing module syntax and asserts in osbuild-tests
Fixes #312
2020-03-19 13:22:14 +02:00
Alexander Todorov
2778efed6f Download AMI image inside integration tests
only build and download AMI image type here b/c building the rest
of the output types is tested separately elsewhere
2020-03-09 13:25:09 +01:00
Alexander Todorov
8117344307 Fix typo in log message 2020-03-09 13:25:09 +01:00
Lars Karlitski
3cff0a2578 osbuild-tests: test saving a blueprint
This is safe now that it is running each test in a temporary working
directory.
2020-03-08 17:04:47 +01:00
Lars Karlitski
22dee28885 osbuild-tests: run compose tests in a temporary directory
Some `composer-cli` commands operate on the current directory, for
example saving blueprints or images. Add the `TemporaryWorkDir` type,
which helps changing to a temporary working directory and cleaning
everything up after.

The alternative would have been to pass a working directory to all calls
of `runComposerCLI`, but that seemed like it would require a lot of
change, which I didn't deem worth for testing code.
2020-03-08 17:04:47 +01:00
Ondřej Budai
d7cbc22da4 lint: fix unhandled errors 2020-03-02 14:28:55 +01:00
Ondřej Budai
1937fc07af lint: fix gosimple/S1002 errors 2020-03-02 14:28:55 +01:00
Alexander Todorov
841885c1b4 tests: Build all available image types during integration test
comparing to lorax-composer test suite only ext4-filesystem and
partitioned-disk are built without asserting anything other than
the build succeeds. For the rest of the images we usually try to
boot them and verify the resulting VM works somehow.
2020-02-24 16:40:42 +01:00
Tom Gundersen
02a194f612 tests: add basic integration tests
Introduce a new osbuild-tests command and ship it in the -tests
sub-package.

The intended usecase is to install the -tests subpackage into an
otherwise pristine VM, and call the osbuild-tests binary over ssh
from the outside of the booted VM. If the binary exits with a return
code of 0, the tests passed, otherwise they failed. The VM should
not be reused after running the tests.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-01-03 22:35:52 +01:00