Runners crash on test startup. 77/61177/5
authorDanielMartinBuckley <daniel.m.buckley@intel.com>
Tue, 21 Aug 2018 13:17:25 +0000 (14:17 +0100)
committerDanielMartinBuckley <daniel.m.buckley@intel.com>
Thu, 23 Aug 2018 09:34:10 +0000 (10:34 +0100)
JIRA: YARDSTICK-1393

The problem resides in this traffic generator class: this class
is inheriting from SampleVNFTrafficGen and overriding the
__init__ method but is NOT calling the parent class __init__
one.

Change-Id: I206a66e361a3e2eb50bb5fa01ddadae25b4a9f54
Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
yardstick/network_services/vnf_generic/vnf/tg_prox.py
yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_prox.py

index 854319a..d12c42e 100644 (file)
@@ -12,9 +12,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from __future__ import absolute_import
-
 import logging
+import copy
 
 from yardstick.network_services.utils import get_nsb_option
 from yardstick.network_services.vnf_generic.vnf.prox_vnf import ProxApproxVnf
@@ -32,7 +31,9 @@ class ProxTrafficGen(SampleVNFTrafficGen):
 
     def __init__(self, name, vnfd, task_id, setup_env_helper_type=None,
                  resource_helper_type=None):
-        # don't call superclass, use custom wrapper of ProxApproxVnf
+        vnfd_cpy = copy.deepcopy(vnfd)
+        super(ProxTrafficGen, self).__init__(name, vnfd_cpy, task_id)
+
         self._vnf_wrapper = ProxApproxVnf(
             name, vnfd, task_id, setup_env_helper_type, resource_helper_type)
         self.bin_path = get_nsb_option('bin_path', '')
index 5ad182f..a7e61da 100644 (file)
@@ -317,6 +317,7 @@ class TestProxTrafficGen(unittest.TestCase):
         prox_traffic_gen = ProxTrafficGen(NAME, self.VNFD0, 'task_id')
         self.assertIsNone(prox_traffic_gen._tg_process)
         self.assertIsNone(prox_traffic_gen._traffic_process)
+        self.assertIsNone(prox_traffic_gen._mq_producer)
 
     @mock.patch.object(ctx_base.Context, 'get_physical_node_from_server', return_value='mock_node')
     @mock.patch(SSH_HELPER)