neutron/neutron/tests/unit/agent/linux
Arjun Baindur ce037876a7 Do not release DHCP lease when no client ID is set on port
The DHCP agent has a really strict enforcement of client ID, which
is part of the DHCP extra options. If a VM advertises a client ID,
DHCP agent will automatically release it's lease whenever *any* other
port is updated/deleted, even if no client ID is set on the port,
because it thinks the client ID has changed.

When reload_allocations() is called, the DHCP agent parses the leases
and hosts files, and gets the list of all the ports in the network from the
DB, computing 3 different sets. The set from the leases file (v4_leases)
could have a client ID, but the set from the port DB and hosts file will
have None.

As a result, the set subtraction does not filter out the entry,
and all ports that have an active lease with a client ID are released.

The Client ID should only be enforced and leases released
if it's actually set in the port DB's DHCP extra Opts.
In that case it means someone knows what they are doing,
and we want to check for a mismatch. If the client ID on a port is
empty, it should not be treated like an unused lease.

We can't expect end users that just create VMs with auto created ports
to know/care about DHCP client IDs, then manually update ports or
change app templates.

In some cases, like Windows VMs, the client ID is advertised as the MAC by default.
In fact, there is a Windows bug which prevents you from even turning this off:
https://support.microsoft.com/en-us/help/3004537/dhcp-client-always-includes-option-61-in-the-dhcp-request-in-windows-8

Linux VMs don't have this on by default, but it may be enabled
in some templates unknown to users.

Change-Id: I8021f740bd78e654915337bd3287b45b2c422e95
Closes-Bug: #1806770
(cherry picked from commit f2111e0354)
2019-03-14 19:28:43 +00:00
..
openvswitch_firewall Reinitialize ovs firewall after ovs-vswitchd restart 2018-12-04 13:27:50 +00:00
__init__.py Empty files should not contain copyright or license 2014-10-20 00:50:32 +00:00
failing_process.py Keep reading stdout/stderr until after kill 2015-11-19 19:14:13 +02:00
test_async_process.py Add kill_timeout to AsyncProcess 2019-01-04 11:44:23 +01:00
test_bridge_lib.py Fix UT BridgeLibTest when IPv6 is disabled 2018-06-05 12:02:26 +02:00
test_daemon.py Use bytes for python3 friendly os.write 2017-02-02 18:59:03 -08:00
test_dhcp.py Do not release DHCP lease when no client ID is set on port 2019-03-14 19:28:43 +00:00
test_external_process.py Use flake8-import-order plugin 2017-07-05 03:15:27 +00:00
test_interface.py Remove deprecated IVS interface driver 2018-04-26 20:15:46 +00:00
test_ip_conntrack.py Move conntrack zones to IPTablesFirewall 2017-03-30 14:54:51 -07:00
test_ip_lib.py Switch isolated metadata proxy to bind to 169.254.169.254 2019-02-12 10:30:25 +00:00
test_ip_link_support.py sriov: implement spoofchecking configuration 2015-07-29 19:38:25 +02:00
test_ip_monitor.py Fix W605 warnings 2018-05-17 16:20:59 +09:00
test_ipset_manager.py Create ipset set_name_exists() method 2015-10-14 10:18:44 -04:00
test_iptables_firewall.py When converting sg rules to iptables, do not emit dport if not supported 2019-03-11 18:14:02 +00:00
test_iptables_manager.py Fix neutron-openvswitch-agent Windows support 2018-08-28 06:53:11 +00:00
test_keepalived.py Use flake8-import-order plugin 2017-07-05 03:15:27 +00:00
test_l3_tc_lib.py Make L3 IP tc filter rate limit more accurate 2018-06-20 02:21:28 +00:00
test_ovsdb_monitor.py Ensure ovsdb_connection enabled before calling monitor 2017-03-06 22:19:18 +00:00
test_pd.py Fix errors in PrefixDelegation.remove_stale_ri_ifname 2017-05-02 16:46:56 +00:00
test_polling.py Ensure ovsdb_connection enabled before calling monitor 2017-03-06 22:19:18 +00:00
test_tc_lib.py Fix ingress bw limit for OVS DPDK ports 2018-01-15 13:19:14 +00:00
test_utils.py Update neutron files for new over-indentation hacking rule (E117) 2019-01-30 20:05:18 +03:00
test_xenapi_root_helper.py Use os-xenapi for neutron when XenServer as hypervisor 2017-03-30 18:33:37 +00:00