summaryrefslogtreecommitdiffstats
path: root/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py
diff options
context:
space:
mode:
authorChornyi, TarasX <tarasx.chornyi@intel.com>2018-04-30 17:17:26 +0300
committerEmma Foley <emma.l.foley@intel.com>2018-06-20 17:00:14 +0000
commit2b3e7b36557744460ccee0d77b6498f02b9e3a21 (patch)
treed803497a94525302350360f5366a7307a6cde803 /tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py
parentc87a5438961cba359629800b31df3ad7f656aff8 (diff)
Add --hwlb options as a command line argument for SampleVNF
To enable HWLB queues in samplevnf on supported hardware (e.g Intel Fortville) --hwlb option needs to be passed as a VNF command line argument. JIRA: YARDSTICK-1159 Change-Id: I6e5c098dc71a711252b545c7622ee52085fa81f0 Signed-off-by: Chornyi, TarasX <tarasx.chornyi@intel.com> (cherry picked from commit 1c8bfeb11a620c63ffd9fcd7f8735ded4521e077)
Diffstat (limited to 'tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py')
-rw-r--r--tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py
index 8c45d973e..9857e95b6 100644
--- a/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py
+++ b/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py
@@ -18,7 +18,7 @@ import os
import time
import mock
-import six.moves.configparser as configparser
+from six.moves import configparser
import unittest
from tests.unit import STL_MOCKS
@@ -663,7 +663,14 @@ class TestVpeApproxVnf(unittest.TestCase):
vpe_approx_vnf.ssh_helper.bin_path = mock.Mock()
vpe_approx_vnf.ssh_helper.upload_config_file = mock.MagicMock()
self.assertIsNone(vpe_approx_vnf._build_vnf_ports())
- self.assertIsNotNone(vpe_approx_vnf.build_config())
+
+ vpe_approx_vnf.ssh_helper.provision_tool = mock.Mock(return_value='tool_path')
+ vpe_approx_vnf.ssh_helper.all_ports = mock.Mock()
+ vpe_approx_vnf.vnfd_helper.port_nums = mock.Mock(return_value=[0, 1])
+ vpe_approx_vnf.scenario_helper.vnf_cfg = {'lb_config': 'HW'}
+
+ expected = 'sudo tool_path -p 0x3 -f /tmp/vpe_config -s /tmp/vpe_script --hwlb 3'
+ self.assertEqual(vpe_approx_vnf.build_config(), expected)
@mock.patch(SSH_HELPER)
def test_wait_for_instantiate(self, ssh):