[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r6119 - GNUnet/src/applications/testing
From: |
gnunet |
Subject: |
[GNUnet-SVN] r6119 - GNUnet/src/applications/testing |
Date: |
Wed, 23 Jan 2008 19:05:47 -0700 (MST) |
Author: nevans
Date: 2008-01-23 19:05:47 -0700 (Wed, 23 Jan 2008)
New Revision: 6119
Added:
GNUnet/src/applications/testing/remotetest.c
Modified:
GNUnet/src/applications/testing/testingtest.c
Log:
Added: GNUnet/src/applications/testing/remotetest.c
===================================================================
--- GNUnet/src/applications/testing/remotetest.c
(rev 0)
+++ GNUnet/src/applications/testing/remotetest.c 2008-01-24 02:05:47 UTC
(rev 6119)
@@ -0,0 +1,95 @@
+/*
+ This file is part of GNUnet.
+ (C) 2007 Christian Grothoff (and other contributing authors)
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ GNUnet 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 GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file applications/testing/remotetest.c
+ * @brief testcase for testing library
+ * @author Not Christian Grothoff
+ */
+
+#include "platform.h"
+#include "gnunet_protocols.h"
+#include "gnunet_testing_lib.h"
+
+/**
+ * Testcase
+ * @return 0: ok, -1: error
+ */
+int
+main (int argc, const char **argv)
+{
+ static char *configFile = "/tmp/fake.conf";
+ static char *path;
+ static char *fullpath;
+ int res;
+ struct GNUNET_GC_Configuration *cfg;
+ struct GNUNET_GE_Context *ectx;
+ struct GNUNET_GC_Configuration *hostConfig;
+
+
+static struct GNUNET_CommandLineOption gnunetstatsOptions[] = {
+ GNUNET_COMMAND_LINE_OPTION_CFG_FILE (&configFile), /* -c */
+ GNUNET_COMMAND_LINE_OPTION_HELP (gettext_noop ("Print statistics about
GNUnet operations.")), /* -h */
+ GNUNET_COMMAND_LINE_OPTION_HOSTNAME, /* -H */
+ GNUNET_COMMAND_LINE_OPTION_LOGGING, /* -L */
+ GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ GNUNET_COMMAND_LINE_OPTION_END,
+};
+
+
+
+ res = GNUNET_init (argc,
+ argv,
+ "testingtest",
+ &configFile, gnunetstatsOptions, &ectx, &cfg);
+ if (res == -1)
+ {
+ GNUNET_fini (ectx, cfg);
+ return -1;
+ }
+
+ GNUNET_GC_get_configuration_value_filename(cfg,"","CONFIG","",&path);
+
+ fullpath = GNUNET_malloc(strlen(path) + 64);
+ strcpy(fullpath,path);
+ strcat(fullpath,configFile);
+
+
+
+ if (GNUNET_OK != GNUNET_TESTING_remote_read_config (fullpath,&hostConfig))
+ {
+ printf("Problem with main host configuration file...\n");
+ exit(1);
+ }
+
+ if (GNUNET_TESTING_remote_check_config(&hostConfig) != GNUNET_OK)
+ {
+ printf("Problem with main host configuration file...\n");
+ exit(1);
+ }
+
+ //GNUNET_TESTING_remote_start_daemon(one,two,six,three,four,five);
+
+ GNUNET_TESTING_remote_start_daemons(&hostConfig);
+
+ return GNUNET_OK;
+}
+
+/* end of testingtest.c */
Modified: GNUnet/src/applications/testing/testingtest.c
===================================================================
--- GNUnet/src/applications/testing/testingtest.c 2008-01-24 02:03:45 UTC
(rev 6118)
+++ GNUnet/src/applications/testing/testingtest.c 2008-01-24 02:05:47 UTC
(rev 6119)
@@ -41,40 +41,11 @@
GNUNET_PeerIdentity p2;
char *c1 = NULL;
char *c2 = NULL;
- static char *configFile = "/tmp/fake.conf";
- static char *path;
int ret = 0;
int res;
struct GNUNET_GC_Configuration *cfg;
struct GNUNET_GE_Context *ectx;
-
-static struct GNUNET_CommandLineOption gnunetstatsOptions[] = {
- GNUNET_COMMAND_LINE_OPTION_CFG_FILE (&configFile), /* -c */
- GNUNET_COMMAND_LINE_OPTION_HELP (gettext_noop ("Print statistics about
GNUnet operations.")), /* -h */
- GNUNET_COMMAND_LINE_OPTION_HOSTNAME, /* -H */
- GNUNET_COMMAND_LINE_OPTION_LOGGING, /* -L */
- GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
- GNUNET_COMMAND_LINE_OPTION_END,
-};
-
-
-
- res = GNUNET_init (argc,
- argv,
- "testingtest",
- &configFile, gnunetstatsOptions, &ectx, &cfg);
- if (res == -1)
- {
- GNUNET_fini (ectx, cfg);
- return -1;
- }
-
- GNUNET_GC_get_configuration_value_filename(cfg,"","CONFIG","",&path);
-
- configFile = strcat(path,configFile);
-
-
if (GNUNET_OK != GNUNET_TESTING_start_daemon (12087,
10000,
"/tmp/gnunet-testing-1",
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r6119 - GNUnet/src/applications/testing,
gnunet <=