chiark / gitweb /
libsystemd-dhcp: Add a full DHCP address acquisition test case
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Tue, 18 Feb 2014 14:07:40 +0000 (16:07 +0200)
committerTom Gundersen <teg@jklm.no>
Tue, 18 Feb 2014 14:23:19 +0000 (15:23 +0100)
commit234ed3eb09f0c8b871253691e0ef9309e68eeae8
tree52570dd3d0a5bbb46845a46f46c596bfcfe12bcf
parent6c8a0f07f21fd32e840ef00f89dd226418f5f8a0
libsystemd-dhcp: Add a full DHCP address acquisition test case

Upon startup the DHCP library will immediately send a DHCP Discover.
Handle the additional DHCP Discover checking and DHCP Offer sending
in test_addr_acq_recv_discover(). Write a zero UDP checksum, the
received XID and the faked MAC address into place to create a DHCP
message the library can accept.

Follow exactly the same steps when receiving a DHCP Request in
test_addr_acq_recv_request() and send the Ack. Check that the proper
addresses have been found by the DHCP library before exiting the
main loop and finishing the test.
src/libsystemd-dhcp/test-dhcp-client.c