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

Commit

Permalink
Merge pull request #1421 from advancedtelematic/use-system-info
Browse files Browse the repository at this point in the history
Use latest endpoint for /system_info
  • Loading branch information
pattivacek authored Oct 22, 2019
2 parents a703189 + 806ca05 commit ca422f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/libaktualizr/primary/sotauptaneclient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ data::InstallationResult SotaUptaneClient::PackageInstallSetResult(const Uptane:
void SotaUptaneClient::reportHwInfo() {
Json::Value hw_info = Utils::getHardwareInfo();
if (!hw_info.empty()) {
http->put(config.tls.server + "/core/system_info", hw_info);
http->put(config.tls.server + "/system_info", hw_info);
} else {
LOG_WARNING << "Unable to fetch hardware information from host system.";
}
Expand Down
16 changes: 8 additions & 8 deletions src/libaktualizr/uptane/uptane_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -826,14 +826,6 @@ class HttpFakeProv : public HttpFake {
EXPECT_EQ(data.size(), 1);
EXPECT_EQ(data[0]["name"].asString(), "fake-package");
EXPECT_EQ(data[0]["version"].asString(), "1.0");
} else if (url.find("/core/system_info") != std::string::npos) {
/* Send hardware info to the server. */
system_info_count++;
Json::Value hwinfo = Utils::getHardwareInfo();
EXPECT_EQ(hwinfo["id"].asString(), data["id"].asString());
EXPECT_EQ(hwinfo["description"].asString(), data["description"].asString());
EXPECT_EQ(hwinfo["class"].asString(), data["class"].asString());
EXPECT_EQ(hwinfo["product"].asString(), data["product"].asString());
} else if (url.find("/director/manifest") != std::string::npos) {
/* Get manifest from primary.
* Get primary installation result.
Expand Down Expand Up @@ -871,6 +863,14 @@ class HttpFakeProv : public HttpFake {
EXPECT_EQ(nwinfo["local_ipv4"].asString(), data["local_ipv4"].asString());
EXPECT_EQ(nwinfo["mac"].asString(), data["mac"].asString());
EXPECT_EQ(nwinfo["hostname"].asString(), data["hostname"].asString());
} else if (url.find("/system_info") != std::string::npos) {
/* Send hardware info to the server. */
system_info_count++;
Json::Value hwinfo = Utils::getHardwareInfo();
EXPECT_EQ(hwinfo["id"].asString(), data["id"].asString());
EXPECT_EQ(hwinfo["description"].asString(), data["description"].asString());
EXPECT_EQ(hwinfo["class"].asString(), data["class"].asString());
EXPECT_EQ(hwinfo["product"].asString(), data["product"].asString());
} else {
EXPECT_EQ(0, 1) << "Unexpected put to URL: " << url;
}
Expand Down

0 comments on commit ca422f8

Please sign in to comment.