Remove selftest file and option
authorSamuel Ortiz <sameo@linux.intel.com>
Thu, 2 Dec 2010 16:56:16 +0000 (17:56 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 2 Dec 2010 16:56:16 +0000 (17:56 +0100)
Makefile.am
src/connman.h
src/main.c
src/resolver.c
src/selftest.c [deleted file]

index b31cf72..b1cbdce 100644 (file)
@@ -62,7 +62,7 @@ src_connmand_SOURCES = $(gdbus_sources) $(gdhcp_sources) \
                        gweb/gresolv.h gweb/gresolv.c \
                        gweb/giognutls.h gweb/gionotls.c \
                        $(builtin_sources) src/connman.ver \
-                       src/main.c src/connman.h src/log.c src/selftest.c \
+                       src/main.c src/connman.h src/log.c \
                        src/error.c src/plugin.c src/task.c src/element.c \
                        src/device.c src/network.c src/connection.c \
                        src/manager.c src/profile.c src/service.c \
index 6e2105a..4fa9050 100644 (file)
@@ -53,8 +53,6 @@ DBusMessage *__connman_error_operation_timeout(DBusMessage *msg);
 DBusMessage *__connman_error_invalid_service(DBusMessage *msg);
 DBusMessage *__connman_error_invalid_property(DBusMessage *msg);
 
-int __connman_selftest(void);
-
 #include <connman/types.h>
 
 int __connman_manager_init(gboolean compat);
@@ -128,8 +126,6 @@ void __connman_rfkill_cleanup(void);
 int __connman_resolver_init(void);
 void __connman_resolver_cleanup(void);
 
-int __connman_resolver_selftest(void);
-
 #include <connman/storage.h>
 
 int __connman_storage_init(void);
index 56675bd..6cdf59e 100644 (file)
@@ -64,7 +64,6 @@ static gchar *option_noplugin = NULL;
 static gchar *option_wifi = NULL;
 static gboolean option_detach = TRUE;
 static gboolean option_compat = FALSE;
-static gboolean option_selftest = FALSE;
 static gboolean option_version = FALSE;
 
 static gboolean parse_debug(const char *key, const char *value,
@@ -97,8 +96,6 @@ static GOptionEntry options[] = {
                                "Don't fork daemon to background" },
        { "compat", 'c', 0, G_OPTION_ARG_NONE, &option_compat,
                                "Enable Network Manager compatibility" },
-       { "selftest", 't', 0, G_OPTION_ARG_NONE, &option_selftest,
-                               "Run self testing routines" },
        { "version", 'v', 0, G_OPTION_ARG_NONE, &option_version,
                                "Show version information and exit" },
        { NULL },
@@ -212,13 +209,6 @@ int main(int argc, char *argv[])
 
        __connman_log_init(option_debug, option_detach);
 
-       if (option_selftest == TRUE) {
-               if (__connman_selftest() < 0) {
-                       connman_error("Self testing routines failed");
-                       goto selftest;
-               }
-       }
-
        __connman_dbus_init(conn);
 
        __connman_storage_init();
@@ -287,7 +277,6 @@ int main(int argc, char *argv[])
 
        __connman_dbus_cleanup();
 
-selftest:
        __connman_log_cleanup();
 
        dbus_connection_unref(conn);
index 8957645..8a4dd1c 100644 (file)
@@ -312,49 +312,6 @@ void connman_resolver_flush(void)
        return;
 }
 
-static int selftest_append(const char *interface, const char *domain,
-                                                       const char *server)
-{
-       DBG("server %s", server);
-
-       return 0;
-}
-
-static int selftest_remove(const char *interface, const char *domain,
-                                                       const char *server)
-{
-       DBG("server %s", server);
-
-       return 0;
-}
-
-static struct connman_resolver selftest_resolver = {
-       .name     = "selftest",
-       .priority = CONNMAN_RESOLVER_PRIORITY_HIGH + 42,
-       .append   = selftest_append,
-       .remove   = selftest_remove,
-};
-
-int __connman_resolver_selftest(void)
-{
-       connman_resolver_append("wlan0", "lwn.net", "192.168.0.1");
-
-       connman_resolver_register(&selftest_resolver);
-
-       connman_resolver_append("eth0", "connman.net", "192.168.42.1");
-       connman_resolver_append("wlan0", "lwn.net", "192.168.0.2");
-
-       connman_resolver_append_public_server("8.8.8.8");
-
-       connman_resolver_remove_public_server("8.8.8.8");
-
-       connman_resolver_remove_all("wlan0");
-
-       connman_resolver_unregister(&selftest_resolver);
-
-       return 0;
-}
-
 struct resolvfile_entry {
        char *interface;
        char *domain;
diff --git a/src/selftest.c b/src/selftest.c
deleted file mode 100644 (file)
index f1500ec..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- *  Connection Manager
- *
- *  Copyright (C) 2007-2010  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");
-
-       connman_info("Testing resolver unit");
-       err = __connman_resolver_selftest();
-       if (err < 0)
-               goto done;
-
-done:
-       connman_info("Finished self testing");
-
-       return err;
-}