diff --git a/tests/integrationtests/AdaptorAndProxy_test.cpp b/tests/integrationtests/AdaptorAndProxy_test.cpp index 1220b47..96b6020 100644 --- a/tests/integrationtests/AdaptorAndProxy_test.cpp +++ b/tests/integrationtests/AdaptorAndProxy_test.cpp @@ -43,6 +43,8 @@ #include #include +#include + using ::testing::Eq; using ::testing::DoubleEq; using ::testing::Gt; @@ -431,6 +433,13 @@ TEST_F(SdbusTestObject, PingsViaPeerInterface) TEST_F(SdbusTestObject, AnswersMachineUuidViaPeerInterface) { + // If /etc/machine-id does not exist in your system (which is very likely because you have + // a non-systemd Linux), org.freedesktop.DBus.Peer.GetMachineId() will not work. To solve + // this, you can create /etc/machine-id yourself as symlink to /var/lib/dbus/machine-id, + // and then org.freedesktop.DBus.Peer.GetMachineId() will start to work. + if (::access("/etc/machine-id", F_OK) == -1) + GTEST_SKIP() << "/etc/machine-id file does not exist, GetMachineId() will not work"; + ASSERT_NO_THROW(m_proxy->GetMachineId()); }