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:
@@ -1191,9 +1191,10 @@ class GenericHardwareManager(HardwareManager):
|
|||||||
return address
|
return address
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# From all the channels 0-15, only 1-7 can be assigned to different
|
# From all the channels 0-15, only 1-11 can be assigned to
|
||||||
# types of communication media and protocols and effectively used
|
# different types of communication media and protocols and
|
||||||
for channel in range(1, 8):
|
# effectively used
|
||||||
|
for channel in range(1, 12):
|
||||||
addr_mode, e = utils.execute(
|
addr_mode, e = utils.execute(
|
||||||
r"ipmitool lan6 print {} enables | "
|
r"ipmitool lan6 print {} enables | "
|
||||||
r"awk '/IPv6\/IPv4 Addressing Enables[ \t]*:/"
|
r"awk '/IPv6\/IPv4 Addressing Enables[ \t]*:/"
|
||||||
|
@@ -2330,7 +2330,7 @@ class TestGenericHardwareManager(base.IronicAgentTest):
|
|||||||
@mock.patch.object(utils, 'try_execute', autospec=True)
|
@mock.patch.object(utils, 'try_execute', autospec=True)
|
||||||
@mock.patch.object(utils, 'execute', autospec=True)
|
@mock.patch.object(utils, 'execute', autospec=True)
|
||||||
def test_get_bmc_v6address_not_enabled(self, mocked_execute, mte):
|
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())
|
self.assertEqual('::/0', self.hardware.get_bmc_v6address())
|
||||||
|
|
||||||
@mock.patch.object(utils, 'try_execute', autospec=True)
|
@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(hardware, 'LOG', autospec=True)
|
||||||
@mock.patch.object(utils, 'try_execute', autospec=True)
|
@mock.patch.object(utils, 'try_execute', autospec=True)
|
||||||
@mock.patch.object(utils, '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):
|
self, mocked_execute, mte, mocked_log):
|
||||||
def side_effect(*args, **kwargs):
|
def side_effect(*args, **kwargs):
|
||||||
if args[0].startswith('ipmitool lan6 print'):
|
if args[0].startswith('ipmitool lan6 print'):
|
||||||
|
Reference in New Issue
Block a user