sbin_PROGRAMS = connmand
-connmand_SOURCES = main.c connman.h log.c error.c plugin.c profile.c \
- element.c device.c network.c security.c resolver.c \
- storage.c manager.c agent.c rtnl.c dbus.c
+connmand_SOURCES = main.c connman.h log.c selftest.c error.c plugin.c \
+ profile.c element.c device.c network.c security.c \
+ resolver.c storage.c manager.c agent.c rtnl.c dbus.c
if UDEV
connmand_SOURCES += udev.c
static gchar *option_device = NULL;
static gboolean option_detach = TRUE;
+static gboolean option_selftest = FALSE;
static gboolean option_compat = FALSE;
static gboolean option_debug = FALSE;
{ "nodaemon", 'n', G_OPTION_FLAG_REVERSE,
G_OPTION_ARG_NONE, &option_detach,
"Don't fork daemon to background" },
+ { "selftest", 't', 0, G_OPTION_ARG_NONE, &option_selftest,
+ "Run self testing routines" },
{ "compat", 'c', 0, G_OPTION_ARG_NONE, &option_compat,
"Enable Network Manager compatibility" },
{ "debug", 'd', 0, G_OPTION_ARG_NONE, &option_debug,
__connman_log_init(option_detach, option_debug);
+ if (option_selftest == TRUE) {
+ if (__connman_selftest() < 0) {
+ connman_error("Self testing routines failed");
+ goto selftest;
+ }
+ }
+
__connman_storage_init();
__connman_element_init(conn, option_device);
__connman_storage_cleanup();
+selftest:
__connman_log_cleanup();
dbus_connection_unref(conn);
--- /dev/null
+/*
+ *
+ * Connection Manager
+ *
+ * Copyright (C) 2007-2008 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "connman.h"
+
+int __connman_selftest(void)
+{
+ int err;
+
+ connman_info("Start self testing");
+
+ err = 0;
+
+ connman_info("Finished self testing");
+
+ return err;
+}