summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--samples/vnf_samples/nsut/vfw/tc_baremetal_rfc2544_ipv4_1rule_1flow_64B_trex_4port.yaml45
-rw-r--r--samples/vnf_samples/nsut/vfw/tc_heat_rfc2544_ipv4_1rule_1flow_64B_trex_4port.yaml89
-rw-r--r--samples/vnf_samples/nsut/vfw/vfw-tg-topology-4port.yaml70
-rw-r--r--samples/vnf_samples/vnf_descriptors/tg_rfc2544_tpl.yaml1
-rw-r--r--samples/vnf_samples/vnf_descriptors/tg_rfc2544_tpl_4port.yaml103
-rw-r--r--tests/opnfv/test_suites/opnfv_os-odl-fdio-noha_daily.yaml38
-rw-r--r--tests/opnfv/test_suites/opnfv_os-odl-nofeature-ha_daily.yaml64
-rw-r--r--tests/opnfv/test_suites/opnfv_os-odl-ovs-ha_daily.yaml64
-rw-r--r--yardstick/network_services/traffic_profile/traffic_profile.py20
-rw-r--r--yardstick/network_services/vnf_generic/vnf/sample_vnf.py5
-rw-r--r--yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py41
11 files changed, 406 insertions, 134 deletions
diff --git a/samples/vnf_samples/nsut/vfw/tc_baremetal_rfc2544_ipv4_1rule_1flow_64B_trex_4port.yaml b/samples/vnf_samples/nsut/vfw/tc_baremetal_rfc2544_ipv4_1rule_1flow_64B_trex_4port.yaml
new file mode 100644
index 000000000..0904ace2c
--- /dev/null
+++ b/samples/vnf_samples/nsut/vfw/tc_baremetal_rfc2544_ipv4_1rule_1flow_64B_trex_4port.yaml
@@ -0,0 +1,45 @@
+# Copyright (c) 2016-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.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+---
+schema: yardstick:task:0.1
+scenarios:
+- type: NSPerf
+ traffic_profile: ../../traffic_profiles/ipv4_throughput-4.yaml
+ topology: vfw-tg-topology-4port.yaml
+ nodes:
+ tg__0: trafficgen_1.yardstick
+ vnf__0: vnf.yardstick
+ options:
+ framesize:
+ private: {64B: 100}
+ public: {64B: 100}
+ flow:
+ src_ip: [{'tg__0': 'xe0'}, {'tg__0': 'xe2'}]
+ dst_ip: [{'tg__0': 'xe1'}, {'tg__0': 'xe3'}]
+ count: 1
+ traffic_type: 4
+ rfc2544:
+ allowed_drop_rate: 0.0001 - 0.0001
+ vnf__0:
+ rules: acl_1rule.yaml
+ vnf_config: {lb_config: 'SW', lb_count: 2, worker_config: '1C/1T', worker_threads: 1}
+ runner:
+ type: Iteration
+ iterations: 10
+ interval: 35
+context:
+ type: Node
+ name: yardstick
+ nfvi_type: baremetal
diff --git a/samples/vnf_samples/nsut/vfw/tc_heat_rfc2544_ipv4_1rule_1flow_64B_trex_4port.yaml b/samples/vnf_samples/nsut/vfw/tc_heat_rfc2544_ipv4_1rule_1flow_64B_trex_4port.yaml
new file mode 100644
index 000000000..972a6ab37
--- /dev/null
+++ b/samples/vnf_samples/nsut/vfw/tc_heat_rfc2544_ipv4_1rule_1flow_64B_trex_4port.yaml
@@ -0,0 +1,89 @@
+# Copyright (c) 2016-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.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+---
+schema: yardstick:task:0.1
+scenarios:
+- type: NSPerf
+ traffic_profile: ../../traffic_profiles/ipv4_throughput-4.yaml
+ topology: vfw-tg-topology-4port.yaml
+ nodes:
+ tg__0: tg_0.yardstick
+ vnf__0: vnf_0.yardstick
+ options:
+ framesize:
+ private: {64B: 100}
+ public: {64B: 100}
+ flow:
+ src_ip: [{'tg__0': 'xe0'}, {'tg__0': 'xe2'}]
+ dst_ip: [{'tg__0': 'xe1'}, {'tg__0': 'xe3'}]
+ count: 1
+ traffic_type: 4
+ rfc2544:
+ allowed_drop_rate: 0.0001 - 0.0001
+ vnf__0:
+ rules: acl_1rule.yaml
+ vnf_config: {lb_config: 'SW', lb_count: 2, worker_config: '1C/1T', worker_threads: 1}
+ runner:
+ type: Iteration
+ iterations: 10
+ interval: 35
+context:
+ # put node context first, so we don't HEAT deploy if node has errors
+ name: yardstick
+ image: yardstick-samplevnfs
+ flavor:
+ vcpus: 10
+ ram: 20480
+ disk: 6
+ extra_specs:
+ hw:cpu_sockets: 1
+ # (2 cores / port * 4 ports) + 1 master == 10 cores
+ hw:cpu_cores: 12
+ hw:cpu_threads: 1
+ user: ubuntu
+ placement_groups:
+ pgrp1:
+ policy: "availability"
+ servers:
+ tg_0:
+ floating_ip: true
+ placement: "pgrp1"
+ vnf_0:
+ floating_ip: true
+ placement: "pgrp1"
+ networks:
+ mgmt:
+ cidr: '10.0.1.0/24'
+ private_0:
+ cidr: '10.1.0.0/24'
+ gateway_ip: 'null'
+ port_security_enabled: False
+ enable_dhcp: 'false'
+ public_0:
+ cidr: '10.1.1.0/24'
+ gateway_ip: 'null'
+ port_security_enabled: False
+ enable_dhcp: 'false'
+ private_1:
+ cidr: '10.2.0.0/24'
+ gateway_ip: 'null'
+ port_security_enabled: False
+ enable_dhcp: 'false'
+ public_1:
+ cidr: '10.2.1.0/24'
+ gateway_ip: 'null'
+ port_security_enabled: False
+ enable_dhcp: 'false'
+
diff --git a/samples/vnf_samples/nsut/vfw/vfw-tg-topology-4port.yaml b/samples/vnf_samples/nsut/vfw/vfw-tg-topology-4port.yaml
new file mode 100644
index 000000000..7babb820a
--- /dev/null
+++ b/samples/vnf_samples/nsut/vfw/vfw-tg-topology-4port.yaml
@@ -0,0 +1,70 @@
+# Copyright (c) 2016-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.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+nsd:nsd-catalog:
+ nsd:
+ - id: 3tg-topology
+ name: 3tg-topology
+ short-name: 3tg-topology
+ description: 3tg-topology
+ constituent-vnfd:
+ - member-vnf-index: '1'
+ vnfd-id-ref: tg__0
+ VNF model: ../../vnf_descriptors/tg_rfc2544_tpl.yaml #VNF type
+ - member-vnf-index: '2'
+ vnfd-id-ref: vnf__0
+ VNF model: ../../vnf_descriptors/vfw_vnf.yaml #VNF type
+
+ vld:
+ - id: private_0
+ name: tg__0 to vnf__0 link 1
+ type: ELAN
+ vnfd-connection-point-ref:
+ - member-vnf-index-ref: '1'
+ vnfd-connection-point-ref: xe0
+ vnfd-id-ref: tg__0
+ - member-vnf-index-ref: '2'
+ vnfd-connection-point-ref: xe0
+ vnfd-id-ref: vnf__0
+ - id: public_0
+ name: vnf__0 to tg__0 link 2
+ type: ELAN
+ vnfd-connection-point-ref:
+ - member-vnf-index-ref: '2'
+ vnfd-connection-point-ref: xe1
+ vnfd-id-ref: vnf__0
+ - member-vnf-index-ref: '1'
+ vnfd-connection-point-ref: xe1
+ vnfd-id-ref: tg__0
+
+ - id: private_1
+ name: tg__0 to vnf__0 link 3
+ type: ELAN
+ vnfd-connection-point-ref:
+ - member-vnf-index-ref: '1'
+ vnfd-connection-point-ref: xe2
+ vnfd-id-ref: tg__0
+ - member-vnf-index-ref: '2'
+ vnfd-connection-point-ref: xe2
+ vnfd-id-ref: vnf__0
+ - id: public_1
+ name: vnf__0 to tg__0 link 4
+ type: ELAN
+ vnfd-connection-point-ref:
+ - member-vnf-index-ref: '2'
+ vnfd-connection-point-ref: xe3
+ vnfd-id-ref: vnf__0
+ - member-vnf-index-ref: '1'
+ vnfd-connection-point-ref: xe3
+ vnfd-id-ref: tg__0
diff --git a/samples/vnf_samples/vnf_descriptors/tg_rfc2544_tpl.yaml b/samples/vnf_samples/vnf_descriptors/tg_rfc2544_tpl.yaml
index d94ddfe4c..533ce2fdb 100644
--- a/samples/vnf_samples/vnf_descriptors/tg_rfc2544_tpl.yaml
+++ b/samples/vnf_samples/vnf_descriptors/tg_rfc2544_tpl.yaml
@@ -36,7 +36,6 @@ vnfd:vnfd-catalog:
- id: trexgen-baremetal
name: trexgen-baremetal
description: TRex stateless traffic verifier
-
benchmark:
kpi:
- rx_throughput_fps
diff --git a/samples/vnf_samples/vnf_descriptors/tg_rfc2544_tpl_4port.yaml b/samples/vnf_samples/vnf_descriptors/tg_rfc2544_tpl_4port.yaml
deleted file mode 100644
index 47da39099..000000000
--- a/samples/vnf_samples/vnf_descriptors/tg_rfc2544_tpl_4port.yaml
+++ /dev/null
@@ -1,103 +0,0 @@
-# Copyright (c) 2016-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.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-vnfd:vnfd-catalog:
- vnfd:
- - id: TrexTrafficGenRFC # nsb class mapping
- name: trexverifier
- short-name: trexverifier
- description: TRex stateless traffic verifier
- mgmt-interface:
- vdu-id: trexgen-baremetal
- {% if user is defined %}
- user: '{{user}}' # Value filled by vnfdgen
- {% endif %}
- {% if password is defined %}
- password: '{{password}}' # Value filled by vnfdgen
- {% endif %}
- {% if ip is defined %}
- ip: '{{ip}}' # Value filled by vnfdgen
- {% endif %}
- {% if key_filename is defined %}
- key_filename: '{{key_filename}}' # Value filled by vnfdgen
- {% endif %}
- connection-point:
- - name: xe0
- type: VPORT
- - name: xe1
- type: VPORT
- vdu:
- - id: trexgen-baremetal
- name: trexgen-baremetal
- description: TRex stateless traffic verifier
- external-interface:
- - name: xe0
- virtual-interface:
- type: PCI-PASSTHROUGH
- # Substitution variables MUST be quoted. Otherwise Python can misinterpet them.
- vpci: '{{ interfaces.xe0.vpci }}' # Value filled by vnfdgen
- local_iface_name: '{{ interfaces.xe0.local_iface_name }}' # Value filled by vnfdgen
- local_ip: '{{ interfaces.xe0.local_ip }}' # Value filled by vnfdgen
- driver: '{{ interfaces.xe0.driver}}' # Value filled by vnfdgen
- dst_ip: '{{ interfaces.xe0.dst_ip }}' # Value filled by vnfdgen
- local_mac: '{{ interfaces.xe0.local_mac }}' # Value filled by vnfdgen
- dst_mac: '{{ interfaces.xe0.dst_mac }}' # Value filled by vnfdgen
- bandwidth: 10 Gbps
- vnfd-connection-point-ref: xe0
- - name: xe1
- virtual-interface:
- type: PCI-PASSTHROUGH
- vpci: '{{ interfaces.xe1.vpci }}' # Value filled by vnfdgen
- local_iface_name: '{{ interfaces.xe1.local_iface_name }}' # Value filled by vnfdgen
- local_ip: '{{ interfaces.xe1.local_ip }}' # Value filled by vnfdgen
- driver: '{{ interfaces.xe1.driver}}' # Value filled by vnfdgen
- dst_ip: '{{ interfaces.xe1.dst_ip }}' # Value filled by vnfdgen
- local_mac: '{{ interfaces.xe1.local_mac }}' # Value filled by vnfdgen
- dst_mac: '{{ interfaces.xe1.dst_mac }}' # Value filled by vnfdgen
- bandwidth: 10 Gbps
- vnfd-connection-point-ref: xe1
- - name: xe2
- virtual-interface:
- type: PCI-PASSTHROUGH
- # Substitution variables MUST be quoted. Otherwise Python can misinterpet them.
- vpci: '{{ interfaces.xe2.vpci }}' # Value filled by vnfdgen
- local_iface_name: '{{ interfaces.xe2.local_iface_name }}' # Value filled by vnfdgen
- local_ip: '{{ interfaces.xe2.local_ip }}' # Value filled by vnfdgen
- driver: '{{ interfaces.xe2.driver}}' # Value filled by vnfdgen
- dst_ip: '{{ interfaces.xe2.dst_ip }}' # Value filled by vnfdgen
- local_mac: '{{ interfaces.xe2.local_mac }}' # Value filled by vnfdgen
- dst_mac: '{{ interfaces.xe2.dst_mac }}' # Value filled by vnfdgen
- bandwidth: 10 Gbps
- vnfd-connection-point-ref: xe2
- - name: xe3
- virtual-interface:
- type: PCI-PASSTHROUGH
- vpci: '{{ interfaces.xe3.vpci }}' # Value filled by vnfdgen
- local_iface_name: '{{ interfaces.xe3.local_iface_name }}' # Value filled by vnfdgen
- local_ip: '{{ interfaces.xe3.local_ip }}' # Value filled by vnfdgen
- driver: '{{ interfaces.xe3.driver}}' # Value filled by vnfdgen
- dst_ip: '{{ interfaces.xe3.dst_ip }}' # Value filled by vnfdgen
- local_mac: '{{ interfaces.xe3.local_mac }}' # Value filled by vnfdgen
- dst_mac: '{{ interfaces.xe3.dst_mac }}' # Value filled by vnfdgen
- bandwidth: 10 Gbps
- vnfd-connection-point-ref: xe3
-
- benchmark:
- kpi:
- - rx_throughput_fps
- - tx_throughput_fps
- - tx_throughput_mbps
- - rx_throughput_mbps
- - in_packets
- - out_packets
diff --git a/tests/opnfv/test_suites/opnfv_os-odl-fdio-noha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-odl-fdio-noha_daily.yaml
new file mode 100644
index 000000000..cc8df99b6
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-odl-fdio-noha_daily.yaml
@@ -0,0 +1,38 @@
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+# os-odl-fdio-noha daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-odl-fdio-noha"
+test_cases_dir: "tests/opnfv/test_cases/"
+test_cases:
+-
+ file_name: opnfv_yardstick_tc002.yaml
+-
+ file_name: opnfv_yardstick_tc005.yaml
+-
+ file_name: opnfv_yardstick_tc010.yaml
+-
+ file_name: opnfv_yardstick_tc011.yaml
+-
+ file_name: opnfv_yardstick_tc012.yaml
+-
+ file_name: opnfv_yardstick_tc014.yaml
+-
+ file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-odl-nofeature-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-odl-nofeature-ha_daily.yaml
new file mode 100644
index 000000000..1ab16e5d1
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-odl-nofeature-ha_daily.yaml
@@ -0,0 +1,64 @@
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+# os-odl-nofeature-ha daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-odl-nofeature-ha"
+test_cases_dir: "tests/opnfv/test_cases/"
+test_cases:
+-
+ file_name: opnfv_yardstick_tc002.yaml
+-
+ file_name: opnfv_yardstick_tc005.yaml
+-
+ file_name: opnfv_yardstick_tc010.yaml
+-
+ file_name: opnfv_yardstick_tc011.yaml
+ constraint:
+ installer: compass
+-
+ file_name: opnfv_yardstick_tc012.yaml
+-
+ file_name: opnfv_yardstick_tc014.yaml
+-
+ file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node5.yardstick-TC055"}'
+-
+ file_name: opnfv_yardstick_tc063.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node5.yardstick-TC063"}'
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
+-
+ file_name: opnfv_yardstick_tc075.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node1.LF"}'
diff --git a/tests/opnfv/test_suites/opnfv_os-odl-ovs-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-odl-ovs-ha_daily.yaml
new file mode 100644
index 000000000..b5e53b94c
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-odl-ovs-ha_daily.yaml
@@ -0,0 +1,64 @@
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+# os-odl-ovs-ha daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-odl-ovs-ha"
+test_cases_dir: "tests/opnfv/test_cases/"
+test_cases:
+-
+ file_name: opnfv_yardstick_tc002.yaml
+-
+ file_name: opnfv_yardstick_tc005.yaml
+-
+ file_name: opnfv_yardstick_tc010.yaml
+-
+ file_name: opnfv_yardstick_tc011.yaml
+ constraint:
+ installer: compass
+-
+ file_name: opnfv_yardstick_tc012.yaml
+-
+ file_name: opnfv_yardstick_tc014.yaml
+-
+ file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node5.yardstick-TC055"}'
+-
+ file_name: opnfv_yardstick_tc063.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node5.yardstick-TC063"}'
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
+-
+ file_name: opnfv_yardstick_tc075.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node1.LF"}'
diff --git a/yardstick/network_services/traffic_profile/traffic_profile.py b/yardstick/network_services/traffic_profile/traffic_profile.py
index 894126c09..3feb92bb6 100644
--- a/yardstick/network_services/traffic_profile/traffic_profile.py
+++ b/yardstick/network_services/traffic_profile/traffic_profile.py
@@ -134,7 +134,7 @@ class TrexProfile(TrafficProfile):
seed=0x1235)
self.vm_flow_vars.append(stl_vm_flow_var)
stl_vm_wr_flow_var = STLVmWrFlowVar(fv_name='port_{}'.format(field),
- pkt_offset=self.udp_sport)
+ pkt_offset=self.udp[field])
self.vm_flow_vars.append(stl_vm_wr_flow_var)
return partial
@@ -156,8 +156,10 @@ class TrexProfile(TrafficProfile):
self.ip_packet = None
self.ip6_packet = None
self.udp_packet = None
- self.udp_dport = ''
- self.udp_sport = ''
+ self.udp = {
+ SRC_PORT: '',
+ DST_PORT: '',
+ }
self.qinq_packet = None
self.qinq = False
self.vm_flow_vars = []
@@ -266,8 +268,8 @@ class TrexProfile(TrafficProfile):
ip_params['proto'] = socket.getprotobyname(outer_l3v4['proto'])
if outer_l3v4['proto'] == 'tcp':
self.udp_packet = Pkt.TCP()
- self.udp_dport = 'TCP.dport'
- self.udp_sport = 'TCP.sport'
+ self.udp[DST_PORT] = 'TCP.dport'
+ self.udp[SRC_PORT] = 'TCP.sport'
tcp_params = {'flags': '', 'window': 0}
self._set_proto_fields(UDP, **tcp_params)
if 'ttl' in outer_l3v4:
@@ -289,8 +291,8 @@ class TrexProfile(TrafficProfile):
ip6_params['proto'] = outer_l3v6['proto']
if outer_l3v6['proto'] == 'tcp':
self.udp_packet = Pkt.TCP()
- self.udp_dport = 'TCP.dport'
- self.udp_sport = 'TCP.sport'
+ self.udp[DST_PORT] = 'TCP.dport'
+ self.udp[SRC_PORT] = 'TCP.sport'
tcp_params = {'flags': '', 'window': 0}
self._set_proto_fields(UDP, **tcp_params)
if 'ttl' in outer_l3v6:
@@ -364,8 +366,8 @@ class TrexProfile(TrafficProfile):
self.ip_packet = Pkt.IP()
self.ip6_packet = None
self.udp_packet = Pkt.UDP()
- self.udp_dport = 'UDP.dport'
- self.udp_sport = 'UDP.sport'
+ self.udp[DST_PORT] = 'UDP.dport'
+ self.udp[SRC_PORT] = 'UDP.sport'
self.qinq = False
self.vm_flow_vars = []
outer_l2 = packet_definition.get('outer_l2', None)
diff --git a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py
index 96e703060..c240d3778 100644
--- a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py
+++ b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py
@@ -786,8 +786,9 @@ class SampleVNF(GenericVNF):
LOG.info("Waiting for %s VNF to start.. ", self.APP_NAME)
time.sleep(1)
- # put newline to force new prompt?
- self.q_in.put("\r\n")
+ # Send ENTER to display a new prompt in case the prompt text was corrupted
+ # by other VNF output
+ self.q_in.put('\r\n')
def _build_run_kwargs(self):
self.run_kwargs = {
diff --git a/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py b/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py
index 93e496969..1b2efe34b 100644
--- a/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py
+++ b/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py
@@ -60,6 +60,7 @@ class IxiaResourceHelper(ClientResourceHelper):
self.rfc_helper = rfc_helper_type(self.scenario_helper)
self.priv_ports = None
self.pub_ports = None
+ self._connect()
def _connect(self, client=None):
self.client._connect(self.vnfd_helper)
@@ -68,8 +69,8 @@ class IxiaResourceHelper(ClientResourceHelper):
return self.client.ix_get_statistics()
def stop_collect(self):
- self._terminated.value = 0
- if self.client and self.client.ixnet:
+ self._terminated.value = 1
+ if self.client:
self.client.ix_stop_traffic()
def generate_samples(self, ports, key=None, default=None):
@@ -117,7 +118,6 @@ class IxiaResourceHelper(ClientResourceHelper):
default = "00:00:00:00:00:00"
self._build_ports()
- self._connect()
# we don't know client_file_name until runtime as instantiate
client_file_name = \
@@ -142,24 +142,27 @@ class IxiaResourceHelper(ClientResourceHelper):
ixia_file = find_relative_file("ixia_traffic.cfg",
self.scenario_helper.scenario_cfg["task_path"])
# Generate ixia traffic config...
- while not self._terminated.value:
- traffic_profile.execute_traffic(self, self.client, mac, ixia_file)
- self.client_started.value = 1
- time.sleep(WAIT_FOR_TRAFFIC)
+ try:
+ while not self._terminated.value:
+ traffic_profile.execute(self, self.client, mac, ixia_file)
+ self.client_started.value = 1
+ time.sleep(WAIT_FOR_TRAFFIC)
+ self.client.ix_stop_traffic()
+ samples = self.generate_samples()
+ self._queue.put(samples)
+ status, samples = traffic_profile.get_drop_percentage(self, samples, min_tol,
+ max_tol, self.client, mac,
+ ixia_file)
+
+ current = samples['CurrentDropPercentage']
+ if min_tol <= current <= max_tol or status == 'Completed':
+ self._terminated.value = 1
+
self.client.ix_stop_traffic()
- samples = self.generate_samples(traffic_profile.ports)
self._queue.put(samples)
- status, samples = traffic_profile.get_drop_percentage(self, samples, min_tol,
- max_tol, self.client, mac,
- ixia_file)
-
- current = samples['CurrentDropPercentage']
- if min_tol <= current <= max_tol or status == 'Completed' or \
- self.rfc_helper.is_done():
- break
-
- self.client.ix_stop_traffic()
- self._queue.put(samples)
+ except Exception:
+ LOG.info("Run Traffic terminated")
+ pass
if not self.rfc_helper.is_done():
self._terminated.value = 1