aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-07-02 21:39:16 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-07-02 21:39:16 +0000
commitcd5d883c4068daff30217ae8ec93ba2fb10a699a (patch)
tree7380aa21bb255caddf0e33f15f070fb2aa94faf6 /src/testing
parent39d195cdbb82baaf20714841d87f865caea5573d (diff)
downloadgnunet-cd5d883c4068daff30217ae8ec93ba2fb10a699a.tar.gz
gnunet-cd5d883c4068daff30217ae8ec93ba2fb10a699a.zip
added TESTING_IGNORE_KEYS
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_testing_defaults.conf3
-rw-r--r--src/testing/test_testing_portreservation.c2
-rw-r--r--src/testing/testing.c53
3 files changed, 54 insertions, 4 deletions
diff --git a/src/testing/test_testing_defaults.conf b/src/testing/test_testing_defaults.conf
index a89064f81..0705b2d15 100644
--- a/src/testing/test_testing_defaults.conf
+++ b/src/testing/test_testing_defaults.conf
@@ -9,6 +9,9 @@ PORT = 2564
9PORT = 2565 9PORT = 2565
10PLUGINS = tcp 10PLUGINS = tcp
11 11
12[transport-tcp]
13TESTING_IGNORE_KEYS = SOMETHING;KEY1;ACCEPT_FROM;
14
12[arm] 15[arm]
13PORT = 2566 16PORT = 2566
14DEFAULTSERVICES = 17DEFAULTSERVICES =
diff --git a/src/testing/test_testing_portreservation.c b/src/testing/test_testing_portreservation.c
index f689f455a..4815d47fd 100644
--- a/src/testing/test_testing_portreservation.c
+++ b/src/testing/test_testing_portreservation.c
@@ -66,7 +66,7 @@ run (void *cls, char *const *args, const char *cfgfile,
66 GNUNET_assert (old_port1 == new_port1); 66 GNUNET_assert (old_port1 == new_port1);
67 GNUNET_TESTING_release_port (system, GNUNET_YES, new_port1); 67 GNUNET_TESTING_release_port (system, GNUNET_YES, new_port1);
68 GNUNET_TESTING_release_port (system, GNUNET_YES, new_port2); 68 GNUNET_TESTING_release_port (system, GNUNET_YES, new_port2);
69 GNUNET_TESTING_system_destroy (system, GNUNET_NO); 69 GNUNET_TESTING_system_destroy (system, GNUNET_YES);
70} 70}
71 71
72 72
diff --git a/src/testing/testing.c b/src/testing/testing.c
index bba38ead3..87c432fb1 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -614,12 +614,59 @@ static void
614update_config_sections (void *cls, 614update_config_sections (void *cls,
615 const char *section) 615 const char *section)
616{ 616{
617 struct UpdateContext *uc = cls; 617 struct UpdateContext *uc = cls;
618 char **ikeys;
619 char *val;
620 char *ptr;
618 char *orig_allowed_hosts; 621 char *orig_allowed_hosts;
619 char *allowed_hosts; 622 char *allowed_hosts;
623 uint16_t ikeys_cnt;
624 uint16_t key;
625
626 ikeys_cnt = 0;
627 val = NULL;
628 if (GNUNET_YES == GNUNET_CONFIGURATION_have_value (uc->cfg, section,
629 "TESTING_IGNORE_KEYS"))
630 {
631 GNUNET_assert
632 (GNUNET_YES ==
633 GNUNET_CONFIGURATION_get_value_string (uc->cfg, section,
634 "TESTING_IGNORE_KEYS", &val));
635 ptr = val;
636 for (ikeys_cnt = 0; NULL != (ptr = strstr (ptr, ";")); ikeys_cnt++)
637 ptr++;
638 if (0 == ikeys_cnt)
639 GNUNET_break (0);
640 else
641 {
642 ikeys = GNUNET_malloc ((sizeof (char *)) * ikeys_cnt);
643 ptr = val;
644 for (key = 0; key < ikeys_cnt; key++)
645 {
646 ikeys[key] = ptr;
647 ptr = strstr (ptr, ";");
648 *ptr = '\0';
649 ptr++;
650 }
651 }
652 }
653 if (0 != ikeys_cnt)
654 {
655 for (key = 0; key < ikeys_cnt; key++)
656 {
657 if (NULL != strstr (ikeys[key], "ACCEPT_FROM"))
658 {
659 GNUNET_free (ikeys);
660 GNUNET_free (val);
661 return;
662 }
663 }
664 GNUNET_free (ikeys);
665 }
666 GNUNET_free_non_null (val);
620 667
621 if (NULL != strstr (section, "transport-")) 668 /* if (NULL != strstr (section, "transport-")) */
622 return; 669 /* return; */
623 670
624 if (GNUNET_OK != 671 if (GNUNET_OK !=
625 GNUNET_CONFIGURATION_get_value_string (uc->cfg, section, "ACCEPT_FROM", 672 GNUNET_CONFIGURATION_get_value_string (uc->cfg, section, "ACCEPT_FROM",