From de6fc4b670fc42fc96f27f375fbcf7a099629434 Mon Sep 17 00:00:00 2001 From: Martin Klozik Date: Thu, 18 May 2017 10:18:38 +0100 Subject: tests: Improvement of step driven testcases A set of improvements was introduced to enhance step driven testcases capabilities. Details: * delay among test steps is configurable by TEST_STEP_DELAY parameter * step driven tool function exec was renamed to exec_shell * new step driven tool function exec_python was introduced to execute a python code * new step driven object sleep was introduced to pause test execution for defined number of seconds. * fixed bug in settings.validate_getValue() to correctly validate access of parameters modified by TEST_PARAMS * new #PARAM() macro was introduced to allow references among configuration parameters * multistream support has been added into ixnetrfc2544v2.tcl, which is used for tunneling protocols test (op2p deployment) * fixed bug in op2p deployment to list interfaces and flows from both bridges involved in the test * test report updated to state exact rfcxxxx type of traffic type, e.g. rfc2544_continuous * test report of step driven testcases was updated to contain measured values from traffic generator in CSV report * method for ovs flow comparison was modified to normalize IPv4 CIDR network addr (e.g. 10.0.0.5/8 => 10.0.0.0/8) JIRA: VSPERF-512 Change-Id: Ib4f38dcdfbf3820dd766b25520da0ad0c81f3293 Signed-off-by: Martin Klozik Reviewed-by: Al Morton Reviewed-by: Christian Trautman Reviewed-by: Sridhar Rao Reviewed-by: Trevor Cooper Reviewed-by: Ciara Loftus --- core/vswitch_controller_op2p.py | 72 ++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 33 deletions(-) (limited to 'core/vswitch_controller_op2p.py') diff --git a/core/vswitch_controller_op2p.py b/core/vswitch_controller_op2p.py index ee8ada8b..85bf79bd 100644 --- a/core/vswitch_controller_op2p.py +++ b/core/vswitch_controller_op2p.py @@ -1,4 +1,4 @@ -# Copyright 2015-2016 Intel Corporation. +# Copyright 2015-2017 Intel Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ import logging from core.vswitch_controller import IVswitchController from vswitches.utils import add_ports_to_flow -from conf import settings +from conf import settings as S from tools import tasks _FLOW_TEMPLATE = { @@ -55,7 +55,7 @@ class VswitchControllerOP2P(IVswitchController): if self._tunnel_operation == "encapsulation": self._setup_encap() else: - if settings.getValue('VSWITCH').endswith('Vanilla'): + if str(S.getValue('VSWITCH')).endswith('Vanilla'): self._setup_decap_vanilla() else: self._setup_decap() @@ -70,17 +70,17 @@ class VswitchControllerOP2P(IVswitchController): try: self._vswitch.start() - bridge = settings.getValue('TUNNEL_INTEGRATION_BRIDGE') - bridge_ext = settings.getValue('TUNNEL_EXTERNAL_BRIDGE') - bridge_ext_ip = settings.getValue('TUNNEL_EXTERNAL_BRIDGE_IP') - tg_port2_mac = settings.getValue('TRAFFICGEN_PORT2_MAC') - vtep_ip2 = settings.getValue('VTEP_IP2') + bridge = S.getValue('TUNNEL_INTEGRATION_BRIDGE') + bridge_ext = S.getValue('TUNNEL_EXTERNAL_BRIDGE') + bridge_ext_ip = S.getValue('TUNNEL_EXTERNAL_BRIDGE_IP') + tg_port2_mac = S.getValue('TRAFFICGEN_PORT2_MAC') + vtep_ip2 = S.getValue('VTEP_IP2') self._vswitch.add_switch(bridge) tasks.run_task(['sudo', 'ip', 'addr', 'add', - settings.getValue('VTEP_IP1'), 'dev', bridge], + S.getValue('VTEP_IP1'), 'dev', bridge], self._logger, 'Assign ' + - settings.getValue('VTEP_IP1') + ' to ' + bridge, + S.getValue('VTEP_IP1') + ' to ' + bridge, False) tasks.run_task(['sudo', 'ip', 'link', 'set', 'dev', bridge, 'up'], self._logger, 'Bring up ' + bridge, False) @@ -104,10 +104,10 @@ class VswitchControllerOP2P(IVswitchController): 'Set ' + bridge_ext + 'status to up') self._vswitch.add_route(bridge, - settings.getValue('VTEP_IP2_SUBNET'), + S.getValue('VTEP_IP2_SUBNET'), bridge_ext) - if settings.getValue('VSWITCH').endswith('Vanilla'): + if str(S.getValue('VSWITCH')).endswith('Vanilla'): tasks.run_task(['sudo', 'arp', '-s', vtep_ip2, tg_port2_mac], self._logger, 'Set ' + bridge_ext + ' status to up') @@ -133,16 +133,16 @@ class VswitchControllerOP2P(IVswitchController): try: self._vswitch.start() - bridge = settings.getValue('TUNNEL_INTEGRATION_BRIDGE') - bridge_ext = settings.getValue('TUNNEL_EXTERNAL_BRIDGE') - bridge_ext_ip = settings.getValue('TUNNEL_EXTERNAL_BRIDGE_IP') - tgen_ip1 = settings.getValue('TRAFFICGEN_PORT1_IP') + bridge = S.getValue('TUNNEL_INTEGRATION_BRIDGE') + bridge_ext = S.getValue('TUNNEL_EXTERNAL_BRIDGE') + bridge_ext_ip = S.getValue('TUNNEL_EXTERNAL_BRIDGE_IP') + tgen_ip1 = S.getValue('TRAFFICGEN_PORT1_IP') self._vswitch.add_switch(bridge) tasks.run_task(['sudo', 'ip', 'addr', 'add', - settings.getValue('VTEP_IP1'), 'dev', bridge], + S.getValue('VTEP_IP1'), 'dev', bridge], self._logger, 'Assign ' + - settings.getValue('VTEP_IP1') + ' to ' + bridge, False) + S.getValue('VTEP_IP1') + ' to ' + bridge, False) tasks.run_task(['sudo', 'ip', 'link', 'set', 'dev', bridge, 'up'], self._logger, 'Bring up ' + bridge, False) @@ -152,7 +152,7 @@ class VswitchControllerOP2P(IVswitchController): self._vswitch.add_phy_port(bridge) (_, phy2_number) = self._vswitch.add_phy_port(bridge_ext) if tunnel_type == "vxlan": - vxlan_vni = 'options:key=' + settings.getValue('VXLAN_VNI') + vxlan_vni = 'options:key=' + S.getValue('VXLAN_VNI') (_, phy3_number) = self._vswitch.add_tunnel_port(bridge_ext, tgen_ip1, tunnel_type, @@ -174,7 +174,7 @@ class VswitchControllerOP2P(IVswitchController): 'Set ' + bridge_ext + ' status to up') self._vswitch.set_tunnel_arp(tgen_ip1, - settings.getValue('TRAFFICGEN_PORT1_MAC'), + S.getValue('TRAFFICGEN_PORT1_MAC'), bridge) # Test is unidirectional for now self._vswitch.del_flow(bridge_ext) @@ -193,16 +193,16 @@ class VswitchControllerOP2P(IVswitchController): try: self._vswitch.start() - bridge = settings.getValue('TUNNEL_INTEGRATION_BRIDGE') - bridge_ext = settings.getValue('TUNNEL_EXTERNAL_BRIDGE') - bridge_ext_ip = settings.getValue('TUNNEL_EXTERNAL_BRIDGE_IP') - tgen_ip1 = settings.getValue('TRAFFICGEN_PORT1_IP') + bridge = S.getValue('TUNNEL_INTEGRATION_BRIDGE') + bridge_ext = S.getValue('TUNNEL_EXTERNAL_BRIDGE') + bridge_ext_ip = S.getValue('TUNNEL_EXTERNAL_BRIDGE_IP') + tgen_ip1 = S.getValue('TRAFFICGEN_PORT1_IP') self._vswitch.add_switch(bridge) tasks.run_task(['sudo', 'ip', 'addr', 'add', - settings.getValue('TUNNEL_INT_BRIDGE_IP'), 'dev', bridge], + S.getValue('TUNNEL_INT_BRIDGE_IP'), 'dev', bridge], self._logger, 'Assign ' + - settings.getValue('TUNNEL_INT_BRIDGE_IP') + ' to ' + bridge, False) + S.getValue('TUNNEL_INT_BRIDGE_IP') + ' to ' + bridge, False) tasks.run_task(['sudo', 'ip', 'link', 'set', 'dev', bridge, 'up'], self._logger, 'Bring up ' + bridge, False) @@ -213,7 +213,7 @@ class VswitchControllerOP2P(IVswitchController): (_, phy2_number) = self._vswitch.add_phy_port(bridge) if tunnel_type == "vxlan": - vxlan_vni = 'options:key=' + settings.getValue('VXLAN_VNI') + vxlan_vni = 'options:key=' + S.getValue('VXLAN_VNI') self._vswitch.add_tunnel_port(bridge, tgen_ip1, tunnel_type, params=[vxlan_vni]) else: @@ -231,15 +231,15 @@ class VswitchControllerOP2P(IVswitchController): self._logger, 'Set ' + bridge_ext + ' status to up') - tg_port2_mac = settings.getValue('TRAFFICGEN_PORT2_MAC') - vtep_ip2 = settings.getValue('TRAFFICGEN_PORT2_IP') + tg_port2_mac = S.getValue('TRAFFICGEN_PORT2_MAC') + vtep_ip2 = S.getValue('TRAFFICGEN_PORT2_IP') self._vswitch.set_tunnel_arp(vtep_ip2, tg_port2_mac, bridge_ext) self._vswitch.add_route(bridge, - settings.getValue('VTEP_IP2_SUBNET'), + S.getValue('VTEP_IP2_SUBNET'), bridge) @@ -278,10 +278,16 @@ class VswitchControllerOP2P(IVswitchController): def get_ports_info(self): """See IVswitchController for description """ - self._logger.debug('get_ports_info using ' + str(self._vswitch_class)) - return self._vswitch.get_ports(settings.getValue('VSWITCH_BRIDGE_NAME')) + self._logger.debug('get_ports_info for bridges: %s, %s', + S.getValue('TUNNEL_INTEGRATION_BRIDGE'), + S.getValue('TUNNEL_EXTERNAL_BRIDGE')) + return self._vswitch.get_ports( + S.getValue('TUNNEL_INTEGRATION_BRIDGE')) +\ + self._vswitch.get_ports( + S.getValue('TUNNEL_EXTERNAL_BRIDGE')) def dump_vswitch_flows(self): """See IVswitchController for description """ - self._vswitch.dump_flows(settings.getValue('VSWITCH_BRIDGE_NAME')) + self._vswitch.dump_flows(S.getValue('TUNNEL_INTEGRATION_BRIDGE')) + self._vswitch.dump_flows(S.getValue('TUNNEL_EXTERNAL_BRIDGE')) -- cgit 1.2.3-korg