aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward MacGillivray <edward.s.macgillivray@intel.com>2017-10-13 14:01:39 -0700
committerRoss Brattain <ross.b.brattain@intel.com>2017-10-18 17:07:19 -0700
commit55f9b4a3d2052ccd5d8148be1209806141898912 (patch)
treebac270d9506dcdd4ed3a47c19f12cd5fa298237a
parent357958bd97dd3e0b1864dfb3d3f973c04c3602a9 (diff)
Relocate iniparser to yardstick.network_services.helpers
Change-Id: I1f457c9c24f2ca84dde61b64f58edaff8952670a Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com>
-rw-r--r--tests/unit/network_services/helpers/test_iniparser.py (renamed from tests/unit/network_services/vnf_generic/vnf/test_iniparser.py)14
-rw-r--r--tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py2
-rw-r--r--yardstick/network_services/helpers/iniparser.py (renamed from yardstick/network_services/vnf_generic/vnf/iniparser.py)0
-rw-r--r--yardstick/network_services/vnf_generic/vnf/prox_helpers.py11
4 files changed, 13 insertions, 14 deletions
diff --git a/tests/unit/network_services/vnf_generic/vnf/test_iniparser.py b/tests/unit/network_services/helpers/test_iniparser.py
index 1ad8df9c6..bd27b497e 100644
--- a/tests/unit/network_services/vnf_generic/vnf/test_iniparser.py
+++ b/tests/unit/network_services/helpers/test_iniparser.py
@@ -27,10 +27,10 @@ stl_patch = mock.patch.dict("sys.modules", STL_MOCKS)
stl_patch.start()
if stl_patch:
- from yardstick.network_services.vnf_generic.vnf.iniparser import ParseError
- from yardstick.network_services.vnf_generic.vnf.iniparser import LineParser
- from yardstick.network_services.vnf_generic.vnf.iniparser import BaseParser
- from yardstick.network_services.vnf_generic.vnf.iniparser import ConfigParser
+ from yardstick.network_services.helpers.iniparser import ParseError
+ from yardstick.network_services.helpers.iniparser import LineParser
+ from yardstick.network_services.helpers.iniparser import BaseParser
+ from yardstick.network_services.helpers.iniparser import ConfigParser
PARSE_TEXT_1 = """\
@@ -141,7 +141,7 @@ class TestConfigParser(unittest.TestCase):
return internal_open
- @mock.patch('yardstick.network_services.vnf_generic.vnf.iniparser.open')
+ @mock.patch('yardstick.network_services.helpers.iniparser.open')
def test_parse(self, mock_open):
mock_open.side_effect = self.make_open(PARSE_TEXT_1)
@@ -182,7 +182,7 @@ class TestConfigParser(unittest.TestCase):
self.assertEqual(config_parser.find_section_index('section1'), 1)
self.assertEqual(config_parser.find_section_index('section3'), -1)
- @mock.patch('yardstick.network_services.vnf_generic.vnf.iniparser.open')
+ @mock.patch('yardstick.network_services.helpers.iniparser.open')
def test_parse_2(self, mock_open):
mock_open.side_effect = self.make_open(PARSE_TEXT_2)
@@ -200,7 +200,7 @@ class TestConfigParser(unittest.TestCase):
self.assertEqual(config_parser.sections, expected)
- @mock.patch('yardstick.network_services.vnf_generic.vnf.iniparser.open')
+ @mock.patch('yardstick.network_services.helpers.iniparser.open')
def test_parse_negative(self, mock_open):
bad_text_dict = {
'no section': PARSE_TEXT_BAD_1,
diff --git a/tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py
index 09060ff57..a6d40877d 100644
--- a/tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py
+++ b/tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py
@@ -376,7 +376,7 @@ class TestProxApproxVnf(unittest.TestCase):
return file_path
@mock.patch('yardstick.benchmark.scenarios.networking.vnf_generic.open', create=True)
- @mock.patch('yardstick.network_services.vnf_generic.vnf.iniparser.open', create=True)
+ @mock.patch('yardstick.network_services.helpers.iniparser.open', create=True)
@mock.patch(SSH_HELPER)
def test_run_prox(self, ssh, *_):
mock_ssh(ssh)
diff --git a/yardstick/network_services/vnf_generic/vnf/iniparser.py b/yardstick/network_services/helpers/iniparser.py
index 98256e08a..98256e08a 100644
--- a/yardstick/network_services/vnf_generic/vnf/iniparser.py
+++ b/yardstick/network_services/helpers/iniparser.py
diff --git a/yardstick/network_services/vnf_generic/vnf/prox_helpers.py b/yardstick/network_services/vnf_generic/vnf/prox_helpers.py
index 992b6d06e..ac5abfbcb 100644
--- a/yardstick/network_services/vnf_generic/vnf/prox_helpers.py
+++ b/yardstick/network_services/vnf_generic/vnf/prox_helpers.py
@@ -14,28 +14,27 @@
from __future__ import absolute_import
import array
-import operator
-import logging
import io
+import logging
+import operator
import os
import re
import select
import socket
-
-from collections import OrderedDict, namedtuple
import time
+from collections import OrderedDict, namedtuple
from contextlib import contextmanager
from itertools import repeat, chain
from multiprocessing import Queue
import six
-from six.moves import zip, StringIO
from six.moves import cStringIO
+from six.moves import zip, StringIO
from yardstick.benchmark.scenarios.networking.vnf_generic import find_relative_file
from yardstick.common import utils
from yardstick.common.utils import SocketTopology, join_non_strings, try_int
-from yardstick.network_services.vnf_generic.vnf.iniparser import ConfigParser
+from yardstick.network_services.helpers.iniparser import ConfigParser
from yardstick.network_services.vnf_generic.vnf.sample_vnf import ClientResourceHelper
from yardstick.network_services.vnf_generic.vnf.sample_vnf import DpdkVnfSetupEnvHelper