Commit Graph

79 Commits

Author SHA1 Message Date
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
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
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
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
Brian C. Lane
c2620b0c85 lifted: Add support for AWS upload
This uses a new Ansible module, ec2_snapshot_import, which is included
here until it is available from upstream.

It will upload the AMI to s3, convert it to a snapshot, and then
register the snapshot as an AMI. The s3 object is deleted when it has
been successfully uploaded.
2019-10-16 09:17:54 -07:00
Brian C. Lane
b91d742ecb tests: Add tests for deleting unknown upload and profile 2019-10-16 09:17:53 -07:00
Brian C. Lane
d16e8f5bfc Change /compose/uploads/delete to /upload/delete
Remove the requirement to pass the compose uuid and the upload uuid --
only the upload uuid is needed.
2019-10-16 09:17:53 -07:00
Brian C. Lane
577c56ebaa tests: Add test for /compose/uploads/delete
Test deleting an upload from a compose.
2019-10-16 09:17:53 -07:00
Brian C. Lane
b307ff0430 tests: Add tests for /compose/uploads/schedule
Test it with a profile, and with one-time use settings. It does not
actually upload anything, it only tests that the upload is scheduled.
2019-10-16 09:17:53 -07:00
Brian C. Lane
fd2330c4b7 tests: Fix comments about V1 API results including uploads data 2019-10-16 09:17:53 -07:00
Brian C. Lane
7396c272b2 Use consistent naming for upload uuids
Since we have both compose uuids and upload uuids they need to be
clearly named. This updates the upload naming to use 'upload_uuid' in
the inputs, and 'upload_id' in the output (_id instead of _uuid for
consistency with build_id naming in the status responses).

This also adds 'upload_id' to the /upload/log response.
2019-10-16 09:17:53 -07:00
Brian C. Lane
ade8945da3 tests: Add tests for new upload routes
This tests the routes for saving a profile, listing profiles, deleting
profiles, as well as composing with upload.

The composes run fake composes with upload data, one selects a profile
the other passes in the settings. No actual upload is done, but it tests
that the info, log, and cancel routes work.

This also updates the test setup to copy over the share/lifted directory
so that the providers are available to the tests.
2019-10-16 09:17:53 -07:00
Brian C. Lane
1b84f90963 lifted directories should be under share_dir and lib_dir
Otherwise passing --sharedir pointed to some other path will not use the
correct providers.
2019-10-16 09:17:53 -07:00
Brian C. Lane
1a6bc098d9 tests: Add tests for API v1
Output from some of these are different from API v0. Instead of mixing
the two this moved v1 tests into a new class - ServerAPIV1TestCase to
make them easier to maintain, and removes the v1 tests from
ServerAPIV0TestCase
2019-10-16 09:17:53 -07:00
Brian C. Lane
3a453eaad7 Make sure V0 API doesn't return uploads information
uploads should only be included in the V1 API routes, add `api`
selection to the relevant helper functions and calls to them from v0.py

Add new V1 routes with api=1 to include the uploads information in the
results.

Also add tests to ensure that V0 requests do not include uploads.
2019-10-16 09:17:53 -07:00
Brian C. Lane
3ee07001b1 tests: Drop tito from the Dockerfile.test
It isn't needed to run the tests, and currently a package it depends on
(cheetah) is not working in rawhide.

Also bump glusterfs version to 7.*
2019-09-03 11:02:52 -07:00
Brian C. Lane
6f686ff9d6 lorax-composer: Add support for dnf variables to repo sources
This loads the system dnf vars from /etc/dnf/vars at startup if
system repos are enabled, and it substitutes the values in the sources
when loaded, and when a new source is added.

Also includes tests.
2019-08-20 16:26:03 -07:00
Brian C. Lane
40bb80f10f tests: Expand test coverage of the v0 and v1 sources API 2019-08-09 13:16:12 -07:00
Brian C. Lane
1e88a99443 lorax-composer: Add v1 API for projects/source/
This changes the source 'name' field to match the DNF usage of it as a
descriptive string. 'id' is now used as the short name to refer to the
source. The v0 API remains unchanged.

