.. _example_service_dhcp-client_send-options:
############
Send-Options
############
Test suite to validate DHCP client send options and identifier persistence.
The DHCP client can send identification information to the server:
- DHCP Client Identifier: Uniquely identifies the client device
- Hostname: Sends the system hostname for logging and identification
This test suite focuses on functionality NOT covered by existing tests:
- Hostname send (zero coverage)
- Identifier persistence (verifies same ID = same IP across releases)
Note: Basic client identifier functionality is already tested in
tests/service/dhcp-server/class.robot (class matching scenarios).
**************************
Test Client Sends Hostname
**************************
Description
===========
This scenario verifies that the DHCP client automatically sends the
system hostname to the DHCP server. When a system hostname is configured,
the DHCP client includes it in DHCP requests without requiring additional
interface-specific configuration. The hostname appears in the server's
journal logs in DHCP messages like DHCPREQUEST/DHCPACK.
When viewing DHCP logs, seeing "test-router" is more informative than
seeing only MAC addresses. This aids in troubleshooting and network documentation.
Verification includes packet capture to confirm hostname in DHCP packets.
Scenario
========
.. include:: send-options/testclientsendshostname
.. raw:: html
*****************************************
Test Serial Number Identifier Persistence
*****************************************
Description
===========
This scenario verifies that using a serial number as the client identifier
ensures IP address persistence across DHCP renewals and releases.
When a client uses its serial number as identifier, the DHCP server
associates the lease with this unique hardware ID rather than the MAC address.
Even if the client releases and re-requests its IP, it should receive
the same IP address as long as it uses the same serial number identifier.
This is critical for maintaining consistent IP addressing in environments
where devices may have changing MAC addresses or multiple network interfaces.
Scenario
========
.. include:: send-options/testserialnumberidentifierpersistence
.. raw:: html
************************************
Test Base-MAC Identifier Persistence
************************************
Description
===========
This scenario verifies that using the base MAC address as the client
identifier ensures IP address persistence. The base MAC is the primary
hardware address of the device, independent of any VLAN or virtual
interface configurations. When a client uses base-mac as its identifier,
it maintains the same lease even when reconnecting through different
sub-interfaces or after configuration changes. This is particularly
useful in VLAN environments where each sub-interface has a different
MAC but all share the same base MAC.
Scenario
========
.. include:: send-options/testbase-macidentifierpersistence
.. raw:: html
**********************************
Test String Identifier Persistence
**********************************
Description
===========
This scenario verifies that using a custom string as the client identifier
ensures IP address persistence across DHCP operations. Custom string
identifiers allow administrators to assign logical, human-readable names
to devices (e.g., "router-branch-office-01") independent of any hardware
identifiers. This provides flexible device identification that survives
hardware replacements - if a device is replaced but configured with the
same string identifier, it will receive the same IP address. This test
verifies that the server correctly tracks leases by the custom string
identifier and maintains address consistency.
Scenario
========
.. include:: send-options/teststringidentifierpersistence
.. raw:: html