Name Date Size #Lines LOC

..--

000-badmsgtype.plH A D24-Jun-20214.2 KiB165102

010-solicit-noclientid.plH A D24-Jun-20215.7 KiB213124

011-solicit-serverid.plH A D24-Jun-20215.8 KiB216126

020-advertise-mcast.plH A D24-Jun-20214.2 KiB165102

030-request-noclientid.plH A D24-Jun-20215.7 KiB213124

031-request-noserverid.plH A D24-Jun-20215.7 KiB213125

032-request-badduid.plH A D24-Jun-20215.8 KiB217126

110-information-request-ia_na.plH A D24-Jun-20215.7 KiB213125

111-information-request-ia_ta.plH A D24-Jun-20215.7 KiB213125

112-badduid.plH A D24-Jun-20215.6 KiB209121

210-solicit-nohost.plH A D24-Jun-20215.7 KiB213125

211-solicit-opt-in-na.plH A D24-Jun-20216 KiB219130

212-solicit-opt-in-na-norapidcommit.plH A D24-Jun-20216 KiB219129

280-release-nohost.plH A D24-Jun-20214.4 KiB176107

281-release-bad-address.plH A D24-Jun-20214.9 KiB188116

282-release-no-address.plH A D24-Jun-20214.7 KiB184112

283-release.plH A D24-Jun-20215.1 KiB190117

290-decline-nohost.plH A D24-Jun-20214.5 KiB176107

291-decline-bad-address.plH A D24-Jun-20214.9 KiB188116

292-decline-no-address.plH A D24-Jun-20214.7 KiB184112

293-decline.plH A D24-Jun-20215.1 KiB190117

READMEH A D24-Jun-20212.2 KiB6343

dhcp_client.pmH A D24-Jun-202111.2 KiB455370

stubcli-opt-in-na.plH A D24-Jun-20216 KiB218130

stubcli.plH A D24-Jun-20215.7 KiB213125

test-a.confH A D24-Jun-20212 KiB6828

test-b.confH A D24-Jun-20211.8 KiB6135

README

1In order to test the DHCPv6 server, we have a configuration file with
2known values, and some Perl scripts designed to send and receive
3DHCPv6 packets to check various code paths.
4
5It is not complete test converage by any means, but it should be
6fairly easy to add additional tests as needed.
7
8The scripts themselves are not very well written. There is a lot of
9copied code, poor error handling, and so on. These should be rewritten
10at some point.
11
12To use, the DHCPv6 server must be running in test mode to send back to
13the originating port. (The scripts can be changed to bind to the
14appropriate client port, but they don't now, and have to run as root
15to do this). In server/dhcpv6.c, look for this comment:
16
17/* For testing, we reply to the sending port, so we don't need a root */
18/* client */
19		to_addr.sin6_port = remote_port;
20/*		to_addr.sin6_port = packet->client_port;*/
21
22And change the code to use the client_port value.
23
24You will need to modify one of the test configuration files to use one
25of the physical subnets that your machine uses, in the subnet6
26statement.
27
28Then run the server as root, in debug mode:
29
30# touch /tmp/test.leases
31# dhcpd -6 -cf test-a.conf -lf /tmp/test.leases -d
32
33You can invoke the scripts then:
34
35$ perl 000-badmsgtype.pl
36
37The expected results vary per script, depending on the behavior that
38is being tested.
39
40
41Notes about scripts:
42
43In order to manipulate IPv6 addresses, we need the Socket6 library,
44available from CPAN:
45
46http://search.cpan.org/~umemoto/Socket6-0.19/Socket6.pm
47
48The Perl that Sun issues for Solaris 10 is compiled with the Sun
49compiler. If you have the Sun compiler, then this will work fine.
50Otherwise you may need to install Perl from source.
51
52We need to get the hardware address in order to build DUID properly.
53The IO::Interface module reports hardware address, but not on Solaris
5410 it seems. Rather than do this the "right way", we do it the "Perl
55way", and hack it. "ifconfig" does return the Ethernet address, but
56only to the root user. However, we can look for files of the name
57/etc/hostname.*, get the IP address from "ifconfig", and then check
58for those addresses in the ARP table.
59
60Client DUID is supposed to be an opaque value to the server, but we go
61ahead and make a "real" type 1 or type 3 DUID.
62
63