27 Commits

Author SHA1 Message Date
Rodrigo Chiossi 1bf26901e7 cmd: Remove all uses of deprecated flag --native
Delete all instances of --native from the code.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2019-11-08 17:09:06 +01:00
William Douglas 623c60999b Enable create Manifest deltas in mixer
swupd-server used to support building bsdiff based deltas of manifest
files. This change adds that ability back for bundle manifests with
the 'mixer build delta-manifests' command.
2019-02-12 13:17:59 -02:00
John Akre db9f24ec0d Increase Clear repo default timeout
Since the default Clear repo mirror changed to the cdn, dnf timeouts
occur more frequently. Increasing the timeout to 45 seconds from the
default timeout of 30 seconds.

Signed-off-by: John Akre <john.w.akre@intel.com>
2019-01-29 01:05:22 +01:00
Otavio Pontes 0c9200fb8c Use cdn to download content on mixer
Use cdn instead of download.clearlinux.org as the standard upstream URL,
because it's more reliable. Other usages of download.clearlinux.org were
also changed with the exception of version number downloads. Downloading
version numbers from download.clearlinux.org is still preferred because
we don't need to be concerned with caching.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2019-01-24 01:10:48 +01:00
Reagan Lopez a9b249da53 bundles: Change bundle edit to bundle create
With the removal of the editor feature in `bundle edit`,
the term `edit` is not relevant anymore. Hence, changing it to `create`.
In order to prevent breakage of existing use-cases,
`edit` is aliased to `create`and `--suppress-editor` is made hidden and deprecated.

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2018-11-20 10:54:38 -08:00
Reagan Lopez 7b6d4c22b5 bundles: Remove editor option for bundle edit
`bundle edit` will no longer open the editor. It will just create new bundles or copy existing bundles.
This command will locate the bundle by first looking in local-bundles, and then in upstream-bundles.
If the bundle is only found upstream, the bundle file will be copied to the local-bundles directory.
If the bundle is not found anywhere, a blank template will be created with the correct name.

This commit also fixes issue #448 and increases test coverage for `bundle validate`.

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2018-11-20 10:54:38 -08:00
Matthew Johnson b538ec1c3a test that no delta-packs created over format bumps
Add a bat test that creates a format bump then attempts to create delta
packs over that format bump. Make sure that the delta packs are not
created and that they are not even attempted to be created.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-11-14 15:44:25 -08:00
Tudor Marcu 001ac4b323 Add BAT test for upstream format bump
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-11-13 15:25:23 -08:00
Tudor Marcu db8dcc0f84 Add new format bump bat test
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-11-13 12:18:22 -08:00
Rodrigo Chiossi db42b94225 bat: Improve download-rpm
Instead of relying on a fixed url, use dnf to download the package
from the latest release.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-10-26 19:42:00 +02:00
Rodrigo Chiossi a50b6e6da6 bat: Remove checks for old config
Mixer now always use new-config which is compatible with `mixer config
set`. If the command fails, bat should stop instead of setting the
values for the old format.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-10-26 19:42:00 +02:00
Matthew Johnson 47438addf3 AFB: Add bat test for simplified format bump approach
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-10-09 11:40:40 -07:00
Tudor Marcu a8a0573a51 Set native to false for 5.0.0 release
With native false, mixer will run in a container by default, so update
the bat tests to run native since they already will run in a container.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-07-23 14:39:43 -07:00
Rodrigo Chiossi 165da8f44e config: Set new config as default
Use TOML format as the default mixer format. The INI format can still be
used by setting the --new-config flag to false during init.

This change also makes TOML the default format for the bat tests.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-07-20 15:39:27 -07:00
Tudor Marcu c0e7a72b76 Do not hit the network for some commands
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-07-06 16:03:51 -07:00
Rodrigo Chiossi e314675b30 battest: Add test for format bump
This patch adds temporary tests for the format bump feature. A permanent
test will require the generation of custom docker images with an updated
build of mixer. Until this tooling is available, this test provides a
minimum integrity check on the feature.

The added test checks the operation of a format bump on a real format
boundary. In addition, it checks the integrity of 4 key values:
- image/LasT_VER should point to the +20 version
- Previous version in +20 MoM should point to +0
- Previous version in +10 MoM should point to +0
- FORMAT property in builder.conf should have the +20 format

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-06-25 12:32:34 -07:00
Kevin C. Wells 4fe9b8cd63 Update BATS to use new default bundles flag
The BATS tests relied on the hack that creating an empty mixbundles list
before running 'mixer init' caused the default bundles to be skipped.

