Add more channel number for detecting BMC IPv6 address

This is a missing fix for patch.[1]

[1] https://review.opendev.org/#/c/656275/

Change-Id: I8443ae0c08487afea383e111b6c2b6d5941d4024
Task: 30654
Story: 2005528
This commit is contained in:
Dongcan Ye 2019-05-20 11:08:31 +00:00
parent 4d87b1648a
commit eb875cc9a2
2 changed files with 6 additions and 5 deletions

View File

@ -1191,9 +1191,10 @@ class GenericHardwareManager(HardwareManager):
return address
try:
# From all the channels 0-15, only 1-7 can be assigned to different
# types of communication media and protocols and effectively used
for channel in range(1, 8):
# From all the channels 0-15, only 1-11 can be assigned to
# different types of communication media and protocols and
# effectively used
for channel in range(1, 12):
addr_mode, e = utils.execute(
r"ipmitool lan6 print {} enables | "
r"awk '/IPv6\/IPv4 Addressing Enables[ \t]*:/"

View File

@ -2330,7 +2330,7 @@ class TestGenericHardwareManager(base.IronicAgentTest):
@mock.patch.object(utils, 'try_execute', autospec=True)
@mock.patch.object(utils, 'execute', autospec=True)
def test_get_bmc_v6address_not_enabled(self, mocked_execute, mte):
mocked_execute.side_effect = [('ipv4\n', '')] * 7
mocked_execute.side_effect = [('ipv4\n', '')] * 11
self.assertEqual('::/0', self.hardware.get_bmc_v6address())
@mock.patch.object(utils, 'try_execute', autospec=True)
@ -2387,7 +2387,7 @@ class TestGenericHardwareManager(base.IronicAgentTest):
@mock.patch.object(hardware, 'LOG', autospec=True)
@mock.patch.object(utils, 'try_execute', autospec=True)
@mock.patch.object(utils, 'execute', autospec=True)
def test_get_bmc_v6address_impitool_invalid_stdout_format(
def test_get_bmc_v6address_ipmitool_invalid_stdout_format(
self, mocked_execute, mte, mocked_log):
def side_effect(*args, **kwargs):
if args[0].startswith('ipmitool lan6 print'):