Commit Graph

216 Commits

Author SHA1 Message Date
Brian C. Lane 900cd436f7 Handle all possible dnf group_install errors
dnf has changed what it will raise when trying to group_install a
nonexistent group, this adds handling for all of them.

Related: rhbz#1947958
2021-10-11 10:24:50 -07:00
Martin Pitt 98555e9d16 test: Add new osbuild-composer expected types 2021-03-29 10:58:20 +03:00
Brian C. Lane 206d9a34a6 composer-cli: Add support for start-ostree --url URL
Some ostree builds, like edge, require passing a url to it along with
the ref and parent arguments. This adds an optional --url argument to
the 'composer-cli compose start-ostree' command.

Resolves: rhbz#1929381
2021-02-16 13:37:23 -08:00
Aleksandar Todorov 198e21e5e0 tests: Override rhel-8-beta.json repositories for osbuild-composer
rhbz#1916684
2021-01-28 12:25:14 +01:00
Aleksandar Todorov 633ab6ed2e tests: Remove systemctl for osbuild-composer
leave osbuild-composer.socket instead otherwise API socket isn't
automatically started

Related: rhbz#1916684
2021-01-28 12:25:14 +01:00
Brian C. Lane f112a0cbc7 tests: Fix diff test BACKEND check
The environmental variable we are using is 'BACKEND' not
'COMPOSER_BACKEND'

Related: rhbz#1825190
2020-08-10 11:15:04 -07:00
Alexander Todorov 3ff8614cc7 tests: Push example blueprints b/c they may not exist
Related: rhbz#1825190
2020-08-07 08:50:40 -07:00
Chris Roberts 3e95ebfbc7 Switch VMware testing env to improve stability results
Related: rhbz#1825190
2020-08-04 20:05:34 +03:00
Alexander Todorov 498dd262f8 Skip test_z_diff() if runninga against for osbuild-composer
See https://github.com/osbuild/osbuild-composer/issues/903

Related: rhbz#1825190
2020-08-03 09:40:23 -07:00
Alexander Todorov 99dec118aa tests: Overwrite rhel-8.json when testing with osbuild-composer
Provides a well-known location of internal repositories and does
not depend on the URLs configured in osbuild-composer itself.

Related: rhbz#1825190
2020-07-28 14:21:47 -07:00
Alexander Todorov b9e5fa5e7b tests: Allow skipping image build in compose sanity test
when $SKIP_IMAGE_BUILD is set the test skips 2 phases:
- start the compose again (after it has been cancelled) and
- waiting for it to finish & downloading the resulting image

This will allow to enable this test script in downstream gating
jobs.

Cherry-picked from cc29b99659,
https://github.com/weldr/lorax/pull/1053/

Related: rhbz#1825190
2020-07-28 14:21:47 -07:00
Alexander Todorov b3ec7af1d1 Set BACKEND=osbuild-composer if running that test scenario
- this will execute cli sanity tests in parallel with the other
- make sure to pass BACKED to vm.install too
- more checks in lib.sh

Cherry-picked from cc29b99659

Related: rhbz#1825190
2020-07-28 14:21:47 -07:00
Alexander Todorov 359b99a178 tests: Don't check info after compose cancel with osbuild-composer
osbuild-composer doesn't remove cancelled composes and even if we
wait for the cancellation to take place the UUID is still there
and `compose info` returns an exit code of 0 instead of 1

Cherry-picked from 27c4c67a59

Related: rhbz#1825190
2020-07-28 14:21:47 -07:00
Alexander Todorov de3f548025 tests: Compare blueprints as TOML objects, not strings
this is to avoid differences in ordering and white space. The same
approach is used on rhel7-extras branch.

Cherry-picked from 04bc5e9e86

Related: rhbz#1825190
2020-07-28 14:21:47 -07:00
Alexander Todorov 45d227a189 tests: Remove lorax-composer specific checks
Cherry-picked from eb7748236c

Related: rhbz#1825190
2020-07-28 14:21:47 -07:00
Alexander Todorov 76b52daa97 tests: Remove compose after we're done
Cherry-picked from 1c218ecbae

Related: rhbz#1825190
2020-07-28 14:21:47 -07:00
Lars Karlitski 3734129e67 tests: don't use beakerlib in blueprint
b/c for osbuild-composer beakerlib is not included in the
distributions we test on.

Cherry-picked from abcbbf3194

