system: RAUC operation and last error properties
This patch implements getting the current operation and last error from
the RAUC via its D-Bus interface [1].
We need to access those properties in order to provide the data about
installation process in the czechlight-system model.
[1] https://rauc.readthedocs.io/en/v1.4/reference.html#properties
Change-Id: Ie1daf89e11be2d72e1ef5a0c9e80a316ed09ab41
diff --git a/tests/system_rauc.cpp b/tests/system_rauc.cpp
index d2d81b6..a60d0fe 100644
--- a/tests/system_rauc.cpp
+++ b/tests/system_rauc.cpp
@@ -97,6 +97,9 @@
[&fakeRaucInstallCb](int32_t perc, const std::string& msg) { fakeRaucInstallCb.progressCallback(perc, msg); },
[&fakeRaucInstallCb](int32_t retval, const std::string& lastError) { fakeRaucInstallCb.completedCallback(retval, lastError); });
+ REQUIRE(rauc->lastError() == "");
+ REQUIRE(rauc->operation() == "idle");
+
SECTION("Test slot status")
{
REQUIRE(rauc->primarySlot() == primarySlot);
@@ -133,6 +136,7 @@
FAKE_RAUC_OPERATION("idle");
rauc->install("/path/to/bundle");
+ REQUIRE(rauc->operation() == "installing");
SECTION("Invoking another operation before the installation ends")
{
@@ -158,6 +162,10 @@
FAKE_RAUC_OPERATION("idle");
rauc->install("/path/to/bundle");
+ REQUIRE(rauc->operation() == "installing");
waitForCompletionAndBitMore(seq1);
+ REQUIRE(rauc->lastError() == "Failed to download bundle https://10.88.3.11:8000/update.raucb: Transfer failed: error:1408F10B:SSL routines:ssl3_get_record:wrong version number");
}
+
+ REQUIRE(rauc->operation() == "idle");
}