[openstack-dev] [neutron] [fullstack] Test of DHCP agent HA

Sławek Kapłoński slawek at kaplonski.pl
Thu Dec 22 16:09:01 UTC 2016


Some time ago I introduced basic test for DHCP agent in fullstack tests
Now I want to add test(s) for HA of DHCP agent - I started it in [2]. I
want to add which will:
* create environment with 2 hosts and 2 dhcp agents,
* spawn FakeMachine and check if it will get IP address,
* kill DHCP agent which hosts DHCP for created network,
* wait a while and check if another DHCP agent starts hosting this
* spawn new FakeMachine and check if it will get IP address from DHCP

So it looks quite easy but there is one problem. Dhcp agent creates
network namespace with name "qdhcp-<network_id>" and spawn there dnsmasq
process. This dnsmasq is using tap interface in this namespace. So when
I killed first dhcp agent, it not removes qdhcp-<network_id> namespace
so second agent want's to "reuse" it. Problem is that in this namespace
still is running dnsmasq spawned by first agent.
So I think that best solution would be to change somehow DHCP agent that
each agent will create namespaces with names like
"qdhcp-<networ_id>-some-random-suffix". And my question is how to do it
in easiest way? I wanted to do it in same way how it is in L3 agent in
fullstack but I would need to "override" couple methods from agent only
for tests and I don't think it's good idea.
Maybe someone more experienced will have some better ideas how to do it.

[1] https://review.openstack.org/#/c/409432/
[2] https://review.openstack.org/#/c/413994/

Best regards / Pozdrawiam
Sławek Kapłoński
slawek at kaplonski.pl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20161222/eabda30b/attachment.pgp>

More information about the OpenStack-dev mailing list