Related: rhbz#1825190
2020-07-28 14:21:47 -07:00
Lars Karlitski 8f860cc8a1 tests: don't depend on internal state of composer
Cherry-picked from 123827c90a

Related: rhbz#1825190
2020-07-28 14:21:47 -07:00
Alexander Todorov 6b2efa0da1 tests: Do not rely on example blueprints
- avoids having to modify them in the first place so less changes
  to the SUT
- will help with transition to osbuild-composer backend
- each test which needs a blueprint either declares it on its own
  (some already do this) or may use a shared blueprints from the
  tests lib dir

Cherry-picked from 7b08fa8838

Related: rhbz#1825190
2020-07-28 14:21:47 -07:00
Alexander Todorov 6240df6caf tests: Special case compose types for osbuild-composer
- alibaba - will be added later
- google - will be added later, low priority b/c
  GCE doesn't fully support RHEL8
- live-iso - not supported for now
- ext4 & partitioned disk - removed from osbuild-composer
- hyper-v & liveimg-tar are available only on master branch

Cherry-picked from 4dd7cf8798

Related: rhbz#1825190
2020-07-28 14:21:47 -07:00
Alexander Todorov b72bb63599 tests: Don't check example blueprints if we don't have to
ATM osbuild-composer doesn't ship example blueprints

Cherry-picked from d68e01b7e1

Related: rhbz#1825190
2020-07-28 14:21:47 -07:00
Alexander Todorov 9193384bb8 tests: Use BACKEND env variable instead of hard-coded values
- default BACKEND to lorax-composer
- pass BACKEND everywhere we need to

Cherry-picked from 14a3c8d5a7

Related: rhbz#1825190
2020-07-28 14:21:47 -07:00
Brian C. Lane 088111f087 composer-cli: Make start-ostree parent and ref optional
This changes the start-ostree command to:

compose start-ostree [--size XXXX] [--parent PARENT] [--ref REF] <BLUEPRINT> <TYPE> [<IMAGE-NAME> <PROFILE.TOML>]

Both of them are optional, and if missing a "" is passed to
osbuild-composer. Also adds more tests for all the various possible
options and removes the provider and profile arguments.

(cherry picked from commit 5b0487f47c)

Resolves: rhbz#1859680
2020-07-23 10:35:28 -07:00
Brian C. Lane dcb2f36c2d composer-cli: Add a get_arg function
This is in preperation for adding more optional arguments. Adds a
generic get_arg function, tests for it, and converts get_size to use it.

(cherry picked from commit 4a4128af23)

Related: rhbz#1859680
2020-07-23 10:35:28 -07:00
Brian C. Lane ba5a36c982 composer-cli: Return a better error with no value
And add tests for the get_size function.

Related: rhbz#1844649
2020-06-11 09:14:11 -07:00
Brian C. Lane d056c350d4 tests: rhel8-branch uses nose not pytest
It tries to run anything with 'test' in it (and run() is reserved). It
also outputs stderr so only log errors.

Related: rhbz#1844649
2020-06-11 09:14:11 -07:00
Brian C. Lane 10c9b98219 tests: Add tests for composer-cli compose start JSON POST
Related: rhbz#1844649
2020-06-11 09:14:01 -07:00
Chris Roberts 9dfc0e6baf Update datastore for VMware testing
Related: rhbz#1825190
Signed-off-by: Brian C. Lane <bcl@redhat.com>
2020-04-28 13:57:10 -07:00
Brian C. Lane e8f31464bd tests: Add tests for variant branding detection
This adds tests to make sure that the changes to _install_branding are
working as expected with or without variants.

Related: rhbz#1826479
2020-04-27 16:02:24 -07:00
Brian C. Lane 78e525fa80 tests: Add tests for branding
Related: rhbz#1826479
2020-04-27 16:02:06 -07:00
Jakub Rusz 0f20c8f5cf tests: Add new test to run 'test' and 'check' in cockpit ci
(cherry picked from commit ac01d52fa6c27de274394dfaa144990f05d9b8df)

Related: rhbz#1785154
2020-02-07 11:51:13 +01:00
Brian C. Lane 226708b27e tests: rpm now returns str, drop decode() call
Related: rhbz#1785154
2020-02-05 15:11:19 -08:00
Brian C. Lane dfdc05df5f tests: Switch to using CentOS8 for the Docker tests
This also moves the packages to be installed into a file that can be
shared between test methods.

