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

OTA-2488: Make Virtual Secondary use the new configuration way. #1246

Merged
merged 2 commits into from
Jul 4, 2019

Conversation

mike-sul
Copy link
Collaborator

Signed-off-by: Mike Sul ext-mykhaylo.sul@here.com

@mike-sul mike-sul force-pushed the refact/OTA-2488/virtual-secondary-refactory branch from c59aa46 to ea2fb03 Compare June 28, 2019 16:21
@codecov-io
Copy link

codecov-io commented Jun 28, 2019

Codecov Report

Merging #1246 into master will decrease coverage by 0.11%.
The diff coverage is 84.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1246      +/-   ##
==========================================
- Coverage   79.49%   79.37%   -0.12%     
==========================================
  Files         168      167       -1     
  Lines       10144    10134      -10     
==========================================
- Hits         8064     8044      -20     
- Misses       2080     2090      +10
Impacted Files Coverage Δ
src/libaktualizr/uptane/isotpsecondary.h 0% <ø> (ø) ⬆️
src/aktualizr_primary/secondary_config.h 100% <ø> (ø) ⬆️
src/libaktualizr/config/config.h 100% <ø> (ø) ⬆️
src/libaktualizr/primary/aktualizr.h 100% <ø> (ø) ⬆️
src/libaktualizr/config/config.cc 93.63% <ø> (-1.08%) ⬇️
src/libaktualizr/primary/sotauptaneclient.h 100% <ø> (ø) ⬆️
src/libaktualizr/uptane/isotpsecondary.cc 0% <0%> (ø) ⬆️
src/aktualizr_primary/secondary.cc 84.21% <0%> (-3.47%) ⬇️
...c/virtual_secondary/partialverificationsecondary.h 77.77% <100%> (ø)
src/virtual_secondary/virtualsecondary.cc 100% <100%> (ø) ⬆️
... and 20 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 12f8558...cef4c6a. Read the comment docs.

@mike-sul mike-sul force-pushed the refact/OTA-2488/virtual-secondary-refactory branch from ea2fb03 to 007fd98 Compare June 28, 2019 16:53
…e the old SecondaryConfig from libaktualizr

Signed-off-by: Mike Sul <ext-mykhaylo.sul@here.com>
@mike-sul mike-sul force-pushed the refact/OTA-2488/virtual-secondary-refactory branch 2 times, most recently from bfe08ca to f79c04a Compare July 1, 2019 08:18
@mike-sul
Copy link
Collaborator Author

mike-sul commented Jul 1, 2019

  1. VirtualSecondary has been moved out of libaktualizr, as well as ManagedSecondary and PartialVerification since the first is used just by the virtual one and the second one is not used by any component or use case at all;
  2. the new approach to secondaries configuration was applied to the virtual one;
  3. the old approach to secondaries configuration has been removed;
  4. SecondaryInterface has been freed from dependency on the old SecondaryConfig containing each secondary type specifics;
  5. Documentation as well as meta-updater have been updated accordingly

config/sota-local.toml Outdated Show resolved Hide resolved
src/virtual_secondary/CMakeLists.txt Outdated Show resolved Hide resolved
src/aktualizr_primary/CMakeLists.txt Outdated Show resolved Hide resolved
src/aktualizr_primary/secondary_config.h Outdated Show resolved Hide resolved
src/libaktualizr/config/config.h Outdated Show resolved Hide resolved
Aktualizr aktualizr(conf, storage, http);
UptaneTestCommon::TestAktualizr aktualizr(conf, storage, http);
UptaneTestCommon::addDefaultSecondary(conf, temp_dir2, "sec_serial2", "sec_hwid2");
if (boost::filesystem::exists(conf.uptane.secondary_config_file)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this if in an unit test? Shouldn't it fail if the file does not exist?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I saw that a similar code lies in uptane_common_test.h. If I understand correctly, this is a test to verify that adding a secondary works after aktualizr has been instantiated.

If so, a small explanatory comment would be helpful.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is redundant in the test, we actually should verify if the secondary instantiated successfully.

It's required in uptane_common_test.h as this code is shared among many tests including those that does not use secondaries. I will add explanatory comment.

@@ -1,5 +1,5 @@
#ifndef UPTANE_MANAGEDSECONDARY_H_
#define UPTANE_MANAGEDSECONDARY_H_
#ifndef PRIMARY_MANAGEDSECONDARY_H_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include-guard was not updated. VIRTUAL_SECONDARY_MANAGEDSECONDARY_H_?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I did, PRIMARY_MANAGEDSECONDARY_H_ is the one I intended to apply, the first word denotes the namespace.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, my bad that's from our naming conventions and it ends up being a bit confusing here.
It could be prefixed by the directory name but it would get quite big in this case. Or we could keep that.

@@ -1,21 +1,35 @@
#ifndef UPTANE_VIRTUALSECONDARY_H_
#define UPTANE_VIRTUALSECONDARY_H_
#ifndef PRIMARY_VIRTUALSECONDARY_H_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same problem with include guard.

Signed-off-by: Mike Sul <ext-mykhaylo.sul@here.com>
@mike-sul mike-sul force-pushed the refact/OTA-2488/virtual-secondary-refactory branch from 5bb0a62 to cef4c6a Compare July 3, 2019 13:10
@mike-sul
Copy link
Collaborator Author

mike-sul commented Jul 3, 2019

Updated according to the latest comments

@lbonn lbonn merged commit 9c592cf into master Jul 4, 2019
@lbonn lbonn deleted the refact/OTA-2488/virtual-secondary-refactory branch July 4, 2019 10:35
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.

3 participants