daemon: Add identity reference count testing
daemon: Add identity reference count testing

Add a new unit test that tests the integration between the daemon DNS
event handling logic and the core FQDN and policy (selector) subsystems.

The core idea here is to validate that when DNS events are handled that
associate FQDNs to IPs, ensure that the reference counting on CIDR
identities remains sane. To this end, we put a mock identity reference
counter into the Daemon (using pkg/counter), then trigger DNS events to
occur. By exercising this core Daemon / FQDN / selector code with our
own "known-good" reference counting identity allocator backend, we can
check that the intermediate code is appropriately balancing the identity
allocation and release.

The resulting test ensures that even if we trigger DNS events multiple
times, the core agent code should not leak identity references.

Signed-off-by: Joe Stringer <16a9a54ddf4259952e3c118c763138e83693d7fd@cilium.io>

michi-covalent/cilium,michi-covalent/cilium,tklauser/cilium,cilium/cilium,michi-covalent/cilium,cilium/cilium,tklauser/cilium,tklauser/cilium,cilium/cilium,michi-covalent/cilium,michi-covalent/cilium,tklauser/cilium,cilium/cilium,tklauser/cilium,cilium/cilium