bugfix: Ethernet type and vnf stop fixes 87/26687/1
authorMartin Klozik <martinx.klozik@intel.com>
Wed, 4 Jan 2017 15:07:52 +0000 (15:07 +0000)
committerMartin Klozik <martinx.klozik@intel.com>
Wed, 4 Jan 2017 18:05:42 +0000 (18:05 +0000)
Usage of ethernet type for IPv4 was harmonized, to use
0x0800 at all places. Together with this fix a bug during
VNF cleanup was removed - VNF started by TestSteps are
tested for validity before the call of their stop() method.
It avoid vsperf crash in case, that VNF was not properly
started.

JIRA: VSPERF-436

Change-Id: Ic1a36919f5c9d707aa0aad64b5d96a1214c56cb3
Signed-off-by: Martin Klozik <martinx.klozik@intel.com>
Reviewed-by: Al Morton <acmorton@att.com>
Reviewed-by: Christian Trautman <ctrautma@redhat.com>
Reviewed-by: Bill Michalowski <bmichalo@redhat.com>
Reviewed-by: Antonio Fischetti <antonio.fischetti@intel.com>
Reviewed-by: Sridhar Rao <sridhar.rao@spirent.com>
core/vswitch_controller_p2p.py
core/vswitch_controller_pxp.py
docs/userguide/teststeps.rst
testcases/testcase.py

index e9ab5cc..de3fcc0 100644 (file)
@@ -158,14 +158,14 @@ class VswitchControllerP2P(IVswitchController):
                 dst_ip_value = netaddr.IPAddress(self._traffic['l3']['dstip']).value
                 for i in range(int(self._traffic['multistream'])):
                     tmp_ip = netaddr.IPAddress(dst_ip_value + i)
-                    flow_template.update({'dl_type':'0x800', 'nw_dst':tmp_ip})
+                    flow_template.update({'dl_type':'0x0800', 'nw_dst':tmp_ip})
                     # optimize flow insertion by usage of cache
                     self._vswitch.add_flow(bridge, flow_template, cache='on')
             elif self._traffic['stream_type'] == 'L4':
                 # read transport protocol from configuration and iterate through its destination port
                 proto = _PROTO_TCP if self._traffic['l3']['proto'].lower() == 'tcp' else _PROTO_UDP
                 for i in range(int(self._traffic['multistream'])):
-                    flow_template.update({'dl_type':'0x800', 'nw_proto':proto, 'tp_dst':i})
+                    flow_template.update({'dl_type':'0x0800', 'nw_proto':proto, 'tp_dst':i})
                     # optimize flow insertion by usage of cache
                     self._vswitch.add_flow(bridge, flow_template, cache='on')
             else:
index 6f53b5a..d4d1e76 100644 (file)
@@ -156,9 +156,9 @@ class VswitchControllerPXP(IVswitchController):
                             flow_p.update({'dl_dst':tmp_mac})
                         elif self._traffic['stream_type'] == 'L3':
                             tmp_ip = netaddr.IPAddress(dst_ip_value + stream)
-                            flow_p.update({'dl_type':'0x800', 'nw_dst':tmp_ip})
+                            flow_p.update({'dl_type':'0x0800', 'nw_dst':tmp_ip})
                         elif self._traffic['stream_type'] == 'L4':
-                            flow_p.update({'dl_type':'0x800', 'nw_proto':proto, 'tp_dst':stream})
+                            flow_p.update({'dl_type':'0x0800', 'nw_proto':proto, 'tp_dst':stream})
                         else:
                             raise RuntimeError('Unknown stream_type {}'.format(self._traffic['stream_type']))
 
index c00a274..5e2d957 100644 (file)
@@ -633,10 +633,10 @@ and available in both csv and rst report files.
                         ['vswitch', 'add_vport', 'br0'],
                         # priority must be higher than default 32768, otherwise flows won't match
                         ['vswitch', 'add_flow', 'br0',
-                         {'in_port': '1', 'actions': ['output:#STEP[-2][1]'], 'idle_timeout': '0', 'dl_type':'0x800',
+                         {'in_port': '1', 'actions': ['output:#STEP[-2][1]'], 'idle_timeout': '0', 'dl_type':'0x0800',
                                                       'nw_proto':'17', 'tp_dst':'0', 'priority': '33000'}],
                         ['vswitch', 'add_flow', 'br0',
-                         {'in_port': '2', 'actions': ['output:#STEP[-2][1]'], 'idle_timeout': '0', 'dl_type':'0x800',
+                         {'in_port': '2', 'actions': ['output:#STEP[-2][1]'], 'idle_timeout': '0', 'dl_type':'0x0800',
                                                       'nw_proto':'17', 'tp_dst':'0', 'priority': '33000'}],
                         ['vswitch', 'add_flow', 'br0', {'in_port': '#STEP[-4][1]', 'actions': ['output:1'],
                                                         'idle_timeout': '0'}],
index 18ad424..55c940a 100644 (file)
@@ -679,7 +679,8 @@ class TestCase(object):
         """ Stop all VNFs started by TestSteps
         """
         for vnf in self._step_vnf_list:
-            self._step_vnf_list[vnf].stop()
+            if self._step_vnf_list[vnf]:
+                self._step_vnf_list[vnf].stop()
 
     @staticmethod
     def step_eval_param(param, STEP):