Commit Graph

326 Commits

Author SHA1 Message Date
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
Alexander Todorov
59924fbafb AWS test: take into account different instance type for non x86
- also updates VM name used in playbook to be more descriptive
- also fix equality comparison to use == for consistency
2020-01-09 11:52:51 -08:00
Jakub Rusz
badc07854c Add test for canceling a running compose
This is a modification of an existing test for compose sanity.
2020-01-09 11:32:57 -08:00
Brian C. Lane
c69c76e9c9 tests: Use wildcard versions for packages
Chasing updated package versions is silly. We already have other tests
to make sure the blueprints support version numbers there is no need to
fail a test at the whim of an upstream repo.
2019-12-11 10:56:23 -08:00
Brian C. Lane
80dd997b9c 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 12:17:34 -08:00
Jakub Rusz
f52e56c628 tests: fix blueprints tag test
This changes the blueprint tested from glusterfs to example-http-server
2019-11-18 08:41:55 -08:00
Jakub Rusz
6839390be2 test: fix serializing repo_to_source test
Travis used fedora-32, this commit changes it to fedora-31.
2019-11-18 08:41:55 -08:00
Brian C. Lane
fad9b324f7 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.
2019-11-14 11:58:56 -08:00
Brian C. Lane
dcd92cf8c0 tests: Add 'test_mkksiso' tests
These use beakerlib to download a Fedora boot.iso and run mkksiso on
it. It currently does not try to boot the resulting iso, it mounts it
and checks that the expected config files have been modified and the
extra files have been added.
2019-11-05 11:09:42 -08:00
Brian C. Lane
94b2b58d99 tests: Add a lorax boot.iso test
This builds a boot.iso in the vm, copies it out, and boots it.
The tests that run inside the boot.iso
(/tests/lorax/test_boot_bootiso.sh) cannot use beakerlib so it needs to
be a simple shell script returning 1 on failure along with a descriptive
message.
2019-11-05 10:38:31 -08:00
Alexander Todorov
2b578dcee8 tests: Ensure failure if beakerlib results file not found
In example here
https://209.132.184.41:8493/logs/pull-887-20191025-100505-509b9eae-weldr-lorax--fedora-31-tar/log.html

we're seeing stuff like:
/tests/test_cli.sh: line 109: /tmp/composer-test.wIAITH/TestResults: No such file or directory

but the result is PASS
2019-11-05 19:05:33 +02:00
Alexander Todorov
c43ba9e78f tests: Documentation updates 2019-11-05 19:05:33 +02:00
Alexander Todorov
b197e448ff DRY when setting up, running & parsing results for beakerlib tests 2019-11-05 19:05:33 +02:00