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

Fix/ota 3057/metadata matching #1258

Merged
merged 11 commits into from
Jul 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ Our versioning scheme is `YEAR.N` where `N` is incremented whenever a new releas

## [??? (unreleased)]

### Added

- aktualizr-info --wait-until-provisioned flag: [PR](https://github.com/advancedtelematic/aktualizr/pull/1253)
- Target object equality requires that hardware IDs match: [PR](https://github.com/advancedtelematic/aktualizr/pull/1258)
- aktualizr-repo image command now requires a hardware ID: [PR](https://github.com/advancedtelematic/aktualizr/pull/1258)


## [2019.5] - 2019-07-12

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The default versions packaged in recent Debian/Ubuntu releases are generally new

Additional packages are used for non-essential components:

* To build the test suite, you will need `python3-dev python3-openssl python3-venv sqlite3 valgrind`.
* To build the test suite, you will need `net-tools python3-dev python3-openssl python3-venv sqlite3 valgrind`.
* To run the linting tools, you will need `clang clang-format-6.0 clang-tidy-6.0`.
* To build additional documentation, you will need `doxygen graphviz`.
* To build with code coverage, you will need `lcov`.
Expand Down
2 changes: 1 addition & 1 deletion docs/aktualizr-repo.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ aktualizr-repo --path <repo path> --command generate
2. Add a target to the images metadata:
+
```
aktualizr-repo --path <repo path> --command image --filename <image name> --targetname <target name>
aktualizr-repo --path <repo path> --command image --filename <image name> --targetname <target name> --hwid <hardware ID>
```
+
This step can be repeated as many times as necessary for each target. `--targetname` is optional. If it is not provided, it is assumed to be the same as the image name provided to `--filename`.
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ LDFLAGS="-s" "$GITREPO_ROOT/scripts/test.sh"
cp -rf "$GITREPO_ROOT/tests/test_data/prov_selfupdate" "$TEST_INSTALL_DESTDIR"
cp -rf "$GITREPO_ROOT/tests/config/selfupdate.toml" "$TEST_INSTALL_DESTDIR"
cp -rf "$GITREPO_ROOT/scripts/selfupdate_server.py" "$TEST_INSTALL_DESTDIR"
cp -rf "$GITREPO_ROOT/tests/test_data/fake_root" "$TEST_INSTALL_DESTDIR"
cp -rf "$GITREPO_ROOT/tests/test_data/selfupdate_2.0" "$TEST_INSTALL_DESTDIR"
cp -rf "$GITREPO_ROOT/src/aktualizr_repo/run/create_repo.sh" "$TEST_INSTALL_DESTDIR"
cp -rf "$GITREPO_ROOT/src/aktualizr_repo/run/serve_repo.py" "$TEST_INSTALL_DESTDIR"

Expand Down
9 changes: 7 additions & 2 deletions scripts/selfupdate_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@

class Handler(BaseHTTPRequestHandler):
def do_GET(self):
print("GET: " + self.path)
local_path = self.path
print("GET: " + local_path)
# Fix annoying issue where aktualizr-repo generates metadata for the
# images repository in /image but aktualizr expects /repo.
if local_path.startswith("/repo/"):
local_path = local_path.replace('/repo/', '/image/', 1)
self.send_response(200)
self.end_headers()
with open(self.server.base_dir + "/fake_root/repo/" + self.path, "rb") as fl:
with open(self.server.base_dir + "/fake_root/repo/" + local_path, "rb") as fl:
self.wfile.write(bytearray(fl.read()))

def do_POST(self):
Expand Down
5 changes: 5 additions & 0 deletions scripts/test_install_aktualizr_and_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ dpkg-deb -I "$TEST_INSTALL_DESTDIR"/aktualizr*.deb && dpkg -i "$TEST_INSTALL_DES
akt_version=$(aktualizr --version)
(grep "$(cat "$TEST_INSTALL_DESTDIR"/aktualizr-version)" <<< "$akt_version") || (echo "$akt_version"; false)

aktualizr-repo generate --path "$TEST_INSTALL_DESTDIR/fake_root"
aktualizr-repo image --path "$TEST_INSTALL_DESTDIR/fake_root" --targetname selfupdate_2.0 --filename "$TEST_INSTALL_DESTDIR/selfupdate_2.0" --hwid selfupdate-device
aktualizr-repo addtarget --path "$TEST_INSTALL_DESTDIR/fake_root" --targetname selfupdate_2.0 --hwid selfupdate-device --serial 723f79763eda1c753ce565c16862c79acdde32eb922d6662f088083c51ffde66
aktualizr-repo signtargets --path "$TEST_INSTALL_DESTDIR/fake_root"

TEMP_DIR=$(mktemp -d)
mkdir -m 700 -p "$TEMP_DIR/import"
cp "$TEST_INSTALL_DESTDIR"/prov_selfupdate/* "$TEMP_DIR/import"
Expand Down
104 changes: 50 additions & 54 deletions src/aktualizr_info/aktualizr_info_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class AktualizrInfoTest : public ::testing::Test {

virtual void SetUp() {
device_id = "aktualizr-info-test-device_ID-fd1fc55c-3abc-4de8-a2ca-32d455ae9c11";
primary_ecu_serial = "82697cac-f54c-40ea-a8f2-76c203b7bf2f";
primary_ecu_id = "primary-hdwr-e96c08e0-38a0-4903-a021-143cf5427bc9";
primary_ecu_serial = Uptane::EcuSerial("82697cac-f54c-40ea-a8f2-76c203b7bf2f");
primary_hw_id = Uptane::HardwareIdentifier("primary-hdwr-e96c08e0-38a0-4903-a021-143cf5427bc9");

db_storage_->storeDeviceId(device_id);
}
Expand Down Expand Up @@ -76,8 +76,8 @@ class AktualizrInfoTest : public ::testing::Test {
AktualizrInfoProcess aktualizr_info_process_{*this, test_conf_file_};

std::string device_id;
std::string primary_ecu_serial;
std::string primary_ecu_id;
Uptane::EcuSerial primary_ecu_serial = Uptane::EcuSerial::Unknown();
Uptane::HardwareIdentifier primary_hw_id = Uptane::HardwareIdentifier::Unknown();
};

/**
Expand All @@ -96,29 +96,27 @@ class AktualizrInfoTest : public ::testing::Test {
* - [x] Print whether metadata has been fetched from the server, if they were fetched
*/
TEST_F(AktualizrInfoTest, PrintPrimaryAndSecondaryInfo) {
const std::string secondary_ecu_serial = "c6998d3e-2a68-4ac2-817e-4ea6ef87d21f";
const std::string secondary_ecu_id = "secondary-hdwr-af250269-bd6f-4148-9426-4101df7f613a";
const Uptane::EcuSerial secondary_ecu_serial{"c6998d3e-2a68-4ac2-817e-4ea6ef87d21f"};
const Uptane::HardwareIdentifier secondary_hw_id{"secondary-hdwr-af250269-bd6f-4148-9426-4101df7f613a"};
const std::string provisioning_status = "Provisioned on server: yes";
const std::string fetched_metadata = "Fetched metadata: yes";

Json::Value meta_root;
std::string director_root = Utils::jsonToStr(meta_root);

db_storage_->storeEcuSerials(
{{Uptane::EcuSerial(primary_ecu_serial), Uptane::HardwareIdentifier(primary_ecu_id)},
{Uptane::EcuSerial(secondary_ecu_serial), Uptane::HardwareIdentifier(secondary_ecu_id)}});
db_storage_->storeEcuSerials({{primary_ecu_serial, primary_hw_id}, {secondary_ecu_serial, secondary_hw_id}});
db_storage_->storeEcuRegistered();
db_storage_->storeRoot(director_root, Uptane::RepositoryType::Director(), Uptane::Version(1));

aktualizr_info_process_.run();
ASSERT_FALSE(aktualizr_info_output.empty());

EXPECT_NE(aktualizr_info_output.find(device_id), std::string::npos);
EXPECT_NE(aktualizr_info_output.find(primary_ecu_serial), std::string::npos);
EXPECT_NE(aktualizr_info_output.find(primary_ecu_id), std::string::npos);
EXPECT_NE(aktualizr_info_output.find(primary_ecu_serial.ToString()), std::string::npos);
EXPECT_NE(aktualizr_info_output.find(primary_hw_id.ToString()), std::string::npos);

EXPECT_NE(aktualizr_info_output.find(secondary_ecu_serial), std::string::npos);
EXPECT_NE(aktualizr_info_output.find(secondary_ecu_id), std::string::npos);
EXPECT_NE(aktualizr_info_output.find(secondary_ecu_serial.ToString()), std::string::npos);
EXPECT_NE(aktualizr_info_output.find(secondary_hw_id.ToString()), std::string::npos);

EXPECT_NE(aktualizr_info_output.find(provisioning_status), std::string::npos);
EXPECT_NE(aktualizr_info_output.find(fetched_metadata), std::string::npos);
Expand All @@ -136,7 +134,7 @@ TEST_F(AktualizrInfoTest, PrintProvisioningAndMetadataNegative) {
const std::string provisioning_status = "Provisioned on server: no";
const std::string fetched_metadata = "Fetched metadata: no";

db_storage_->storeEcuSerials({{Uptane::EcuSerial(primary_ecu_serial), Uptane::HardwareIdentifier(primary_ecu_id)}});
db_storage_->storeEcuSerials({{primary_ecu_serial, primary_hw_id}});

aktualizr_info_process_.run();
ASSERT_FALSE(aktualizr_info_output.empty());
Expand All @@ -156,24 +154,21 @@ TEST_F(AktualizrInfoTest, PrintProvisioningAndMetadataNegative) {
TEST_F(AktualizrInfoTest, PrintSecondaryNotRegisteredOrRemoved) {
const std::string provisioning_status = "Provisioned on server: yes";

const std::string secondary_ecu_serial = "c6998d3e-2a68-4ac2-817e-4ea6ef87d21f";
const std::string secondary_ecu_id = "secondary-hdwr-af250269-bd6f-4148-9426-4101df7f613a";
const Uptane::EcuSerial secondary_ecu_serial{"c6998d3e-2a68-4ac2-817e-4ea6ef87d21f"};
const Uptane::HardwareIdentifier secondary_hw_id{"secondary-hdwr-af250269-bd6f-4148-9426-4101df7f613a"};

const std::string secondary_ecu_serial_not_reg = "18b018a1-fdda-4461-a281-42237256cc2f";
const std::string secondary_ecu_id_not_reg = "secondary-hdwr-cbce3a7a-7cbb-4da4-9fff-8e10e5c3de98";
const Uptane::EcuSerial secondary_ecu_serial_not_reg{"18b018a1-fdda-4461-a281-42237256cc2f"};
const Uptane::HardwareIdentifier secondary_hw_id_not_reg{"secondary-hdwr-cbce3a7a-7cbb-4da4-9fff-8e10e5c3de98"};

const std::string secondary_ecu_serial_old = "c2191c12-7298-4be3-b781-d223dac7f75e";
const std::string secondary_ecu_id_old = "secondary-hdwr-0ded1c51-d280-49c3-a92b-7ff2c2e91d8c";
const Uptane::EcuSerial secondary_ecu_serial_old{"c2191c12-7298-4be3-b781-d223dac7f75e"};
const Uptane::HardwareIdentifier secondary_hw_id_old{"secondary-hdwr-0ded1c51-d280-49c3-a92b-7ff2c2e91d8c"};

db_storage_->storeEcuSerials(
{{Uptane::EcuSerial(primary_ecu_serial), Uptane::HardwareIdentifier(primary_ecu_id)},
{Uptane::EcuSerial(secondary_ecu_serial), Uptane::HardwareIdentifier(secondary_ecu_id)}});
db_storage_->storeEcuSerials({{primary_ecu_serial, primary_hw_id}, {secondary_ecu_serial, secondary_hw_id}});
db_storage_->storeEcuRegistered();

db_storage_->storeMisconfiguredEcus({{Uptane::EcuSerial(secondary_ecu_serial_not_reg),
Uptane::HardwareIdentifier(secondary_ecu_id_not_reg), EcuState::kNotRegistered},
{Uptane::EcuSerial(secondary_ecu_serial_old),
Uptane::HardwareIdentifier(secondary_ecu_id_old), EcuState::kOld}});
db_storage_->storeMisconfiguredEcus(
{{secondary_ecu_serial_not_reg, secondary_hw_id_not_reg, EcuState::kNotRegistered},
{secondary_ecu_serial_old, secondary_hw_id_old, EcuState::kOld}});

aktualizr_info_process_.run();
ASSERT_FALSE(aktualizr_info_output.empty());
Expand All @@ -197,7 +192,7 @@ TEST_F(AktualizrInfoTest, PrintSecondaryNotRegisteredOrRemoved) {
* - [x] Print root metadata from images repository
*/
TEST_F(AktualizrInfoTest, PrintImageRootMetadata) {
db_storage_->storeEcuSerials({{Uptane::EcuSerial(primary_ecu_serial), Uptane::HardwareIdentifier(primary_ecu_id)}});
db_storage_->storeEcuSerials({{primary_ecu_serial, primary_hw_id}});
db_storage_->storeEcuRegistered();

Json::Value images_root_json;
Expand All @@ -221,7 +216,7 @@ TEST_F(AktualizrInfoTest, PrintImageRootMetadata) {
* - [x] Print targets metadata from images repository
*/
TEST_F(AktualizrInfoTest, PrintImageTargetsMetadata) {
db_storage_->storeEcuSerials({{Uptane::EcuSerial(primary_ecu_serial), Uptane::HardwareIdentifier(primary_ecu_id)}});
db_storage_->storeEcuSerials({{primary_ecu_serial, primary_hw_id}});
db_storage_->storeEcuRegistered();

Json::Value images_root_json;
Expand Down Expand Up @@ -250,7 +245,7 @@ TEST_F(AktualizrInfoTest, PrintImageTargetsMetadata) {
* - [x] Print root metadata from director repository
*/
TEST_F(AktualizrInfoTest, PrintDirectorRootMetadata) {
db_storage_->storeEcuSerials({{Uptane::EcuSerial(primary_ecu_serial), Uptane::HardwareIdentifier(primary_ecu_id)}});
db_storage_->storeEcuSerials({{primary_ecu_serial, primary_hw_id}});
db_storage_->storeEcuRegistered();

Json::Value director_root_json;
Expand All @@ -273,7 +268,7 @@ TEST_F(AktualizrInfoTest, PrintDirectorRootMetadata) {
* - [x] Print targets metadata from director repository
*/
TEST_F(AktualizrInfoTest, PrintDirectorTargetsMetadata) {
db_storage_->storeEcuSerials({{Uptane::EcuSerial(primary_ecu_serial), Uptane::HardwareIdentifier(primary_ecu_id)}});
db_storage_->storeEcuSerials({{primary_ecu_serial, primary_hw_id}});
db_storage_->storeEcuRegistered();

Json::Value director_root_json;
Expand Down Expand Up @@ -303,7 +298,7 @@ TEST_F(AktualizrInfoTest, PrintDirectorTargetsMetadata) {
* - [x] Print ECU private key
*/
TEST_F(AktualizrInfoTest, PrintPrimaryEcuKeys) {
db_storage_->storeEcuSerials({{Uptane::EcuSerial(primary_ecu_serial), Uptane::HardwareIdentifier(primary_ecu_id)}});
db_storage_->storeEcuSerials({{primary_ecu_serial, primary_hw_id}});
db_storage_->storeEcuRegistered();

const std::string public_key = "public-key-1dc766fe-136d-4c6c-bdf4-daa79c49b3c8";
Expand Down Expand Up @@ -339,7 +334,7 @@ TEST_F(AktualizrInfoTest, PrintPrimaryEcuKeys) {
* - [x] Print TLS client private key
*/
TEST_F(AktualizrInfoTest, PrintTlsCredentials) {
db_storage_->storeEcuSerials({{Uptane::EcuSerial(primary_ecu_serial), Uptane::HardwareIdentifier(primary_ecu_id)}});
db_storage_->storeEcuSerials({{primary_ecu_serial, primary_hw_id}});
db_storage_->storeEcuRegistered();

const std::string ca = "ca-ee532748-8837-44f5-9afb-08ba9f534fec";
Expand Down Expand Up @@ -381,17 +376,18 @@ TEST_F(AktualizrInfoTest, PrintTlsCredentials) {
* - [x] Print primary ECU current and pending versions
*/
TEST_F(AktualizrInfoTest, PrintPrimaryEcuCurrentAndPendingVersions) {
db_storage_->storeEcuSerials({{Uptane::EcuSerial(primary_ecu_serial), Uptane::HardwareIdentifier(primary_ecu_id)}});
db_storage_->storeEcuSerials({{primary_ecu_serial, primary_hw_id}});
db_storage_->storeEcuRegistered();

const std::string current_ecu_version = "639a4e39-e6ba-4832-ace4-8b12cf20d562";
const std::string pending_ecu_version = "9636753d-2a09-4c80-8b25-64b2c2d0c4df";

Uptane::EcuMap ecu_map{{primary_ecu_serial, primary_hw_id}};
db_storage_->savePrimaryInstalledVersion(
{"update.bin", {{Uptane::Hash::Type::kSha256, current_ecu_version}}, 1, "corrid"},
{"update.bin", ecu_map, {{Uptane::Hash::Type::kSha256, current_ecu_version}}, 1, "corrid"},
InstalledVersionUpdateMode::kCurrent);
db_storage_->savePrimaryInstalledVersion(
{"update-01.bin", {{Uptane::Hash::Type::kSha256, pending_ecu_version}}, 1, "corrid-01"},
{"update-01.bin", ecu_map, {{Uptane::Hash::Type::kSha256, pending_ecu_version}}, 1, "corrid-01"},
InstalledVersionUpdateMode::kPending);

aktualizr_info_process_.run();
Expand All @@ -410,7 +406,7 @@ TEST_F(AktualizrInfoTest, PrintPrimaryEcuCurrentAndPendingVersions) {
* - [x] Print primary ECU current and pending versions
*/
TEST_F(AktualizrInfoTest, PrintPrimaryEcuCurrentAndPendingVersionsNegative) {
db_storage_->storeEcuSerials({{Uptane::EcuSerial(primary_ecu_serial), Uptane::HardwareIdentifier(primary_ecu_id)}});
db_storage_->storeEcuSerials({{primary_ecu_serial, primary_hw_id}});
db_storage_->storeEcuRegistered();

const std::string pending_ecu_version = "9636753d-2a09-4c80-8b25-64b2c2d0c4df";
Expand All @@ -419,14 +415,15 @@ TEST_F(AktualizrInfoTest, PrintPrimaryEcuCurrentAndPendingVersionsNegative) {
ASSERT_FALSE(aktualizr_info_output.empty());

EXPECT_NE(aktualizr_info_output.find(device_id), std::string::npos);
EXPECT_NE(aktualizr_info_output.find(primary_ecu_serial), std::string::npos);
EXPECT_NE(aktualizr_info_output.find(primary_ecu_id), std::string::npos);
EXPECT_NE(aktualizr_info_output.find(primary_ecu_serial.ToString()), std::string::npos);
EXPECT_NE(aktualizr_info_output.find(primary_hw_id.ToString()), std::string::npos);

EXPECT_NE(aktualizr_info_output.find("No currently running version on primary ecu"), std::string::npos);
EXPECT_EQ(aktualizr_info_output.find("Pending primary ecu version:"), std::string::npos);

Uptane::EcuMap ecu_map{{primary_ecu_serial, primary_hw_id}};
db_storage_->savePrimaryInstalledVersion(
{"update-01.bin", {{Uptane::Hash::Type::kSha256, pending_ecu_version}}, 1, "corrid-01"},
{"update-01.bin", ecu_map, {{Uptane::Hash::Type::kSha256, pending_ecu_version}}, 1, "corrid-01"},
InstalledVersionUpdateMode::kPending);

aktualizr_info_process_.run();
Expand All @@ -436,7 +433,7 @@ TEST_F(AktualizrInfoTest, PrintPrimaryEcuCurrentAndPendingVersionsNegative) {
EXPECT_NE(aktualizr_info_output.find("Pending primary ecu version: " + pending_ecu_version), std::string::npos);

db_storage_->savePrimaryInstalledVersion(
{"update-01.bin", {{Uptane::Hash::Type::kSha256, pending_ecu_version}}, 1, "corrid-01"},
{"update-01.bin", ecu_map, {{Uptane::Hash::Type::kSha256, pending_ecu_version}}, 1, "corrid-01"},
InstalledVersionUpdateMode::kCurrent);

aktualizr_info_process_.run();
Expand All @@ -456,24 +453,25 @@ TEST_F(AktualizrInfoTest, PrintPrimaryEcuCurrentAndPendingVersionsNegative) {
* - [x] Print secondary ECU current and pending versions
*/
TEST_F(AktualizrInfoTest, PrintSecondaryEcuCurrentAndPendingVersions) {
const std::string secondary_ecu_serial = "c6998d3e-2a68-4ac2-817e-4ea6ef87d21f";
const std::string secondary_ecu_id = "secondary-hdwr-af250269-bd6f-4148-9426-4101df7f613a";
const Uptane::EcuSerial secondary_ecu_serial{"c6998d3e-2a68-4ac2-817e-4ea6ef87d21f"};
const Uptane::HardwareIdentifier secondary_hw_id{"secondary-hdwr-af250269-bd6f-4148-9426-4101df7f613a"};
const std::string secondary_ecu_filename = "secondary.file";
const std::string secondary_ecu_filename_update = "secondary.file.update";
const std::string current_ecu_version = "639a4e39-e6ba-4832-ace4-8b12cf20d562";
const std::string pending_ecu_version = "9636753d-2a09-4c80-8b25-64b2c2d0c4df";

db_storage_->storeEcuSerials(
{{Uptane::EcuSerial(primary_ecu_serial), Uptane::HardwareIdentifier(primary_ecu_id)},
{Uptane::EcuSerial(secondary_ecu_serial), Uptane::HardwareIdentifier(secondary_ecu_id)}});
db_storage_->storeEcuSerials({{primary_ecu_serial, primary_hw_id}, {secondary_ecu_serial, secondary_hw_id}});
db_storage_->storeEcuRegistered();

db_storage_->saveInstalledVersion(secondary_ecu_serial,
{secondary_ecu_filename, {{Uptane::Hash::Type::kSha256, current_ecu_version}}, 1},
InstalledVersionUpdateMode::kCurrent);
Uptane::EcuMap ecu_map{{secondary_ecu_serial, secondary_hw_id}};
db_storage_->saveInstalledVersion(
secondary_ecu_serial.ToString(),
{secondary_ecu_filename, ecu_map, {{Uptane::Hash::Type::kSha256, current_ecu_version}}, 1},
InstalledVersionUpdateMode::kCurrent);

db_storage_->saveInstalledVersion(
secondary_ecu_serial, {secondary_ecu_filename_update, {{Uptane::Hash::Type::kSha256, pending_ecu_version}}, 1},
secondary_ecu_serial.ToString(),
{secondary_ecu_filename_update, ecu_map, {{Uptane::Hash::Type::kSha256, pending_ecu_version}}, 1},
InstalledVersionUpdateMode::kPending);

aktualizr_info_process_.run();
Expand All @@ -487,9 +485,7 @@ TEST_F(AktualizrInfoTest, PrintSecondaryEcuCurrentAndPendingVersions) {
// negative test, no any installed images
db_storage_->clearInstalledVersions();
db_storage_->clearEcuSerials();
db_storage_->storeEcuSerials(
{{Uptane::EcuSerial(primary_ecu_serial), Uptane::HardwareIdentifier(primary_ecu_id)},
{Uptane::EcuSerial(secondary_ecu_serial), Uptane::HardwareIdentifier(secondary_ecu_id)}});
db_storage_->storeEcuSerials({{primary_ecu_serial, primary_hw_id}, {secondary_ecu_serial, secondary_hw_id}});

aktualizr_info_process_.run();
ASSERT_FALSE(aktualizr_info_output.empty());
Expand All @@ -503,7 +499,7 @@ TEST_F(AktualizrInfoTest, PrintDeviceNameOnly) {
Json::Value meta_root;
std::string director_root = Utils::jsonToStr(meta_root);

db_storage_->storeEcuSerials({{Uptane::EcuSerial(primary_ecu_serial), Uptane::HardwareIdentifier(primary_ecu_id)}});
db_storage_->storeEcuSerials({{primary_ecu_serial, primary_hw_id}});
db_storage_->storeEcuRegistered();
db_storage_->storeRoot(director_root, Uptane::RepositoryType::Director(), Uptane::Version(1));

Expand Down
3 changes: 2 additions & 1 deletion src/aktualizr_lite/test_lite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ add_target() {
}
EOF
akrepo --command image \
--targetname $name --targetsha256 $sha --targetlength 0 --targetcustom $custom_json
--targetname $name --targetsha256 $sha --targetlength 0 \
--hwid hwid-for-test --targetcustom $custom_json
}

akrepo --command generate --expires 2021-07-04T16:33:27Z
Expand Down
Loading