Tests for v1 behavior have been added.

Now that the v1 API is in use the status message will return api: 1
2019-08-07 13:26:35 -07:00
Brian C. Lane
b9d18216ef lorax-composer: Add liveimg-tar image type
This creates a tar suitable for use with the anaconda kickstart liveimg
command. It adds the kernel, grub2, and grub2-tools packages to the tar
template.
2019-08-05 14:50:32 -07:00
Brian C. Lane
835c912e12 Only use repos with valid urls for test_server.py
libdnf-0.22.5-5 changed something and now the repos with fake urls are
failing when loaded by test_server.py (they still work fine with
test_projects.py) so only use the 'good' repos with the test_server.py
tests -- the others weren't needed for any of its tests anyway.
2019-08-05 14:48:23 -07:00
Brian C. Lane
abe7df34fc Switch to new toml library
The previous library, pytoml from https://github.com/avakar/pytoml is no
longer supported. So this adds a compatibility layer on top of the
suggested replacement, toml from https://github.com/uiri/toml
2019-06-18 14:01:15 -07:00
Lars Karlitski
8ed910b29a composer: Set up a custom HTTP error handler
Override flask's default error handler, because that return html. Return
JSON instead with the usual { "status": false, "errors": [ ... ] }
pattern.
2019-06-04 11:50:25 +03:00
Brian C. Lane
795cc3400c tests: Update tmux version to 2.9a 2019-05-23 14:57:46 -07:00
Brian C. Lane
fa4bda8317 tests: Update openssh-server to v8.* 2019-05-02 17:02:30 -07:00
Brian C. Lane
65b8a2be68 tests: Cleanup on failure of in_tempdir
Otherwise other tests will also fail when they try to run from the wrong
directory.
2019-04-15 14:06:48 -07:00
David Shea
44e14176bb Add a compose type for alibaba.
This compose type creates a partitioned disk as a qcow2 file, but with
only one partition instead of using a separate /boot.
2019-04-03 13:05:31 -04:00
David Shea
434fe58c28 Add a new compose type for Hyper-V
This is based on the VHD compose type, with the following differences:

  * Use the vhdx format instead of vhd
  * No WALinuxAgent
  * Install hyperv-daemons

