Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Fix/bad metadata handling #1510

Merged
merged 6 commits into from
Jan 9, 2020
Merged

Fix/bad metadata handling #1510

merged 6 commits into from
Jan 9, 2020

Conversation

pattivacek
Copy link
Collaborator

This fixes a bug I recently reported and that I believe @kbushgit may have also encountered.

@codecov-io
Copy link

codecov-io commented Jan 8, 2020

Codecov Report

Merging #1510 into master will increase coverage by 0.1%.
The diff coverage is 91.17%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #1510     +/-   ##
========================================
+ Coverage    80.7%   80.8%   +0.1%     
========================================
  Files         184     184             
  Lines       11156   11182     +26     
========================================
+ Hits         9003    9036     +33     
+ Misses       2153    2146      -7
Impacted Files Coverage Δ
src/libaktualizr/utilities/types.cc 73.43% <ø> (+4.68%) ⬆️
src/libaktualizr/utilities/types.h 84.21% <ø> (ø) ⬆️
src/libaktualizr/primary/sotauptaneclient.h 100% <ø> (ø) ⬆️
src/libaktualizr/primary/sotauptaneclient.cc 88.81% <100%> (-0.05%) ⬇️
src/libaktualizr/primary/aktualizr.cc 97.36% <100%> (+0.09%) ⬆️
src/aktualizr_primary/main.cc 83.33% <100%> (+0.92%) ⬆️
src/libaktualizr/primary/results.h 88.46% <70%> (-11.54%) ⬇️
src/libaktualizr/storage/sqlstorage.cc 76.78% <0%> (+0.22%) ⬆️
src/libaktualizr/package_manager/ostreemanager.cc 80.14% <0%> (+1.12%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ff077a7...ea2b787. Read the comment docs.

lbonn
lbonn previously approved these changes Jan 9, 2020
@pattivacek
Copy link
Collaborator Author

Just realized there's a small change I'd like to make to the test I wrote. (No point verifying nothing was installed if we never install anything.)

Previously these statuses were not necessarily obvious unless you ran
with loglevel 0. This just expands the existing log messages with some
additional information.

Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
We weren't informing the server in this particular case.

Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
Previously, checkUpdates() returned any targets that were successfully
matched before one that did not. That was inconsistent, it conflicted
with the Uptane standard, and it caused an unnecessary download call in
UptaneCycle(), which correctly rejected all targets.

Also inform the backend of the installation failure in this case,
although the installation wasn't even attempted.

Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
This way we can report the update failure immediately to the backend.
Note this only applies to UptaneCycle(); API users can still control
when manifests are sent in this case.

Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
Covers that we correctly reject the target and then can continue to get
new updates. Also checks that no updates are reported if any one update
is invalid.

Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
@pattivacek pattivacek merged commit 6f4caea into master Jan 9, 2020
@pattivacek pattivacek deleted the fix/bad-metadata-handling branch January 9, 2020 12:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants