Ignore changes in selected systemd units
This commit implements a possibility of ignoring changes in specified
systemd unit as proposed by [1]. This can be useful in cases where
some of the units are behaving badly (but not affecting the health
of a whole system).
Add a CLI option `--systemd-ignore-unit` to let user specify which units
should be ignored.
[1]: https://github.com/CESNET/velia/issues/1
Change-Id: I5902151b4ac95bdcd9aacf29c0189fb62537497f
diff --git a/tests/dbus-helpers/dbus_systemd_server.h b/tests/dbus-helpers/dbus_systemd_server.h
index 9dd700f..7961a8b 100644
--- a/tests/dbus-helpers/dbus_systemd_server.h
+++ b/tests/dbus-helpers/dbus_systemd_server.h
@@ -12,13 +12,14 @@
explicit DbusSystemdServer(sdbus::IConnection& connection);
- void createUnit(sdbus::IConnection& connection, const sdbus::ObjectPath& objPath, const std::string& activeState, const std::string& subState);
+ void createUnit(sdbus::IConnection& connection, const std::string& unitName, const sdbus::ObjectPath& objPath, const std::string& activeState, const std::string& subState);
void changeUnitState(const sdbus::ObjectPath& objPath, const std::string& activeState, const std::string& subState);
private:
struct Unit {
- Unit(std::unique_ptr<sdbus::IObject> object, std::string activeState, std::string subState);
+ Unit(std::string unitName, std::unique_ptr<sdbus::IObject> object, std::string activeState, std::string subState);
+ std::string m_unitName;
std::unique_ptr<sdbus::IObject> m_object;
std::string m_activeState;
std::string m_subState;
@@ -28,4 +29,4 @@
std::map<sdbus::ObjectPath, Unit> m_units;
std::vector<UnitStruct> ListUnits();
-};
\ No newline at end of file
+};