summaryrefslogtreecommitdiff
path: root/mesh/main.c
diff options
context:
space:
mode:
authorInga Stotland <inga.stotland@intel.com>2021-03-19 13:38:25 -0700
committerBrian Gix <brian.gix@intel.com>2021-04-10 10:29:27 -0700
commitd9bc40218d3de8f1a02bcc748961c42093b5a375 (patch)
treef7842126351c5363acc6b757c604e3bab8ad7555 /mesh/main.c
parentc4cfcf085ce40af2e90f44f47eff333ef2f670a9 (diff)
downloadbluez-d9bc40218d3de8f1a02bcc748961c42093b5a375.tar.gz
tools/mesh-cfgtest: Non-iteractive test for mesh
This adds a non-interactive test to excercise different datapaths in bluetooth-meshd. The test cases utilize D-Bus based mesh APIs, e.g., to create a new network, import a node, import NetKey, import a remote node.
Diffstat (limited to 'mesh/main.c')
-rw-r--r--mesh/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/mesh/main.c b/mesh/main.c
index 1b466598b..a13866d7e 100644
--- a/mesh/main.c
+++ b/mesh/main.c
@@ -17,7 +17,9 @@
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
+#include <signal.h>
+#include <sys/prctl.h>
#include <sys/stat.h>
#include <ell/ell.h>
@@ -262,7 +264,13 @@ int main(int argc, char *argv[])
if (!detached)
umask(0077);
- dbus = l_dbus_new_default(L_DBUS_SYSTEM_BUS);
+ if (io_type != MESH_IO_TYPE_UNIT_TEST)
+ dbus = l_dbus_new_default(L_DBUS_SYSTEM_BUS);
+ else {
+ dbus = l_dbus_new_default(L_DBUS_SESSION_BUS);
+ prctl(PR_SET_PDEATHSIG, SIGSEGV);
+ }
+
if (!dbus) {
l_error("unable to connect to D-Bus");
status = EXIT_FAILURE;