709 Commits
Author SHA1 Message Date
Rodrigo Chiossi c95763bc4f Release 5.5.2
This release includes the following:
- Fix iterative manifests leaking on minversion
- Enable iterative manifests with 0 file count
- Add support for experimental bundles

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
v5.5.2
2018-12-28 15:20:25 +00:00
Reagan Lopez f5e79c0d86 builder: Experimental bundles
From format 27 onwards, Mixer will recognize bundles with "[Status] : Experimental"
as experimental bundles and mark their status flag as "e" in the Manifest.MoM.

i.e. These bundles will include an "e" in the 2nd position of the manifest flags,
as shown here:

Me.. 4b91c3122e7e32f1e3edb597c6f89ff32cfffd977afb5e5 10 some-bundle

Fixes #497

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2018-12-20 17:06:42 +01:00
John Akre 328947396a Add iterative manifest test for minversions
This test verifies that iterative manifests aren't unintentionally
generated or forwarded into new MoMs by a minversion update.

Signed-off-by: John Akre <john.w.akre@intel.com>
2018-12-20 17:03:33 +01:00
John Akre a2678abc03 create_manifests: Don't leak iterative manifests on minversions
During a minversion update, iterative manifests older than the new
minversion were leaked into the new MoM. Also, format bumps perform
minversion updates, so iterative manifests from an old format could
leak into new formats. This change prevents forwarding iterative
manifests with versions older than the minversion into the new MoM.

Fixes #523

Signed-off-by: John Akre <john.w.akre@intel.com>
2018-12-20 17:03:33 +01:00
John Akre 6facb4b650 Enable iterative manifests with 0 file count
When a bundle is updated to only modify which bundles are included, an
iterative manifest can be generated with 0 files. This change adds a
type field to the Manifest struct to determine when an iterative
manifest is used and allows the creation of iterative manifests with
a 0 file count.

Fixes #516

Signed-off-by: John Akre <john.w.akre@intel.com>
2018-12-06 10:53:40 -08:00
Tudor Marcu 59b24abf8c Release v5.5.1
This release reverts the go modules update until it can be properly
implemented.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v5.5.1
2018-12-04 12:24:51 -08:00
Tudor Marcu 37293bc2e0 Revert "Convert to using go modules for dependency management"
This reverts commit 37ddafa696.

This needs to be implemented properly so mixer and be autospec'd
correctly and still work in Travis CI.
2018-12-04 12:17:46 -08:00
Tudor Marcu 1f84109b48 Revert "Use go mod vendor to manage vendor directory"
This reverts commit c6777502c8.

To make this automatically packageable through autospec we need to do
some more work. The travis environment also needs to be trimmed down to
speed up the build, and building the package should work without network
connection. In the current state, it will not satisfy both travis and
autospec, so reverting this until it can be properly transitioned.
2018-12-04 12:06:03 -08:00
Tudor Marcu cbae09a36c Release v5.5.0
This release includes the following fixes and additions:
- Fix MoM verification with OpenSSL 1.1 requring a purpose to be passed
- Make --config global
- Break root preRun() into smaller parts, with better & simplified logic
- builder: only check online to update upstreamver
- Removed editor option for bundle edit; simply creates new bundles or
  copies existing ones now
- Added bundle_control unit tests
- Convert to using go mod vendor instead of our full vendor directory
- Enable iterative manifest creation for more optimal update content
  creation
- Misc formatting and error fixes

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v5.5.0
2018-12-03 15:31:43 -08:00
Tudor Marcu d1b80ca810 Fix formatting error
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-12-03 14:23:14 -08:00
John Akre b5b7213bc0 swupd: Fix minor style and comment issues
Signed-off-by: John Akre <john.w.akre@intel.com>
2018-11-30 13:27:39 -08:00
John Akre aaee2b55ff format_switch_test: Separate format guard tests
The format guard test for the tranisition from format 25 to 26 became
too large. This test has been split into separate tests for each
feature. These features include minversion, iterative manifests, delta
manifests.

Signed-off-by: John Akre <john.w.akre@intel.com>
2018-11-30 13:27:39 -08:00
John Akre 1c764e7765 Add delta manifest format guard
Similarly to iterative manifests, delta manifests were introduced in
format 26 and should not be used in earlier formats. This change
restricts delta manifest generation in unsupported formats and updates
delta manifest tests to use supported formats.

Signed-off-by: John Akre <john.w.akre@intel.com>
2018-11-30 13:27:39 -08:00
John Akre c4bef69b87 Add iterative manifest format guard
Iterative manifests should only be used on manifests with formats
greater than 25. Adding a format guard to prevent iterative manifest
generation on formats less than or equal to 25. Additionally, this
change updates iterative manifest tests to use formats greater than 25
and adds a test to verify that older formats do not generate iterative
manifests.

