From 9ecc15f0edf2460c2eb2cac8e9ccca8cbb8d3808 Mon Sep 17 00:00:00 2001 From: Feng Pan Date: Mon, 17 Jul 2017 16:25:25 -0400 Subject: Merge Newton private changes - Add interface mapping data to hiera - Add support for VPP interfaces - Continue bringing up interfaces even if one fails - Change hiera to json format List of commits: https://github.com/openstack/os-net-config/compare/stable/newton...trozet:stable/danube Change-Id: If7a2c6119bf613f1fc8846237b077cd8f0e26015 Signed-off-by: Feng Pan --- os_net_config/tests/test_utils.py | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) (limited to 'os_net_config/tests/test_utils.py') diff --git a/os_net_config/tests/test_utils.py b/os_net_config/tests/test_utils.py index 9e516b6..8a78946 100644 --- a/os_net_config/tests/test_utils.py +++ b/os_net_config/tests/test_utils.py @@ -21,6 +21,7 @@ import shutil import tempfile import yaml +from os_net_config import objects from os_net_config.tests import base from os_net_config import utils @@ -38,6 +39,33 @@ supports-register-dump: yes supports-priv-flags: no ''' +_VPPCTL_OUTPUT = ''' + Name Idx State Counter Count +GigabitEthernet0/9/0 1 down +local0 0 down + +''' + +_INITIAL_VPP_CONFIG = ''' +unix { + nodaemon + log /tmp/vpp.log + full-coredump +} + + +api-trace { + on +} + +api-segment { + gid vpp +} + +dpdk { +} +''' + class TestUtils(base.TestCase): @@ -83,7 +111,7 @@ class TestUtils(base.TestCase): out = _PCI_OUTPUT return out, None self.stubs.Set(processutils, 'execute', test_execute) - pci = utils._get_pci_address('nic2', False) + pci = utils.get_pci_address('nic2', False) self.assertEqual('0000:00:19.0', pci) def test_get_pci_address_exception(self): @@ -91,7 +119,7 @@ class TestUtils(base.TestCase): if 'ethtool' in name: raise processutils.ProcessExecutionError self.stubs.Set(processutils, 'execute', test_execute) - pci = utils._get_pci_address('nic2', False) + pci = utils.get_pci_address('nic2', False) self.assertEqual(None, pci) def test_get_pci_address_error(self): @@ -99,7 +127,7 @@ class TestUtils(base.TestCase): if 'ethtool' in name: return None, 'Error' self.stubs.Set(processutils, 'execute', test_execute) - pci = utils._get_pci_address('nic2', False) + pci = utils.get_pci_address('nic2', False) self.assertEqual(None, pci) def test_bind_dpdk_interfaces(self): -- cgit 1.2.3-korg