diff options
-rw-r--r-- | conf/02_vswitch.conf | 5 | ||||
-rw-r--r-- | docs/testing/user/configguide/trafficgen.rst | 7 | ||||
-rw-r--r-- | src/ovs/ofctl.py | 20 | ||||
-rw-r--r-- | src/package-list.mk | 2 | ||||
-rwxr-xr-x | systems/rhel/7.2/build_base_machine.sh | 4 | ||||
-rwxr-xr-x | systems/rhel/7.3/build_base_machine.sh | 4 | ||||
-rw-r--r-- | tools/pkt_gen/xena/json/xena_json.py | 21 | ||||
-rwxr-xr-x | tools/pkt_gen/xena/xena.py | 6 |
8 files changed, 51 insertions, 18 deletions
diff --git a/conf/02_vswitch.conf b/conf/02_vswitch.conf index 6a830a05..4d0fc46b 100644 --- a/conf/02_vswitch.conf +++ b/conf/02_vswitch.conf @@ -201,6 +201,11 @@ VSWITCH = "OvsDpdkVhost" VSWITCH_JUMBO_FRAMES_ENABLED = False VSWITCH_JUMBO_FRAMES_SIZE = 9000 +# default arguments of OVS ctl tools +OVS_VSCTL_ARGS = [] +OVS_OFCTL_ARGS = ['-O', 'OpenFlow13'] # backward compatible default value +OVS_APPCTL_ARGS = [] + ######################### ## VPP ######################### diff --git a/docs/testing/user/configguide/trafficgen.rst b/docs/testing/user/configguide/trafficgen.rst index 4909c55a..52b1b4a5 100644 --- a/docs/testing/user/configguide/trafficgen.rst +++ b/docs/testing/user/configguide/trafficgen.rst @@ -745,11 +745,14 @@ You can directly download from GitHub: git clone https://github.com/cisco-system-traffic-generator/trex-core -and use the master branch: +and use the same Trex version for both server and client API. + +**NOTE:** The Trex API version used by VSPERF is defined by variable ``TREX_TAG`` +in file ``src/package-list.mk``. .. code-block:: console - git checkout master + git checkout v2.38 or Trex latest release you can download from here: diff --git a/src/ovs/ofctl.py b/src/ovs/ofctl.py index e5c20378..b023e080 100644 --- a/src/ovs/ofctl.py +++ b/src/ovs/ofctl.py @@ -25,10 +25,10 @@ import re import netaddr from tools import tasks -from conf import settings +from conf import settings as S -_OVS_BRIDGE_NAME = settings.getValue('VSWITCH_BRIDGE_NAME') -_OVS_CMD_TIMEOUT = settings.getValue('OVS_CMD_TIMEOUT') +_OVS_BRIDGE_NAME = S.getValue('VSWITCH_BRIDGE_NAME') +_OVS_CMD_TIMEOUT = S.getValue('OVS_CMD_TIMEOUT') _CACHE_FILE_NAME = '/tmp/vsperf_flows_cache' @@ -62,9 +62,11 @@ class OFBase(object): :return: None """ if self.timeout == -1: - cmd = ['sudo', settings.getValue('TOOLS')['ovs-vsctl'], '--no-wait'] + args + cmd = ['sudo', S.getValue('TOOLS')['ovs-vsctl'], '--no-wait'] + \ + S.getValue('OVS_VSCTL_ARGS') + args else: - cmd = ['sudo', settings.getValue('TOOLS')['ovs-vsctl'], '--timeout', str(self.timeout)] + args + cmd = ['sudo', S.getValue('TOOLS')['ovs-vsctl'], '--timeout', + str(self.timeout)] + S.getValue('OVS_VSCTL_ARGS') + args return tasks.run_task( cmd, self.logger, 'Running ovs-vsctl...', check_error) @@ -77,9 +79,9 @@ class OFBase(object): :return: None """ - cmd = ['sudo', settings.getValue('TOOLS')['ovs-appctl'], + cmd = ['sudo', S.getValue('TOOLS')['ovs-appctl'], '--timeout', - str(self.timeout)] + args + str(self.timeout)] + S.getValue('OVS_APPCTL_ARGS') + args return tasks.run_task( cmd, self.logger, 'Running ovs-appctl...', check_error) @@ -180,8 +182,8 @@ class OFBridge(OFBase): :return: None """ tmp_timeout = self.timeout if timeout is None else timeout - cmd = ['sudo', settings.getValue('TOOLS')['ovs-ofctl'], '-O', - 'OpenFlow13', '--timeout', str(tmp_timeout)] + args + cmd = ['sudo', S.getValue('TOOLS')['ovs-ofctl'], '--timeout', + str(tmp_timeout)] + S.getValue('OVS_OFCTL_ARGS') + args return tasks.run_task( cmd, self.logger, 'Running ovs-ofctl...', check_error) diff --git a/src/package-list.mk b/src/package-list.mk index 7b82ee6f..d32a9ffd 100644 --- a/src/package-list.mk +++ b/src/package-list.mk @@ -29,4 +29,4 @@ QEMU_TAG ?= v2.9.1 # TREX section TREX_URL ?= https://github.com/cisco-system-traffic-generator/trex-core.git -TREX_TAG ?= 8bf9c16556843e55c232b64d9a5061bf588fad42 +TREX_TAG ?= v2.38 diff --git a/systems/rhel/7.2/build_base_machine.sh b/systems/rhel/7.2/build_base_machine.sh index d3f74726..198f39d7 100755 --- a/systems/rhel/7.2/build_base_machine.sh +++ b/systems/rhel/7.2/build_base_machine.sh @@ -53,7 +53,6 @@ pkglist=( numactl\ numactl-devel\ libpng-devel\ - epel-release\ sshpass\ ) @@ -63,6 +62,9 @@ pkglist=( python-six\ ) +# install RHEL compatible epel for sshpass +yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm + # Iterate installing each package. If packages fail to install, record those # packages and exit with an error message on completion. Customer may need to # add repo locations and subscription levels. diff --git a/systems/rhel/7.3/build_base_machine.sh b/systems/rhel/7.3/build_base_machine.sh index dfa738df..ae527214 100755 --- a/systems/rhel/7.3/build_base_machine.sh +++ b/systems/rhel/7.3/build_base_machine.sh @@ -53,7 +53,6 @@ pkglist=( numactl\ numactl-devel\ libpng-devel\ - epel-release\ sshpass\ ) @@ -63,6 +62,9 @@ pkglist=( python-six\ ) +# install RHEL compatible epel for sshpass +yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm + # Iterate installing each package. If packages fail to install, record those # packages and exit with an error message on completion. Customer may need to # add repo locations and subscription levels. diff --git a/tools/pkt_gen/xena/json/xena_json.py b/tools/pkt_gen/xena/json/xena_json.py index b1eed720..90b61d8c 100644 --- a/tools/pkt_gen/xena/json/xena_json.py +++ b/tools/pkt_gen/xena/json/xena_json.py @@ -28,8 +28,6 @@ import locale import logging import os -import scapy.layers.inet as inet - from tools.pkt_gen.xena.json import json_utilities _LOGGER = logging.getLogger(__name__) @@ -51,6 +49,9 @@ class XenaJSON(object): two module ports with each port having its own stream config profile. :return: XenaJSON object """ + # import can't be performed at module level, because it conflicts with import + # of customized scapy version by T-Rex + import scapy.layers.inet as inet self.json_data = json_utilities.read_json_file(json_path) self.packet_data = OrderedDict() @@ -279,6 +280,10 @@ class XenaJSON(object): :param kwargs: Extra params per scapy usage. :return: None """ + # import can't be performed at module level, because it conflicts with import + # of customized scapy version by T-Rex + import scapy.layers.inet as inet + self.packet_data['layer2'] = [ inet.Ether(dst=dst_mac, src=src_mac, **kwargs), inet.Ether(dst=src_mac, src=dst_mac, **kwargs)] @@ -293,6 +298,10 @@ class XenaJSON(object): :param kwargs: Extra params per scapy usage :return: None """ + # import can't be performed at module level, because it conflicts with import + # of customized scapy version by T-Rex + import scapy.layers.inet as inet + self.packet_data['layer3'] = [ inet.IP(src=src_ip, dst=dst_ip, proto=protocol.lower(), **kwargs), inet.IP(src=dst_ip, dst=src_ip, proto=protocol.lower(), **kwargs)] @@ -305,6 +314,10 @@ class XenaJSON(object): :param kwargs: Extra params per scapy usage :return: None """ + # import can't be performed at module level, because it conflicts with import + # of customized scapy version by T-Rex + import scapy.layers.inet as inet + self.packet_data['layer4'] = [ inet.UDP(sport=source_port, dport=destination_port, **kwargs), inet.UDP(sport=source_port, dport=destination_port, **kwargs)] @@ -316,6 +329,10 @@ class XenaJSON(object): :param kwargs: Extra params per scapy usage :return: None """ + # import can't be performed at module level, because it conflicts with import + # of customized scapy version by T-Rex + import scapy.layers.inet as inet + self.packet_data['vlan'] = [ inet.Dot1Q(vlan=vlan_id, **kwargs), inet.Dot1Q(vlan=vlan_id, **kwargs)] diff --git a/tools/pkt_gen/xena/xena.py b/tools/pkt_gen/xena/xena.py index af68463c..c8988b06 100755 --- a/tools/pkt_gen/xena/xena.py +++ b/tools/pkt_gen/xena/xena.py @@ -32,8 +32,6 @@ import xml.etree.ElementTree as ET from collections import OrderedDict from time import sleep -import scapy.layers.inet as inet - from conf import merge_spec from conf import settings from core.results.results_constants import ResultsConstants @@ -149,6 +147,10 @@ class Xena(ITrafficGenerator): :param reverse: Swap source and destination info when building header :return: packet header in hex """ + # import can't be performed at module level, because it conflicts with import + # of customized scapy version by T-Rex + import scapy.layers.inet as inet + srcmac = self._params['traffic']['l2'][ 'srcmac'] if not reverse else self._params['traffic']['l2'][ 'dstmac'] |