Signed-off-by: John Akre <john.w.akre@intel.com>
2018-11-30 13:27:39 -08:00
Otavio Pontes 8617c16bff packs_test: Add a test for cases where delta manifests shouldn't be created
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2018-11-30 13:27:39 -08:00
Otavio Pontes 69fea81031 Introducing the Delta-Manifests
Currently, when updating from version X to Y, in order to apply a delta, swupd
needs to download the Manifest from version X to check which file the
from-hash in delta file is pointing to. Downloading that Manifest some times
is even larger than the delta pack, so reducing the download size would make
a significant improvement in update time.

The Delta-Manifest is a Manifest included in delta packs with all information
from Manifest X in order to apply deltas, i.e., all files that are going to be
used to apply deltas.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2018-11-30 13:27:39 -08:00
Otavio Pontes 17a4d1302d rename: Don't override file type on renames
When renaming, don't override file type in the from-manifest. This
information isn't used anywhere in mixer and it is necessary to create
delta manifests.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2018-11-30 13:27:39 -08:00
Otavio Pontes 11f403f105 create_manifest: Don't create Iterative Manfests on minversions
When we have a minversion, all files from all Manifests are considered
updated and have its version set to the minversion number. In this case
Iterative Manifests will include all files from the full bundle Manifest.
So there's no gain in creating iterative manifests in a minversion.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2018-11-30 13:27:39 -08:00
Otavio Pontes 813b75f72b packs: Don't create packs for Iterative Manifests
Files that are not of type Manifest are not bundles, so we shouldn't create
packs for them.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2018-11-30 13:27:39 -08:00
Otavio Pontes 8a35392a76 Introducing the Iterative to-Manifest
When creating manifests for a new build, also create to-Manifests
for each bundle that has changes in this version.

The goal on publishing to-Manifests is to reduce the download size
on updates, according to what was discussed on
clearlinux/swupd-client#498

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2018-11-30 13:27:39 -08:00
Otavio Pontes 2e70c7f989 test: Add function to check the number of files in a Manifest
This function can be used to check if Iterative don't have more items
that them should.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2018-11-30 13:27:39 -08:00
Otavio Pontes bc38cf5c3a manifest: Create function to append a File and update ContentSize
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2018-11-30 13:27:39 -08:00
John Akre 4270d9185d mixin: prevent removal of clear repo
The clear repo is mandatory for mixin. This change prevents mixin from
removing the clear repo.

Fixes #326

Signed-off-by: John Akre <john.w.akre@intel.com>
2018-11-29 15:49:20 -08:00
Reagan Lopez 8297cfc991 bundles: Add valid bundles and skip invalid ones
`bundle add` will now add valid bundles and skip only the invalid ones,
thereby fixing issue #489.

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2018-11-27 10:13:37 -08:00
Matthew Johnson c6777502c8 Use go mod vendor to manage vendor directory
go mod vendor cleans up the vendor directory to only keep what source
files are actually needed.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-11-27 10:12:18 -08:00
Matthew Johnson 25bfebeb3f travis: update to go 1.11
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-11-27 10:12:18 -08:00
Matthew Johnson a33c8a2867 Makefile: remove required argument to checkcoverage
We are on Go 1.11 now and -coverprofile supports multiple packages.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-11-27 10:12:18 -08:00
Matthew Johnson 37ddafa696 Convert to using go modules for dependency management
This means we can remove local gopath preparation from the Makefile and
will be using the officially sanctioned dependency management system for
Go. We have to leave the vendor directory so we can create the dist
tarball.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-11-27 10:12:18 -08:00
Matthew Johnson a8aec55670 builder: improve isLocalBundle checks based on testing
Some testcases showed these checks were incomplete and not handling
corner cases. Improve the logic of these checks to comply with the new
tests.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-11-21 14:07:37 -08:00
Matthew Johnson 1d90131733 builder: read upstream-bundles from mix workspace
Instead of requiring upstream bundles be read from a child directory
under where mixer is currently run read them from underneath the mixer
workspace (builder.Config.Mixer.VersionPath) the same way local-bundles
is handled.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-11-21 14:07:37 -08:00
Matthew Johnson 3cd63f99ed Start to add bundle_control unit tests
Start to add some unit tests for the bundle_control file. There is much
work to still be done as far as testing goes for these methods.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-11-21 14:07:37 -08:00
Reagan Lopez 7992b45eaa Refactored the tests for bundle commands
- Reordered the tests to reduce code change impacts
- Added more test coverage for `bundle remove`

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2018-11-20 10:54:38 -08: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
Tudor Marcu 2f547c9010 Add bat test for updating mixver offline
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-11-16 15:05:38 -08:00
Tudor Marcu 116c3ada8c builder: Only check online to update upstreamver
Updating mixver should not require a network connection, nor reach out
to the server to find out any more information than is needed.

