.. _example_service_dhcp-client_lifecycle:
#########
Lifecycle
#########
Test suite to validate DHCP client lifecycle operations.
The DHCP client supports various lifecycle operations:
- RENEW: Request renewal of existing lease
- RELEASE: Release current lease back to server
- RESTART: Stop and start DHCP client
- STOP: Stop DHCP client completely
This test suite verifies that:
- RENEW maintains the same IP address
- RELEASE properly frees the IP on server
- RESTART can obtain same or different IP
- Operations work with VRF and VLAN
***********************************
Test DHCP Client RENEW Maintains IP
***********************************
Description
===========
This scenario checks that DHCP client RENEW maintains the same IP address.
When a client renews its lease, it should keep the same IP it already has.
This is critical for maintaining stable network connectivity.
Verification includes packet capture to confirm DHCPREQUEST/DHCPACK exchange.
Scenario
========
.. include:: lifecycle/testdhcpclientrenewmaintainsip
.. raw:: html
*********************************
Test DHCP Client RELEASE Frees IP
*********************************
Description
===========
This scenario checks that DHCP client RELEASE properly frees the IP.
When a client releases its lease, the server should mark it as free
and the client should no longer have the IP address.
We release by removing DHCP configuration.
Verification includes packet capture to confirm DHCPRELEASE is sent.
Scenario
========
.. include:: lifecycle/testdhcpclientreleasefreesip
.. raw:: html
************************
Test DHCP Client RESTART
************************
Description
===========
This scenario checks that DHCP client RESTART works correctly.
RESTART stops and starts the DHCP client, which may result in
the same IP (if available) or a different IP from the pool.
We restart by removing and re-adding DHCP configuration.
Scenario
========
.. include:: lifecycle/testdhcpclientrestart
.. raw:: html
*********************
Test DHCP Client STOP
*********************
Description
===========
This scenario checks that DHCP client STOP removes the IP address.
When DHCP client is stopped, the interface should no longer have
the DHCP-assigned IP address.
We stop by removing DHCP configuration.
Scenario
========
.. include:: lifecycle/testdhcpclientstop
.. raw:: html
*******************************
Test DHCP Client RENEW with VRF
*******************************
Description
===========
This scenario checks that DHCP client RENEW works in VRF context.
Scenario
========
.. include:: lifecycle/testdhcpclientrenewwithvrf
.. raw:: html
********************************
Test DHCP Client RENEW with VLAN
********************************
Description
===========
This scenario checks that DHCP client RENEW works on VLAN sub-interfaces.
Scenario
========
.. include:: lifecycle/testdhcpclientrenewwithvlan
.. raw:: html
******************************
Test Multiple RENEW Operations
******************************
Description
===========
This scenario checks that multiple consecutive RENEW operations work correctly.
Performing multiple renewals should not cause any issues.
Scenario
========
.. include:: lifecycle/testmultiplerenewoperations
.. raw:: html
**********************************
Test RELEASE and Request New Lease
**********************************
Description
===========
This scenario checks that after RELEASE, client can request a new lease.
This verifies the complete lifecycle: obtain → release → obtain again.
We release by removing DHCP and then re-adding it.
Scenario
========
.. include:: lifecycle/testreleaseandrequestnewlease
.. raw:: html
**************************************
Test Lease Expiration and Auto-Renewal
**************************************
Description
===========
This scenario checks that client automatically renews lease before expiration.
With a short lease time (60s), the client should automatically renew
at T1 (30s) without manual intervention.
Scenario
========
.. include:: lifecycle/testleaseexpirationandauto-renewal
.. raw:: html