mirror of
https://github.com/systemd/systemd.git
synced 2025-02-07 05:57:46 +03:00
test-dhcp-client: utilize log_info instead of printf
log_info appears to be the preferred method to convey information from tests. Convert all the printfs to log_info to follow this standard. (cherry picked from commit 38557d9ffbc6351b8980faf90d54619790436d43)
This commit is contained in:
parent
852e38edd0
commit
4ea8428848
@ -46,7 +46,7 @@ static void test_request_basic(sd_event *e) {
|
||||
sd_dhcp_client *client;
|
||||
|
||||
if (verbose)
|
||||
printf("* %s\n", __func__);
|
||||
log_info("* %s", __func__);
|
||||
|
||||
/* Initialize client without Anonymize settings. */
|
||||
r = sd_dhcp_client_new(&client, false);
|
||||
@ -106,7 +106,7 @@ static void test_request_anonymize(sd_event *e) {
|
||||
sd_dhcp_client *client;
|
||||
|
||||
if (verbose)
|
||||
printf("* %s\n", __func__);
|
||||
log_info("* %s", __func__);
|
||||
|
||||
/* Initialize client with Anonymize settings. */
|
||||
r = sd_dhcp_client_new(&client, true);
|
||||
@ -138,7 +138,7 @@ static void test_checksum(void) {
|
||||
};
|
||||
|
||||
if (verbose)
|
||||
printf("* %s\n", __func__);
|
||||
log_info("* %s", __func__);
|
||||
|
||||
assert_se(dhcp_packet_checksum((uint8_t*)&buf, 20) == be16toh(0x78ae));
|
||||
}
|
||||
@ -270,7 +270,7 @@ static int test_discover_message_verify(size_t size, struct DHCPMessage *dhcp) {
|
||||
assert_se(res == DHCP_DISCOVER);
|
||||
|
||||
if (verbose)
|
||||
printf(" recv DHCP Discover 0x%08x\n", be32toh(dhcp->xid));
|
||||
log_info(" recv DHCP Discover 0x%08x", be32toh(dhcp->xid));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -280,7 +280,7 @@ static void test_discover_message(sd_event *e) {
|
||||
int res, r;
|
||||
|
||||
if (verbose)
|
||||
printf("* %s\n", __func__);
|
||||
log_info("* %s", __func__);
|
||||
|
||||
r = sd_dhcp_client_new(&client, false);
|
||||
assert_se(r >= 0);
|
||||
@ -424,7 +424,7 @@ static int test_addr_acq_acquired(sd_dhcp_client *client, int event,
|
||||
sizeof(addrs[0].s_addr)) == 0);
|
||||
|
||||
if (verbose)
|
||||
printf(" DHCP address acquired\n");
|
||||
log_info(" DHCP address acquired");
|
||||
|
||||
sd_event_exit(e, 0);
|
||||
|
||||
@ -443,7 +443,7 @@ static int test_addr_acq_recv_request(size_t size, DHCPMessage *request) {
|
||||
assert_se(msg_bytes[size - 1] == SD_DHCP_OPTION_END);
|
||||
|
||||
if (verbose)
|
||||
printf(" recv DHCP Request 0x%08x\n", be32toh(xid));
|
||||
log_info(" recv DHCP Request 0x%08x", be32toh(xid));
|
||||
|
||||
memcpy(&test_addr_acq_ack[26], &udp_check, sizeof(udp_check));
|
||||
memcpy(&test_addr_acq_ack[32], &xid, sizeof(xid));
|
||||
@ -456,7 +456,7 @@ static int test_addr_acq_recv_request(size_t size, DHCPMessage *request) {
|
||||
assert_se(res == sizeof(test_addr_acq_ack));
|
||||
|
||||
if (verbose)
|
||||
printf(" send DHCP Ack\n");
|
||||
log_info(" send DHCP Ack");
|
||||
|
||||
return 0;
|
||||
};
|
||||
@ -474,7 +474,7 @@ static int test_addr_acq_recv_discover(size_t size, DHCPMessage *discover) {
|
||||
xid = discover->xid;
|
||||
|
||||
if (verbose)
|
||||
printf(" recv DHCP Discover 0x%08x\n", be32toh(xid));
|
||||
log_info(" recv DHCP Discover 0x%08x", be32toh(xid));
|
||||
|
||||
memcpy(&test_addr_acq_offer[26], &udp_check, sizeof(udp_check));
|
||||
memcpy(&test_addr_acq_offer[32], &xid, sizeof(xid));
|
||||
@ -487,7 +487,7 @@ static int test_addr_acq_recv_discover(size_t size, DHCPMessage *discover) {
|
||||
assert_se(res == sizeof(test_addr_acq_offer));
|
||||
|
||||
if (verbose)
|
||||
printf(" sent DHCP Offer\n");
|
||||
log_info(" sent DHCP Offer");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -497,7 +497,7 @@ static void test_addr_acq(sd_event *e) {
|
||||
int res, r;
|
||||
|
||||
if (verbose)
|
||||
printf("* %s\n", __func__);
|
||||
log_info("* %s", __func__);
|
||||
|
||||
r = sd_dhcp_client_new(&client, false);
|
||||
assert_se(r >= 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user