Commit Graph

46 Commits

Author SHA1 Message Date
David Shea
9a4a45f05a 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.

(cherry picked from commit 44e14176bb)
(cherry picked from commit 0f59e576d8)
2019-05-06 12:07:29 -07:00
David Shea
0220077242 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.

(cherry picked from commit 434fe58c28)
(cherry picked from commit 367c2583e4)
2019-05-06 12:07:29 -07:00
David Shea
69caef3c2d Add a compose type for Google Compute Engine
(cherry picked from commit bd804c271b)
(cherry picked from commit 846d839980)
2019-05-06 12:07:29 -07:00
Brian C. Lane
c5108bce9f 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.

(cherry picked from commit 8c2184d59e)
(cherry picked from commit 78f79a94ec)
2019-05-06 12:06:06 -07:00
Brian C. Lane
2dd3dd54c5 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
(cherry picked from commit d32f477e0b)
(cherry picked from commit 82aa9cdbc6)
2019-05-06 12:00:22 -07:00
Brian C. Lane
d0458750df lorax-composer: Delete workspace copy when deleting blueprint
Also extends the blueprint delete test to also check the workspace.

(cherry picked from commit 26bd2c1378)
(cherry picked from commit 5c0f127b3c)
2019-05-06 12:00:22 -07:00
Brian C. Lane
35faa61f7e 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.

(cherry picked from commit 5dea308080)
(cherry picked from commit 2861bdb95e)
2019-05-06 11:56:17 -07:00
Brian C. Lane
afa68df873 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.

(cherry picked from commit 59464286f9)
(cherry picked from commit c5f4dfe113)
2019-05-06 11:54:56 -07:00
Brian C. Lane
47a909209f 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.

(cherry picked from commit 98482e444d)
2019-01-30 08:43:37 -08:00
Brian C. Lane
708cadee82 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-10 14:25:38 -07:00
Brian C. Lane
ce6fa9c05f Add an openstack image type
This is a qcow2 image with cloud-init in the template.
2018-10-09 11:07:46 -07:00
Brian C. Lane
5184ccef9f 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-05 09:09:10 -07:00
David Shea
ecd4327a01 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-05 09:09:10 -07:00
David Shea
d6274ec413 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-05 09:09:10 -07:00
David Shea
af3cab0dfe 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-05 09:09:10 -07:00
Stef Walter
f32ef25fd1 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-10-05 09:09:10 -07:00
David Shea
9ee2d46a32 Fix the expected versions of blueprint components 2018-10-05 09:09:10 -07:00
Brian C. Lane
972b5c4142 Add tests for limit=0 routes
Passing ?limit=0 to the blueprints/list, blueprints/changes,
projects/list, modules/list should always return the total possible
results, not 0.

Also move the composer-cli test_diff to the end so that it will work
consistently. Do this by naming it test_z_diff.
2018-08-27 11:05:46 -07:00
Brian C. Lane
4e32026354 Fix tests related to blueprint name changes 2018-08-23 13:32:26 -07:00
David Shea
c52ba4236a Add tests for /compose/status filter arguments 2018-08-21 16:42:27 -07:00
Chris Lumens
fb9e5c4a2b Fix more tests.
These were broken due to me rebasing before sending a PR off.  They
should work now.

(cherry picked from commit 4cb15e0a0f)
2018-08-09 16:20:29 -04:00
Chris Lumens
6a3ccd6ade Add error IDs to things that can go wrong when running a compose.
Note the exception string checking around compose_type.  I didn't really
want to introduce a new exception type just for this, but also didn't
want to duplicate strings.  I'd be open to other suggestions for how to
do this.

(cherry picked from commit b3bb438254)
2018-08-09 16:19:19 -04:00
Chris Lumens
2f8f076b1f Add error IDs for when an unknown blueprint is requested.
This adds some fairly redundant code to the beginning of all the
blueprint routes to attempt reading a commit from git for the
blueprint's recipe.  If it succeeds, the blueprint exists and the route
can continue.  Otherwise, return an error.  Hopefully this doesn't slow
things down too much.

(cherry picked from commit a925cc7ddb)
2018-08-09 16:18:49 -04:00
Chris Lumens
a2ce0686ca Add error IDs for when an unknown build UUID is requested.
Note that this also changes the return type of uuid_info to return None
when an unknown ID is given.  The other uuid_* functions are fine
because they are checked ahead of time.

(cherry picked from commit 6497b4fb65)
2018-08-09 16:18:40 -04:00
Brian C. Lane
55dd45de6e Drop .decode from UTF8_TEST_STRING 2018-08-07 10:12:14 -07:00
Brian C. Lane
ec4c555174 Add input string checks to the branch and format arguments
Make sure no UTF8 characters are allowed and return an error if they
are.

