.. _example_service_dhcp-server_static-mapping: ############## Static-Mapping ############## Test suite to validate DHCP static-mapping functionality. Static mappings allow assigning fixed IP addresses to specific MAC addresses. Additionally, each static mapping can have its own DHCP options that override the subnet-level options. Key scenarios verified: - Basic static mapping: MAC → fixed IP - Static mapping with custom NTP server (different from subnet) - Static mapping with custom DNS server (different from subnet) - Option hierarchy: static-mapping options override subnet options - Multiple static mappings with different options ******************************* Test DHCP Server Static Mapping ******************************* Description =========== This scenario will check if the ``static-mapping`` option works. This option will give a specific lease to the MAC received, configured for the DHCP server. The server will then configure the option with this MAC and the client will then check it has received de IP address. Scenario ======== .. include:: static-mapping/testdhcpserverstaticmapping .. raw:: html
****************************************** Test Static Mapping with Custom NTP Server ****************************************** Description =========== This scenario verifies that a static mapping can have custom NTP server options that override the subnet-level NTP configuration. Configuration: - Subnet NTP: 10.10.10.1 - Host1 static mapping with NTP: 10.10.10.11 Expected: - Host1 receives custom NTP (10.10.10.11), not subnet NTP - Host1 gets the static IP (192.168.60.50) Scenario ======== .. include:: static-mapping/teststaticmappingwithcustomntpserver .. raw:: html
****************************************** Test Static Mapping with Custom DNS Server ****************************************** Description =========== This scenario verifies that a static mapping can have custom DNS server options that override the subnet-level DNS configuration. Configuration: - Subnet DNS: 10.20.20.1 - Host2 static mapping with DNS: 10.20.20.22 Expected: - Host2 receives custom DNS (10.20.20.22), not subnet DNS - Host2 gets the static IP (192.168.60.51) Scenario ======== .. include:: static-mapping/teststaticmappingwithcustomdnsserver .. raw:: html
**************************************************** Test Multiple Static Mappings with Different Options **************************************************** Description =========== This scenario verifies that multiple static mappings can coexist, each with their own custom options. Configuration: - Subnet options: NTP 10.10.10.1, DNS 10.20.20.1 - Host1: Custom NTP 10.10.10.11 (inherits subnet DNS) - Host2: Custom DNS 10.20.20.22 (inherits subnet NTP) Expected: - Host1 gets custom NTP but subnet DNS - Host2 gets custom DNS but subnet NTP Scenario ======== .. include:: static-mapping/testmultiplestaticmappingswithdifferentoptions .. raw:: html
***************************************************** Test Option Hierarchy Static Mapping Overrides Subnet ***************************************************** Description =========== This scenario explicitly tests that static mapping options have higher priority than subnet-level options. This is an important ISC DHCP behavior: options defined in a host declaration override options from the containing subnet. Test verifies that when both subnet and static-mapping define the same option (ntp-server), the static-mapping value wins. Scenario ======== .. include:: static-mapping/testoptionhierarchystaticmappingoverridessubnet .. raw:: html