added TESTING_IGNORE_KEYS
authorSree Harsha Totakura <totakura@in.tum.de>
Mon, 2 Jul 2012 21:39:16 +0000 (21:39 +0000)
committerSree Harsha Totakura <totakura@in.tum.de>
Mon, 2 Jul 2012 21:39:16 +0000 (21:39 +0000)
src/testing/test_testing_defaults.conf
src/testing/test_testing_portreservation.c
src/testing/testing.c

index a89064f81371128df0f6de43c37a7d646da1117c..0705b2d15d4f4bc907b98761c8ac7eaf161ff036 100644 (file)
@@ -9,6 +9,9 @@ PORT = 2564
 PORT = 2565
 PLUGINS = tcp
 
+[transport-tcp]
+TESTING_IGNORE_KEYS = SOMETHING;KEY1;ACCEPT_FROM;
+
 [arm]
 PORT = 2566
 DEFAULTSERVICES = 
index f689f455ab7e1b32ce3e28948b03f7e53896cdd6..4815d47fdad5dc77dd942b9f507bcf574f37b1ba 100644 (file)
@@ -66,7 +66,7 @@ run (void *cls, char *const *args, const char *cfgfile,
   GNUNET_assert (old_port1 == new_port1);
   GNUNET_TESTING_release_port (system, GNUNET_YES, new_port1);
   GNUNET_TESTING_release_port (system, GNUNET_YES, new_port2);
-  GNUNET_TESTING_system_destroy (system, GNUNET_NO);
+  GNUNET_TESTING_system_destroy (system, GNUNET_YES);
 }
 
 
index bba38ead3a57b1a3b8c71847731d42c26fd9faab..87c432fb14f9938e6253500176e6f1a836c301d1 100644 (file)
@@ -614,12 +614,59 @@ static void
 update_config_sections (void *cls,
                         const char *section)
 {
-  struct UpdateContext *uc = cls;
+  struct UpdateContext *uc = cls;  
+  char **ikeys;
+  char *val;
+  char *ptr;
   char *orig_allowed_hosts;
   char *allowed_hosts;
+  uint16_t ikeys_cnt;
+  uint16_t key;
+  
+  ikeys_cnt = 0;
+  val = NULL;
+  if (GNUNET_YES == GNUNET_CONFIGURATION_have_value (uc->cfg, section,
+                                                     "TESTING_IGNORE_KEYS"))
+  {
+    GNUNET_assert 
+      (GNUNET_YES == 
+       GNUNET_CONFIGURATION_get_value_string (uc->cfg, section,
+                                              "TESTING_IGNORE_KEYS", &val));
+    ptr = val;
+    for (ikeys_cnt = 0; NULL != (ptr = strstr (ptr, ";")); ikeys_cnt++)
+      ptr++;
+    if (0 == ikeys_cnt)
+      GNUNET_break (0);
+    else
+    {
+      ikeys = GNUNET_malloc ((sizeof (char *)) * ikeys_cnt);
+      ptr = val;
+      for (key = 0; key < ikeys_cnt; key++)
+      {
+        ikeys[key] = ptr;
+        ptr = strstr (ptr, ";");
+        *ptr = '\0';
+        ptr++;
+      }
+    }
+  }
+  if (0 != ikeys_cnt)
+  {
+    for (key = 0; key < ikeys_cnt; key++)
+    {
+      if (NULL != strstr (ikeys[key], "ACCEPT_FROM"))
+      {
+        GNUNET_free (ikeys);
+        GNUNET_free (val);
+        return;
+      }
+    }
+    GNUNET_free (ikeys);
+  }
+  GNUNET_free_non_null (val);
 
-  if (NULL != strstr (section, "transport-"))
-    return;
+  /* if (NULL != strstr (section, "transport-")) */
+  /*   return; */
 
   if (GNUNET_OK != 
       GNUNET_CONFIGURATION_get_value_string (uc->cfg, section, "ACCEPT_FROM",