It drops several packages that are unnecessary for testing, and excludes
those paths from pylint checks using pocketlint.

Related: rhbz#1785154
2020-02-05 14:54:02 -08:00
Brian C. Lane c1af43d56f tests: Finish switch to using example-development in composer tests
These tests are fragile, order matters in some cases, and a previous
patch was incomplete. The diff test was failing because the blueprint
that it checks must be pushed twice in order to trigger the version bump
and 'Changed Version' output from composer-cli.

Related: rhbz#1785154
2020-02-05 14:38:28 -08:00
Brian C. Lane 2c9989a06d tests: this_is_rhel function return true for CentOS or RHEL
Related: rhbz#1785154
2020-02-05 14:36:35 -08:00
Brian C. Lane a4a6371581 pylint: whitelist the rpm module
Without this, depending on which version of pylint is used, you may see
errors related to the rpm.RPMTAG_* constants. This makes sure that
pylint allows loading the rpm module.

Related: rhbz#1785154
2020-02-05 11:19:14 -08:00
Brian C. Lane ce0f9c4ebf tests: Use unittest.mock
Related: rhbz#1785154
2020-02-05 11:02:29 -08:00
Alexander Todorov cb92c839f2 Test & cleanup script for Alibaba cloud
Cherry-picked from 718ac31c47

Related: rhbz#1785154
2020-02-04 09:51:40 +01:00
Jakub Rusz 4dec82ae20 tests: run ssh commands in batch mode
(cherry picked from commit 711668dc99)

Related: rhbz#1785154
2020-01-24 14:27:40 +02:00
Jakub Rusz 2a310efdcf tests: remove --test=2 from compose_sanity
This ensures that after canceling a compose, the next one can be finished.

(cherry picked from commit 2ee92b75b0)

Related: rhbz#1788461
2020-01-21 15:27:13 +02:00
Brian C. Lane 96c65beb01 Add tests for metapackages and package name globs
This makes sure that depsolving shim installs the shim-* package, and
that depsolving grub2-efi-*-cdboot installs a specific -cdboot package.

Cherry-picked from 47fd6e85b2

Related: rhbz#1791612
2020-01-20 12:45:56 +02:00
Jakub Rusz 14d399fe0c tests: Check for cloud-init presence in azure image
This tests if the cloud-init is installed and running.
Cherry-picked from: bae3cb06bc

Related: rhbz#1754711
2020-01-14 19:20:38 +02:00
Alexander Todorov 5189a97f0a tests: Enable Elastic Network Adapter support for AWS
- this is required for arm64 but is present in all latest kernels
  so doesn't seem to hurt
- when registering the AMI mark its architecture properly

Cherry-picked from 6c35448feb

Related: rhbz#1789308
2020-01-13 15:35:54 -08:00
Alexander Todorov 69589123b7 AWS test: take into account different instance type for non x86
- also fix equality comparison to use == for consistency

Cherry-picked from d3d7e072d9

Related: rhbz#1789308
2020-01-13 15:35:54 -08:00
Brian C. Lane 17ce6ee4e4 lorax-composer: Enable ami on aarch64
Resolves: rhbz#1789308
2020-01-13 15:10:16 -08:00
Jakub Rusz 23d528c705 Add test for canceling a running compose
This is a modification of an existing test for compose sanity.
Cherry-picked from master 8c9f528cd4

Related: rhbz#1788461
2020-01-11 13:52:33 +02:00
Jiri Kortus d20b2f3309 Add test for running composer with --no-system-repos option
- add test coverage for rhbz#1650363
- cherry-picked from 5322664432

Related: rhbz#1785154
2020-01-06 09:31:57 +02:00
Brian C. Lane 054669d027 composer-cli: Only display the available compose types
The enabled bool is now being used so the cli should only show the types
actually available on the architecture.

Also modifies the test in test_compose_sanity.sh

Related: rhbz#1751998
2019-12-10 15:52:39 -08:00
Brian C. Lane b6b842943d composer-cli: Return int from handle_api_result not bool
The callers, and the documentation, all expect int 0/1 to use as the
exit status for the program. Not True/False, even though that works most
of the time.

(cherry picked from commit fad9b324f7)
Related: rhbz#1779301
2019-12-03 15:13:05 -08:00
Jakub Rusz 86ea9adbab tests: enable compose_ext4 test to use CDN repos
Related: rhbz#1777265
2019-11-27 15:08:27 +02:00