Commit Graph

350 Commits

Author SHA1 Message Date
Brian C. Lane c9e90ec0b2 tests: Fix the image minimizer test dnf usage
If the host dnf repos contain $releasever then using --installroot will
fail because it tries to use a rpmdb in the installroot, which starts
out empty. Passing --releasever=/ will use the releasever from the host.
2022-02-14 10:07:37 -08:00
Brian C. Lane cc90406a58 tests: Add tests for image-minimizer 2021-12-21 13:18:23 -08:00
Brian C. Lane 6160d340c4 Fix monitor problem with split UTF8 characters
Sometimes, depending on the buffering, or length of data being received,
the end of the data could be the 1st byte or so of a UTF8 character.
This would cause a crash when trying to decode the raw data buffer.

This switches it to only decode once a full line has been found.
It also adds tests for the LogMonitor class.
2021-11-17 15:37:59 -08:00
Brian C. Lane c4aba2e47f mount: Switch to using pycdio instead of pycdlib
Also add a root only test for IsoMountpoint.
2021-11-09 12:02:54 -08:00
Brian C. Lane 1adbeef14c ltmpl: Add version compare support to installpkg
This adds support for enforcing version requirements on installed
packages. See the documentation in ltmpl.installpkg for details.
2021-10-28 14:19:50 -07:00
Brian C. Lane 49ff2c7d5c tests: Ignore new pylint warnings
Newer versions of pylint complain about u'' not being needed and using
open without setting encoding. These are valid warnings, but do not
effect the operation of lorax so they have been added to the
FalsePositive list in runpylint.py
2021-09-27 09:06:48 -07:00
Brian C. Lane 9cb34c5520 treebuilder: Add branding package to template variables
The branding package name doesn't always match the product name.  This
saves the branding package names as discovered in the enabled repos and
exposes it to the templates as branding.release and branding.logos --
which could potentially be None so the template needs to take that into
account.

Related: rhbz#1956205
2021-05-05 11:16:31 -07:00
Brian C. Lane b75b692607 composer-cli: Remove all traces of composer-cli
weldr-client has replaced composer-cli so remove all of the code and
tests, adjust various things so they don't expect it to be available,
and rename some things like test/composertest.py to reflect its
exclusive use by lorax.
2021-04-26 15:59:35 -07:00
Brian C. Lane 2762cf95da tests: Fix pocketlint use of removed pylint messages
pylint has removed python2 only messages so running
pocketlint is causing tracebacks in every file.

This removes the problem messages from the disabledOptions property
until pocketlint can be fixed upstream.
2021-04-20 08:35:34 -07:00
Brian C. Lane 730621808c 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-03-03 16:24:07 -08:00
Brian C. Lane 0dc1edb564 tests: Include the fedora-updates repo when testing boot.iso building 2021-01-28 13:48:59 -08:00
Brian C. Lane 1246bd8fba tests: Fix open file warning in test_execWithRedirect 2020-10-07 10:51:41 -07:00
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