Commit Graph

338 Commits

Author SHA1 Message Date
Brian C. Lane
f1aee05167 tests: Remove test_del_execReadlines
Doesn't test anything useful, and leaves the process running.
2020-10-07 10:51:41 -07:00
Brian C. Lane
9d6211f1b3 Fix unclosed files
Python will eventually close open files, but it is recommended to
explicitly close them instead of waiting for the gc or program exit.

This fixes all the uses of open...read/write in the codebase, mostly in
tests.
2020-10-07 10:51:41 -07:00
Brian C. Lane
468f651af4 tests: Update composer-cli blueprint server tests
I removed the example blueprints, and this is now going to run against
osbuild-composer which doesn't have default blueprints installed. So
embed them into the test and push them as the first test.

Also note that osbuild-composer diff currently has a bug, you cannot
specify a commit hash, so mark the final diff test failure as expected
for now.
2020-10-07 10:48:43 -07:00
Brian C. Lane
0eda7829a8 tests: Remove unused lorax-composer tests
This leaves the composer-cli related tests, and switches the default
backend to osbuild-composer for the tests.
2020-09-30 16:35:51 -07:00
Brian C. Lane
7616a10373 Remove lorax-composer, it has been replaced by osbuild-composer
Remove the code, related files, and tests.
2020-09-30 15:42:46 -07:00
Brian C. Lane
47822e5932 tests: Ignore W0707 raise-missing-from warnings 2020-08-27 16:03:25 -07:00
Chris Roberts
5165beef73 Switch VMware testing env to improve stability results
Related: rhbz#1825190
2020-08-04 10:14:42 -07:00
Alexander Todorov
556fdf3020 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.
2020-07-28 10:28:05 -07:00
Brian C. Lane
b7e69596e3 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.
2020-07-23 10:35:10 -07:00
Brian C. Lane
d830829929 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.
2020-07-23 10:35:10 -07:00
Alexander Todorov
cc29b99659 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
2020-07-23 10:20:47 -07:00
Alexander Todorov
27c4c67a59 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
2020-07-23 10:20:47 -07:00
Alexander Todorov
04bc5e9e86 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.
2020-07-23 10:20:47 -07:00
Alexander Todorov
eb7748236c tests: Remove lorax-composer specific checks 2020-07-23 10:20:47 -07:00
Alexander Todorov
1c218ecbae tests: Remove compose after we're done 2020-07-23 10:20:47 -07:00
Lars Karlitski
abcbbf3194 tests: don't use beakerlib in blueprint
b/c for osbuild-composer beakerlib is not included in the
distributions we test on.
2020-07-23 10:20:47 -07:00
Lars Karlitski
123827c90a tests: don't depend on internal state of composer 2020-07-23 10:20:47 -07:00
Alexander Todorov
7b08fa8838 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
2020-07-23 10:20:47 -07:00
Alexander Todorov
4dd7cf8798 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
2020-07-23 10:20:47 -07:00
Alexander Todorov
d68e01b7e1 tests: Don't check example blueprints if we don't have to
ATM osbuild-composer doesn't ship example blueprints
2020-07-23 10:20:47 -07:00
Alexander Todorov
14a3c8d5a7 tests: Use BACKEND env variable instead of hard-coded values
- default BACKEND to lorax-composer
- pass BACKEND everywhere we need to
2020-07-23 10:20:47 -07:00
Alexander Todorov
0b5285a3e2 tests: Disable cloud-init status check
Fails on Fedora 32 and we are going to decommission this test
very soon, leaving only composer-cli related tests here. All image
building and verification tasks are already in the osbuild-composer
test suite!
2020-07-10 08:36:19 -07:00
Brian C. Lane
bf1be846e5 composer-cli: Return a better error with no value
And add tests for the get_size function.
2020-06-11 09:36:32 -07:00
Brian C. Lane
9a17eba974 tests: Add tests for composer-cli compose start JSON POST 2020-06-11 09:36:32 -07:00
Brian C. Lane
019cac8a7c lorax-composer: Check compose/status for invalid characters 2020-05-28 14:23:57 -07:00
Brian C. Lane
9a76c20c6b lorax-composer: deleting an unknown workspace should return an error
This changes the workspace delete behavior to match osbuild-composer's,
returning an error if the workspace doesn't exist.
2020-05-28 11:57:21 -07:00
Brian C. Lane
74f8cd4f34 lorax-composer: Check for valid characters in the undo commit
Return an error 400 with INVALID_CHARS if the commit characters are not
in the allowed list.
2020-05-28 09:39:23 -07:00
Brian C. Lane
c9c1283c56 lorax: Add --skip-branding cmdline argument
Also document how branding currently works. See docs/lorax.rst

