forked from Kistler-Group/sdbus-cpp
feat: add FreeBSD support (#358)
* chore: don't use systemd headers with elogind In file included from src/VTableUtils.c:27: src/VTableUtils.h:30:10: fatal error: 'systemd/sd-bus.h' file not found #include <systemd/sd-bus.h> ^~~~~~~~~~~~~~~~~~ * chore: add basu support Similar to elogind but also supported on non-Linux. * chore(tests): permit /var/lib/machine-id on non-systemd https://github.com/elogind/elogind/commit/84fdc0fc61c1 https://git.sr.ht/~emersion/basu/commit/8324e6729231 * chore(ci): add simple freebsd job Mainly to cover libc++ and basu. * chore(ci): explicitly pass CMAKE_INSTALL_PREFIX Some sdbus-cpp tests require configuring system bus. However, Linux testing relies on writing outside of prefix in order to affect current system bus instance instead of launching a dedicated one. * chore(tests): respect CMAKE_INSTALL_PREFIX for system bus config DBus isn't part of base system on BSDs, so may not use /etc for configs. Also, testing installation failed as non-root: $ cmake -DBUILD_TESTS=1 -DCMAKE_INSTALL_PREFIX=/tmp/sdbus-cpp_prefix -DTESTS_INSTALL_PATH=/tmp/sdbus-cpp_prefix/tests $ cmake --build . $ cmake --install . [...] CMake Error at tests/cmake_install.cmake:105 (file): file cannot create directory: /etc/dbus-1/system.d. Maybe need administrative privileges. * chore(tests): temporarily skip 1 test on FreeBSD to keep CI happy * chore(ci): run tests in freebsd job
This commit is contained in:
committed by
Stanislav Angelovič
parent
290078d6af
commit
1e2d13a04a
25
.github/workflows/ci.yml
vendored
25
.github/workflows/ci.yml
vendored
@ -48,19 +48,19 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-O0 -g -W -Wextra -Wall -Wnon-virtual-dtor -Werror" -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_TESTS=ON -DENABLE_PERF_TESTS=ON -DENABLE_STRESS_TESTS=ON -DBUILD_CODE_GEN=ON ..
|
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_CXX_FLAGS="-O0 -g -W -Wextra -Wall -Wnon-virtual-dtor -Werror" -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_TESTS=ON -DENABLE_PERF_TESTS=ON -DENABLE_STRESS_TESTS=ON -DBUILD_CODE_GEN=ON ..
|
||||||
- name: configure-release
|
- name: configure-release
|
||||||
if: matrix.build == 'shared-libsystemd' && matrix.os == 'ubuntu-22.04'
|
if: matrix.build == 'shared-libsystemd' && matrix.os == 'ubuntu-22.04'
|
||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_FLAGS="-O3 -DNDEBUG -W -Wextra -Wall -Wnon-virtual-dtor -Werror" -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_TESTS=ON -DENABLE_PERF_TESTS=ON -DENABLE_STRESS_TESTS=ON -DBUILD_CODE_GEN=ON ..
|
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_CXX_FLAGS="-O3 -DNDEBUG -W -Wextra -Wall -Wnon-virtual-dtor -Werror" -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_TESTS=ON -DENABLE_PERF_TESTS=ON -DENABLE_STRESS_TESTS=ON -DBUILD_CODE_GEN=ON ..
|
||||||
- name: configure-with-embedded-libsystemd
|
- name: configure-with-embedded-libsystemd
|
||||||
if: matrix.build == 'embedded-static-libsystemd'
|
if: matrix.build == 'embedded-static-libsystemd'
|
||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_TESTS=ON -DENABLE_PERF_TESTS=ON -DENABLE_STRESS_TESTS=ON -DBUILD_CODE_GEN=ON -DBUILD_LIBSYSTEMD=ON -DLIBSYSTEMD_VERSION=244 ..
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_TESTS=ON -DENABLE_PERF_TESTS=ON -DENABLE_STRESS_TESTS=ON -DBUILD_CODE_GEN=ON -DBUILD_LIBSYSTEMD=ON -DLIBSYSTEMD_VERSION=244 ..
|
||||||
- name: make
|
- name: make
|
||||||
run: |
|
run: |
|
||||||
cd build
|
cd build
|
||||||
@ -84,3 +84,22 @@ jobs:
|
|||||||
build/sdbus-c++*.deb
|
build/sdbus-c++*.deb
|
||||||
build/sdbus-c++*.ddeb
|
build/sdbus-c++*.ddeb
|
||||||
retention-days: 10
|
retention-days: 10
|
||||||
|
freebsd-build:
|
||||||
|
name: build (freebsd, clang/libc++, basu)
|
||||||
|
runs-on: macos-12 # until https://github.com/actions/runner/issues/385
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Test in FreeBSD VM
|
||||||
|
uses: vmactions/freebsd-vm@v0
|
||||||
|
with:
|
||||||
|
copyback: false
|
||||||
|
usesh: true
|
||||||
|
prepare: |
|
||||||
|
pkg install -y cmake ninja pkgconf basu expat googletest
|
||||||
|
run: |
|
||||||
|
cmake -B _build -G Ninja -DBUILD_CODE_GEN=ON -DBUILD_TESTS=ON -DENABLE_PERF_TESTS=ON -DENABLE_STRESS_TESTS=ON
|
||||||
|
cmake --build _build
|
||||||
|
cmake --install _build
|
||||||
|
pkg install -y dbus
|
||||||
|
service dbus onestart
|
||||||
|
ctest --output-on-failure --test-dir _build
|
||||||
|
@ -12,7 +12,7 @@ include(GNUInstallDirs) # Installation directories for `install` command and pkg
|
|||||||
# PERFORMING CHECKS & PREPARING THE DEPENDENCIES
|
# PERFORMING CHECKS & PREPARING THE DEPENDENCIES
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
|
|
||||||
set(LIBSYSTEMD "libsystemd")
|
set(LIBSYSTEMD "systemd")
|
||||||
|
|
||||||
option(BUILD_LIBSYSTEMD "Build libsystemd static library and incorporate it into libsdbus-c++" OFF)
|
option(BUILD_LIBSYSTEMD "Build libsystemd static library and incorporate it into libsdbus-c++" OFF)
|
||||||
|
|
||||||
@ -23,9 +23,15 @@ if(NOT BUILD_LIBSYSTEMD)
|
|||||||
message(WARNING "libsystemd not found, checking for libelogind instead")
|
message(WARNING "libsystemd not found, checking for libelogind instead")
|
||||||
pkg_check_modules(Systemd IMPORTED_TARGET GLOBAL libelogind>=236)
|
pkg_check_modules(Systemd IMPORTED_TARGET GLOBAL libelogind>=236)
|
||||||
if(TARGET PkgConfig::Systemd)
|
if(TARGET PkgConfig::Systemd)
|
||||||
set(LIBSYSTEMD "libelogind")
|
set(LIBSYSTEMD "elogind")
|
||||||
string(REPLACE "." ";" VERSION_LIST ${Systemd_VERSION})
|
string(REPLACE "." ";" VERSION_LIST ${Systemd_VERSION})
|
||||||
list(GET VERSION_LIST 0 Systemd_VERSION)
|
list(GET VERSION_LIST 0 Systemd_VERSION)
|
||||||
|
else()
|
||||||
|
message(WARNING "libelogind not found, checking for basu instead")
|
||||||
|
pkg_check_modules(Systemd IMPORTED_TARGET GLOBAL basu)
|
||||||
|
set(LIBSYSTEMD "basu")
|
||||||
|
# https://git.sr.ht/~emersion/basu/commit/d4d185d29a26
|
||||||
|
set(Systemd_VERSION "240")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(NOT TARGET PkgConfig::Systemd)
|
if(NOT TARGET PkgConfig::Systemd)
|
||||||
@ -116,7 +122,11 @@ endif()
|
|||||||
|
|
||||||
# Having an object target allows unit tests to reuse already built sources without re-building
|
# Having an object target allows unit tests to reuse already built sources without re-building
|
||||||
add_library(sdbus-c++-objlib OBJECT ${SDBUSCPP_SRCS})
|
add_library(sdbus-c++-objlib OBJECT ${SDBUSCPP_SRCS})
|
||||||
target_compile_definitions(sdbus-c++-objlib PRIVATE BUILD_LIB=1 LIBSYSTEMD_VERSION=${LIBSYSTEMD_VERSION})
|
target_compile_definitions(sdbus-c++-objlib PRIVATE
|
||||||
|
BUILD_LIB=1
|
||||||
|
LIBSYSTEMD_VERSION=${LIBSYSTEMD_VERSION}
|
||||||
|
SDBUS_${LIBSYSTEMD}
|
||||||
|
SDBUS_HEADER=<${LIBSYSTEMD}/sd-bus.h>)
|
||||||
target_include_directories(sdbus-c++-objlib PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
target_include_directories(sdbus-c++-objlib PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>)
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>)
|
||||||
if(DEFINED BUILD_SHARED_LIBS)
|
if(DEFINED BUILD_SHARED_LIBS)
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include <sdbus-c++/Message.h>
|
#include <sdbus-c++/Message.h>
|
||||||
#include <sdbus-c++/Error.h>
|
#include <sdbus-c++/Error.h>
|
||||||
#include "ScopeGuard.h"
|
#include "ScopeGuard.h"
|
||||||
#include <systemd/sd-bus.h>
|
#include SDBUS_HEADER
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <sys/eventfd.h>
|
#include <sys/eventfd.h>
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include "IConnection.h"
|
#include "IConnection.h"
|
||||||
#include "ScopeGuard.h"
|
#include "ScopeGuard.h"
|
||||||
#include "ISdBus.h"
|
#include "ISdBus.h"
|
||||||
#include <systemd/sd-bus.h>
|
#include SDBUS_HEADER
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sdbus-c++/Error.h>
|
#include <sdbus-c++/Error.h>
|
||||||
#include <systemd/sd-bus.h>
|
#include SDBUS_HEADER
|
||||||
#include "ScopeGuard.h"
|
#include "ScopeGuard.h"
|
||||||
|
|
||||||
namespace sdbus
|
namespace sdbus
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sdbus-c++/Flags.h>
|
#include <sdbus-c++/Flags.h>
|
||||||
#include <systemd/sd-bus.h>
|
#include SDBUS_HEADER
|
||||||
|
|
||||||
namespace sdbus
|
namespace sdbus
|
||||||
{
|
{
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#define SDBUS_CXX_INTERNAL_ICONNECTION_H_
|
#define SDBUS_CXX_INTERNAL_ICONNECTION_H_
|
||||||
|
|
||||||
#include <sdbus-c++/IConnection.h>
|
#include <sdbus-c++/IConnection.h>
|
||||||
#include <systemd/sd-bus.h>
|
#include SDBUS_HEADER
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#ifndef SDBUS_CXX_ISDBUS_H
|
#ifndef SDBUS_CXX_ISDBUS_H
|
||||||
#define SDBUS_CXX_ISDBUS_H
|
#define SDBUS_CXX_ISDBUS_H
|
||||||
|
|
||||||
#include <systemd/sd-bus.h>
|
#include SDBUS_HEADER
|
||||||
|
|
||||||
namespace sdbus::internal {
|
namespace sdbus::internal {
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include "ISdBus.h"
|
#include "ISdBus.h"
|
||||||
#include "IConnection.h"
|
#include "IConnection.h"
|
||||||
#include "ScopeGuard.h"
|
#include "ScopeGuard.h"
|
||||||
#include <systemd/sd-bus.h>
|
#include SDBUS_HEADER
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
namespace sdbus {
|
namespace sdbus {
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include "IConnection.h"
|
#include "IConnection.h"
|
||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
#include "VTableUtils.h"
|
#include "VTableUtils.h"
|
||||||
#include <systemd/sd-bus.h>
|
#include SDBUS_HEADER
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include <sdbus-c++/IObject.h>
|
#include <sdbus-c++/IObject.h>
|
||||||
#include "IConnection.h"
|
#include "IConnection.h"
|
||||||
#include <systemd/sd-bus.h>
|
#include SDBUS_HEADER
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include "sdbus-c++/IConnection.h"
|
#include "sdbus-c++/IConnection.h"
|
||||||
#include "sdbus-c++/Error.h"
|
#include "sdbus-c++/Error.h"
|
||||||
#include "ScopeGuard.h"
|
#include "ScopeGuard.h"
|
||||||
#include <systemd/sd-bus.h>
|
#include SDBUS_HEADER
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include <sdbus-c++/IProxy.h>
|
#include <sdbus-c++/IProxy.h>
|
||||||
#include "IConnection.h"
|
#include "IConnection.h"
|
||||||
#include <systemd/sd-bus.h>
|
#include SDBUS_HEADER
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
@ -224,7 +224,12 @@ int SdBus::sd_bus_open_user_with_address(sd_bus **ret, const char* address)
|
|||||||
|
|
||||||
int SdBus::sd_bus_open_system_remote(sd_bus **ret, const char *host)
|
int SdBus::sd_bus_open_system_remote(sd_bus **ret, const char *host)
|
||||||
{
|
{
|
||||||
|
#ifdef SDBUS_basu
|
||||||
|
// https://git.sr.ht/~emersion/basu/commit/01d33b244eb6
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
#else
|
||||||
return ::sd_bus_open_system_remote(ret, host);
|
return ::sd_bus_open_system_remote(ret, host);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int SdBus::sd_bus_request_name(sd_bus *bus, const char *name, uint64_t flags)
|
int SdBus::sd_bus_request_name(sd_bus *bus, const char *name, uint64_t flags)
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include <sdbus-c++/Types.h>
|
#include <sdbus-c++/Types.h>
|
||||||
#include <sdbus-c++/Error.h>
|
#include <sdbus-c++/Error.h>
|
||||||
#include "MessageUtils.h"
|
#include "MessageUtils.h"
|
||||||
#include <systemd/sd-bus.h>
|
#include SDBUS_HEADER
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
namespace sdbus {
|
namespace sdbus {
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#define SDBUS_CXX_INTERNAL_UTILS_H_
|
#define SDBUS_CXX_INTERNAL_UTILS_H_
|
||||||
|
|
||||||
#include <sdbus-c++/Error.h>
|
#include <sdbus-c++/Error.h>
|
||||||
#include <systemd/sd-bus.h>
|
#include SDBUS_HEADER
|
||||||
|
|
||||||
#if LIBSYSTEMD_VERSION>=246
|
#if LIBSYSTEMD_VERSION>=246
|
||||||
#define SDBUS_CHECK_OBJECT_PATH(_PATH) \
|
#define SDBUS_CHECK_OBJECT_PATH(_PATH) \
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "VTableUtils.h"
|
#include "VTableUtils.h"
|
||||||
#include <systemd/sd-bus.h>
|
#include SDBUS_HEADER
|
||||||
|
|
||||||
sd_bus_vtable createVTableStartItem(uint64_t flags)
|
sd_bus_vtable createVTableStartItem(uint64_t flags)
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#ifndef SDBUS_CXX_INTERNAL_VTABLEUTILS_H_
|
#ifndef SDBUS_CXX_INTERNAL_VTABLEUTILS_H_
|
||||||
#define SDBUS_CXX_INTERNAL_VTABLEUTILS_H_
|
#define SDBUS_CXX_INTERNAL_VTABLEUTILS_H_
|
||||||
|
|
||||||
#include <systemd/sd-bus.h>
|
#include SDBUS_HEADER
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -104,7 +104,9 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
|||||||
#----------------------------------
|
#----------------------------------
|
||||||
|
|
||||||
add_executable(sdbus-c++-unit-tests ${UNITTESTS_SRCS})
|
add_executable(sdbus-c++-unit-tests ${UNITTESTS_SRCS})
|
||||||
target_compile_definitions(sdbus-c++-unit-tests PRIVATE LIBSYSTEMD_VERSION=${LIBSYSTEMD_VERSION})
|
target_compile_definitions(sdbus-c++-unit-tests PRIVATE
|
||||||
|
LIBSYSTEMD_VERSION=${LIBSYSTEMD_VERSION}
|
||||||
|
SDBUS_HEADER=<${LIBSYSTEMD}/sd-bus.h>)
|
||||||
target_link_libraries(sdbus-c++-unit-tests sdbus-c++-objlib GTest::gmock)
|
target_link_libraries(sdbus-c++-unit-tests sdbus-c++-objlib GTest::gmock)
|
||||||
|
|
||||||
add_executable(sdbus-c++-integration-tests ${INTEGRATIONTESTS_SRCS})
|
add_executable(sdbus-c++-integration-tests ${INTEGRATIONTESTS_SRCS})
|
||||||
@ -138,21 +140,22 @@ endif()
|
|||||||
# INSTALLATION
|
# INSTALLATION
|
||||||
#----------------------------------
|
#----------------------------------
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
set(TESTS_INSTALL_PATH "/opt/test/bin" CACHE STRING "Specifies where the test binaries will be installed")
|
set(TESTS_INSTALL_PATH "/opt/test/bin" CACHE STRING "Specifies where the test binaries will be installed")
|
||||||
|
|
||||||
install(TARGETS sdbus-c++-unit-tests DESTINATION ${TESTS_INSTALL_PATH} COMPONENT test)
|
install(TARGETS sdbus-c++-unit-tests DESTINATION ${TESTS_INSTALL_PATH} COMPONENT test)
|
||||||
install(TARGETS sdbus-c++-integration-tests DESTINATION ${TESTS_INSTALL_PATH} COMPONENT test)
|
install(TARGETS sdbus-c++-integration-tests DESTINATION ${TESTS_INSTALL_PATH} COMPONENT test)
|
||||||
install(FILES ${INTEGRATIONTESTS_SOURCE_DIR}/files/org.sdbuscpp.integrationtests.conf DESTINATION /etc/dbus-1/system.d COMPONENT test)
|
install(FILES ${INTEGRATIONTESTS_SOURCE_DIR}/files/org.sdbuscpp.integrationtests.conf DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/dbus-1/system.d COMPONENT test)
|
||||||
|
|
||||||
if(ENABLE_PERF_TESTS)
|
if(ENABLE_PERF_TESTS)
|
||||||
install(TARGETS sdbus-c++-perf-tests-client DESTINATION ${TESTS_INSTALL_PATH} COMPONENT test)
|
install(TARGETS sdbus-c++-perf-tests-client DESTINATION ${TESTS_INSTALL_PATH} COMPONENT test)
|
||||||
install(TARGETS sdbus-c++-perf-tests-server DESTINATION ${TESTS_INSTALL_PATH} COMPONENT test)
|
install(TARGETS sdbus-c++-perf-tests-server DESTINATION ${TESTS_INSTALL_PATH} COMPONENT test)
|
||||||
install(FILES ${PERFTESTS_SOURCE_DIR}/files/org.sdbuscpp.perftests.conf DESTINATION /etc/dbus-1/system.d COMPONENT test)
|
install(FILES ${PERFTESTS_SOURCE_DIR}/files/org.sdbuscpp.perftests.conf DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/dbus-1/system.d COMPONENT test)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_STRESS_TESTS)
|
if(ENABLE_STRESS_TESTS)
|
||||||
install(TARGETS sdbus-c++-stress-tests DESTINATION ${TESTS_INSTALL_PATH} COMPONENT test)
|
install(TARGETS sdbus-c++-stress-tests DESTINATION ${TESTS_INSTALL_PATH} COMPONENT test)
|
||||||
install(FILES ${STRESSTESTS_SOURCE_DIR}/files/org.sdbuscpp.stresstests.conf DESTINATION /etc/dbus-1/system.d COMPONENT test)
|
install(FILES ${STRESSTESTS_SOURCE_DIR}/files/org.sdbuscpp.stresstests.conf DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/dbus-1/system.d COMPONENT test)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#----------------------------------
|
#----------------------------------
|
||||||
|
@ -277,6 +277,10 @@ TEST_F(SdbusTestObject, CannotSetGeneralMethodTimeoutWithLibsystemdVersionLessTh
|
|||||||
|
|
||||||
TEST_F(SdbusTestObject, CanCallMethodSynchronouslyWithoutAnEventLoopThread)
|
TEST_F(SdbusTestObject, CanCallMethodSynchronouslyWithoutAnEventLoopThread)
|
||||||
{
|
{
|
||||||
|
#if defined(__clang__) && defined(__FreeBSD__)
|
||||||
|
GTEST_SKIP() << "https://github.com/Kistler-Group/sdbus-cpp/issues/359";
|
||||||
|
#endif
|
||||||
|
|
||||||
auto proxy = std::make_unique<TestProxy>(BUS_NAME, OBJECT_PATH, sdbus::dont_run_event_loop_thread);
|
auto proxy = std::make_unique<TestProxy>(BUS_NAME, OBJECT_PATH, sdbus::dont_run_event_loop_thread);
|
||||||
|
|
||||||
auto multiplyRes = proxy->multiply(INT64_VALUE, DOUBLE_VALUE);
|
auto multiplyRes = proxy->multiply(INT64_VALUE, DOUBLE_VALUE);
|
||||||
|
@ -61,12 +61,9 @@ TEST_F(SdbusTestObject, PingsViaPeerInterface)
|
|||||||
|
|
||||||
TEST_F(SdbusTestObject, AnswersMachineUuidViaPeerInterface)
|
TEST_F(SdbusTestObject, AnswersMachineUuidViaPeerInterface)
|
||||||
{
|
{
|
||||||
// If /etc/machine-id does not exist in your system (which is very likely because you have
|
if (::access("/etc/machine-id", F_OK) == -1 &&
|
||||||
// a non-systemd Linux), org.freedesktop.DBus.Peer.GetMachineId() will not work. To solve
|
::access("/var/lib/dbus/machine-id", F_OK) == -1)
|
||||||
// this, you can create /etc/machine-id yourself as symlink to /var/lib/dbus/machine-id,
|
GTEST_SKIP() << "/etc/machine-id and /var/lib/dbus/machine-id files do not exist, GetMachineId() will not work";
|
||||||
// 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());
|
ASSERT_NO_THROW(m_proxy->GetMachineId());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user