Also includes tests to make sure the correct error is returned.

(cherry picked from commit 86d79cd8a6)
2018-08-07 10:12:02 -07:00
Brian C. Lane
f93f64a061 Add a test for invalid characters in the API route
Currently the code is not UTF8 safe, so we need to return a clear error
when invalid characters are passed in.

This also adds tests for the routes to confirm that an error is
correctly returned.

(cherry picked from commit 74f5def3d4)
2018-08-07 10:12:02 -07:00
Brian C. Lane
e2dd59c6dc Update get_system_repo for dnf
With dnf we iterate the repos and return their names, not the filenames
like we do with yum. Also make the list test more flexible.
2018-08-07 09:22:18 -07:00
Brian C. Lane
991416adf5 Update ConfigParser usage for Py3
SafeConfigParser is now just ConfigParser
2018-08-07 09:22:18 -07:00
Brian C. Lane
ae19bc7343 Use the first enabled system repo for the test
(cherry picked from commit 3fd5e50c80)
2018-08-06 16:56:49 -07:00
Brian C. Lane
aec0e09caa Show more details when the system repo delete test fails
Works fine for me locally, but not in Travis for some reason so let's
get more info.

(cherry picked from commit 26df083bd4)
2018-08-06 16:56:03 -07:00
Brian C. Lane
231a8ed4b2 Update samba and rsync versions for tests 2018-07-18 15:58:48 -07:00
Chris Lumens
e151c8399d Add group-based tests.
(cherry picked from commit ab0655d5a9)
2018-07-18 15:38:40 -07:00
Brian C. Lane
460a277d4e Check the compose templates at startup
Depsolve the packages included in the templates and report any errors
using the /api/status 'msgs' field. This should help narrow down
problems with package sources not being setup correctly.
2018-07-13 10:18:07 -07:00
Brian C. Lane
86c4ef5f45 Allow more than 1 bash build in tests
It is perfectly valid to have more than one build of a package, eg. one
in the release repo and one in the updates repo.
2018-06-21 16:09:47 -07:00
Brian C. Lane
59847db275 Update tests for glusterfs 4.1.* on rawhide 2018-06-21 15:43:17 -07:00
Brian C. Lane
afa89ea657 Fix DNF related issues with source selection
DNF Repo.dump() function cannot be used as a .repo file for dnf due to
it writing baseurl and gpgkey as a list instead of a string. Add a new
function to write this in the correct format, and limited to the fields
we use.

Add a test for the new function.

Fix /projects/source/info to return an error 400 if a nonexistant TOML
source is requested. If JSON is used the error is part of the standard
response.

Update test_server.py to check for the correct error code.
2018-06-04 15:45:36 -07:00
Brian C. Lane
dd8e4d9e99 Fix handling bad source repos and add a test
When adding a source failed it wasn't being removed from the dnf object.
This fixes that, and returns an error when setting up the source fails.
Also adds a test for it.
This also includes detecting rawhide vs. non-rawhide releases and
adjusting the tests accordingly (some of the source names change).
2018-06-04 15:45:36 -07:00
Brian C. Lane
1034cfd9a7 Make sure new sources show up in the source/list output
Also remove an unneeded makedirs from test_server.py
2018-06-04 15:45:36 -07:00
Brian C. Lane
22070dcf42 Update test_server for rawhide
The system repo is 'rawhide' and the 'fedora' and 'updates' repos are
disabled.
2018-06-04 15:45:36 -07:00
Brian C. Lane
6d677b2207 Add support for user defined package sources API
This lives under /api/v0/projects/source/*

See the documentation for details
2018-06-04 15:45:36 -07:00
Brian C. Lane
095829171a Add support for version globs to blueprints
This uses dnf's version__glob filter to implement it. It amounts to '*'
wildcards and '?' for single character matching.
2018-05-18 12:03:26 -07:00
Brian C. Lane
25bec0b50d Add blueprint customization support for hostname and ssh key
This adds support for the optional blueprint section [customizations].

Use it like this:

[customizations]
hostname = yourhostnamehere

[[customiations.sshkey]]
user = root
key = root user key
2018-05-14 13:00:15 -07:00
Brian C. Lane
5c25f98db7 Update test_server for blueprint and Yum to DNF changes. 2018-05-14 13:00:15 -07:00
Brian C. Lane
d31bea7bd3 Use 2to3 to convert the python2 lorax-composer code to python3 2018-05-14 13:00:14 -07:00
Brian C. Lane
4a91936dd2 Add the tests from lorax-composer branch
These currently fail for several reasons and will be adjusted as the
code it ported to this branch.
2018-05-14 13:00:14 -07:00