Fixes #282

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-11-16 15:05:38 -08:00
Rodrigo Chiossi ec17d97d94 cmd: Move init subcommand to its own file
With the exception of init, all other subcommands have their own file.
This patch moves init to a separate file to keep it consistent with the
rest of the code.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-11-16 15:05:06 -08:00
Rodrigo Chiossi ee27092878 cmd: Break root preRun into smaller parts
The root preRun() function accumulated a lot of responsibility over time
that are better located into sub command. This PR deconstructs that
function in order to have a simpler codepath.

Now, the prerun performs only 3 actions:
- Start profiling if needed.
- Check if it is the root command.
- Check if the command should run on a container or not.

The container logic has also been simplified. All commands are not
treated as native commands. During the pre-run, if a command has the
container marker, the current execution is aborted and the command is
re-executed inside a container. This way, the native flag only needs to
be checked once during execution.

Most of the logic in the root preRun() were exclusive to the `build`
subcommand, so they were moved to the build preRun().

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-11-16 15:05:06 -08:00
Rodrigo Chiossi 84653f2386 cmd: make --config a global flag
The --config flag was added to every single subcommand in mixer. Instead
of doing so, make it a global flag.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-11-16 15:05:06 -08:00
Rodrigo Chiossi bd1d4d50f8 cmd: Fix execution of top level mixer command
When mixer is executed without any argument, it should print its usage
message and exit. In order to do so, mixer must skip all it's checks on
the pre-run and just return if the current command is the top level
command alone.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-11-16 15:05:06 -08:00
Patrick McCarty 1f9f87fa18 mixin: fix MoM verification with openssl 1.1
The "-purpose any" option is required now under openssl 1.1.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-11-16 15:04:41 -08:00
Tudor Marcu 49a03d70cc Release v5.4.0
This release of mixer includes various changes around the entire much of
the code base:
- Mixer uses the log package for warnings and errors throughout the code
  to more properly handle writing to correct streams.
- More BAT tests have been added to expand functional test coverage.
- Many unit tests have been added to start getting better coverage for
  the builder package.
- Builder package was broken up from an almost 3000 line file into
  multiple, logical files that are easier to work with.
- Mixer ignores validation for bundle list so it does not fail to list even
  if there is an invalid bundle.
- Increased bsdiff delta timeout to handle large files which *do* create
  deltas, despite the increase in build time. These are typically large
  GCC files which cannot be stripped at this time.
- The build all command supports --increment now instead of auto
  incrementing the mixversion.
- Format bump process was updated to use a new simplified flow, which
  does not require switching tooling back and forth during the build. This
  process is used to peform both upstream and downstream format bumps
  automatically for the user.
- Build image automatically gets the ister template if it does not exist
  and populates it with the bundles from mixbundles.
- No delta packs are created over format bumps. Minversions should have
  delta packs created over them, but not format bumps because clients
  can't update over bump boundaries.
- Misc bug and code structure fixes.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v5.4.0
2018-11-16 14:43:41 -08:00
Matthew Johnson b839630c3d bat: remove unnecessary numbering system
There is no reason to number these tests as bat does not respect the
numbering system and it was obnoxious to try to keep collisions from
happening and keep the descriptions up-to-date.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-11-14 16:29:44 -08:00
Matthew Johnson 4174344b22 bat: update to use new mixer-mixversion-update function
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-11-14 16:29:44 -08:00
Matthew Johnson 711e2a8e7b bat: renumber conflicting tests
We had three 09-* tests, renumber them so we can prove we actually know
how to count when people look at our test directory.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-11-14 16:29:44 -08:00
Matthew Johnson b11de6f6e0 builder: do not create delta-packs over format bumps
Fixes #482
Since clients can't update over format bump boundaries anyways do not
attempt to create delta-packs covering that jump.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-11-14 15:44:25 -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
Reagan Lopez b45ec080aa bundles: Build image with default ister template
This commit fulfills enhancement #58. When building an image without providing a template,
if the default image template is not present in the mix directory, mixer will do the following:
 - Copy image template from ister template "/usr/share/defaults/ister/release-image-config.json".
 - Update image template with the bundle list from "mixbundles" file.
   In case the "mixbundles" file is empty or not present, use ister template as is.
 - Inform the user about the above steps.
 - Continue the existing build process.

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2018-11-13 15:26:39 -08:00
Tudor Marcu 9d90a2745a Update auto format bump for regular users
Users basing their mixes on upstream Clear and not acting as pure OSV's
need to have the correct mixes automatically generated for them. This
creates the two mixes as needed and then resets their upstreamversion to
the version they were attempting to build.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-11-13 15:25:23 -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