Commit Graph

315 Commits

Author SHA1 Message Date
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
Brian C. Lane
89539a7bf4 tests: Use journalctl -g to check for failed login
/var/log/audit/audit.log isn't always available (eg. tar liveimg
install), but it is logged to the journal, which can be grepped with
'journalctl -g' so use that instead.
2019-11-01 09:00:57 -07:00
Brian C. Lane
454af0c5d5 tests: Fix check_root_account when used with tar liveimg test
passwd and openssh-clients need to be installed, and there is no need to
use sudo when you are connecting to the system as root.
2019-11-01 09:00:57 -07:00
Alexander Todorov
d67745d755 tests: Use the same asserts as before
after the changes around live-iso and qcow2 test cases the asserts
used have also changed. This commit utilizes the existing test lib.
2019-11-01 09:00:57 -07:00
Alexander Todorov
e1b45958f4 tests: switch to using podman instead of docker
Note: use podman-docker to avoid changing tests too much. This
is also what we have on the RHEL branches.

There's no service to be started/restarted so remove everything
related to docker service.
2019-11-01 09:00:57 -07:00
Brian C. Lane
4705ff3b1e tests: Remove nested vm from tar liveimg kickstart test
Use anaconda to install the root.tar.xz into a disk image.  Copy the
disk image to the host, and use the cockpit vm support to boot it and
test it.
2019-11-01 09:00:57 -07:00
Brian C. Lane
a0ae10c2d7 tests: Use --http0.9 for curl ssh test 2019-11-01 09:00:57 -07:00
Brian C. Lane
e3654e8297 test: Boot the live-iso faster, and login using ssh key
On Fedora 31 passworless root login is no longer working. We already
install a ssh key, may as well use it.

This also reduces the live boot timeout to 2s from 60s, which should
help with timeout problems when booting.
2019-11-01 09:00:57 -07:00
Brian C. Lane
b8bf258a3c tests: Split testing the image into a separate script
Nested virt is not reliable enough, especially on other arches, to rely
on for testing the created images. This moves the test code into
test_boot_* scripts to be run from inside the booted images.

It also adds copying the results of the build into
/var/tmp/test-results/, and includes the generated ssh key so that
whatever boots the image can also log in.

The tests/test_image.sh script has been added to handle running the
test_boot_* scripts without any of the extra lorax-composer specific
setup.
2019-11-01 09:00:57 -07:00
Brian C. Lane
e365e476af Disable some compose types on other architectures
The 'enabled' field in the /compose/types output now reflects whether or
not the type is supported on the current architecture. Disabled types
are not allowed to be built, and will raise an error like:

Compose type 'alibaba' is disabled on this architecture
2019-10-28 16:42:36 -07:00
Alexander Todorov
88162780a7 tests: Document Azure setup 2019-10-21 19:46:37 +02:00
Brian C. Lane
0eb01b84a8 tests: Switch the azure examples used in the lifted tests to use aws 2019-10-16 09:17:54 -07:00