diff options
author | Fabian Wiesel <fabian.wiesel@sap.com> | 2018-09-14 19:33:01 +0000 |
---|---|---|
committer | Server Team CI Bot <josh.powers+server-team-bot@canonical.com> | 2018-09-14 19:33:01 +0000 |
commit | c6cfed7fb58be76a3f95963a5de469aa03542cd3 (patch) | |
tree | b609c9d2f9b79051b490f28b8a24213713b9d962 /tests | |
parent | 84bf2482ad569357541e94d8f7f90cf0cdd759e2 (diff) | |
download | vyos-cloud-init-c6cfed7fb58be76a3f95963a5de469aa03542cd3.tar.gz vyos-cloud-init-c6cfed7fb58be76a3f95963a5de469aa03542cd3.zip |
OpenStack: Support setting mac address on bond.
Fix a bug where setting of mac address on a bond device was
ignored when provided in OpenStack network_config.json.
LP: #1682064
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unittests/test_datasource/test_configdrive.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/unittests/test_datasource/test_configdrive.py b/tests/unittests/test_datasource/test_configdrive.py index b0abfc5f..231619c9 100644 --- a/tests/unittests/test_datasource/test_configdrive.py +++ b/tests/unittests/test_datasource/test_configdrive.py @@ -136,6 +136,7 @@ NETWORK_DATA_3 = { ] } +BOND_MAC = "fa:16:3e:b3:72:36" NETWORK_DATA_BOND = { "services": [ {"type": "dns", "address": "1.1.1.191"}, @@ -163,7 +164,7 @@ NETWORK_DATA_BOND = { {"bond_links": ["eth0", "eth1"], "bond_miimon": 100, "bond_mode": "4", "bond_xmit_hash_policy": "layer3+4", - "ethernet_mac_address": "0c:c4:7a:34:6e:3c", + "ethernet_mac_address": BOND_MAC, "id": "bond0", "type": "bond"}, {"ethernet_mac_address": "fa:16:3e:b3:72:30", "id": "vlan2", "type": "vlan", "vlan_id": 602, @@ -691,6 +692,9 @@ class TestConvertNetworkData(CiTestCase): self.assertIn("auto oeth0", eni_rendering) self.assertIn("auto oeth1", eni_rendering) self.assertIn("auto bond0", eni_rendering) + # The bond should have the given mac address + pos = eni_rendering.find("auto bond0") + self.assertIn(BOND_MAC, eni_rendering[pos:]) def test_vlan(self): # light testing of vlan config conversion and eni rendering |