diff options
author | Feng Pan <fpan@redhat.com> | 2017-07-17 16:25:25 -0400 |
---|---|---|
committer | Feng Pan <fpan@redhat.com> | 2017-07-24 16:15:47 -0400 |
commit | 9ecc15f0edf2460c2eb2cac8e9ccca8cbb8d3808 (patch) | |
tree | 665bb067f795505f77d0d1eba98204e02dd11dec /os_net_config/tests/test_utils.py | |
parent | 02da9fd51b454b1954b04a462cb05a14598fa172 (diff) |
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 <fpan@redhat.com>
Diffstat (limited to 'os_net_config/tests/test_utils.py')
-rw-r--r-- | os_net_config/tests/test_utils.py | 34 |
1 files changed, 31 insertions, 3 deletions
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): |