.. _example_service_dhcp-server_advisor:
#######
Advisor
#######
These scenarios check that the advisor DHCP functions operate correctly,
including lease preservation when the advisor toggles.
************************
Test DHCP Server Advisor
************************
Description
===========
This scenario configures and checks that an ``advisor`` for the DHCP-server works correctly.
First, you should configure at least one server (for this scenario, there are 2).
Then configure the alarm and the advisor linked to the alarm and the server.
Alarms are configured as false by default, meaning ``'not al'`` will be true.
The advisor will then become true and the process will start running.
Next, the value of the advisor is changed to ``'al'``, so the process will not be running.
Finally, the advisor returns to its previous value, so the process will be running.
Scenario
========
.. include:: advisor/testdhcpserveradvisor
.. raw:: html
************************************
Test Advisor Toggle Preserves Leases
************************************
Description
===========
This scenario verifies that DHCP server leases are preserved when
the server is stopped and restarted due to advisor status changes.
When an advisor linked to a shared-network changes to false, the
server stops but should preserve existing lease information.
When the advisor returns to true, the server restarts and the
previous lease entries should still be available.
Scenario
========
.. include:: advisor/testadvisortogglepreservesleases
.. raw:: html
**********************************************************
Test Multiple Shared Networks Advisor Preserves All Leases
**********************************************************
Description
===========
This scenario verifies that when multiple shared-networks are
linked to the same advisor, all leases from all networks are
preserved when the advisor toggles. This ensures the lease
preservation works correctly with multiple DHCP pools.
Scenario
========
.. include:: advisor/testmultiplesharednetworksadvisorpreservesallleases
.. raw:: html
****************************************
Test Advisor Toggle VRF Preserves Leases
****************************************
Description
===========
This scenario verifies that lease preservation works correctly
when the DHCP server is configured within a VRF context.
Each VRF has its own separate lease storage, and this test
ensures that advisor-triggered restarts preserve VRF-specific leases.
Scenario
========
.. include:: advisor/testadvisortogglevrfpreservesleases
.. raw:: html
******************************************
Test Rapid Advisor Toggles Preserve Leases
******************************************
Description
===========
This scenario verifies that rapid consecutive advisor state
changes do not corrupt or lose lease information.
The server may be started and stopped multiple times in quick
succession, and lease data should remain intact throughout.
Scenario
========
.. include:: advisor/testrapidadvisortogglespreserveleases
.. raw:: html