Checking IP version from extra-dhcp-options
Existing IPv4 and IPv6 extra-dhcp-options tests ignored the ip_version attribute, so all the extra-dhcp-options tested had IP version 4 Change-Id: I5fee2579a158918c2c22d95493b471e23d0f8161
This commit is contained in:
parent
e347cd2858
commit
da60eab4de
|
@ -13,6 +13,7 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from neutron_lib import constants
|
||||||
from tempest.lib.common.utils import data_utils
|
from tempest.lib.common.utils import data_utils
|
||||||
from tempest.lib import decorators
|
from tempest.lib import decorators
|
||||||
|
|
||||||
|
@ -48,9 +49,14 @@ class ExtraDHCPOptionsTestJSON(base.BaseNetworkTest):
|
||||||
cls.ip_server = ('123.123.123.45' if cls._ip_version == 4
|
cls.ip_server = ('123.123.123.45' if cls._ip_version == 4
|
||||||
else '2015::badd')
|
else '2015::badd')
|
||||||
cls.extra_dhcp_opts = [
|
cls.extra_dhcp_opts = [
|
||||||
{'opt_value': 'pxelinux.0', 'opt_name': 'bootfile-name'},
|
{'opt_value': 'pxelinux.0',
|
||||||
{'opt_value': cls.ip_tftp, 'opt_name': 'tftp-server'},
|
'opt_name': 'bootfile-name'}, # default ip_version is 4
|
||||||
{'opt_value': cls.ip_server, 'opt_name': 'server-ip-address'}
|
{'opt_value': cls.ip_tftp,
|
||||||
|
'opt_name': 'tftp-server',
|
||||||
|
'ip_version': cls._ip_version},
|
||||||
|
{'opt_value': cls.ip_server,
|
||||||
|
'opt_name': 'server-ip-address',
|
||||||
|
'ip_version': cls._ip_version}
|
||||||
]
|
]
|
||||||
|
|
||||||
@decorators.idempotent_id('d2c17063-3767-4a24-be4f-a23dbfa133c9')
|
@decorators.idempotent_id('d2c17063-3767-4a24-be4f-a23dbfa133c9')
|
||||||
|
@ -85,8 +91,11 @@ class ExtraDHCPOptionsTestJSON(base.BaseNetworkTest):
|
||||||
self.assertEqual(len(retrieved), len(extra_dhcp_opts))
|
self.assertEqual(len(retrieved), len(extra_dhcp_opts))
|
||||||
for retrieved_option in retrieved:
|
for retrieved_option in retrieved:
|
||||||
for option in extra_dhcp_opts:
|
for option in extra_dhcp_opts:
|
||||||
|
# default ip_version is 4
|
||||||
|
ip_version = option.get('ip_version', constants.IP_VERSION_4)
|
||||||
if (retrieved_option['opt_value'] == option['opt_value'] and
|
if (retrieved_option['opt_value'] == option['opt_value'] and
|
||||||
retrieved_option['opt_name'] == option['opt_name']):
|
retrieved_option['opt_name'] == option['opt_name'] and
|
||||||
|
retrieved_option['ip_version'] == ip_version):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
self.fail('Extra DHCP option not found in port %s' %
|
self.fail('Extra DHCP option not found in port %s' %
|
||||||
|
|
Loading…
Reference in New Issue