Create fake Kea server for unit testing
When I was reviewing #814 (closed) I realized that our unit tests have a lot of overhead in creating mock agents with static responses from Kea. It introduces a lot of repetitive code that is also error prone. See the TestUpdateHost
function in #814 (closed).
I am thinking that we could maybe introduce something similar to DHCP unit test clients in Kea. We could create a go "object" that can receive configuration from the unit test, e.g. a collection of host reservations, and a unit test could call functions that mimic certain commands. The fake server would return appropriate responses based on its configuration. It should move the logic to create the fake agents and generate JSON out of the individual unit tests and provide more generic code. The unit tests should be consequently easier to follow.