aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/testing/user/userguide/nsb/tc_bng_pppoe_rfc2544_ixia.rst177
-rw-r--r--docs/testing/user/userguide/nsb/tc_bng_pppoe_rfc2544_ixia_8ports_1port_congested.rst179
-rw-r--r--samples/vnf_samples/nsut/prox/tc_prox_ovs-dpdk_buffering-scale-up.yaml105
-rw-r--r--samples/vnf_samples/nsut/prox/tc_prox_ovs-dpdk_lb-scale-up.yaml114
-rw-r--r--samples/vnf_samples/nsut/prox/tc_prox_sriov_buffering-scale-up.yaml95
-rw-r--r--samples/vnf_samples/nsut/prox/tc_prox_sriov_lb-scale-up.yaml103
-rw-r--r--yardstick/network_services/helpers/dpdkbindnic_helper.py1
-rw-r--r--yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py40
-rw-r--r--yardstick/network_services/traffic_profile/ixia_rfc2544.py20
-rw-r--r--yardstick/network_services/traffic_profile/rfc2544.py18
-rw-r--r--yardstick/network_services/vnf_generic/vnf/sample_vnf.py3
-rw-r--r--yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py10
-rw-r--r--yardstick/network_services/vnf_generic/vnf/tg_trex.py2
-rw-r--r--yardstick/ssh.py2
-rw-r--r--yardstick/tests/unit/network_services/libs/ixia_libs/test_ixnet_api.py101
-rw-r--r--yardstick/tests/unit/network_services/traffic_profile/test_ixia_rfc2544.py26
-rw-r--r--yardstick/tests/unit/network_services/traffic_profile/test_rfc2544.py26
-rw-r--r--yardstick/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py757
-rw-r--r--yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py31
19 files changed, 1317 insertions, 493 deletions
diff --git a/docs/testing/user/userguide/nsb/tc_bng_pppoe_rfc2544_ixia.rst b/docs/testing/user/userguide/nsb/tc_bng_pppoe_rfc2544_ixia.rst
new file mode 100644
index 000000000..ffe4f6c19
--- /dev/null
+++ b/docs/testing/user/userguide/nsb/tc_bng_pppoe_rfc2544_ixia.rst
@@ -0,0 +1,177 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International
+.. License.
+.. http://creativecommons.org/licenses/by/4.0
+.. (c) OPNFV, 2019 Intel Corporation.
+
+***************************************************************
+Yardstick Test Case Description: NSB vBNG RFC2544 QoS TEST CASE
+***************************************************************
+
++-----------------------------------------------------------------------------+
+|NSB vBNG RFC2544 QoS base line test case without link congestion |
+| |
++--------------+--------------------------------------------------------------+
+|test case id | tc_bng_pppoe_rfc2544_ixia_IMIX_scale_up |
+| | |
++--------------+--------------------------------------------------------------+
+| metric | Network metrics: |
+| | * TxThroughput |
+| | * RxThroughput |
+| | * TG packets in |
+| | * TG packets out |
+| | * Max Latency |
+| | * Min Latency |
+| | * Average Latency |
+| | * Packets drop percentage |
+| | |
+| | PPPoE subscribers metrics: |
+| | * Sessions up |
+| | * Sessions down |
+| | * Sessions Not Started |
+| | * Sessions Total |
+| | |
+| | NOTE: the same network metrics list are collecting: |
+| | * summary for all ports |
+| | * per port |
+| | * per priority flows summary on all ports |
+| | |
++--------------+--------------------------------------------------------------+
+|test purpose | This test allows to measure performance of BNG network device|
+| | according to RFC2544 testing methodology. Test case creates |
+| | PPPoE subscriber connections to BNG, runs prioritized traffic|
+| | on maximum throughput on all ports and collects network |
+| | and PPPoE subscriber metrics. |
+| | |
++--------------+--------------------------------------------------------------+
+|configuration | The BNG QoS RFC2544 test cases are listed below: |
+| | |
+| | * tc_bng_pppoe_rfc2544_ixia_IMIX_scale_up.yaml |
+| | |
+| | Mentioned test case is a template and number of ports in the |
+| | setup could be passed using cli arguments, e.g: |
+| | |
+| | yardstick -d task start --task-args='{vports: 8}' <tc_yaml> |
+| | |
+| | By default, vports=2. |
+| | |
+| | Test duration: |
+| | * set as 30sec; |
+| | |
+| | Traffic type: |
+| | * IPv4; |
+| | |
+| | Packet sizes: |
+| | * IMIX. The following default IMIX distribution is using: |
+| | |
+| | uplink: 70B - 33%, 940B - 33%, 1470B - 34% |
+| | downlink: 68B - 3%, 932B - 1%, 1470B - 96% |
+| | |
+| | VLAN settings: |
+| | * QinQ on access ports; |
+| | * VLAN on core ports; |
+| | |
+| | Number of PPPoE subscribers: |
+| | * 4000 per access port; |
+| | * 1000 per SVLAN; |
+| | |
+| | Default ToS bits settings: |
+| | * 0 - (000) Routine |
+| | * 4 - (100) Flash Override |
+| | * 7 - (111) Network Control. |
+| | |
+| | The above fields are the main options used for the test case |
+| | and could be configured using cli options on test run or |
+| | directly in test case yaml file. |
+| | |
++--------------+--------------------------------------------------------------+
+|test tool | IXIA IxNetwork |
+| | |
+| | IXIA IxNetwork is using to emulates PPPoE sessions, generate |
+| | L2-L3 traffic, analyze traffic flows and collect network |
+| | metrics during test run. |
+| | |
++--------------+--------------------------------------------------------------+
+|applicability | Mentioned BNG QoS RFC2544 test case can be configured with |
+| | different: |
+| | |
+| | * Number of PPPoE subscribers sessions; |
+| | * Setup ports number; |
+| | * IP Priority type; |
+| | * Packet size; |
+| | * Enable/disable BGP protocol on core ports; |
+| | |
+| | Default values exist. |
+| | |
++--------------+--------------------------------------------------------------+
+|references | RFC2544 |
+| | |
++--------------+--------------------------------------------------------------+
+| pre-test | 1. BNG is up and running and has configured: |
+| conditions | * access ports with QinQ tagging; |
+| | * core ports with configured IP addresses and VLAN; |
+| | * PPPoE subscribers authorization settings (no auth or |
+| | Radius server, PAP auth protocol); |
+| | * QoS settings; |
+| | |
+| | 2. IxNetwork API server is running on specified in pod.yaml |
+| | file TCL port; |
+| | |
+| | 3. BNG ports are connected to IXIA ports (IXIA uplink |
+| | ports are connected to BNG access ports and IXIA |
+| | downlink ports are connected to BNG core ports; |
+| | |
+| | 4. The pod.yaml file contains all necessary information |
+| | (BNG access and core ports settings, core ports IP |
+| | address, NICs, IxNetwork TCL port, IXIA uplink/downlink |
+| | ports, etc). |
+| | |
++--------------+--------------------------------------------------------------+
+|test sequence | description and expected result |
+| | |
++--------------+--------------------------------------------------------------+
+|step 1 | Yardstick resolves the topology and connects to IxNetwork |
+| | API server by TCL. |
+| | |
++--------------+--------------------------------------------------------------+
+|step 2 | Test scenarios run, which performs the following steps: |
+| | |
+| | 1. Create access network topologies (this topologies are |
+| | based on IXIA ports which are connected to BNG access |
+| | ports); |
+| | 2. Configure access network topologies with multiple device |
+| | groups. Each device group represents single SVLAN with |
+| | PPPoE subscribers sessions (number of created on port |
+| | SVLANs and subscribers depends on specified if test case |
+| | file options); |
+| | 3. Create core network topologies (this topologies are |
+| | based on IXIA ports which are connected to BNG core |
+| | ports); |
+| | 4. Configure core network topologies with single device |
+| | group which represents one connection with configured |
+| | VLAN and BGP protocol; |
+| | 5. Establish PPPoE subscribers connections to BNG; |
+| | 6. Create traffic flows between access and core ports |
+| | (traffic flows are creating between access-core ports |
+| | pairs, traffic is bi-directional); |
+| | 7. Configure each traffic flow with specified in traffic |
+| | profile options; |
+| | 8. Run traffic with specified in test case file duration; |
+| | 9. Collect network metrics after traffic was stopped; |
+| | 10. In case drop percentage rate is higher than expected, |
+| | reduce traffic line rate and repeat steps 7-10 again; |
+| | 11. In case drop percentage rate is as expected or number |
+| | of maximum iterations in step 10 achieved, disconnect |
+| | PPPoE subscribers and stop traffic; |
+| | 12. Stop test. |
+| | |
++--------------+--------------------------------------------------------------+
+|step 3 | During each iteration interval in the test run, all specified|
+| | metrics are retrieved from IxNetwork and stored in the |
+| | yardstick dispatcher. |
+| | |
++--------------+--------------------------------------------------------------+
+|test verdict | The vBNG RFC2544 test case will achieve maximum traffic line |
+| | rate with zero packet loss (or other non-zero allowed |
+| | partial drop rate). |
+| | |
++--------------+--------------------------------------------------------------+
diff --git a/docs/testing/user/userguide/nsb/tc_bng_pppoe_rfc2544_ixia_8ports_1port_congested.rst b/docs/testing/user/userguide/nsb/tc_bng_pppoe_rfc2544_ixia_8ports_1port_congested.rst
new file mode 100644
index 000000000..889ba2410
--- /dev/null
+++ b/docs/testing/user/userguide/nsb/tc_bng_pppoe_rfc2544_ixia_8ports_1port_congested.rst
@@ -0,0 +1,179 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International
+.. License.
+.. http://creativecommons.org/licenses/by/4.0
+.. (c) OPNFV, 2019 Intel Corporation.
+
+***************************************************************
+Yardstick Test Case Description: NSB vBNG RFC2544 QoS TEST CASE
+***************************************************************
+
++-----------------------------------------------------------------------------+
+|NSB vBNG RFC2544 QoS base line test case with link congestion |
+| |
++--------------+--------------------------------------------------------------+
+|test case id | tc_bng_pppoe_rfc2544_ixia_8ports_1port_congested_IMIX |
+| | |
++--------------+--------------------------------------------------------------+
+| metric | Network metrics: |
+| | * TxThroughput |
+| | * RxThroughput |
+| | * TG packets in |
+| | * TG packets out |
+| | * Max Latency |
+| | * Min Latency |
+| | * Average Latency |
+| | * Packets drop percentage |
+| | |
+| | PPPoE subscribers metrics: |
+| | * Sessions up |
+| | * Sessions down |
+| | * Sessions Not Started |
+| | * Sessions Total |
+| | |
+| | NOTE: the same network metrics list are collecting: |
+| | * summary for all ports |
+| | * per port |
+| | * per priority flows summary on all ports |
+| | |
++--------------+--------------------------------------------------------------+
+|test purpose | This test allows to measure performance of BNG network device|
+| | according to RFC2544 testing methodology. Test case creates |
+| | PPPoE subscribers connections to BNG, run prioritized traffic|
+| | causing congestion of access port (port xe0) and collects |
+| | network and PPPoE subscribers metrics. |
+| | |
++--------------+--------------------------------------------------------------+
+|configuration | The BNG QoS RFC2544 test cases are listed below: |
+| | |
+| | * tc_bng_pppoe_rfc2544_ixia_8ports_1port_congested_IMIX.yaml |
+| | |
+| | Number of ports: |
+| | * 8 ports |
+| | |
+| | Test duration: |
+| | * set as 30sec; |
+| | |
+| | Traffic type: |
+| | * IPv4; |
+| | |
+| | Packet sizes: |
+| | * IMIX. The following default IMIX distribution is using: |
+| | |
+| | uplink: 70B - 33%, 940B - 33%, 1470B - 34% |
+| | downlink: 68B - 3%, 932B - 1%, 1470B - 96% |
+| | |
+| | VLAN settings: |
+| | * QinQ on access ports; |
+| | * VLAN on core ports; |
+| | |
+| | Number of PPPoE subscribers: |
+| | * 4000 per access port; |
+| | * 1000 per SVLAN; |
+| | |
+| | Default ToS bits settings: |
+| | * 0 - (000) Routine |
+| | * 4 - (100) Flash Override |
+| | * 7 - (111) Network Control. |
+| | |
+| | The above fields are the main options used for the test case |
+| | and could be configured using cli options on test run or |
+| | directly in test case yaml file. |
+| | |
+| | NOTE: that only parameter that can't be changed is ports |
+| | number. To run the test with another number of ports |
+| | traffic profile should be updated. |
+| | |
++--------------+--------------------------------------------------------------+
+|test tool | IXIA IxNetwork |
+| | |
+| | IXIA IxNetwork is using to emulates PPPoE sessions, generate |
+| | L2-L3 traffic, analyze traffic flows and collect network |
+| | metrics during test run. |
+| | |
++--------------+--------------------------------------------------------------+
+|applicability | Mentioned BNG QoS RFC2544 test cases can be configured with |
+| | different: |
+| | |
+| | * Number of PPPoE subscribers sessions; |
+| | * IP Priority type; |
+| | * Packet size; |
+| | * enable/disable BGP protocol on core ports; |
+| | |
+| | Default values exist. |
+| | |
++--------------+--------------------------------------------------------------+
+|references | RFC2544 |
+| | |
++--------------+--------------------------------------------------------------+
+| pre-test | 1. BNG is up and running and has configured: |
+| conditions | * access ports with QinQ tagging; |
+| | * core ports with configured IP addresses and VLAN; |
+| | * PPPoE subscribers authorization settings (no auth or |
+| | Radius server, PAP auth protocol); |
+| | * QoS settings; |
+| | |
+| | 2. IxNetwork API server is running on specified in pod.yaml |
+| | file TCL port; |
+| | |
+| | 3. BNG ports are connected to IXIA ports (IXIA uplink |
+| | ports are connected to BNG access ports and IXIA |
+| | downlink ports are connected to BNG core ports; |
+| | |
+| | 4. The pod.yaml file contains all necessary information |
+| | (BNG access and core ports settings, core ports IP |
+| | address, NICs, IxNetwork TCL port, IXIA uplink/downlink |
+| | ports, etc). |
+| | |
++--------------+--------------------------------------------------------------+
+|test sequence | description and expected result |
+| | |
++--------------+--------------------------------------------------------------+
+|step 1 | Yardstick resolve the topology and connects to IxNetwork |
+| | API server by TCL. |
+| | |
++--------------+--------------------------------------------------------------+
+|step 2 | Test scenarios run, which performs the following steps: |
+| | |
+| | 1. Create access network topologies (this topologies are |
+| | based on IXIA ports which are connected to BNG access |
+| | ports); |
+| | 2. Configure access network topologies with multiple device |
+| | groups. Each device group represents single SVLAN with |
+| | PPPoE subscribers sessions (number of created on port |
+| | SVLANs and subscribers depends on specified if test case |
+| | file options); |
+| | 3. Create core network topologies (this topologies are |
+| | based on IXIA ports which are connected to BNG core |
+| | ports); |
+| | 4. Configure core network topologies with single device |
+| | group which represents one connection with configured |
+| | VLAN and BGP protocol; |
+| | 5. Establish PPPoE subscribers connections to BNG; |
+| | 6. Create traffic flows between access and core ports. |
+| | While test covers case with access port congestion, |
+| | flows between ports will be created in the following |
+| | way: traffic from two core ports are going to one access |
+| | port causing port congestion and traffic from other two |
+| | core ports is splitting between remaining three access |
+| | ports; |
+| | 7. Configure each traffic flow with specified in traffic |
+| | profile options; |
+| | 8. Run traffic with specified in test case file duration; |
+| | 9. Collect network metrics after traffic was stopped; |
+| | 10. Measure drop percentage rate of different priority |
+| | packets on congested port. Expected that all high and |
+| | medium priority packets was forwarded and only low |
+| | priority packets has drops. |
+| | 11. Disconnect PPPoE subscribers and stop test. |
+| | |
++--------------+--------------------------------------------------------------+
+|step 3 | During test run, in the end of each iteration all specified |
+| | in the document metrics are retrieved from IxNetwork and |
+| | stored in the yardstick dispatcher. |
+| | |
++--------------+--------------------------------------------------------------+
+|test verdict | The test case is successful if all high and medium priority |
+| | packets on congested port was forwarded and only low |
+| | priority packets has drops. |
+| | |
++--------------+--------------------------------------------------------------+
diff --git a/samples/vnf_samples/nsut/prox/tc_prox_ovs-dpdk_buffering-scale-up.yaml b/samples/vnf_samples/nsut/prox/tc_prox_ovs-dpdk_buffering-scale-up.yaml
new file mode 100644
index 000000000..a01e98225
--- /dev/null
+++ b/samples/vnf_samples/nsut/prox/tc_prox_ovs-dpdk_buffering-scale-up.yaml
@@ -0,0 +1,105 @@
+# Copyright (c) 2019 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.
+
+{% set vports = vports or 2 %}
+---
+schema: "yardstick:task:0.1"
+
+scenarios:
+-
+ type: NSPerf
+ traffic_profile: ../../traffic_profiles/prox_binsearch.yaml
+ extra_args:
+ vports: {{ vports }}
+ topology: prox-tg-topology-scale-up.yaml
+
+ nodes:
+ tg__0: trafficgen_0.yardstick
+ vnf__0: vnf_0.yardstick
+
+ options:
+ vnf__0:
+ collectd:
+ interval: 1
+ prox_path: /opt/nsb_bin/prox
+ prox_config: "configs/handle_buffering-{{ vports }}.cfg"
+ prox_args:
+ "-t": ""
+
+ tg__0:
+ collectd:
+ interval: 1
+ prox_path: /opt/nsb_bin/prox
+ prox_config: "configs/gen_buffering-{{ vports }}.cfg"
+ prox_args:
+ "-e": ""
+ "-t": ""
+
+ runner:
+ type: Duration
+ # we kill after duration, independent of test duration, so set this high
+ duration: 300
+
+contexts:
+ - name: yardstick
+ type: Node
+ file: prox_tg_bm.yaml
+ servers:
+ - name: yardstick
+ type: StandaloneOvsDpdk
+ file: /etc/yardstick/nodes/standalone/host_ovs.yaml
+ vm_deploy: True
+ ovs_properties:
+ version:
+ ovs: 2.8.0
+ dpdk: 17.05.2
+ pmd_threads: 2
+ ram:
+ socket_0: 2048
+ socket_1: 2048
+ queues: 4
+ vpath: "/usr/local"
+ flavor:
+ images: "/var/lib/libvirt/images/yardstick-nsb-image.img"
+ ram: 16384
+ extra_specs:
+ hw:cpu_sockets: 1
+ hw:cpu_cores: 10
+ hw:cpu_threads: 2
+ servers:
+ vnf__0:
+ network_ports:
+ mgmt:
+ cidr: '1.1.1.62/24'
+{% for port_num in range((vports/2)|int) %}
+ xe{{ port_num * 2 }}:
+ - uplink_{{ port_num }}
+ xe{{ (port_num * 2) + 1 }}:
+ - downlink_{{ port_num }}
+{% endfor %}
+ networks:
+{% for port_num in range((vports/2)|int) %}
+ uplink_{{ port_num }}:
+ port_num: {{networks.uplink[port_num].port_num}}
+ phy_port: "{{networks.uplink[port_num].phy_port}}"
+ vpci: "{{networks.uplink[port_num].vpci}}"
+ cidr: "{{networks.uplink[port_num].cidr}}"
+ gateway_ip: "{{ networks.uplink[port_num].gateway_ip }}"
+ downlink_{{ port_num }}:
+ port_num: {{networks.downlink[port_num].port_num}}
+ phy_port: "{{networks.downlink[port_num].phy_port}}"
+ vpci: "{{networks.downlink[port_num].vpci}}"
+ cidr: "{{networks.downlink[port_num].cidr}}"
+ gateway_ip: "{{networks.downlink[port_num].gateway_ip}}"
+{% endfor %}
diff --git a/samples/vnf_samples/nsut/prox/tc_prox_ovs-dpdk_lb-scale-up.yaml b/samples/vnf_samples/nsut/prox/tc_prox_ovs-dpdk_lb-scale-up.yaml
new file mode 100644
index 000000000..bf7fd9d1e
--- /dev/null
+++ b/samples/vnf_samples/nsut/prox/tc_prox_ovs-dpdk_lb-scale-up.yaml
@@ -0,0 +1,114 @@
+# Copyright (c) 2019 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.
+
+
+{% set vports = vports or 2 %}
+---
+schema: "yardstick:task:0.1"
+
+scenarios:
+-
+ type: NSPerf
+
+ traffic_profile: ../../traffic_profiles/prox_binsearch.yaml
+ extra_args:
+ vports: {{ vports }}
+ topology: prox-tg-topology-scale-up.yaml
+
+ nodes:
+ tg__0: trafficgen_0.yardstick
+ vnf__0: vnf_0.yardstick
+
+ options:
+ vnf__0:
+ collectd:
+ interval: 1
+ prox_path: /opt/nsb_bin/prox
+ prox_config: "configs/handle_lb-{{ vports }}.cfg"
+ prox_args:
+ "-t": ""
+ prox_files:
+ "configs/tuples.lua": ""
+
+ tg__0:
+ collectd:
+ interval: 1
+ prox_path: /opt/nsb_bin/prox
+ prox_config: "configs/gen_lb-{{ vports }}.cfg"
+ prox_args:
+ "-e": ""
+ "-t": ""
+
+ runner:
+ type: ProxDuration
+ # sampling interval
+ interval: 1
+ # sampled : yes OR sampled: no (DEFAULT yes)
+ sampled: yes
+ # we kill after duration, independent of test duration, so set this high
+ duration: 4000
+ # Confirmation attempts
+ confirmation: 1
+
+contexts:
+ - name: yardstick
+ type: Node
+ file: prox_tg_bm.yaml
+ - name: yardstick
+ type: StandaloneOvsDpdk
+ file: /etc/yardstick/nodes/standalone/host_ovs.yaml
+ vm_deploy: True
+ ovs_properties:
+ version:
+ ovs: 2.8.0
+ dpdk: 17.05.2
+ pmd_threads: 2
+ ram:
+ socket_0: 2048
+ socket_1: 2048
+ queues: 4
+ vpath: "/usr/local"
+ flavor:
+ images: "/var/lib/libvirt/images/yardstick-nsb-image.img"
+ ram: 32786
+ extra_specs:
+ hw:cpu_sockets: 1
+ hw:cpu_cores: 32
+ hw:cpu_threads: 2
+ servers:
+ vnf__0:
+ network_ports:
+ mgmt:
+ cidr: '1.1.1.62/24'
+{% for port_num in range((vports/2)|int) %}
+ xe{{ port_num * 2 }}:
+ - uplink_{{ port_num }}
+ xe{{ (port_num * 2) + 1 }}:
+ - downlink_{{ port_num }}
+{% endfor %}
+ networks:
+{% for port_num in range((vports/2)|int) %}
+ uplink_{{ port_num }}:
+ port_num: {{ networks.uplink[port_num].port_num }}
+ phy_port: "{{ networks.uplink[port_num].phy_port }}"
+ vpci: "{{ networks.uplink[port_num].vpci }}"
+ cidr: "{{ networks.uplink[port_num].cidr }}"
+ gateway_ip: "{{ networks.uplink[port_num].gateway_ip }}"
+ downlink_{{ port_num }}:
+ port_num: {{ networks.downlink[port_num].port_num }}
+ phy_port: "{{ networks.downlink[port_num].phy_port }}"
+ vpci: "{{ networks.downlink[port_num].vpci }}"
+ cidr: "{{ networks.downlink[port_num].cidr }}"
+ gateway_ip: "{{ networks.downlink[port_num].gateway_ip }}"
+{% endfor %}
diff --git a/samples/vnf_samples/nsut/prox/tc_prox_sriov_buffering-scale-up.yaml b/samples/vnf_samples/nsut/prox/tc_prox_sriov_buffering-scale-up.yaml
new file mode 100644
index 000000000..211405aa6
--- /dev/null
+++ b/samples/vnf_samples/nsut/prox/tc_prox_sriov_buffering-scale-up.yaml
@@ -0,0 +1,95 @@
+# Copyright (c) 2019 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.
+
+{% set vports = vports or 2 %}
+---
+schema: "yardstick:task:0.1"
+
+scenarios:
+-
+ type: NSPerf
+ traffic_profile: ../../traffic_profiles/prox_binsearch.yaml
+ extra_args:
+ vports: {{ vports }}
+ topology: prox-tg-topology-scale-up.yaml
+
+ nodes:
+ tg__0: trafficgen_0.yardstick
+ vnf__0: vnf_0.yardstick
+
+ options:
+ vnf__0:
+ collectd:
+ interval: 1
+ prox_path: /opt/nsb_bin/prox
+ prox_config: "configs/handle_buffering-{{ vports }}.cfg"
+ prox_args:
+ "-t": ""
+
+ tg__0:
+ collectd:
+ interval: 1
+ prox_path: /opt/nsb_bin/prox
+ prox_config: "configs/gen_buffering-{{ vports }}.cfg"
+ prox_args:
+ "-e": ""
+ "-t": ""
+
+ runner:
+ type: Duration
+ # we kill after duration, independent of test duration, so set this high
+ duration: 300
+
+contexts:
+ - name: yardstick
+ type: Node
+ file: prox_tg_bm.yaml
+ - name: yardstick
+ type: StandaloneSriov
+ file: /etc/yardstick/nodes/standalone/host_sriov.yaml
+ vm_deploy: True
+ flavor:
+ images: "/var/lib/libvirt/images/yardstick-nsb-image.img"
+ ram: 16384
+ extra_specs:
+ hw:cpu_sockets: 1
+ hw:cpu_cores: 10
+ hw:cpu_threads: 2
+ servers:
+ vnf__0:
+ network_ports:
+ mgmt:
+ cidr: '1.1.1.62/24'
+{% for port_num in range((vports/2)|int) %}
+ xe{{ port_num * 2 }}:
+ - uplink_{{ port_num }}
+ xe{{ (port_num * 2) + 1 }}:
+ - downlink_{{ port_num }}
+{% endfor %}
+ networks:
+{% for port_num in range((vports/2)|int) %}
+ uplink_{{ port_num }}:
+ port_num: {{networks.uplink[port_num].port_num}}
+ phy_port: "{{networks.uplink[port_num].phy_port}}"
+ vpci: "{{networks.uplink[port_num].vpci}}"
+ cidr: "{{networks.uplink[port_num].cidr}}"
+ gateway_ip: "{{ networks.uplink[port_num].gateway_ip }}"
+ downlink_{{ port_num }}:
+ port_num: {{networks.downlink[port_num].port_num}}
+ phy_port: "{{networks.downlink[port_num].phy_port}}"
+ vpci: "{{networks.downlink[port_num].vpci}}"
+ cidr: "{{networks.downlink[port_num].cidr}}"
+ gateway_ip: "{{networks.downlink[port_num].gateway_ip}}"
+{% endfor %}
+
diff --git a/samples/vnf_samples/nsut/prox/tc_prox_sriov_lb-scale-up.yaml b/samples/vnf_samples/nsut/prox/tc_prox_sriov_lb-scale-up.yaml
new file mode 100644
index 000000000..982943c5c
--- /dev/null
+++ b/samples/vnf_samples/nsut/prox/tc_prox_sriov_lb-scale-up.yaml
@@ -0,0 +1,103 @@
+# Copyright (c) 2019 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.
+
+
+{% set vports = vports or 2 %}
+---
+schema: "yardstick:task:0.1"
+
+scenarios:
+-
+ type: NSPerf
+
+ traffic_profile: ../../traffic_profiles/prox_binsearch.yaml
+ extra_args:
+ vports: {{ vports }}
+ topology: prox-tg-topology-scale-up.yaml
+
+ nodes:
+ tg__0: trafficgen_0.yardstick
+ vnf__0: vnf_0.yardstick
+
+ options:
+ vnf__0:
+ collectd:
+ interval: 1
+ prox_path: /opt/nsb_bin/prox
+ prox_config: "configs/handle_lb-{{ vports }}.cfg"
+ prox_args:
+ "-t": ""
+ prox_files:
+ "configs/tuples.lua": ""
+
+ tg__0:
+ collectd:
+ interval: 1
+ prox_path: /opt/nsb_bin/prox
+ prox_config: "configs/gen_lb-{{ vports }}.cfg"
+ prox_args:
+ "-e": ""
+ "-t": ""
+
+ runner:
+ type: ProxDuration
+ # sampling interval
+ interval: 1
+ # sampled : yes OR sampled: no (DEFAULT yes)
+ sampled: yes
+ # we kill after duration, independent of test duration, so set this high
+ duration: 4000
+ # Confirmation attempts
+ confirmation: 1
+
+contexts:
+ - name: yardstick
+ type: Node
+ file: prox_tg_bm.yaml
+ - name: yardstick
+ type: StandaloneSriov
+ file: /etc/yardstick/nodes/standalone/host_sriov.yaml
+ vm_deploy: True
+ flavor:
+ images: "/var/lib/libvirt/images/yardstick-nsb-image.img"
+ ram: 32768
+ extra_specs:
+ hw:cpu_sockets: 1
+ hw:cpu_cores: 32
+ hw:cpu_threads: 2
+ servers:
+ vnf__0:
+ network_ports:
+ mgmt:
+ cidr: '1.1.1.62/24'
+{% for port_num in range((vports/2)|int) %}
+ xe{{ port_num * 2 }}:
+ - uplink_{{ port_num }}
+ xe{{ (port_num * 2) + 1 }}:
+ - downlink_{{ port_num }}
+{% endfor %}
+ networks:
+{% for port_num in range((vports/2)|int) %}
+ uplink_{{ port_num }}:
+ phy_port: "{{ networks.uplink[port_num].phy_port }}"
+ vpci: "{{ networks.uplink[port_num].vpci }}"
+ cidr: "{{ networks.uplink[port_num].cidr }}"
+ gateway_ip: "{{ networks.uplink[port_num].gateway_ip }}"
+ downlink_{{ port_num }}:
+ phy_port: "{{ networks.downlink[port_num].phy_port }}"
+ vpci: "{{ networks.downlink[port_num].vpci }}"
+ cidr: "{{ networks.downlink[port_num].cidr }}"
+ gateway_ip: "{{ networks.downlink[port_num].gateway_ip }}"
+{% endfor %}
+
diff --git a/yardstick/network_services/helpers/dpdkbindnic_helper.py b/yardstick/network_services/helpers/dpdkbindnic_helper.py
index 1c74355ef..0fc63f88d 100644
--- a/yardstick/network_services/helpers/dpdkbindnic_helper.py
+++ b/yardstick/network_services/helpers/dpdkbindnic_helper.py
@@ -284,6 +284,7 @@ printf "%s/driver:" $1 ; basename $(readlink -s $1/device/driver); } \
res = self.ssh_helper.execute(*args, **kwargs)
if res[0] != 0:
template = '{} command failed with rc={}'
+ LOG.critical("DPDK_DEVBIND Failure %s", res[1])
raise DpdkBindHelperException(template.format(self.dpdk_devbind, res[0]))
return res
diff --git a/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py b/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py
index cb462f79c..cb8ba1771 100644
--- a/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py
+++ b/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py
@@ -100,6 +100,8 @@ class IxNextgen(object): # pragma: no cover
"Rx_Rate_Kbps": 'Rx. Rate (Kbps)',
"Tx_Rate_Mbps": 'Tx. Rate (Mbps)',
"Rx_Rate_Mbps": 'Rx. Rate (Mbps)',
+ "Bytes_Tx": 'Bytes Tx.',
+ "Bytes_Rx": 'Bytes Rx.'
}
LATENCY_NAME_MAP = {
@@ -405,7 +407,25 @@ class IxNextgen(object): # pragma: no cover
'/traffic/protocolTemplate:"{}"'.format(protocol_name))
self.ixnet.execute('append', previous_element, protocol)
- def _setup_config_elements(self, add_default_proto=True):
+ def is_qinq(self, flow_data):
+ for traffic_type in flow_data:
+ if flow_data[traffic_type]['outer_l2'].get('QinQ'):
+ return True
+ return False
+
+ def _flows_settings(self, cfg):
+ flows_data = []
+ res = [key for key in cfg.keys() if key.split('_')[0] in ['uplink', 'downlink']]
+ for i in range(len(res)):
+ uplink = 'uplink_{}'.format(i)
+ downlink = 'downlink_{}'.format(i)
+ if uplink in res:
+ flows_data.append(cfg[uplink])
+ if downlink in res:
+ flows_data.append(cfg[downlink])
+ return flows_data
+
+ def _setup_config_elements(self, traffic_profile, add_default_proto=True):
"""Setup the config elements
The traffic item is configured to allow individual configurations per
@@ -421,7 +441,9 @@ class IxNextgen(object): # pragma: no cover
'trafficItem')[0]
log.info('Split the frame rate distribution per config element')
config_elements = self.ixnet.getList(traffic_item_id, 'configElement')
- for config_element in config_elements:
+ flows = self._flows_settings(traffic_profile.params)
+ # TODO: check length of both lists, it should be equal!!!
+ for config_element, flow_data in zip(config_elements, flows):
self.ixnet.setAttribute(config_element + '/frameRateDistribution',
'-portDistribution', 'splitRateEvenly')
self.ixnet.setAttribute(config_element + '/frameRateDistribution',
@@ -432,8 +454,13 @@ class IxNextgen(object): # pragma: no cover
PROTO_UDP, config_element + '/stack:"ethernet-1"')
self._append_procotol_to_stack(
PROTO_IPV4, config_element + '/stack:"ethernet-1"')
+ if self.is_qinq(flow_data):
+ self._append_procotol_to_stack(
+ PROTO_VLAN, config_element + '/stack:"ethernet-1"')
+ self._append_procotol_to_stack(
+ PROTO_VLAN, config_element + '/stack:"ethernet-1"')
- def create_traffic_model(self, uplink_ports, downlink_ports):
+ def create_traffic_model(self, uplink_ports, downlink_ports, traffic_profile):
"""Create a traffic item and the needed flow groups
Each flow group inside the traffic item (only one is present)
@@ -448,7 +475,7 @@ class IxNextgen(object): # pragma: no cover
uplink_endpoints = [port + '/protocols' for port in uplink_ports]
downlink_endpoints = [port + '/protocols' for port in downlink_ports]
self._create_flow_groups(uplink_endpoints, downlink_endpoints)
- self._setup_config_elements()
+ self._setup_config_elements(traffic_profile=traffic_profile)
def create_ipv4_traffic_model(self, uplink_endpoints, downlink_endpoints):
"""Create a traffic item and the needed flow groups
@@ -530,11 +557,6 @@ class IxNextgen(object): # pragma: no cover
'-fieldValue', ETHER_TYPE_802_1ad,
'-valueType', SINGLE_VALUE)
- self._append_procotol_to_stack(
- PROTO_VLAN, config_element + '/stack:"ethernet-1"')
- self._append_procotol_to_stack(
- PROTO_VLAN, config_element + '/stack:"ethernet-1"')
-
self._update_vlan_tag(fg_id, s_vlan, S_VLAN)
self._update_vlan_tag(fg_id, c_vlan, C_VLAN)
diff --git a/yardstick/network_services/traffic_profile/ixia_rfc2544.py b/yardstick/network_services/traffic_profile/ixia_rfc2544.py
index c4664a36a..aded2d347 100644
--- a/yardstick/network_services/traffic_profile/ixia_rfc2544.py
+++ b/yardstick/network_services/traffic_profile/ixia_rfc2544.py
@@ -209,8 +209,16 @@ class IXIARFC2544Profile(trex_traffic_profile.TrexProfile):
[samples[iface]['in_packets'] for iface in samples])
out_packets_sum = sum(
[samples[iface]['out_packets'] for iface in samples])
+ in_bytes_sum = sum(
+ [samples[iface]['in_bytes'] for iface in samples])
+ out_bytes_sum = sum(
+ [samples[iface]['out_bytes'] for iface in samples])
rx_throughput = round(float(in_packets_sum) / duration, 3)
tx_throughput = round(float(out_packets_sum) / duration, 3)
+ # Rx throughput in Bps
+ rx_throughput_bps = round(float(in_bytes_sum) / duration, 3)
+ # Tx throughput in Bps
+ tx_throughput_bps = round(float(out_bytes_sum) / duration, 3)
packet_drop = abs(out_packets_sum - in_packets_sum)
try:
@@ -262,6 +270,8 @@ class IXIARFC2544Profile(trex_traffic_profile.TrexProfile):
samples['TxThroughput'] = tx_throughput
samples['RxThroughput'] = rx_throughput
+ samples['TxThroughputBps'] = tx_throughput_bps
+ samples['RxThroughputBps'] = rx_throughput_bps
samples['DropPercentage'] = drop_percent
samples['latency_ns_avg'] = latency_ns_avg
samples['latency_ns_min'] = latency_ns_min
@@ -351,8 +361,16 @@ class IXIARFC2544PppoeScenarioProfile(IXIARFC2544Profile):
[samples[iface]['in_packets'] for iface in samples])
out_packets_sum = sum(
[samples[iface]['out_packets'] for iface in samples])
+ in_bytes_sum = sum(
+ [samples[iface]['in_bytes'] for iface in samples])
+ out_bytes_sum = sum(
+ [samples[iface]['out_bytes'] for iface in samples])
rx_throughput = round(float(in_packets_sum) / duration, 3)
tx_throughput = round(float(out_packets_sum) / duration, 3)
+ # Rx throughput in Bps
+ rx_throughput_bps = round(float(in_bytes_sum) / duration, 3)
+ # Tx throughput in Bps
+ tx_throughput_bps = round(float(out_bytes_sum) / duration, 3)
sum_packet_drop = abs(out_packets_sum - in_packets_sum)
try:
@@ -374,6 +392,8 @@ class IXIARFC2544PppoeScenarioProfile(IXIARFC2544Profile):
samples['TxThroughput'] = tx_throughput
samples['RxThroughput'] = rx_throughput
+ samples['TxThroughputBps'] = tx_throughput_bps
+ samples['RxThroughputBps'] = rx_throughput_bps
samples['DropPercentage'] = sum_drop_percent
samples['latency_ns_avg'] = latency_ns_avg
samples['latency_ns_min'] = latency_ns_min
diff --git a/yardstick/network_services/traffic_profile/rfc2544.py b/yardstick/network_services/traffic_profile/rfc2544.py
index 86ef0db5e..1fe229769 100644
--- a/yardstick/network_services/traffic_profile/rfc2544.py
+++ b/yardstick/network_services/traffic_profile/rfc2544.py
@@ -142,7 +142,7 @@ class RFC2544Profile(trex_traffic_profile.TrexProfile):
return trex_stl_streams.STLProfile(streams)
def _create_imix_data(self, imix,
- weight_mode=constants.DISTRIBUTION_IN_PACKETS):
+ weight_mode=constants.DISTRIBUTION_IN_BYTES):
"""Generate the IMIX distribution for a STL profile
The input information is the framesize dictionary in a test case
@@ -192,13 +192,13 @@ class RFC2544Profile(trex_traffic_profile.TrexProfile):
imix_dip = {size: float(weight) / weight_normalize
for size, weight in imix_count.items()}
- if weight_mode == constants.DISTRIBUTION_IN_BYTES:
+ if weight_mode == constants.DISTRIBUTION_IN_PACKETS:
return imix_dip
byte_total = sum([int(size) * weight
- for size, weight in imix_dip.items()])
- return {size: (int(size) * weight * 100) / byte_total
- for size, weight in imix_dip.items()}
+ for size, weight in imix_count.items()])
+ return {size: float(int(size) * weight * 100) / byte_total
+ for size, weight in imix_count.items()}
def _create_vm(self, packet_definition):
"""Create the STL Raw instructions"""
@@ -278,10 +278,16 @@ class RFC2544Profile(trex_traffic_profile.TrexProfile):
in_pkt_end = sum(port['in_packets'] for port in samples[-1].values())
out_pkt_ini = sum(port['out_packets'] for port in samples[0].values())
in_pkt_ini = sum(port['in_packets'] for port in samples[0].values())
+ in_bytes_ini = sum(port['in_bytes'] for port in samples[0].values())
+ out_bytes_ini = sum(port['out_bytes'] for port in samples[0].values())
+ in_bytes_end = sum(port['in_bytes'] for port in samples[-1].values())
+ out_bytes_end = sum(port['out_bytes'] for port in samples[-1].values())
time_diff = (list(samples[-1].values())[0]['timestamp'] -
list(samples[0].values())[0]['timestamp']).total_seconds()
out_packets = out_pkt_end - out_pkt_ini
in_packets = in_pkt_end - in_pkt_ini
+ out_bytes = out_bytes_end - out_bytes_ini
+ in_bytes = in_bytes_end - in_bytes_ini
tx_rate_fps = float(out_packets) / time_diff
rx_rate_fps = float(in_packets) / time_diff
drop_percent = 100.0
@@ -320,6 +326,8 @@ class RFC2544Profile(trex_traffic_profile.TrexProfile):
output = {
'TxThroughput': tx_rate_fps,
'RxThroughput': rx_rate_fps,
+ 'RxThroughputBps': round(float(in_bytes) / time_diff, 3),
+ 'TxThroughputBps': round(float(out_bytes) / time_diff, 3),
'CurrentDropPercentage': drop_percent,
'Throughput': throughput,
'DropPercentage': self.drop_percent_max,
diff --git a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py
index 743aed0ee..2a477bb8d 100644
--- a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py
+++ b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py
@@ -231,6 +231,9 @@ class DpdkVnfSetupEnvHelper(SetupEnvHelper):
exit_status = self.dpdk_bind_helper.check_dpdk_driver()
if exit_status == 0:
return
+ else:
+ LOG.critical("DPDK Driver not installed")
+ return
def _setup_resources(self):
# what is this magic? how do we know which socket is for which port?
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 2f9eb3f0d..5d69fc8c8 100644
--- a/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py
+++ b/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py
@@ -60,7 +60,7 @@ class IxiaBasicScenario(object):
self._uplink_vports = vports[::2]
self._downlink_vports = vports[1::2]
self.client.create_traffic_model(self._uplink_vports,
- self._downlink_vports)
+ self._downlink_vports, traffic_profile)
def _get_stats(self):
return self.client.get_statistics()
@@ -84,8 +84,12 @@ class IxiaBasicScenario(object):
'tx_throughput_kps': float(stats['Tx_Rate_Kbps'][port_num]),
'rx_throughput_mbps': float(stats['Rx_Rate_Mbps'][port_num]),
'tx_throughput_mbps': float(stats['Tx_Rate_Mbps'][port_num]),
+ 'RxThroughputBps': float(stats['Bytes_Rx'][port_num]) / duration,
+ 'TxThroughputBps': float(stats['Bytes_Tx'][port_num]) / duration,
'in_packets': int(stats['Valid_Frames_Rx'][port_num]),
'out_packets': int(stats['Frames_Tx'][port_num]),
+ 'in_bytes': int(stats['Bytes_Rx'][port_num]),
+ 'out_bytes': int(stats['Bytes_Tx'][port_num]),
'RxThroughput': float(stats['Valid_Frames_Rx'][port_num]) / duration,
'TxThroughput': float(stats['Frames_Tx'][port_num]) / duration,
'Store-Forward_Avg_latency_ns': utils.safe_cast(avg_latency, int, 0),
@@ -608,8 +612,12 @@ class IxiaPppoeClientScenario(object):
'tx_throughput_kps': float(ports_stats[port_num]['Tx_Rate_Kbps']),
'rx_throughput_mbps': float(ports_stats[port_num]['Rx_Rate_Mbps']),
'tx_throughput_mbps': float(ports_stats[port_num]['Tx_Rate_Mbps']),
+ 'RxThroughputBps': float(ports_stats[port_num]['Bytes_Rx']) / duration,
+ 'TxThroughputBps': float(ports_stats[port_num]['Bytes_Tx']) / duration,
'in_packets': int(ports_stats[port_num]['Valid_Frames_Rx']),
'out_packets': int(ports_stats[port_num]['Frames_Tx']),
+ 'in_bytes': int(ports_stats[port_num]['Bytes_Rx']),
+ 'out_bytes': int(ports_stats[port_num]['Bytes_Tx']),
'RxThroughput': float(ports_stats[port_num]['Valid_Frames_Rx']) / duration,
'TxThroughput': float(ports_stats[port_num]['Frames_Tx']) / duration,
'Store-Forward_Avg_latency_ns': utils.safe_cast(avg_latency, int, 0),
diff --git a/yardstick/network_services/vnf_generic/vnf/tg_trex.py b/yardstick/network_services/vnf_generic/vnf/tg_trex.py
index 3011c60a3..0cb66a714 100644
--- a/yardstick/network_services/vnf_generic/vnf/tg_trex.py
+++ b/yardstick/network_services/vnf_generic/vnf/tg_trex.py
@@ -179,6 +179,8 @@ class TrexResourceHelper(ClientResourceHelper):
'tx_throughput_bps': float(port_stats.get('tx_bps', 0.0)),
'in_packets': int(port_stats.get('ipackets', 0)),
'out_packets': int(port_stats.get('opackets', 0)),
+ 'in_bytes': int(port_stats.get('ibytes', 0)),
+ 'out_bytes': int(port_stats.get('obytes', 0)),
'timestamp': timestamp
}
diff --git a/yardstick/ssh.py b/yardstick/ssh.py
index 438e8158b..6bc6010f7 100644
--- a/yardstick/ssh.py
+++ b/yardstick/ssh.py
@@ -80,6 +80,7 @@ from yardstick.common import exceptions
from yardstick.common.utils import try_int, NON_NONE_DEFAULT, make_dict_from_map
from yardstick.network_services.utils import provision_tool
+LOG = logging.getLogger(__name__)
def convert_key_to_str(key):
if not isinstance(key, (paramiko.RSAKey, paramiko.DSSKey)):
@@ -337,6 +338,7 @@ class SSH(object):
details = fmt % {"cmd": cmd, "status": exit_status}
if stderr_data:
details += " Last stderr data: '%s'." % stderr_data
+ LOG.critical("PROX ERROR: %s", details)
raise exceptions.SSHError(error_msg=details)
return exit_status
diff --git a/yardstick/tests/unit/network_services/libs/ixia_libs/test_ixnet_api.py b/yardstick/tests/unit/network_services/libs/ixia_libs/test_ixnet_api.py
index 418ca63fa..270d342fd 100644
--- a/yardstick/tests/unit/network_services/libs/ixia_libs/test_ixnet_api.py
+++ b/yardstick/tests/unit/network_services/libs/ixia_libs/test_ixnet_api.py
@@ -22,11 +22,47 @@ from collections import OrderedDict
from yardstick.common import exceptions
from yardstick.network_services.libs.ixia_libs.ixnet import ixnet_api
+from yardstick.network_services.traffic_profile import ixia_rfc2544
UPLINK = 'uplink'
DOWNLINK = 'downlink'
+TRAFFIC_PROFILE = {
+ 'uplink_0': {
+ 'ipv4': {
+ 'outer_l2': {
+ 'framesize': {
+ '128B': '0',
+ '1518B': '0',
+ '64B': '0',
+ '373b': '0',
+ '256B': '0',
+ '1400B': '0',
+ '570B': '0'}},
+ 'id': 1}},
+ 'description': 'Traffic profile to run RFC2544 latency',
+ 'name': 'rfc2544',
+ 'schema': 'isb:traffic_profile:0.1',
+ 'traffic_profile': {
+ 'injection_time': None,
+ 'enable_latency': True,
+ 'frame_rate': '100%',
+ 'traffic_type': 'IXIARFC2544Profile'},
+ 'downlink_0': {
+ 'ipv4': {
+ 'outer_l2': {
+ 'framesize': {
+ '128B': '0',
+ '1518B': '0',
+ '64B': '0',
+ '373b': '0',
+ '256B': '0',
+ '1400B': '0',
+ '570B': '0'}},
+ 'id': 2}}}
+
+
TRAFFIC_PARAMETERS = {
UPLINK: {
'id': 1,
@@ -506,12 +542,17 @@ class TestIxNextgen(unittest.TestCase):
'my_root/traffic/protocolTemplate:"my_protocol"')
def test__setup_config_elements(self):
+ # the config parsed from some_file
+ yaml_data = {'traffic_profile': {}
+ }
+ traffic_profile = ixia_rfc2544.IXIARFC2544Profile(yaml_data)
+ traffic_profile.params = TRAFFIC_PROFILE
self.ixnet_gen.ixnet.getList.side_effect = [['traffic_item'],
['cfg_element']]
with mock.patch.object(self.ixnet_gen, '_append_procotol_to_stack') as \
mock_append_proto:
- self.ixnet_gen._setup_config_elements()
- mock_append_proto.assert_has_calls([
+ self.ixnet_gen._setup_config_elements(traffic_profile=traffic_profile)
+ mock_append_proto.assert_has_calls([
mock.call(ixnet_api.PROTO_UDP, 'cfg_element/stack:"ethernet-1"'),
mock.call(ixnet_api.PROTO_IPV4, 'cfg_element/stack:"ethernet-1"')])
self.ixnet_gen.ixnet.setAttribute.assert_has_calls([
@@ -526,11 +567,15 @@ class TestIxNextgen(unittest.TestCase):
def test_create_traffic_model(self, mock__setup_config_elements,
mock__create_flow_groups,
mock__create_traffic_item):
+ # the config parsed from some_file
+ yaml_data = {'traffic_profile': {}}
+ traffic_profile = ixia_rfc2544.IXIARFC2544Profile(yaml_data)
uplink_ports = ['port1', 'port3']
downlink_ports = ['port2', 'port4']
uplink_endpoints = ['port1/protocols', 'port3/protocols']
downlink_endpoints = ['port2/protocols', 'port4/protocols']
- self.ixnet_gen.create_traffic_model(uplink_ports, downlink_ports)
+ self.ixnet_gen.create_traffic_model(uplink_ports, downlink_ports,
+ traffic_profile=traffic_profile)
mock__create_traffic_item.assert_called_once_with('raw')
mock__create_flow_groups.assert_called_once_with(uplink_endpoints,
downlink_endpoints)
@@ -551,6 +596,56 @@ class TestIxNextgen(unittest.TestCase):
downlink_topologies)
mock__setup_config_elements.assert_called_once_with(False)
+ def test_flows_settings(self):
+ cfg = {'uplink_0': {
+ 'ipv4': {
+ 'outer_l2': {
+ 'framesize': {
+ '128B': '0',
+ '1518B': '0',
+ '64B': '0',
+ '373b': '0',
+ '256B': '0',
+ '1400B': '0',
+ '570B': '0'}},
+ 'id': 1}}}
+
+ expected = [
+ {'ipv4': {
+ 'id': 1,
+ 'outer_l2': {
+ 'framesize': {
+ '1518B': '0',
+ '1400B': '0',
+ '128B': '0',
+ '64B': '0',
+ '256B': '0',
+ '373b': '0',
+ '570B': '0'}}}}]
+
+ self.assertEqual(expected, self.ixnet_gen._flows_settings(cfg=cfg))
+
+ def test_is_qinq(self):
+ flow_data = {'ipv4': {
+ 'outer_l2': {},
+ 'id': 1}}
+ self.assertEqual(False, self.ixnet_gen.is_qinq(flow_data=flow_data))
+
+ flow_data = {'ipv4': {
+ 'outer_l2': {
+ 'QinQ': {
+ 'C-VLAN': {
+ 'priority': 0,
+ 'cfi': 0,
+ 'id': 512},
+ 'S-VLAN': {
+ 'priority': 0,
+ 'cfi': 0,
+ 'id': 128}},
+ },
+ 'id': 1}}
+ self.assertEqual(True, self.ixnet_gen.is_qinq(flow_data=flow_data))
+
def test__update_frame_mac(self):
with mock.patch.object(self.ixnet_gen, '_get_field_in_stack_item') as \
mock_get_field:
diff --git a/yardstick/tests/unit/network_services/traffic_profile/test_ixia_rfc2544.py b/yardstick/tests/unit/network_services/traffic_profile/test_ixia_rfc2544.py
index 169e47a28..7b5165c39 100644
--- a/yardstick/tests/unit/network_services/traffic_profile/test_ixia_rfc2544.py
+++ b/yardstick/tests/unit/network_services/traffic_profile/test_ixia_rfc2544.py
@@ -630,11 +630,13 @@ class TestIXIARFC2544Profile(unittest.TestCase):
def test_get_drop_percentage_completed(self):
samples = {'iface_name_1':
{'in_packets': 1000, 'out_packets': 1000,
+ 'in_bytes': 64000, 'out_bytes': 64000,
'Store-Forward_Avg_latency_ns': 20,
'Store-Forward_Min_latency_ns': 15,
'Store-Forward_Max_latency_ns': 25},
'iface_name_2':
{'in_packets': 1005, 'out_packets': 1007,
+ 'in_bytes': 64320, 'out_bytes': 64448,
'Store-Forward_Avg_latency_ns': 23,
'Store-Forward_Min_latency_ns': 13,
'Store-Forward_Max_latency_ns': 28}
@@ -658,11 +660,13 @@ class TestIXIARFC2544Profile(unittest.TestCase):
def test_get_drop_percentage_over_drop_percentage(self):
samples = {'iface_name_1':
{'in_packets': 1000, 'out_packets': 1000,
+ 'in_bytes': 64000, 'out_bytes': 64000,
'Store-Forward_Avg_latency_ns': 20,
'Store-Forward_Min_latency_ns': 15,
'Store-Forward_Max_latency_ns': 25},
'iface_name_2':
{'in_packets': 1005, 'out_packets': 1007,
+ 'in_bytes': 64320, 'out_bytes': 64448,
'Store-Forward_Avg_latency_ns': 20,
'Store-Forward_Min_latency_ns': 15,
'Store-Forward_Max_latency_ns': 25}
@@ -681,11 +685,13 @@ class TestIXIARFC2544Profile(unittest.TestCase):
def test_get_drop_percentage_under_drop_percentage(self):
samples = {'iface_name_1':
{'in_packets': 1000, 'out_packets': 1000,
+ 'in_bytes': 64000, 'out_bytes': 64000,
'Store-Forward_Avg_latency_ns': 20,
'Store-Forward_Min_latency_ns': 15,
'Store-Forward_Max_latency_ns': 25},
'iface_name_2':
{'in_packets': 1005, 'out_packets': 1007,
+ 'in_bytes': 64320, 'out_bytes': 64448,
'Store-Forward_Avg_latency_ns': 20,
'Store-Forward_Min_latency_ns': 15,
'Store-Forward_Max_latency_ns': 25}
@@ -705,11 +711,13 @@ class TestIXIARFC2544Profile(unittest.TestCase):
def test_get_drop_percentage_not_flow(self, *args):
samples = {'iface_name_1':
{'in_packets': 1000, 'out_packets': 0,
+ 'in_bytes': 64000, 'out_bytes': 0,
'Store-Forward_Avg_latency_ns': 20,
'Store-Forward_Min_latency_ns': 15,
'Store-Forward_Max_latency_ns': 25},
'iface_name_2':
{'in_packets': 1005, 'out_packets': 0,
+ 'in_bytes': 64320, 'out_bytes': 0,
'Store-Forward_Avg_latency_ns': 20,
'Store-Forward_Min_latency_ns': 15,
'Store-Forward_Max_latency_ns': 25}
@@ -728,11 +736,13 @@ class TestIXIARFC2544Profile(unittest.TestCase):
def test_get_drop_percentage_first_run(self):
samples = {'iface_name_1':
{'in_packets': 1000, 'out_packets': 1000,
+ 'in_bytes': 64000, 'out_bytes': 64000,
'Store-Forward_Avg_latency_ns': 20,
'Store-Forward_Min_latency_ns': 15,
'Store-Forward_Max_latency_ns': 25},
'iface_name_2':
{'in_packets': 1005, 'out_packets': 1007,
+ 'in_bytes': 64320, 'out_bytes': 64448,
'Store-Forward_Avg_latency_ns': 20,
'Store-Forward_Min_latency_ns': 15,
'Store-Forward_Max_latency_ns': 25}
@@ -752,11 +762,13 @@ class TestIXIARFC2544Profile(unittest.TestCase):
rfc2544_profile._get_next_rate = mock.Mock(return_value=0.1)
samples = {'iface_name_1':
{'in_packets': 1000, 'out_packets': 1000,
+ 'in_bytes': 64000, 'out_bytes': 64000,
'Store-Forward_Avg_latency_ns': 20,
'Store-Forward_Min_latency_ns': 15,
'Store-Forward_Max_latency_ns': 25},
'iface_name_2':
{'in_packets': 1005, 'out_packets': 1007,
+ 'in_bytes': 64320, 'out_bytes': 64448,
'Store-Forward_Avg_latency_ns': 20,
'Store-Forward_Min_latency_ns': 15,
'Store-Forward_Max_latency_ns': 25}
@@ -768,11 +780,13 @@ class TestIXIARFC2544Profile(unittest.TestCase):
samples = {'iface_name_1':
{'in_packets': 1000, 'out_packets': 1000,
+ 'in_bytes': 64000, 'out_bytes': 64000,
'Store-Forward_Avg_latency_ns': 20,
'Store-Forward_Min_latency_ns': 15,
'Store-Forward_Max_latency_ns': 25},
'iface_name_2':
{'in_packets': 1005, 'out_packets': 1007,
+ 'in_bytes': 64320, 'out_bytes': 64448,
'Store-Forward_Avg_latency_ns': 20,
'Store-Forward_Min_latency_ns': 15,
'Store-Forward_Max_latency_ns': 25}
@@ -899,12 +913,16 @@ class TestIXIARFC2544PppoeScenarioProfile(unittest.TestCase):
'0': {
'in_packets': 100,
'out_packets': 100,
+ 'in_bytes': 6400,
+ 'out_bytes': 6400,
'Store-Forward_Avg_latency_ns': 10,
'Store-Forward_Min_latency_ns': 10,
'Store-Forward_Max_latency_ns': 10}},
'xe0': {
'in_packets': 100,
'out_packets': 100,
+ 'in_bytes': 6400,
+ 'out_bytes': 6400,
'Store-Forward_Avg_latency_ns': 10,
'Store-Forward_Min_latency_ns': 10,
'Store-Forward_Max_latency_ns': 10}}
@@ -937,12 +955,16 @@ class TestIXIARFC2544PppoeScenarioProfile(unittest.TestCase):
'0': {
'in_packets': 90,
'out_packets': 100,
+ 'in_bytes': 5760,
+ 'out_bytes': 6400,
'Store-Forward_Avg_latency_ns': 10,
'Store-Forward_Min_latency_ns': 10,
'Store-Forward_Max_latency_ns': 10}},
'xe0': {
'in_packets': 90,
'out_packets': 100,
+ 'in_bytes': 5760,
+ 'out_bytes': 6400,
'Store-Forward_Avg_latency_ns': 10,
'Store-Forward_Min_latency_ns': 10,
'Store-Forward_Max_latency_ns': 10}}
@@ -972,12 +994,16 @@ class TestIXIARFC2544PppoeScenarioProfile(unittest.TestCase):
'0': {
'in_packets': 100,
'out_packets': 100,
+ 'in_bytes': 6400,
+ 'out_bytes': 6400,
'Store-Forward_Avg_latency_ns': 10,
'Store-Forward_Min_latency_ns': 10,
'Store-Forward_Max_latency_ns': 10}},
'xe0': {
'in_packets': 90,
'out_packets': 100,
+ 'in_bytes': 5760,
+ 'out_bytes': 6400,
'Store-Forward_Avg_latency_ns': 10,
'Store-Forward_Min_latency_ns': 10,
'Store-Forward_Max_latency_ns': 10
diff --git a/yardstick/tests/unit/network_services/traffic_profile/test_rfc2544.py b/yardstick/tests/unit/network_services/traffic_profile/test_rfc2544.py
index fdcd36f0e..88eaaef28 100644
--- a/yardstick/tests/unit/network_services/traffic_profile/test_rfc2544.py
+++ b/yardstick/tests/unit/network_services/traffic_profile/test_rfc2544.py
@@ -141,25 +141,25 @@ class TestRFC2544Profile(base.BaseUnitTestCase):
port_pg_id, True)
mock_stl_profile.assert_called_once_with(['stream1'])
- def test__create_imix_data_mode_DIB(self):
+ def test__create_imix_data_mode_DIP(self):
rfc2544_profile = rfc2544.RFC2544Profile(self.TRAFFIC_PROFILE)
data = {'64B': 50, '128B': 50}
self.assertEqual(
{'64': 50.0, '128': 50.0},
rfc2544_profile._create_imix_data(
- data, weight_mode=constants.DISTRIBUTION_IN_BYTES))
+ data, weight_mode=constants.DISTRIBUTION_IN_PACKETS))
data = {'64B': 1, '128b': 3}
self.assertEqual(
{'64': 25.0, '128': 75.0},
rfc2544_profile._create_imix_data(
- data, weight_mode=constants.DISTRIBUTION_IN_BYTES))
+ data, weight_mode=constants.DISTRIBUTION_IN_PACKETS))
data = {}
self.assertEqual(
{},
rfc2544_profile._create_imix_data(
- data, weight_mode=constants.DISTRIBUTION_IN_BYTES))
+ data, weight_mode=constants.DISTRIBUTION_IN_PACKETS))
- def test__create_imix_data_mode_DIP(self):
+ def test__create_imix_data_mode_DIB(self):
rfc2544_profile = rfc2544.RFC2544Profile(self.TRAFFIC_PROFILE)
data = {'64B': 25, '128B': 25, '512B': 25, '1518B': 25}
byte_total = 64 * 25 + 128 * 25 + 512 * 25 + 1518 * 25
@@ -169,17 +169,17 @@ class TestRFC2544Profile(base.BaseUnitTestCase):
'512': 512 * 25.0 * 100 / byte_total,
'1518': 1518 * 25.0 * 100/ byte_total},
rfc2544_profile._create_imix_data(
- data, weight_mode=constants.DISTRIBUTION_IN_PACKETS))
+ data, weight_mode=constants.DISTRIBUTION_IN_BYTES))
data = {}
self.assertEqual(
{},
rfc2544_profile._create_imix_data(
- data, weight_mode=constants.DISTRIBUTION_IN_PACKETS))
+ data, weight_mode=constants.DISTRIBUTION_IN_BYTES))
data = {'64B': 100}
self.assertEqual(
{'64': 100.0},
rfc2544_profile._create_imix_data(
- data, weight_mode=constants.DISTRIBUTION_IN_PACKETS))
+ data, weight_mode=constants.DISTRIBUTION_IN_BYTES))
def test__create_vm(self):
packet = {'outer_l2': 'l2_definition'}
@@ -255,22 +255,30 @@ class TestRFC2544Profile(base.BaseUnitTestCase):
'rx_throughput_fps': 101,
'out_packets': 2100,
'in_packets': 2010,
+ 'out_bytes': 134400,
+ 'in_bytes': 128640,
'timestamp': datetime.datetime(2000, 1, 1, 1, 1, 1, 1)},
'xe2': {'tx_throughput_fps': 210,
'rx_throughput_fps': 201,
'out_packets': 4100,
'in_packets': 4010,
+ 'out_bytes': 262400,
+ 'in_bytes': 256640,
'timestamp': datetime.datetime(2000, 1, 1, 1, 1, 1, 1)}},
{'xe1': {'tx_throughput_fps': 156,
'rx_throughput_fps': 108,
'out_packets': 2110,
'in_packets': 2040,
+ 'out_bytes': 135040,
+ 'in_bytes': 130560,
'latency': 'Latency1',
'timestamp': datetime.datetime(2000, 1, 1, 1, 1, 1, 31)},
'xe2': {'tx_throughput_fps': 253,
'rx_throughput_fps': 215,
'out_packets': 4150,
'in_packets': 4010,
+ 'out_bytes': 265600,
+ 'in_bytes': 256640,
'latency': 'Latency2',
'timestamp': datetime.datetime(2000, 1, 1, 1, 1, 1, 31)}}
]
@@ -280,6 +288,8 @@ class TestRFC2544Profile(base.BaseUnitTestCase):
'Latency': {'xe1': 'Latency1', 'xe2': 'Latency2'},
'RxThroughput': 1000000.0,
'TxThroughput': 2000000.0,
+ 'RxThroughputBps': 64000000.0,
+ 'TxThroughputBps': 128000000.0,
'CurrentDropPercentage': 50.0,
'Rate': 100.0,
'Throughput': 1000000.0}
diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py
index bc914bf87..8aa59ccd1 100644
--- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py
+++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py
@@ -16,25 +16,22 @@ from copy import deepcopy
import unittest
import mock
+import six
import time
+import subprocess
import paramiko
from yardstick.common import exceptions as y_exceptions
from yardstick.common import utils
-from yardstick.network_services.nfvi.resource import ResourceProfile
-from yardstick.network_services.vnf_generic.vnf.base import VnfdHelper
+from yardstick.network_services.nfvi import resource
+from yardstick.network_services.vnf_generic.vnf import base
from yardstick.network_services.vnf_generic.vnf import sample_vnf
from yardstick.network_services.vnf_generic.vnf import vnf_ssh_helper
-from yardstick.network_services.vnf_generic.vnf.sample_vnf import SampleVNFDeployHelper
-from yardstick.network_services.vnf_generic.vnf.sample_vnf import ScenarioHelper
from yardstick.network_services.vnf_generic.vnf.sample_vnf import ResourceHelper
-from yardstick.network_services.vnf_generic.vnf.sample_vnf import ClientResourceHelper
-from yardstick.network_services.vnf_generic.vnf.sample_vnf import Rfc2544ResourceHelper
from yardstick.network_services.vnf_generic.vnf.sample_vnf import SetupEnvHelper
from yardstick.network_services.vnf_generic.vnf.sample_vnf import SampleVNF
from yardstick.network_services.vnf_generic.vnf.sample_vnf import SampleVNFTrafficGen
-from yardstick.network_services.vnf_generic.vnf.sample_vnf import DpdkVnfSetupEnvHelper
from yardstick.tests.unit.network_services.vnf_generic.vnf import test_base
from yardstick.benchmark.contexts import base as ctx_base
from yardstick import ssh
@@ -364,123 +361,24 @@ class TestSetupEnvHelper(unittest.TestCase):
class TestDpdkVnfSetupEnvHelper(unittest.TestCase):
- VNFD_0 = {
- 'short-name': 'VpeVnf',
- 'vdu': [
- {
- 'routing_table': [
- {
- 'network': '152.16.100.20',
- 'netmask': '255.255.255.0',
- 'gateway': '152.16.100.20',
- 'if': 'xe0'
- },
- {
- 'network': '152.16.40.20',
- 'netmask': '255.255.255.0',
- 'gateway': '152.16.40.20',
- 'if': 'xe1'
- },
- ],
- 'description': 'VPE approximation using DPDK',
- 'name': 'vpevnf-baremetal',
- 'nd_route_tbl': [
- {
- 'network': '0064:ff9b:0:0:0:0:9810:6414',
- 'netmask': '112',
- 'gateway': '0064:ff9b:0:0:0:0:9810:6414',
- 'if': 'xe0'
- },
- {
- 'network': '0064:ff9b:0:0:0:0:9810:2814',
- 'netmask': '112',
- 'gateway': '0064:ff9b:0:0:0:0:9810:2814',
- 'if': 'xe1'
- },
- ],
- 'id': 'vpevnf-baremetal',
- 'external-interface': [
- {
- 'virtual-interface': {
- 'dst_mac': '00:00:00:00:00:03',
- 'vpci': '0000:05:00.0',
- 'dpdk_port_num': 0,
- 'driver': 'i40e',
- 'local_ip': '152.16.100.19',
- 'type': 'PCI-PASSTHROUGH',
- 'netmask': '255.255.255.0',
- 'bandwidth': '10 Gbps',
- 'dst_ip': '152.16.100.20',
- 'local_mac': '00:00:00:00:00:01',
- 'vld_id': 'uplink_0',
- 'ifname': 'xe0',
- },
- 'vnfd-connection-point-ref': 'xe0',
- 'name': 'xe0'
- },
- {
- 'virtual-interface': {
- 'dst_mac': '00:00:00:00:00:04',
- 'vpci': '0000:05:00.1',
- 'dpdk_port_num': 1,
- 'driver': 'ixgbe',
- 'local_ip': '152.16.40.19',
- 'type': 'PCI-PASSTHROUGH',
- 'netmask': '255.255.255.0',
- 'bandwidth': '10 Gbps',
- 'dst_ip': '152.16.40.20',
- 'local_mac': '00:00:00:00:00:02',
- 'vld_id': 'downlink_0',
- 'ifname': 'xe1',
- },
- 'vnfd-connection-point-ref': 'xe1',
- 'name': 'xe1'
- },
- ],
- },
- ],
- 'description': 'Vpe approximation using DPDK',
- 'mgmt-interface': {
- 'vdu-id': 'vpevnf-baremetal',
- 'host': '1.1.1.1',
- 'password': 'r00t',
- 'user': 'root',
- 'ip': '1.1.1.1'
- },
- 'benchmark': {
- 'kpi': [
- 'packets_in',
- 'packets_fwd',
- 'packets_dropped',
- ],
- },
- 'connection-point': [
- {
- 'type': 'VPORT',
- 'name': 'xe0',
- },
- {
- 'type': 'VPORT',
- 'name': 'xe1',
- },
- ],
- 'id': 'VpeApproxVnf', 'name': 'VPEVnfSsh'
- }
+ VNFD_0 = TestVnfSshHelper.VNFD_0
- VNFD = {
- 'vnfd:vnfd-catalog': {
- 'vnfd': [
- VNFD_0,
- ]
- }
- }
+ VNFD = TestVnfSshHelper.VNFD
+
+ def setUp(self):
+ self.vnfd_helper = base.VnfdHelper(deepcopy(self.VNFD_0))
+ self.scenario_helper = mock.Mock()
+ self.ssh_helper = mock.Mock()
+ self.dpdk_setup_helper = sample_vnf.DpdkVnfSetupEnvHelper(
+ self.vnfd_helper, self.ssh_helper, self.scenario_helper)
def test__update_packet_type(self):
ip_pipeline_cfg = 'pkt_type = ipv4'
pkt_type = {'pkt_type': '1'}
expected = "pkt_type = 1"
- result = DpdkVnfSetupEnvHelper._update_packet_type(ip_pipeline_cfg, pkt_type)
+ result = self.dpdk_setup_helper._update_packet_type(
+ ip_pipeline_cfg, pkt_type)
self.assertEqual(result, expected)
def test__update_packet_type_no_op(self):
@@ -488,91 +386,99 @@ class TestDpdkVnfSetupEnvHelper(unittest.TestCase):
pkt_type = {'pkt_type': '1'}
expected = "pkt_type = ipv6"
- result = DpdkVnfSetupEnvHelper._update_packet_type(ip_pipeline_cfg, pkt_type)
+ result = self.dpdk_setup_helper._update_packet_type(
+ ip_pipeline_cfg, pkt_type)
self.assertEqual(result, expected)
def test__update_packet_type_multi_op(self):
ip_pipeline_cfg = 'pkt_type = ipv4\npkt_type = 1\npkt_type = ipv4'
pkt_type = {'pkt_type': '1'}
-
expected = 'pkt_type = 1\npkt_type = 1\npkt_type = 1'
- result = DpdkVnfSetupEnvHelper._update_packet_type(ip_pipeline_cfg, pkt_type)
+
+ result = self.dpdk_setup_helper._update_packet_type(
+ ip_pipeline_cfg, pkt_type)
self.assertEqual(result, expected)
def test__update_traffic_type(self):
ip_pipeline_cfg = 'pkt_type = ipv4'
-
- traffic_options = {"vnf_type": DpdkVnfSetupEnvHelper.APP_NAME, 'traffic_type': 4}
+ traffic_options = {
+ "vnf_type": sample_vnf.DpdkVnfSetupEnvHelper.APP_NAME,
+ "traffic_type": 4}
expected = "pkt_type = ipv4"
- result = DpdkVnfSetupEnvHelper._update_traffic_type(ip_pipeline_cfg, traffic_options)
+
+ result = self.dpdk_setup_helper._update_traffic_type(
+ ip_pipeline_cfg, traffic_options)
self.assertEqual(result, expected)
def test__update_traffic_type_ipv6(self):
ip_pipeline_cfg = 'pkt_type = ipv4'
-
- traffic_options = {"vnf_type": DpdkVnfSetupEnvHelper.APP_NAME, 'traffic_type': 6}
+ traffic_options = {
+ "vnf_type": sample_vnf.DpdkVnfSetupEnvHelper.APP_NAME,
+ "traffic_type": 6}
expected = "pkt_type = ipv6"
- result = DpdkVnfSetupEnvHelper._update_traffic_type(ip_pipeline_cfg, traffic_options)
+
+ result = self.dpdk_setup_helper._update_traffic_type(
+ ip_pipeline_cfg, traffic_options)
self.assertEqual(result, expected)
def test__update_traffic_type_not_app_name(self):
ip_pipeline_cfg = 'traffic_type = 4'
-
- vnf_type = ''.join(["Not", DpdkVnfSetupEnvHelper.APP_NAME])
+ vnf_type = ''.join(["Not", sample_vnf.DpdkVnfSetupEnvHelper.APP_NAME])
traffic_options = {"vnf_type": vnf_type, 'traffic_type': 8}
expected = "traffic_type = 8"
- result = DpdkVnfSetupEnvHelper._update_traffic_type(ip_pipeline_cfg, traffic_options)
+
+ result = self.dpdk_setup_helper._update_traffic_type(
+ ip_pipeline_cfg, traffic_options)
self.assertEqual(result, expected)
- @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.open')
+ @mock.patch.object(six.moves.builtins, 'open')
@mock.patch.object(utils, 'find_relative_file')
- @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.MultiPortConfig')
- @mock.patch.object(utils, 'open_relative_file')
- def test_build_config(self, mock_open_rf, mock_multi_port_config_class, mock_find, *args):
+ @mock.patch.object(sample_vnf, 'MultiPortConfig')
+ def test_build_config(self, mock_multi_port_config_class,
+ mock_find, *args):
mock_multi_port_config = mock_multi_port_config_class()
- vnfd_helper = VnfdHelper(self.VNFD_0)
- ssh_helper = mock.Mock()
- scenario_helper = mock.Mock()
- scenario_helper.vnf_cfg = {}
- scenario_helper.options = {}
- scenario_helper.all_options = {}
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, scenario_helper)
+ self.scenario_helper.vnf_cfg = {}
+ self.scenario_helper.options = {}
+ self.scenario_helper.all_options = {}
- dpdk_setup_helper.PIPELINE_COMMAND = expected = 'pipeline command'
- result = dpdk_setup_helper.build_config()
+ self.dpdk_setup_helper.PIPELINE_COMMAND = expected = 'pipeline command'
+ result = self.dpdk_setup_helper.build_config()
self.assertEqual(result, expected)
- self.assertGreaterEqual(ssh_helper.upload_config_file.call_count, 2)
+ self.assertGreaterEqual(self.ssh_helper.upload_config_file.call_count, 2)
mock_find.assert_called()
mock_multi_port_config.generate_config.assert_called()
mock_multi_port_config.generate_script.assert_called()
- scenario_helper.options = {'rules': 'fake_file'}
- scenario_helper.vnf_cfg = {'file': 'fake_file'}
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, scenario_helper)
+ @mock.patch.object(six.moves.builtins, 'open')
+ @mock.patch.object(utils, 'find_relative_file')
+ @mock.patch.object(sample_vnf, 'MultiPortConfig')
+ @mock.patch.object(utils, 'open_relative_file')
+ def test_build_config2(self, mock_open_rf, mock_multi_port_config_class,
+ mock_find, *args):
+ mock_multi_port_config = mock_multi_port_config_class()
+ self.scenario_helper.options = {'rules': 'fake_file'}
+ self.scenario_helper.vnf_cfg = {'file': 'fake_file'}
+ self.scenario_helper.all_options = {}
mock_open_rf.side_effect = mock.mock_open(read_data='fake_data')
- dpdk_setup_helper.PIPELINE_COMMAND = expected = 'pipeline command'
+ self.dpdk_setup_helper.PIPELINE_COMMAND = expected = 'pipeline command'
- result = dpdk_setup_helper.build_config()
+ result = self.dpdk_setup_helper.build_config()
mock_open_rf.assert_called()
self.assertEqual(result, expected)
- self.assertGreaterEqual(ssh_helper.upload_config_file.call_count, 2)
+ self.assertGreaterEqual(self.ssh_helper.upload_config_file.call_count, 2)
mock_find.assert_called()
mock_multi_port_config.generate_config.assert_called()
mock_multi_port_config.generate_script.assert_called()
def test__build_pipeline_kwargs(self):
- vnfd_helper = VnfdHelper(self.VNFD_0)
- ssh_helper = mock.Mock()
- ssh_helper.provision_tool.return_value = 'tool_path'
- scenario_helper = mock.Mock()
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, scenario_helper)
- dpdk_setup_helper.CFG_CONFIG = 'config'
- dpdk_setup_helper.CFG_SCRIPT = 'script'
- dpdk_setup_helper.pipeline_kwargs = {}
- dpdk_setup_helper.all_ports = [0, 1, 2]
- dpdk_setup_helper.scenario_helper.vnf_cfg = {'lb_config': 'HW',
- 'worker_threads': 1}
+ self.ssh_helper.provision_tool.return_value = 'tool_path'
+ self.dpdk_setup_helper.CFG_CONFIG = 'config'
+ self.dpdk_setup_helper.CFG_SCRIPT = 'script'
+ self.dpdk_setup_helper.pipeline_kwargs = {}
+ self.dpdk_setup_helper.all_ports = [0, 1, 2]
+ self.dpdk_setup_helper.scenario_helper.vnf_cfg = {'lb_config': 'HW',
+ 'worker_threads': 1}
expected = {
'cfg_file': 'config',
@@ -581,12 +487,14 @@ class TestDpdkVnfSetupEnvHelper(unittest.TestCase):
'tool_path': 'tool_path',
'hwlb': ' --hwlb 1',
}
- dpdk_setup_helper._build_pipeline_kwargs()
- self.assertDictEqual(dpdk_setup_helper.pipeline_kwargs, expected)
+ self.dpdk_setup_helper._build_pipeline_kwargs()
+ self.assertDictEqual(self.dpdk_setup_helper.pipeline_kwargs, expected)
- @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time')
- @mock.patch('yardstick.ssh.SSH')
+ @mock.patch.object(time, 'sleep')
+ @mock.patch.object(ssh, 'SSH')
def test_setup_vnf_environment(self, *args):
+ self.scenario_helper.nodes = [None, None]
+
def execute(cmd):
if cmd.startswith('which '):
return exec_failure
@@ -594,104 +502,82 @@ class TestDpdkVnfSetupEnvHelper(unittest.TestCase):
exec_success = (0, 'good output', '')
exec_failure = (1, 'bad output', 'error output')
+ self.ssh_helper.execute = execute
- vnfd_helper = VnfdHelper(self.VNFD_0)
- ssh_helper = mock.Mock()
- ssh_helper.execute = execute
+ self.dpdk_setup_helper._validate_cpu_cfg = mock.Mock(return_value=[])
- scenario_helper = mock.Mock()
- scenario_helper.nodes = [None, None]
- dpdk_vnf_setup_env_helper = DpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, scenario_helper)
- dpdk_vnf_setup_env_helper._validate_cpu_cfg = mock.Mock(return_value=[])
-
- with mock.patch.object(dpdk_vnf_setup_env_helper, '_setup_dpdk'):
+ with mock.patch.object(self.dpdk_setup_helper, '_setup_dpdk'):
self.assertIsInstance(
- dpdk_vnf_setup_env_helper.setup_vnf_environment(),
- ResourceProfile)
+ self.dpdk_setup_helper.setup_vnf_environment(),
+ resource.ResourceProfile)
@mock.patch.object(utils, 'setup_hugepages')
def test__setup_dpdk(self, mock_setup_hugepages):
- ssh_helper = mock.Mock()
- ssh_helper.execute = mock.Mock()
- ssh_helper.execute.return_value = (0, 0, 0)
- scenario_helper = mock.Mock()
- scenario_helper.all_options = {'hugepages_gb': 8}
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(mock.ANY, ssh_helper,
- scenario_helper)
- dpdk_setup_helper._setup_dpdk()
- mock_setup_hugepages.assert_called_once_with(ssh_helper, 8*1024*1024)
- ssh_helper.execute.assert_has_calls([
+ self.ssh_helper.execute = mock.Mock()
+ self.ssh_helper.execute.return_value = (0, 0, 0)
+ self.scenario_helper.all_options = {'hugepages_gb': 8}
+ self.dpdk_setup_helper._setup_dpdk()
+ mock_setup_hugepages.assert_called_once_with(
+ self.ssh_helper, 8*1024*1024)
+ self.ssh_helper.execute.assert_has_calls([
mock.call('sudo modprobe uio && sudo modprobe igb_uio'),
mock.call('lsmod | grep -i igb_uio')
])
- @mock.patch('yardstick.ssh.SSH')
+ @mock.patch.object(ssh, 'SSH')
def test__setup_resources(self, _):
- vnfd_helper = VnfdHelper(deepcopy(self.VNFD_0))
- ssh_helper = mock.Mock()
- scenario_helper = mock.Mock()
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, scenario_helper)
- dpdk_setup_helper._validate_cpu_cfg = mock.Mock()
+ self.dpdk_setup_helper._validate_cpu_cfg = mock.Mock()
+ self.dpdk_setup_helper.bound_pci = [v['virtual-interface']["vpci"] for v in
+ self.vnfd_helper.interfaces]
+ result = self.dpdk_setup_helper._setup_resources()
+ self.assertIsInstance(result, resource.ResourceProfile)
+ self.assertEqual(self.dpdk_setup_helper.socket, 0)
- dpdk_setup_helper.bound_pci = [v['virtual-interface']["vpci"] for v in
- vnfd_helper.interfaces]
- result = dpdk_setup_helper._setup_resources()
- self.assertIsInstance(result, ResourceProfile)
- self.assertEqual(dpdk_setup_helper.socket, 0)
-
- @mock.patch('yardstick.ssh.SSH')
+ @mock.patch.object(ssh, 'SSH')
def test__setup_resources_socket_1(self, _):
- vnfd_helper = VnfdHelper(deepcopy(self.VNFD_0))
- vnfd_helper.interfaces[0]['virtual-interface']['vpci'] = '0000:55:00.0'
- vnfd_helper.interfaces[1]['virtual-interface']['vpci'] = '0000:35:00.0'
- ssh_helper = mock.Mock()
- scenario_helper = mock.Mock()
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, scenario_helper)
- dpdk_setup_helper._validate_cpu_cfg = mock.Mock()
-
- dpdk_setup_helper.bound_pci = [v['virtual-interface']["vpci"] for v in
- vnfd_helper.interfaces]
- result = dpdk_setup_helper._setup_resources()
- self.assertIsInstance(result, ResourceProfile)
- self.assertEqual(dpdk_setup_helper.socket, 1)
+ self.vnfd_helper.interfaces[0]['virtual-interface']['vpci'] = \
+ '0000:55:00.0'
+ self.vnfd_helper.interfaces[1]['virtual-interface']['vpci'] = \
+ '0000:35:00.0'
+
+ self.dpdk_setup_helper._validate_cpu_cfg = mock.Mock()
+ self.dpdk_setup_helper.bound_pci = [v['virtual-interface']["vpci"] for v in
+ self.vnfd_helper.interfaces]
+ result = self.dpdk_setup_helper._setup_resources()
+ self.assertIsInstance(result, resource.ResourceProfile)
+ self.assertEqual(self.dpdk_setup_helper.socket, 1)
- @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time')
+ @mock.patch.object(time, 'sleep')
def test__detect_and_bind_drivers(self, *args):
- vnfd_helper = VnfdHelper(deepcopy(self.VNFD_0))
- ssh_helper = mock.Mock()
- # ssh_helper.execute = mock.Mock(return_value = (0, 'text', ''))
- # ssh_helper.execute.return_value = 0, 'output', ''
- scenario_helper = mock.Mock()
- scenario_helper.nodes = [None, None]
+ self.scenario_helper.nodes = [None, None]
rv = ['0000:05:00.1', '0000:05:00.0']
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, scenario_helper)
- dpdk_setup_helper.dpdk_bind_helper._get_bound_pci_addresses = mock.Mock(return_value=rv)
- dpdk_setup_helper.dpdk_bind_helper.bind = mock.Mock()
- dpdk_setup_helper.dpdk_bind_helper.read_status = mock.Mock()
+ self.dpdk_setup_helper.dpdk_bind_helper._get_bound_pci_addresses = \
+ mock.Mock(return_value=rv)
+ self.dpdk_setup_helper.dpdk_bind_helper.bind = mock.Mock()
+ self.dpdk_setup_helper.dpdk_bind_helper.read_status = mock.Mock()
- self.assertIsNone(dpdk_setup_helper._detect_and_bind_drivers())
+ self.assertIsNone(self.dpdk_setup_helper._detect_and_bind_drivers())
- intf_0 = vnfd_helper.vdu[0]['external-interface'][0]['virtual-interface']
- intf_1 = vnfd_helper.vdu[0]['external-interface'][1]['virtual-interface']
+ intf_0 = self.vnfd_helper.vdu[0]['external-interface'][0]['virtual-interface']
+ intf_1 = self.vnfd_helper.vdu[0]['external-interface'][1]['virtual-interface']
self.assertEqual(0, intf_0['dpdk_port_num'])
self.assertEqual(1, intf_1['dpdk_port_num'])
def test_tear_down(self):
- vnfd_helper = VnfdHelper(self.VNFD_0)
- ssh_helper = mock.Mock()
- scenario_helper = mock.Mock()
- scenario_helper.nodes = [None, None]
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, scenario_helper)
- dpdk_setup_helper.dpdk_bind_helper.bind = mock.Mock()
- dpdk_setup_helper.dpdk_bind_helper.used_drivers = {
+ self.scenario_helper.nodes = [None, None]
+
+ self.dpdk_setup_helper.dpdk_bind_helper.bind = mock.Mock()
+ self.dpdk_setup_helper.dpdk_bind_helper.used_drivers = {
'd1': ['0000:05:00.0'],
'd3': ['0000:05:01.0'],
}
- self.assertIsNone(dpdk_setup_helper.tear_down())
- dpdk_setup_helper.dpdk_bind_helper.bind.assert_any_call(['0000:05:00.0'], 'd1', True)
- dpdk_setup_helper.dpdk_bind_helper.bind.assert_any_call(['0000:05:01.0'], 'd3', True)
+ self.assertIsNone(self.dpdk_setup_helper.tear_down())
+ self.dpdk_setup_helper.dpdk_bind_helper.bind.assert_any_call(
+ ['0000:05:00.0'], 'd1', True)
+ self.dpdk_setup_helper.dpdk_bind_helper.bind.assert_any_call(
+ ['0000:05:01.0'], 'd3', True)
class TestResourceHelper(unittest.TestCase):
@@ -795,46 +681,33 @@ class TestResourceHelper(unittest.TestCase):
'id': 'VpeApproxVnf', 'name': 'VPEVnfSsh'
}
+ def setUp(self):
+ self.vnfd_helper = base.VnfdHelper(self.VNFD_0)
+ self.dpdk_setup_helper = sample_vnf.DpdkVnfSetupEnvHelper(
+ self.vnfd_helper, mock.Mock(), mock.Mock())
+ self.resource_helper = sample_vnf.ResourceHelper(self.dpdk_setup_helper)
+
def test_setup(self):
resource = object()
- vnfd_helper = VnfdHelper(self.VNFD_0)
- ssh_helper = mock.Mock()
- scenario_helper = mock.Mock()
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, scenario_helper)
- dpdk_setup_helper.setup_vnf_environment = mock.Mock(return_value=resource)
- resource_helper = ResourceHelper(dpdk_setup_helper)
+ self.dpdk_setup_helper.setup_vnf_environment = (
+ mock.Mock(return_value=resource))
+ resource_helper = sample_vnf.ResourceHelper(self.dpdk_setup_helper)
self.assertIsNone(resource_helper.setup())
self.assertIs(resource_helper.resource, resource)
def test_generate_cfg(self):
- vnfd_helper = VnfdHelper(self.VNFD_0)
- ssh_helper = mock.Mock()
- scenario_helper = mock.Mock()
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, scenario_helper)
- resource_helper = ResourceHelper(dpdk_setup_helper)
-
- self.assertIsNone(resource_helper.generate_cfg())
+ self.assertIsNone(self.resource_helper.generate_cfg())
def test_stop_collect(self):
- vnfd_helper = VnfdHelper(self.VNFD_0)
- ssh_helper = mock.Mock()
- scenario_helper = mock.Mock()
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, scenario_helper)
- resource_helper = ResourceHelper(dpdk_setup_helper)
- resource_helper.resource = mock.Mock()
+ self.resource_helper.resource = mock.Mock()
- self.assertIsNone(resource_helper.stop_collect())
+ self.assertIsNone(self.resource_helper.stop_collect())
def test_stop_collect_none(self):
- vnfd_helper = VnfdHelper(self.VNFD_0)
- ssh_helper = mock.Mock()
- scenario_helper = mock.Mock()
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, scenario_helper)
- resource_helper = ResourceHelper(dpdk_setup_helper)
- resource_helper.resource = None
+ self.resource_helper.resource = None
- self.assertIsNone(resource_helper.stop_collect())
+ self.assertIsNone(self.resource_helper.stop_collect())
class TestClientResourceHelper(unittest.TestCase):
@@ -966,102 +839,75 @@ class TestClientResourceHelper(unittest.TestCase):
},
}
- @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.LOG')
- @mock.patch.object(sample_vnf, 'STLError', new_callable=lambda: MockError)
- def test_get_stats_not_connected(self, mock_stl_error, *args):
- vnfd_helper = VnfdHelper(self.VNFD_0)
+ def setUp(self):
+ vnfd_helper = base.VnfdHelper(self.VNFD_0)
ssh_helper = mock.Mock()
scenario_helper = mock.Mock()
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(
+ dpdk_setup_helper = sample_vnf.DpdkVnfSetupEnvHelper(
vnfd_helper, ssh_helper, scenario_helper)
- client_resource_helper = ClientResourceHelper(dpdk_setup_helper)
- client_resource_helper.client = mock.Mock()
- client_resource_helper.client.get_stats.side_effect = mock_stl_error
+ self.client_resource_helper = (
+ sample_vnf.ClientResourceHelper(dpdk_setup_helper))
+
+ @mock.patch.object(sample_vnf, 'LOG')
+ @mock.patch.object(sample_vnf, 'STLError', new_callable=lambda: MockError)
+ def test_get_stats_not_connected(self, mock_stl_error, *args):
+ self.client_resource_helper.client = mock.Mock()
+ self.client_resource_helper.client.get_stats.side_effect = \
+ mock_stl_error
- self.assertEqual(client_resource_helper.get_stats(), {})
- client_resource_helper.client.get_stats.assert_called_once()
+ self.assertEqual(self.client_resource_helper.get_stats(), {})
+ self.client_resource_helper.client.get_stats.assert_called_once()
def test_clear_stats(self):
- vnfd_helper = VnfdHelper(self.VNFD_0)
- ssh_helper = mock.Mock()
- scenario_helper = mock.Mock()
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(
- vnfd_helper, ssh_helper, scenario_helper)
- client_resource_helper = ClientResourceHelper(dpdk_setup_helper)
- client_resource_helper.client = mock.Mock()
+ self.client_resource_helper.client = mock.Mock()
- self.assertIsNone(client_resource_helper.clear_stats())
+ self.assertIsNone(self.client_resource_helper.clear_stats())
self.assertEqual(
- client_resource_helper.client.clear_stats.call_count, 1)
+ self.client_resource_helper.client.clear_stats.call_count, 1)
def test_clear_stats_of_ports(self):
- vnfd_helper = VnfdHelper(self.VNFD_0)
- ssh_helper = mock.Mock()
- scenario_helper = mock.Mock()
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(
- vnfd_helper, ssh_helper, scenario_helper)
- client_resource_helper = ClientResourceHelper(dpdk_setup_helper)
- client_resource_helper.client = mock.Mock()
+ self.client_resource_helper.client = mock.Mock()
- self.assertIsNone(client_resource_helper.clear_stats([3, 4]))
- self.assertEqual(
- client_resource_helper.client.clear_stats.call_count, 1)
+ self.assertIsNone(self.client_resource_helper.clear_stats([3, 4]))
+ self.client_resource_helper.client.clear_stats.assert_called_once()
def test_start(self):
- vnfd_helper = VnfdHelper(self.VNFD_0)
- ssh_helper = mock.Mock()
- scenario_helper = mock.Mock()
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(
- vnfd_helper, ssh_helper, scenario_helper)
- client_resource_helper = ClientResourceHelper(dpdk_setup_helper)
- client_resource_helper.client = mock.Mock()
+ self.client_resource_helper.client = mock.Mock()
- self.assertIsNone(client_resource_helper.start())
- client_resource_helper.client.start.assert_called_once()
+ self.assertIsNone(self.client_resource_helper.start())
+ self.client_resource_helper.client.start.assert_called_once()
def test_start_ports(self):
- vnfd_helper = VnfdHelper(self.VNFD_0)
- ssh_helper = mock.Mock()
- scenario_helper = mock.Mock()
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(
- vnfd_helper, ssh_helper, scenario_helper)
- client_resource_helper = ClientResourceHelper(dpdk_setup_helper)
- client_resource_helper.client = mock.Mock()
+ self.client_resource_helper.client = mock.Mock()
- self.assertIsNone(client_resource_helper.start([3, 4]))
- client_resource_helper.client.start.assert_called_once()
+ self.assertIsNone(self.client_resource_helper.start([3, 4]))
+ self.client_resource_helper.client.start.assert_called_once()
def test_collect_kpi_with_queue(self):
- vnfd_helper = VnfdHelper(self.VNFD_0)
- ssh_helper = mock.Mock()
- scenario_helper = mock.Mock()
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, scenario_helper)
- client_resource_helper = ClientResourceHelper(dpdk_setup_helper)
- client_resource_helper._result = {'existing': 43, 'replaceable': 12}
- client_resource_helper._queue = mock.Mock()
- client_resource_helper._queue.empty.return_value = False
- client_resource_helper._queue.get.return_value = {'incoming': 34, 'replaceable': 99}
+ self.client_resource_helper._result = {
+ 'existing': 43,
+ 'replaceable': 12}
+ self.client_resource_helper._queue = mock.Mock()
+ self.client_resource_helper._queue.empty.return_value = False
+ self.client_resource_helper._queue.get.return_value = {
+ 'incoming': 34,
+ 'replaceable': 99}
expected = {
'existing': 43,
'incoming': 34,
'replaceable': 99,
}
- result = client_resource_helper.collect_kpi()
- self.assertDictEqual(result, expected)
+ result = self.client_resource_helper.collect_kpi()
+ self.assertEqual(result, expected)
- @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time')
+ @mock.patch.object(time, 'sleep')
@mock.patch.object(sample_vnf, 'STLError')
def test__connect_with_failures(self, mock_stl_error, *args):
- vnfd_helper = VnfdHelper(self.VNFD_0)
- ssh_helper = mock.Mock()
- scenario_helper = mock.Mock()
- dpdk_setup_helper = DpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, scenario_helper)
- client_resource_helper = ClientResourceHelper(dpdk_setup_helper)
client = mock.MagicMock()
client.connect.side_effect = mock_stl_error(msg='msg')
- self.assertIs(client_resource_helper._connect(client), client)
+ self.assertIs(self.client_resource_helper._connect(client), client)
class TestRfc2544ResourceHelper(unittest.TestCase):
@@ -1108,185 +954,170 @@ class TestRfc2544ResourceHelper(unittest.TestCase):
}
}
- def test_property_rfc2544(self):
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = self.SCENARIO_CFG_1
- rfc2544_resource_helper = Rfc2544ResourceHelper(scenario_helper)
+ def setUp(self):
+ self.scenario_helper = sample_vnf.ScenarioHelper('name1')
+ self.rfc2544_resource_helper = \
+ sample_vnf.Rfc2544ResourceHelper(self.scenario_helper)
- self.assertIsNone(rfc2544_resource_helper._rfc2544)
- self.assertDictEqual(rfc2544_resource_helper.rfc2544, self.RFC2544_CFG_1)
- self.assertDictEqual(rfc2544_resource_helper._rfc2544, self.RFC2544_CFG_1)
- scenario_helper.scenario_cfg = {} # ensure that resource_helper caches
- self.assertDictEqual(rfc2544_resource_helper.rfc2544, self.RFC2544_CFG_1)
+ def test_property_rfc2544(self):
+ self.scenario_helper.scenario_cfg = self.SCENARIO_CFG_1
+
+ self.assertIsNone(self.rfc2544_resource_helper._rfc2544)
+ self.assertEqual(self.rfc2544_resource_helper.rfc2544,
+ self.RFC2544_CFG_1)
+ self.assertEqual(self.rfc2544_resource_helper._rfc2544,
+ self.RFC2544_CFG_1)
+ # ensure that resource_helper caches
+ self.scenario_helper.scenario_cfg = {}
+ self.assertEqual(self.rfc2544_resource_helper.rfc2544,
+ self.RFC2544_CFG_1)
def test_property_tolerance_high(self):
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = self.SCENARIO_CFG_1
- rfc2544_resource_helper = Rfc2544ResourceHelper(scenario_helper)
+ self.scenario_helper.scenario_cfg = self.SCENARIO_CFG_1
- self.assertIsNone(rfc2544_resource_helper._tolerance_high)
- self.assertEqual(rfc2544_resource_helper.tolerance_high, 0.15)
- self.assertEqual(rfc2544_resource_helper._tolerance_high, 0.15)
- self.assertEqual(rfc2544_resource_helper._tolerance_precision, 2)
- scenario_helper.scenario_cfg = {} # ensure that resource_helper caches
- self.assertEqual(rfc2544_resource_helper.tolerance_high, 0.15)
+ self.assertIsNone(self.rfc2544_resource_helper._tolerance_high)
+ self.assertEqual(self.rfc2544_resource_helper.tolerance_high, 0.15)
+ self.assertEqual(self.rfc2544_resource_helper._tolerance_high, 0.15)
+ self.assertEqual(self.rfc2544_resource_helper._tolerance_precision, 2)
+ # ensure that resource_helper caches
+ self.scenario_helper.scenario_cfg = {}
+ self.assertEqual(self.rfc2544_resource_helper.tolerance_high, 0.15)
def test_property_tolerance_low(self):
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = self.SCENARIO_CFG_1
- rfc2544_resource_helper = Rfc2544ResourceHelper(scenario_helper)
+ self.scenario_helper.scenario_cfg = self.SCENARIO_CFG_1
- self.assertIsNone(rfc2544_resource_helper._tolerance_low)
- self.assertEqual(rfc2544_resource_helper.tolerance_low, 0.1)
- self.assertEqual(rfc2544_resource_helper._tolerance_low, 0.1)
- scenario_helper.scenario_cfg = {} # ensure that resource_helper caches
- self.assertEqual(rfc2544_resource_helper.tolerance_low, 0.1)
+ self.assertIsNone(self.rfc2544_resource_helper._tolerance_low)
+ self.assertEqual(self.rfc2544_resource_helper.tolerance_low, 0.1)
+ self.assertEqual(self.rfc2544_resource_helper._tolerance_low, 0.1)
+ # ensure that resource_helper caches
+ self.scenario_helper.scenario_cfg = {}
+ self.assertEqual(self.rfc2544_resource_helper.tolerance_low, 0.1)
def test_property_tolerance_high_range_swap(self):
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = self.SCENARIO_CFG_2
- rfc2544_resource_helper = Rfc2544ResourceHelper(scenario_helper)
+ self.scenario_helper.scenario_cfg = self.SCENARIO_CFG_2
- self.assertEqual(rfc2544_resource_helper.tolerance_high, 0.25)
+ self.assertEqual(self.rfc2544_resource_helper.tolerance_high, 0.25)
def test_property_tolerance_low_range_swap(self):
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = self.SCENARIO_CFG_2
- rfc2544_resource_helper = Rfc2544ResourceHelper(scenario_helper)
+ self.scenario_helper.scenario_cfg = self.SCENARIO_CFG_2
- self.assertEqual(rfc2544_resource_helper.tolerance_low, 0.05)
+ self.assertEqual(self.rfc2544_resource_helper.tolerance_low, 0.05)
def test_property_tolerance_high_not_range(self):
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = self.SCENARIO_CFG_3
- rfc2544_resource_helper = Rfc2544ResourceHelper(scenario_helper)
+ self.scenario_helper.scenario_cfg = self.SCENARIO_CFG_3
- self.assertEqual(rfc2544_resource_helper.tolerance_high, 0.2)
- self.assertEqual(rfc2544_resource_helper._tolerance_precision, 1)
+ self.assertEqual(self.rfc2544_resource_helper.tolerance_high, 0.2)
+ self.assertEqual(self.rfc2544_resource_helper._tolerance_precision, 1)
def test_property_tolerance_low_not_range(self):
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = self.SCENARIO_CFG_3
- rfc2544_resource_helper = Rfc2544ResourceHelper(scenario_helper)
+ self.scenario_helper.scenario_cfg = self.SCENARIO_CFG_3
- self.assertEqual(rfc2544_resource_helper.tolerance_low, 0.2)
+ self.assertEqual(self.rfc2544_resource_helper.tolerance_low, 0.2)
def test_property_tolerance_high_default(self):
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = self.SCENARIO_CFG_4
- rfc2544_resource_helper = Rfc2544ResourceHelper(scenario_helper)
+ self.scenario_helper.scenario_cfg = self.SCENARIO_CFG_4
- self.assertEqual(rfc2544_resource_helper.tolerance_high, 0.0001)
+ self.assertEqual(self.rfc2544_resource_helper.tolerance_high, 0.0001)
def test_property_tolerance_low_default(self):
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = self.SCENARIO_CFG_4
- rfc2544_resource_helper = Rfc2544ResourceHelper(scenario_helper)
+ self.scenario_helper.scenario_cfg = self.SCENARIO_CFG_4
- self.assertEqual(rfc2544_resource_helper.tolerance_low, 0.0001)
+ self.assertEqual(self.rfc2544_resource_helper.tolerance_low, 0.0001)
def test_property_latency(self):
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = self.SCENARIO_CFG_1
- rfc2544_resource_helper = Rfc2544ResourceHelper(scenario_helper)
+ self.scenario_helper.scenario_cfg = self.SCENARIO_CFG_1
- self.assertIsNone(rfc2544_resource_helper._latency)
- self.assertTrue(rfc2544_resource_helper.latency)
- self.assertTrue(rfc2544_resource_helper._latency)
- scenario_helper.scenario_cfg = {} # ensure that resource_helper caches
- self.assertTrue(rfc2544_resource_helper.latency)
+ self.assertIsNone(self.rfc2544_resource_helper._latency)
+ self.assertTrue(self.rfc2544_resource_helper.latency)
+ self.assertTrue(self.rfc2544_resource_helper._latency)
+ # ensure that resource_helper caches
+ self.scenario_helper.scenario_cfg = {}
+ self.assertTrue(self.rfc2544_resource_helper.latency)
def test_property_latency_default(self):
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = self.SCENARIO_CFG_2
- rfc2544_resource_helper = Rfc2544ResourceHelper(scenario_helper)
+ self.scenario_helper.scenario_cfg = self.SCENARIO_CFG_2
- self.assertFalse(rfc2544_resource_helper.latency)
+ self.assertFalse(self.rfc2544_resource_helper.latency)
def test_property_correlated_traffic(self):
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = self.SCENARIO_CFG_1
- rfc2544_resource_helper = Rfc2544ResourceHelper(scenario_helper)
+ self.scenario_helper.scenario_cfg = self.SCENARIO_CFG_1
- self.assertIsNone(rfc2544_resource_helper._correlated_traffic)
- self.assertTrue(rfc2544_resource_helper.correlated_traffic)
- self.assertTrue(rfc2544_resource_helper._correlated_traffic)
- scenario_helper.scenario_cfg = {} # ensure that resource_helper caches
- self.assertTrue(rfc2544_resource_helper.correlated_traffic)
+ self.assertIsNone(self.rfc2544_resource_helper._correlated_traffic)
+ self.assertTrue(self.rfc2544_resource_helper.correlated_traffic)
+ self.assertTrue(self.rfc2544_resource_helper._correlated_traffic)
+ # ensure that resource_helper caches
+ self.scenario_helper.scenario_cfg = {}
+ self.assertTrue(self.rfc2544_resource_helper.correlated_traffic)
def test_property_correlated_traffic_default(self):
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = self.SCENARIO_CFG_2
- rfc2544_resource_helper = Rfc2544ResourceHelper(scenario_helper)
+ self.scenario_helper.scenario_cfg = self.SCENARIO_CFG_2
- self.assertFalse(rfc2544_resource_helper.correlated_traffic)
+ self.assertFalse(self.rfc2544_resource_helper.correlated_traffic)
class TestSampleVNFDeployHelper(unittest.TestCase):
- @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time')
- @mock.patch('subprocess.check_output')
- def test_deploy_vnfs_disabled(self, *_):
- vnfd_helper = mock.Mock()
- ssh_helper = mock.Mock()
- ssh_helper.join_bin_path.return_value = 'joined_path'
- ssh_helper.execute.return_value = 1, 'bad output', 'error output'
- ssh_helper.put.return_value = None
- sample_vnf_deploy_helper = SampleVNFDeployHelper(vnfd_helper, ssh_helper)
-
- self.assertIsNone(sample_vnf_deploy_helper.deploy_vnfs('name1'))
- sample_vnf_deploy_helper.DISABLE_DEPLOY = True
- self.assertEqual(ssh_helper.execute.call_count, 5)
- ssh_helper.put.assert_called_once()
-
- @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time')
- @mock.patch('subprocess.check_output')
- def test_deploy_vnfs(self, *args):
- vnfd_helper = mock.Mock()
- ssh_helper = mock.Mock()
- ssh_helper.join_bin_path.return_value = 'joined_path'
- ssh_helper.execute.return_value = 1, 'bad output', 'error output'
- ssh_helper.put.return_value = None
- sample_vnf_deploy_helper = SampleVNFDeployHelper(vnfd_helper, ssh_helper)
- sample_vnf_deploy_helper.DISABLE_DEPLOY = False
-
- self.assertIsNone(sample_vnf_deploy_helper.deploy_vnfs('name1'))
- self.assertEqual(ssh_helper.execute.call_count, 5)
- ssh_helper.put.assert_called_once()
-
- @mock.patch('subprocess.check_output')
- def test_deploy_vnfs_early_success(self, *args):
- vnfd_helper = mock.Mock()
- ssh_helper = mock.Mock()
- ssh_helper.join_bin_path.return_value = 'joined_path'
- ssh_helper.execute.return_value = 0, 'output', ''
- ssh_helper.put.return_value = None
- sample_vnf_deploy_helper = SampleVNFDeployHelper(vnfd_helper, ssh_helper)
- sample_vnf_deploy_helper.DISABLE_DEPLOY = False
+ def setUp(self):
+ self._mock_time_sleep = mock.patch.object(time, 'sleep')
+ self.mock_time_sleep = self._mock_time_sleep.start()
+ self._mock_check_output = mock.patch.object(subprocess, 'check_output')
+ self.mock_check_output = self._mock_check_output.start()
+ self.addCleanup(self._stop_mocks)
+
+ self.ssh_helper = mock.Mock()
+ self.sample_vnf_deploy_helper = sample_vnf.SampleVNFDeployHelper(
+ mock.Mock(), self.ssh_helper)
+ self.ssh_helper.join_bin_path.return_value = 'joined_path'
+ self.ssh_helper.put.return_value = None
+
+ def _stop_mocks(self):
+ self._mock_time_sleep.stop()
+ self._mock_check_output.stop()
+
+ def test_deploy_vnfs_disabled(self):
+ self.ssh_helper.execute.return_value = 1, 'bad output', 'error output'
- self.assertIsNone(sample_vnf_deploy_helper.deploy_vnfs('name1'))
- ssh_helper.execute.assert_called_once()
- ssh_helper.put.assert_not_called()
+ self.sample_vnf_deploy_helper.deploy_vnfs('name1')
+ self.sample_vnf_deploy_helper.DISABLE_DEPLOY = True
+ self.assertEqual(self.ssh_helper.execute.call_count, 5)
+ self.ssh_helper.put.assert_called_once()
+
+ def test_deploy_vnfs(self):
+ self.ssh_helper.execute.return_value = 1, 'bad output', 'error output'
+ self.sample_vnf_deploy_helper.DISABLE_DEPLOY = False
+
+ self.sample_vnf_deploy_helper.deploy_vnfs('name1')
+ self.assertEqual(self.ssh_helper.execute.call_count, 5)
+ self.ssh_helper.put.assert_called_once()
+
+ def test_deploy_vnfs_early_success(self):
+ self.ssh_helper.execute.return_value = 0, 'output', ''
+ self.sample_vnf_deploy_helper.DISABLE_DEPLOY = False
+
+ self.sample_vnf_deploy_helper.deploy_vnfs('name1')
+ self.ssh_helper.execute.assert_called_once()
+ self.ssh_helper.put.assert_not_called()
class TestScenarioHelper(unittest.TestCase):
+ def setUp(self):
+ self.scenario_helper = sample_vnf.ScenarioHelper('name1')
+
def test_property_task_path(self):
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = {
+ self.scenario_helper.scenario_cfg = {
'task_path': 'my_path',
}
- self.assertEqual(scenario_helper.task_path, 'my_path')
+ self.assertEqual(self.scenario_helper.task_path, 'my_path')
def test_property_nodes(self):
nodes = ['node1', 'node2']
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = {
+ self.scenario_helper.scenario_cfg = {
'nodes': nodes,
}
- self.assertEqual(scenario_helper.nodes, nodes)
+ self.assertEqual(self.scenario_helper.nodes, nodes)
def test_property_all_options(self):
data = {
@@ -1295,30 +1126,27 @@ class TestScenarioHelper(unittest.TestCase):
},
'name2': {}
}
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = {
+ self.scenario_helper.scenario_cfg = {
'options': data,
}
- self.assertDictEqual(scenario_helper.all_options, data)
+ self.assertDictEqual(self.scenario_helper.all_options, data)
def test_property_options(self):
data = {
'key1': 'value1',
'key2': 'value2',
}
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = {
+ self.scenario_helper.scenario_cfg = {
'options': {
'name1': data,
},
}
- self.assertDictEqual(scenario_helper.options, data)
+ self.assertDictEqual(self.scenario_helper.options, data)
def test_property_vnf_cfg(self):
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = {
+ self.scenario_helper.scenario_cfg = {
'options': {
'name1': {
'vnf_config': 'my_config',
@@ -1326,25 +1154,24 @@ class TestScenarioHelper(unittest.TestCase):
},
}
- self.assertEqual(scenario_helper.vnf_cfg, 'my_config')
+ self.assertEqual(self.scenario_helper.vnf_cfg, 'my_config')
def test_property_vnf_cfg_default(self):
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = {
+ self.scenario_helper.scenario_cfg = {
'options': {
'name1': {},
},
}
- self.assertDictEqual(scenario_helper.vnf_cfg, ScenarioHelper.DEFAULT_VNF_CFG)
+ self.assertEqual(self.scenario_helper.vnf_cfg,
+ sample_vnf.ScenarioHelper.DEFAULT_VNF_CFG)
def test_property_topology(self):
- scenario_helper = ScenarioHelper('name1')
- scenario_helper.scenario_cfg = {
+ self.scenario_helper.scenario_cfg = {
'topology': 'my_topology',
}
- self.assertEqual(scenario_helper.topology, 'my_topology')
+ self.assertEqual(self.scenario_helper.topology, 'my_topology')
class TestSampleVnf(unittest.TestCase):
diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py
index ccf077220..d84fda789 100644
--- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py
+++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py
@@ -28,6 +28,7 @@ from yardstick.benchmark.contexts import base as ctx_base
from yardstick.network_services.libs.ixia_libs.ixnet import ixnet_api
from yardstick.network_services.traffic_profile import base as tp_base
from yardstick.network_services.vnf_generic.vnf import tg_rfc2544_ixia
+from yardstick.network_services.traffic_profile import ixia_rfc2544
TEST_FILE_YAML = 'nsb_test_case.yaml'
@@ -501,6 +502,8 @@ class TestIxiaBasicScenario(unittest.TestCase):
'Valid_Frames_Rx': ['150', '150'],
'Frames_Tx_Rate': ['0.0', '0.0'],
'Valid_Frames_Rx_Rate': ['0.0', '0.0'],
+ 'Bytes_Rx': ['9600', '9600'],
+ 'Bytes_Tx': ['9600', '9600'],
'Tx_Rate_Kbps': ['0.0', '0.0'],
'Rx_Rate_Mbps': ['0.0', '0.0'],
'Tx_Rate_Mbps': ['0.0', '0.0'],
@@ -528,9 +531,13 @@ class TestIxiaBasicScenario(unittest.TestCase):
def test_create_traffic_model(self):
self.mock_IxNextgen.get_vports.return_value = [1, 2, 3, 4]
- self.scenario.create_traffic_model()
+ yaml_data = {'traffic_profile': {}
+ }
+ traffic_profile = ixia_rfc2544.IXIARFC2544Profile(yaml_data)
+ self.scenario.create_traffic_model(traffic_profile)
self.scenario.client.get_vports.assert_called_once()
- self.scenario.client.create_traffic_model.assert_called_once_with([1, 3], [2, 4])
+ self.scenario.client.create_traffic_model.assert_called_once_with(
+ [1, 3], [2, 4], traffic_profile)
def test_apply_config(self):
self.assertIsNone(self.scenario.apply_config())
@@ -551,10 +558,14 @@ class TestIxiaBasicScenario(unittest.TestCase):
expected_samples = {'xe0': {
'in_packets': 150,
'out_packets': 150,
+ 'in_bytes': 9600,
+ 'out_bytes': 9600,
'rx_throughput_mbps': 0.0,
'rx_throughput_kps': 0.0,
'RxThroughput': 5.0,
'TxThroughput': 5.0,
+ 'RxThroughputBps': 320.0,
+ 'TxThroughputBps': 320.0,
'tx_throughput_mbps': 0.0,
'tx_throughput_kps': 0.0,
'Store-Forward_Max_latency_ns': 100,
@@ -563,10 +574,14 @@ class TestIxiaBasicScenario(unittest.TestCase):
'xe1': {
'in_packets': 150,
'out_packets': 150,
+ 'in_bytes': 9600,
+ 'out_bytes': 9600,
'rx_throughput_mbps': 0.0,
'rx_throughput_kps': 0.0,
'RxThroughput': 5.0,
'TxThroughput': 5.0,
+ 'RxThroughputBps': 320.0,
+ 'TxThroughputBps': 320.0,
'tx_throughput_mbps': 0.0,
'tx_throughput_kps': 0.0,
'Store-Forward_Max_latency_ns': 200,
@@ -1169,6 +1184,8 @@ class TestIxiaPppoeClientScenario(unittest.TestCase):
'port_statistics': [
{'Frames_Tx': '3000',
'Valid_Frames_Rx': '3000',
+ 'Bytes_Rx': '192000',
+ 'Bytes_Tx': '192000',
'Rx_Rate_Kbps': '0.0',
'Tx_Rate_Kbps': '0.0',
'Rx_Rate_Mbps': '0.0',
@@ -1176,6 +1193,8 @@ class TestIxiaPppoeClientScenario(unittest.TestCase):
'port_name': 'Ethernet - 001'},
{'Frames_Tx': '3000',
'Valid_Frames_Rx': '3000',
+ 'Bytes_Rx': '192000',
+ 'Bytes_Tx': '192000',
'Rx_Rate_Kbps': '0.0',
'Tx_Rate_Kbps': '0.0',
'Rx_Rate_Mbps': '0.0',
@@ -1215,6 +1234,10 @@ class TestIxiaPppoeClientScenario(unittest.TestCase):
'TxThroughput': 100.0,
'in_packets': 3000,
'out_packets': 3000,
+ 'in_bytes': 192000,
+ 'out_bytes': 192000,
+ 'RxThroughputBps': 6400.0,
+ 'TxThroughputBps': 6400.0,
'rx_throughput_kps': 0.0,
'rx_throughput_mbps': 0.0,
'sessions_down': 0,
@@ -1230,6 +1253,10 @@ class TestIxiaPppoeClientScenario(unittest.TestCase):
'TxThroughput': 100.0,
'in_packets': 3000,
'out_packets': 3000,
+ 'in_bytes': 192000,
+ 'out_bytes': 192000,
+ 'RxThroughputBps': 6400.0,
+ 'TxThroughputBps': 6400.0,
'rx_throughput_kps': 0.0,
'rx_throughput_mbps': 0.0,
'tx_throughput_kps': 0.0,