chiark / gitweb /
libsystemd-dhcp: Add capability to print out test steps
[elogind.git] / src / libsystemd-dhcp / test-dhcp-client.c
index 56a10b3dfc7bb6c8b7fc2a5420275a36f955e595..32c79ebb68e496feb17fdf9c0393bbe83c4863f0 100644 (file)
@@ -38,6 +38,7 @@ static struct ether_addr mac_addr = {
         .ether_addr_octet = {'A', 'B', 'C', '1', '2', '3'}
 };
 
+static bool verbose = false;
 static int test_fd[2];
 
 static void test_request_basic(sd_event *e)
@@ -46,6 +47,9 @@ static void test_request_basic(sd_event *e)
 
         sd_dhcp_client *client;
 
+        if (verbose)
+                printf("* %s\n", __FUNCTION__);
+
         r = sd_dhcp_client_new(&client);
 
         assert(r >= 0);
@@ -126,6 +130,9 @@ static void test_checksum(void)
                 0xff, 0xff, 0xff, 0xff
         };
 
+        if (verbose)
+                printf("* %s\n", __FUNCTION__);
+
         assert(client_checksum(&buf, 20) == be16toh(0x78ae));
 }
 
@@ -191,12 +198,12 @@ int dhcp_network_bind_raw_socket(int index, union sockaddr_union *link)
         return test_fd[0];
 }
 
-int dhcp_network_bind_udp_socket(int index, be32_t client_address)
+int dhcp_network_bind_udp_socket(int index, be32_t address, uint16_t port)
 {
         return 0;
 }
 
-int dhcp_network_send_udp_socket(int s, be32_t server_address,
+int dhcp_network_send_udp_socket(int s, be32_t address, uint16_t port,
                                  const void *packet, size_t len)
 {
         return 0;
@@ -207,6 +214,9 @@ static void test_discover_message(sd_event *e)
         sd_dhcp_client *client;
         int res, r;
 
+        if (verbose)
+                printf("* %s\n", __FUNCTION__);
+
         r = sd_dhcp_client_new(&client);
         assert(r >= 0);
         assert(client);