summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <ralonsoh@redhat.com>2023-02-17 09:55:50 +0100
committerRodolfo Alonso Hernandez <ralonsoh@redhat.com>2023-02-24 19:18:38 +0100
commit5ea2b540aeeeeef01c5130bde0a563626c394416 (patch)
treec370d9065e41a7a6635b6209f18dce996c08b8bf
parentdd45d5baa0bf8b269233b3d166aa3c48766f4cb5 (diff)
downloadneutron-5ea2b540aeeeeef01c5130bde0a563626c394416.tar.gz
Format correctly (dialect=mac_unix_expanded) the MAC addresses
Format correctly (dialect=mac_unix_expanded) the MAC addresses in ``DHCPAgentOVSTestFramework``. Before this patch, this is the leases file the DHCP server was using: Done building initial lease file /tmp/tmp3_m7_fqk/tmpiadm5q0e/9afb0444-e28e-4582-abb0-031d6ed500e4/leases with contents: 1676775199 24:77:3:7d:0:4c 192.168.10.11 * * 1676775199 24:77:3:7d:0:3a 192.168.10.1 * * Related-Bug: #2007992 Change-Id: Ie903fd3f645f7428854cf6b2fe48a1edf342cc32 (cherry picked from commit c61ce3447e2aa3689fa7545170b4e0d94d1a4380)
-rw-r--r--neutron/tests/functional/agent/test_dhcp_agent.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/neutron/tests/functional/agent/test_dhcp_agent.py b/neutron/tests/functional/agent/test_dhcp_agent.py
index 3c189c9da5..3e59bb0a9e 100644
--- a/neutron/tests/functional/agent/test_dhcp_agent.py
+++ b/neutron/tests/functional/agent/test_dhcp_agent.py
@@ -20,6 +20,7 @@ from unittest import mock
import eventlet
import fixtures
import netaddr
+from neutron_lib.api import converters
from neutron_lib import constants as lib_const
from oslo_config import fixture as fixture_config
from oslo_utils import uuidutils
@@ -42,10 +43,10 @@ from neutron.tests.functional import base
class DHCPAgentOVSTestFramework(base.BaseSudoTestCase):
- _DHCP_PORT_MAC_ADDRESS = netaddr.EUI("24:77:03:7d:00:4c")
- _DHCP_PORT_MAC_ADDRESS.dialect = netaddr.mac_unix
- _TENANT_PORT_MAC_ADDRESS = netaddr.EUI("24:77:03:7d:00:3a")
- _TENANT_PORT_MAC_ADDRESS.dialect = netaddr.mac_unix
+ _DHCP_PORT_MAC_ADDRESS = converters.convert_to_sanitized_mac_address(
+ '24:77:03:7d:00:4c')
+ _TENANT_PORT_MAC_ADDRESS = converters.convert_to_sanitized_mac_address(
+ '24:77:03:7d:00:3a')
_IP_ADDRS = {
4: {'addr': '192.168.10.11',
@@ -307,9 +308,8 @@ class DHCPAgentOVSTestCase(DHCPAgentOVSTestFramework):
network, port = self._get_network_port_for_allocation_test()
network.ports.append(port)
self.configure_dhcp_for_network(network=network)
- bad_mac_address = netaddr.EUI(self._TENANT_PORT_MAC_ADDRESS.value + 1)
- bad_mac_address.dialect = netaddr.mac_unix
- port.mac_address = str(bad_mac_address)
+ port.mac_address = converters.convert_to_sanitized_mac_address(
+ '24:77:03:7d:00:4d')
self._plug_port_for_dhcp_request(network, port)
self.assert_bad_allocation_for_port(network, port)