Resolves: rhbz#1826479
2020-04-21 15:57:54 -07:00
Chris Roberts
1d5a0a378b Update datastore for VMware testing
This change is needed for VMWare testing due to changes in the storage,
and the datastore we used before is not available for the time being.
2020-04-15 12:25:27 +03:00
Brian C. Lane
f94171bb0f tests: Add tests for _install_branding with and without variant
This adds tests to make sure that the changes to _install_branding are
working as expected.
2020-03-20 08:28:11 -07:00
Alexander Todorov
ad54403c6d tests: OpenStack - apply tags and delete by tags
- for keys use Composer-Test-Key prefix (for consistency)
- for images and VMs use Composer-Test prefix
- delete VMs both by searching by tags & by name in case we
  manually create them without tags
2020-02-12 14:58:11 +01:00
Alexander Todorov
354c909b9b tests: Azure - apply tags and delete by tags
- change image & vm names to Composer-Test-* for consistency
- tag vm with composer_test upon creation, timestamp is already present
- tag blobs with composer_test upon upload
- tag images with composer_test & first_seen timestamp upon creation
2020-02-12 14:58:11 +01:00
Alexander Todorov
06d727e4fd tests: VMware - delete only VMs named Composer-Test-*
- change VM name for consistency sake
- change vmdk file name also for consistency
2020-02-12 14:58:11 +01:00
Alexander Todorov
d1d30bb974 tests: AWS - apply tags when creating resoures and delete by tags
- for objects in S3 - match filenames starting with Composer-Test
- for keys use the new Composer-Test-Key- prefix (for consistency)
- for VM names use Composer-Test-VM- prefix instead of ami id
2020-02-12 14:58:11 +01:00
Brian C. Lane
fe45fa3610 lorax: Catch rootfs out of space failures
It isn't always obvious what happened when the rootfs runs out of space,
especially when using lorax via pungi. So this checks for the out of
space error string when building the runtime image and logs it to the
primary logfile and console as an error with the rootfs size.

eg.
2020-01-20 18:52:58,920: The rootfs ran out of space with size=1
2020-02-05 15:27:41 -08:00
Brian C. Lane
9dd160ba44 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.
2020-02-05 11:17:14 -08:00
Alexander Todorov
e31fccc4ae tests: remove ALI_DIR after we're done using the cli
also fix typo
2020-01-30 08:47:38 -08:00
Alexander Todorov
718ac31c47 Test & cleanup script for Alibaba cloud 2020-01-28 13:48:57 +02:00
Jakub Rusz
67410a9770 tests: run ssh commands in batch mode 2020-01-24 14:27:31 +02:00
Jakub Rusz
2ee92b75b0 tests: remove --test=2 from compose_sanity
This will ensure that the compose_sanity test also covers a scenario described in rhbz#1788501
2020-01-20 13:27:40 +02:00
Brian C. Lane
35348636c5 tests: Use mock from unittest 2020-01-16 09:26:27 -08:00
Brian C. Lane
a0fce98109 Add --dracut-conf cmdline argument to lorax and livemedia-creator
This adds the ability to use a dracut.conf file instead of passing
--dracut-arg on the cmdline multiple times.
2020-01-16 09:26:27 -08:00
Brian C. Lane
a60cef3e1e 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.

Related: rhbz#1641601

Cherry-picked from: 47fd6e85b2
2020-01-16 12:00:26 +02:00
Brian C. Lane
d265824564 tests: unittest and pytest expect functions to start with test_ 2020-01-15 10:40:17 -08:00
Brian C. Lane
9bb1a0916e Update to_timeval usage to use format_iso8601
GLib.DateTime.to_timeval is deprecated.
2020-01-15 10:40:17 -08:00
Brian C. Lane
0d3cff0dde ltmpl: Update to use collections.abc 2020-01-15 10:40:17 -08:00
Jakub Rusz
bae3cb06bc tests: Check for cloud-init presence in azure image
This tests if the cloud-init is installed and running.
2020-01-14 12:54:06 +02:00
Jakub Rusz
ca876483db tests: check for failed compose before trying to cancel
This was suggested and added to rhel8-branch so adding it here as well.
2020-01-14 11:23:56 +02:00
Alexander Todorov
887fb6ce35 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
2020-01-13 15:36:20 -08:00
Brian C. Lane
b69e6d725d lorax-composer: Enable ami on aarch64 2020-01-13 14:55:41 -08:00