The hyperv-daemons are activated through udev rules, so there is no need
to add them to the services line.
2019-04-03 13:00:37 -04:00
David Shea
bd804c271b Add a compose type for Google Compute Engine 2019-04-02 10:15:42 -04:00
Brian C. Lane
5dea308080 lorax-composer: pass customization.kernel append to extra_boot_args
This allows iso builds to include the extra kernel boot parameters by
passing them to the arch-specific live/*tmpl template.

Also adds tests to make sure it is written to config.toml in the build
metadata.
2019-03-26 11:06:57 -07:00
Brian C. Lane
59464286f9 lorax-composer: Add the ability to append to the kernel command-line
Sometimes it is necessary to modify the kernel command-line of the
image, this adds support for a [customizations.kernel] section to the
blueprint:

[customizations.kernel]
append = "nosmt=force"

This will be appended to the kickstart's bootloader --append argument.

Includes tests for modifying the bootloader line, the kickstart
template, and examining the final-kickstart.ks created for a compose.
2019-03-26 11:06:57 -07:00
Brian C. Lane
8c2184d59e Add tests using repos.git in blueprints
- Check final-kickstart.ks for the rpm source
- Check final-kickstart.ks for the rpm package name and version
- Make sure depsolve works
- Make sure errors from a bad repo are returned correctly
- Make sure errors from a bad reference are returned correctly

This moves _wait_for_status into a helper function so it can be shared
between the test classes.
2019-03-15 11:18:12 -07:00
Brian C. Lane
e39d2aec22 tests: Make it easier to update version globs
Use constants so we won't have to edit a dozen places in the test when
the package versions are bumped.

Also switch to using Fedora 31 GPG key now that it has branched for
Fedora 30.
2019-03-08 10:09:42 -08:00
Brian C. Lane
d32f477e0b lorax-composer: Return UnknownBlueprint errors when using deleted blueprints
Reading a blueprint wasn't checking to see if it had been deleted so it
was returning the most recent commit before it had been deleted. This
allowed things like starting a compose with a blueprint that technically
doesn't exist.

One exception to this is the /changes/ route, it must be available so
that you can use the commit hash to undo a delete.

This also adds tests for the various operations.

Resolves: rhbz#1682113
2019-03-01 14:39:21 -08:00
Brian C. Lane
26bd2c1378 lorax-composer: Delete workspace copy when deleting blueprint
Also extends the blueprint delete test to also check the workspace.
2019-03-01 14:39:21 -08:00
Brian C. Lane
98482e444d Remove duplicate repositories from the sources list
In some cases when the host has, for whatever reason, multiple copies of
the same repo listed the build may fail with an error about running out
of space.

So this commit removes duplicate entries after the host's repos have been
loaded. It also adjusts some of the test repos to use different
temporary repo names for the tests.
2019-01-30 08:30:40 -08:00
Alexander Todorov
cd6f4fdb67 Drop minor version from php package in blueprint
there's 7.2 in Fedora 29 (which we use in Jenkins) and 7.3 in
Rawhide which causes test jobs to fail with unsolved dependencies.
Alternatively we can switch to another recipe for cloud image tests.
2018-11-29 09:46:06 +02:00
Alexander Todorov
453b1c1236 Update tmux version in tests 2018-10-29 23:15:06 +02:00
Brian C. Lane
df70e3d677 Update php version to 7.3.* 2018-10-24 10:22:40 -07:00
Brian C. Lane
75644689de Update the tests for new make_dnf_dir arguments.
Use the uid and gid that the test is running as instead of hard-coding
0.
2018-10-12 11:59:32 -07:00
Brian C. Lane
98f8b23129 Add an openstack image type
This is a qcow2 image with cloud-init in the template.
2018-10-09 10:17:14 -07:00
Brian C. Lane
7e31a2c138 Add a test for repo metadata expiration
This tests to make sure that the metadata timer is working (by setting
it to 10s and adding a new package to the repo), and that
DNFLock.lock_check immediately picks up a new package.

This depends on rpmfluff which is available from Fedora or EPEL repos.

Related: rhbz#1631561
2018-10-02 13:59:42 -07:00
David Shea
1056bfc25b Add a vmdk compose type.
This is similar to the AMI type, but also adds open-vm-tools and does not do
anything special to the partitioning
2018-10-02 11:54:41 -04:00
David Shea
e0c236ff36 Add a vhd compose type for Azure images
This does pretty much the same things as the AMI compose type, but also
replaces NetworkManager with the Azure linux agent.
2018-10-02 11:54:41 -04:00
David Shea
18188bf6cf Add an ami compose type for AWS images
This differs from lmc's --make-ami in that creates a full disk image instead of
an fsimage. Create a raw disk image with a / and /boot partitions, and enable
sshd, chronyd, and cockpit by default.
2018-10-02 11:54:38 -04:00
Alexander Todorov
c97a6985fb Update glusterfs to 5.*
otherwise depsolve fails b/c rawhide repositories don't seem to
contain the 4.1.* versions
2018-09-24 22:28:57 +03:00
Stef Walter
4a66b5b085 tests: Fix tests so they run on Fedora 28
Broaden the match for Samba in the glusterfs blueprint so it
can work on Fedora 28
2018-09-19 08:47:23 -07:00
David Shea
b4b8985caa Fix the expected versions of blueprint components 2018-09-07 13:34:30 -04:00