-test cleanup
authorMartin Schanzenbach <mschanzenbach@posteo.de>
Sun, 24 Jun 2012 23:32:15 +0000 (23:32 +0000)
committerMartin Schanzenbach <mschanzenbach@posteo.de>
Sun, 24 Jun 2012 23:32:15 +0000 (23:32 +0000)
src/gns/test_gns_pseu_shorten.c
src/gns/test_gns_simple_mx_lookup.c
src/gns/test_gns_simple_srv_lookup.c

index 293a20d379d036bc8991fbfffd44d57b906a0e33..560c5bb8a89cf4890f7a87b692e6869be111b03a 100644 (file)
@@ -37,7 +37,7 @@
 #define VERBOSE GNUNET_YES
 
 /* Timeout for entire testcase */
-#define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 5)
+#define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 30)
 
 /* If number of peers not in config file, use this number */
 #define DEFAULT_NUM_PEERS 2
index e93a2ca0b199d44c475e4654b4393522397092fe..357c85797052b29dacb69713497b4accf60b838e 100644 (file)
@@ -93,11 +93,7 @@ static void
 on_lookup_result(void *cls, uint32_t rd_count,
                  const struct GNUNET_NAMESTORE_RecordData *rd)
 {
-  struct in_addr a;
   int i;
-  char* addr;
-  int mx_found = 0;
-  int ip_found = 0;
   uint16_t mx_preference;
   char* mx;
   
@@ -114,19 +110,7 @@ on_lookup_result(void *cls, uint32_t rd_count,
     for (i=0; i<rd_count; i++)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_INFO, "type: %d\n", rd[i].record_type);
-      if (rd[i].record_type == GNUNET_GNS_RECORD_TYPE_A)
-      {
-        memcpy(&a, rd[i].data, sizeof(a));
-        addr = inet_ntoa(a);
-        GNUNET_log (GNUNET_ERROR_TYPE_INFO, "address: %s\n", addr);
-        if (0 == strcmp(addr, TEST_IP))
-        {
-          GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                    "%s correctly resolved to %s!\n", TEST_DOMAIN, addr);
-          ip_found = 1;
-        }
-      }
-      else if (rd[i].record_type == GNUNET_GNS_RECORD_MX)
+      if (rd[i].record_type == GNUNET_GNS_RECORD_MX)
       {
         mx = (char*)rd[i].data+sizeof(uint16_t);
         mx_preference = *(uint16_t*)rd[i].data;
@@ -137,26 +121,12 @@ on_lookup_result(void *cls, uint32_t rd_count,
           GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                       "%s correctly resolved to %s!\n", TEST_DOMAIN,
                       TEST_EXPECTED_MX);
-          mx_found = 1;
+          ok = 0;
         }
       }
     }
   }
 
-  if (ip_found && mx_found)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                "Test succeeded!\n");
-    ok = 0;
-  }
-
-  if (!ip_found && mx_found)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-  "A record not passed along!(NOT IMPLEMENTED)\n");
-    ok = 0;
-  }
-
   GNUNET_GNS_disconnect(gns_handle);
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n");
   GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
index b23d6ded3f4bc99ed4fcdec258058800d9ace143..23554e7711b24f0474d0fcd22e9326ebde033ab1 100644 (file)
@@ -30,6 +30,7 @@
 #include "gnunet_namestore_service.h"
 #include "../namestore/namestore.h"
 #include "gnunet_dnsparser_lib.h"
+#include "../dns/dnsparser.h"
 #include "gnunet_gns_service.h"
 
 /* DEFINES */
@@ -185,14 +186,6 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   ok = 1;
 }
 
-GNUNET_NETWORK_STRUCT_BEGIN
-struct srv_data
-{
-  uint16_t prio GNUNET_PACKED;
-  uint16_t weight GNUNET_PACKED;
-  uint16_t port GNUNET_PACKED;
-};
-GNUNET_NETWORK_STRUCT_END
 
 static void
 do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,