This patch uses the new '--no-default-bundles' flag to do this properly.

Signed-off-by: Kevin C. Wells <kevin.c.wells@intel.com>
2018-05-29 12:40:37 -07:00
Rodrigo Chiossi 456073ffd0 battest: Use config name instead of code name
The name used in battests for config set were using the name used in the
code for the properties instead of the name found in the config file
causing the test to fail.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-05-18 10:39:20 -07:00
Rodrigo Chiossi fbf806ab4f battest: Fix property setting for new config
LOCAL_BUNDLE_DIR and LOCAL_REPO_DIR must be added using TOML format.
This patch changes bat tests to try to use new-config for setting the
properties. If it fails, it will fall back to appending INI properties
to the end of the file.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-05-17 13:19:45 -07:00
Rodrigo Chiossi 9b35bdd872 bat-test: Allow global arg via env var
Allow global arguments to be passed to mixer during `make batcheck`
through the $MIXARGS environment variable.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-05-17 13:19:45 -07:00
Matthew Johnson 97e8c70728 Update bat tests to remove deprecated flags
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-04-12 13:31:19 -07:00
Kevin C. Wells eb4a9b7d6d Refactor 'mixer build' bats tests
This patch significantly overhauls the BATS tests for building mixes,
with the goal of reducing redundancy and increasing accuracy.

Each of the following concepts is only tested once:
- Building a mix with a full, real upstream bundle
- Updating the version of a mix (technically tested twice)
- Adding a bundle to a mix
- Removing a bundle from a mix
- Building a mix with a custom local bundle
- Adding a custom package to an upstream bundle
- Adding an upstream package to a custom bundle

Because all but one of the tests use stripped down versions of upstream
bundles for efficiency, they all test:
- Building a mix with a local, edited upstream bundle

This dramatically reduces the number of actual builds that occur.

The test descriptions accurately describe what the tests are actually
doing, and they report if they are using stripped down versions of upstream
bundles.

Signed-off-by: Kevin C. Wells <kevin.c.wells@intel.com>
2018-03-22 17:26:40 -07:00
Kevin C. Wells cf7ccdde2b bat tests: Fix local directory names and rpm paths
The mixerlib file and the CLEANDIRS variable in all of the individual
bat Makefiles still pointed to the old "local" and "rpms" directories in
some locations.

This, made 'make batclean' not clean up directories correctly. This likely
made some of the tests not actually do what they were supposed to do, as it
was looking for rpms in 'local-rpms', but putting them in 'rpms'.

This patch also updates the url for the "json-c" rpm, as the previous url no
longer is active and was to a source rpm.

Signed-off-by: Kevin C. Wells <kevin.c.wells@intel.com>
2018-03-22 10:46:07 -07:00
Matthew Johnson 66392a1e64 Convert chroot/yum references to bundles/dnf
Recent changes deprecated the use of individual bundle chroots when
building bundle contents and moved away from using yum to using dnf.
Because of this much of our variable and file names and comments were
inconsistent with the implementation.

This includes a change to make 'mixer build chroots' an alias to 'mixer
build bundles' and updates to the bat tests to call the new 'mixer build
bundles' command. This is not a breaking change since 'mixer build
chroots' behaves the way it always has (except internally with the
recent changes mentioned).

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-03-12 09:57:17 -07:00
Tudor Marcu 2fc6761727 Updates for new mixer
Touch mixbundles so it does not get autopopulated by init, and use
os-core in the builder.conf so we do not have to include os-core-update.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-03-08 16:32:01 -08:00
Matthew Johnson 3b61e82eab bat: write to buildconf as privileged user
The builder.conf is created and owned by root, so it must be appended to
as root.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-03-08 16:25:53 -08:00
Tudor Marcu 0a87d8cb91 Add BAT tests for mixer command-line testing
These tests should be reporting on the structure and correctness of mixer
and its user interface. Due to them running very slowly on the Travis CI
environment, they are not run by default, but can be run locally with
make batcheck.

This patch also introduces a docker container to do the build, so we do not
have to worry about running this in different environments such as Travis
CI. The tests are thus confined to a strict, well-known workspace,
and we can avoid many dependency problems.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-02-16 16:06:36 -08:00