Commit eccde16e authored by Zuul's avatar Zuul Committed by Gerrit Code Review

Merge "Fix VIP plugging on CentOS-based amphorae" into stable/stein

parents aa06d8d1 4ca1b681
...@@ -209,7 +209,7 @@ class BaseOS(object): ...@@ -209,7 +209,7 @@ class BaseOS(object):
addr_flush = "ip netns exec {ns} ip addr flush {int}".format( addr_flush = "ip netns exec {ns} ip addr flush {int}".format(
ns=consts.AMPHORA_NAMESPACE, int=interface) ns=consts.AMPHORA_NAMESPACE, int=interface)
cmd = ("ip netns exec {ns} ifup -v {params}".format( cmd = ("ip netns exec {ns} ifup {params}".format(
ns=consts.AMPHORA_NAMESPACE, params=interface)) ns=consts.AMPHORA_NAMESPACE, params=interface))
try: try:
out = subprocess.check_output(int_up.split(), out = subprocess.check_output(int_up.split(),
......
...@@ -1185,7 +1185,7 @@ class TestServerTestCase(base.TestCase): ...@@ -1185,7 +1185,7 @@ class TestServerTestCase(base.TestCase):
'PERSISTENT_DHCLIENT="1"\n'.format(int=test_int_num)) 'PERSISTENT_DHCLIENT="1"\n'.format(int=test_int_num))
mock_check_output.assert_called_with( mock_check_output.assert_called_with(
['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE, ['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
'ifup', '-v', 'eth' + test_int_num], stderr=-2) 'ifup', 'eth' + test_int_num], stderr=-2)
# fixed IPs happy path # fixed IPs happy path
port_info = {'mac_address': '123', 'mtu': 1450, 'fixed_ips': [ port_info = {'mac_address': '123', 'mtu': 1450, 'fixed_ips': [
...@@ -1263,7 +1263,7 @@ class TestServerTestCase(base.TestCase): ...@@ -1263,7 +1263,7 @@ class TestServerTestCase(base.TestCase):
'NETMASK="255.255.255.0"\n'.format(int=test_int_num)) 'NETMASK="255.255.255.0"\n'.format(int=test_int_num))
mock_check_output.assert_called_with( mock_check_output.assert_called_with(
['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE, ['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
'ifup', '-v', 'eth' + test_int_num], stderr=-2) 'ifup', 'eth' + test_int_num], stderr=-2)
# fixed IPs happy path IPv6 # fixed IPs happy path IPv6
port_info = {'mac_address': '123', 'mtu': 1450, 'fixed_ips': [ port_info = {'mac_address': '123', 'mtu': 1450, 'fixed_ips': [
...@@ -1337,7 +1337,7 @@ class TestServerTestCase(base.TestCase): ...@@ -1337,7 +1337,7 @@ class TestServerTestCase(base.TestCase):
'0000:0002"\n'.format(int=test_int_num)) '0000:0002"\n'.format(int=test_int_num))
mock_check_output.assert_called_with( mock_check_output.assert_called_with(
['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE, ['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
'ifup', '-v', 'eth' + test_int_num], stderr=-2) 'ifup', 'eth' + test_int_num], stderr=-2)
# fixed IPs, bogus IP # fixed IPs, bogus IP
port_info = {'mac_address': '123', 'fixed_ips': [ port_info = {'mac_address': '123', 'fixed_ips': [
...@@ -1539,7 +1539,7 @@ class TestServerTestCase(base.TestCase): ...@@ -1539,7 +1539,7 @@ class TestServerTestCase(base.TestCase):
mock_os_chmod.assert_has_calls(calls) mock_os_chmod.assert_has_calls(calls)
mock_check_output.assert_called_with( mock_check_output.assert_called_with(
['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE, ['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
'ifup', '-v', consts.NETNS_PRIMARY_INTERFACE], stderr=-2) 'ifup', consts.NETNS_PRIMARY_INTERFACE], stderr=-2)
def test_ubuntu_plug_VIP4(self): def test_ubuntu_plug_VIP4(self):
self._test_plug_VIP4(consts.UBUNTU) self._test_plug_VIP4(consts.UBUNTU)
...@@ -1800,7 +1800,7 @@ class TestServerTestCase(base.TestCase): ...@@ -1800,7 +1800,7 @@ class TestServerTestCase(base.TestCase):
mock_os_chmod.assert_has_calls(calls) mock_os_chmod.assert_has_calls(calls)
mock_check_output.assert_called_with( mock_check_output.assert_called_with(
['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE, ['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
'ifup', '-v', '{netns_int}:0'.format( 'ifup', '{netns_int}:0'.format(
netns_int=consts.NETNS_PRIMARY_INTERFACE)], stderr=-2) netns_int=consts.NETNS_PRIMARY_INTERFACE)], stderr=-2)
# Verify sysctl was loaded # Verify sysctl was loaded
...@@ -1903,7 +1903,7 @@ class TestServerTestCase(base.TestCase): ...@@ -1903,7 +1903,7 @@ class TestServerTestCase(base.TestCase):
netns_int=consts.NETNS_PRIMARY_INTERFACE)) netns_int=consts.NETNS_PRIMARY_INTERFACE))
mock_check_output.assert_called_with( mock_check_output.assert_called_with(
['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE, ['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
'ifup', '-v', '{netns_int}:0'.format( 'ifup', '{netns_int}:0'.format(
netns_int=consts.NETNS_PRIMARY_INTERFACE)], stderr=-2) netns_int=consts.NETNS_PRIMARY_INTERFACE)], stderr=-2)
mock_interfaces.side_effect = [['blah']] mock_interfaces.side_effect = [['blah']]
...@@ -2167,12 +2167,12 @@ class TestServerTestCase(base.TestCase): ...@@ -2167,12 +2167,12 @@ class TestServerTestCase(base.TestCase):
if distro == consts.UBUNTU: if distro == consts.UBUNTU:
mock_check_output.assert_called_with( mock_check_output.assert_called_with(
['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE, ['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
'ifup', '-v', '{netns_int}:0'.format( 'ifup', '{netns_int}:0'.format(
netns_int=consts.NETNS_PRIMARY_INTERFACE)], stderr=-2) netns_int=consts.NETNS_PRIMARY_INTERFACE)], stderr=-2)
elif distro == consts.CENTOS: elif distro == consts.CENTOS:
mock_check_output.assert_called_with( mock_check_output.assert_called_with(
['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE, ['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
'ifup', '-v', '{netns_int}'.format( 'ifup', '{netns_int}'.format(
netns_int=consts.NETNS_PRIMARY_INTERFACE)], stderr=-2) netns_int=consts.NETNS_PRIMARY_INTERFACE)], stderr=-2)
# Verify sysctl was loaded # Verify sysctl was loaded
...@@ -2277,12 +2277,12 @@ class TestServerTestCase(base.TestCase): ...@@ -2277,12 +2277,12 @@ class TestServerTestCase(base.TestCase):
if distro == consts.UBUNTU: if distro == consts.UBUNTU:
mock_check_output.assert_called_with( mock_check_output.assert_called_with(
['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE, ['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
'ifup', '-v', '{netns_int}:0'.format( 'ifup', '{netns_int}:0'.format(
netns_int=consts.NETNS_PRIMARY_INTERFACE)], stderr=-2) netns_int=consts.NETNS_PRIMARY_INTERFACE)], stderr=-2)
elif distro == consts.CENTOS: elif distro == consts.CENTOS:
mock_check_output.assert_called_with( mock_check_output.assert_called_with(
['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE, ['ip', 'netns', 'exec', consts.AMPHORA_NAMESPACE,
'ifup', '-v', '{netns_int}'.format( 'ifup', '{netns_int}'.format(
netns_int=consts.NETNS_PRIMARY_INTERFACE)], stderr=-2) netns_int=consts.NETNS_PRIMARY_INTERFACE)], stderr=-2)
mock_interfaces.side_effect = [['blah']] mock_interfaces.side_effect = [['blah']]
......
---
fixes:
- Fixed an error when plugging the VIP on CentOS-based amphorae.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment