diff options
75 files changed, 1348 insertions, 124 deletions
diff --git a/ansible/install.yaml b/ansible/install.yaml index 847f01c57..184fa8607 100644 --- a/ansible/install.yaml +++ b/ansible/install.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation. +# Copyright (c) 2018-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. diff --git a/ansible/roles/enable_cpu_isolation_on_boot/defaults/main.yml b/ansible/roles/enable_cpu_isolation_on_boot/defaults/main.yml index 37c3fd8e1..fda366682 100644 --- a/ansible/roles/enable_cpu_isolation_on_boot/defaults/main.yml +++ b/ansible/roles/enable_cpu_isolation_on_boot/defaults/main.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation +# Copyright (c) 2018-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. diff --git a/ansible/roles/enable_cpu_isolation_on_boot/tasks/main.yml b/ansible/roles/enable_cpu_isolation_on_boot/tasks/main.yml index b41a2b307..e11288bfd 100644 --- a/ansible/roles/enable_cpu_isolation_on_boot/tasks/main.yml +++ b/ansible/roles/enable_cpu_isolation_on_boot/tasks/main.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation +# Copyright (c) 2018-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. diff --git a/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml b/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml index 8ca8650ff..82d80fd5a 100644 --- a/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml +++ b/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Intel Corporation. +# Copyright (c) 2017-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. 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/nsb_setup.sh b/nsb_setup.sh index 2e244cf00..49eb5def8 100755 --- a/nsb_setup.sh +++ b/nsb_setup.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2017 Intel Corporation. +# Copyright (c) 2017-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. diff --git a/samples/vnf_samples/nsut/agnostic/tc_baremetal_rfc2544_ipv4_trex.yaml b/samples/vnf_samples/nsut/agnostic/tc_baremetal_rfc2544_ipv4_trex.yaml new file mode 100644 index 000000000..44c7f6da0 --- /dev/null +++ b/samples/vnf_samples/nsut/agnostic/tc_baremetal_rfc2544_ipv4_trex.yaml @@ -0,0 +1,46 @@ +# 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 framesize = framesize or "{64B: 100}" %} +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf-RFC2544 + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: agnostic_vnf_topology_trex_2ports.yaml + nodes: + tg__0: trafficgen_0.yardstick + vnf__0: vnf_0.yardstick + options: + framesize: + uplink: {{ framesize }} + downlink: {{ framesize }} + flow: + src_ip: [{'tg__0': 'xe0'}] + dst_ip: [{'tg__0': 'xe1'}] + count: 1 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.0001 + vnf__0: + [] + runner: + type: Iteration + iterations: 1 + interval: 5 +context: + type: Node + name: yardstick + nfvi_type: baremetal + file: /etc/yardstick/nodes/pod_trex.yaml diff --git a/samples/vnf_samples/nsut/prox/configs/gen_lb-2.cfg b/samples/vnf_samples/nsut/prox/configs/gen_lb-2.cfg index c86b5f063..cd53631eb 100644 --- a/samples/vnf_samples/nsut/prox/configs/gen_lb-2.cfg +++ b/samples/vnf_samples/nsut/prox/configs/gen_lb-2.cfg @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/samples/vnf_samples/nsut/prox/configs/gen_lb-4.cfg b/samples/vnf_samples/nsut/prox/configs/gen_lb-4.cfg index 6a2d3f95a..00449041b 100644 --- a/samples/vnf_samples/nsut/prox/configs/gen_lb-4.cfg +++ b/samples/vnf_samples/nsut/prox/configs/gen_lb-4.cfg @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/samples/vnf_samples/nsut/prox/configs/handle_buffering-2.cfg b/samples/vnf_samples/nsut/prox/configs/handle_buffering-2.cfg index 14763c336..17300e651 100644 --- a/samples/vnf_samples/nsut/prox/configs/handle_buffering-2.cfg +++ b/samples/vnf_samples/nsut/prox/configs/handle_buffering-2.cfg @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/samples/vnf_samples/nsut/prox/configs/handle_lb-2.cfg b/samples/vnf_samples/nsut/prox/configs/handle_lb-2.cfg index 18ae9f4f9..24c064b21 100644 --- a/samples/vnf_samples/nsut/prox/configs/handle_lb-2.cfg +++ b/samples/vnf_samples/nsut/prox/configs/handle_lb-2.cfg @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/samples/vnf_samples/nsut/prox/configs/handle_lb-4.cfg b/samples/vnf_samples/nsut/prox/configs/handle_lb-4.cfg index 233a88522..0df50f748 100644 --- a/samples/vnf_samples/nsut/prox/configs/handle_lb-4.cfg +++ b/samples/vnf_samples/nsut/prox/configs/handle_lb-4.cfg @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. 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_l2fwd-scale-up.yaml b/samples/vnf_samples/nsut/prox/tc_prox_sriov_l2fwd-scale-up.yaml index 3bcacd354..0fb86c4e6 100644 --- a/samples/vnf_samples/nsut/prox/tc_prox_sriov_l2fwd-scale-up.yaml +++ b/samples/vnf_samples/nsut/prox/tc_prox_sriov_l2fwd-scale-up.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation +# Copyright (c) 2018-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. 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/samples/vnf_samples/nsut/vfw/tc_baremetal_rfc2544_ipv4_trex.yaml b/samples/vnf_samples/nsut/vfw/tc_baremetal_rfc2544_ipv4_trex.yaml new file mode 100644 index 000000000..856a4aa7e --- /dev/null +++ b/samples/vnf_samples/nsut/vfw/tc_baremetal_rfc2544_ipv4_trex.yaml @@ -0,0 +1,48 @@ +# 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 framesize = framesize or "{64B: 100}" %} +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf-RFC2544 + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: vfw-tg-topology.yaml + nodes: + tg__0: trafficgen_0.yardstick + vnf__0: vnf_0.yardstick + options: + framesize: + uplink: {{ framesize }} + downlink: {{ framesize }} + flow: + src_ip: [{'tg__0': 'xe0'}] + dst_ip: [{'tg__0': 'xe1'}] + count: 1 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.0001 + vnf__0: + rules: acl_1rule.yaml + vnf_config: {lb_config: 'SW', lb_count: 1, worker_config: '1C/1T', worker_threads: 1} + nfvi_enable: True + runner: + type: Iteration + iterations: 1 + interval: 5 +context: + type: Node + name: yardstick + nfvi_type: baremetal + file: /etc/yardstick/nodes/pod_trex.yaml diff --git a/samples/vnf_samples/nsut/vfw/tc_heat_rfc2544_ipv4_trex.yaml b/samples/vnf_samples/nsut/vfw/tc_heat_rfc2544_ipv4_trex.yaml new file mode 100644 index 000000000..eadc6cca1 --- /dev/null +++ b/samples/vnf_samples/nsut/vfw/tc_heat_rfc2544_ipv4_trex.yaml @@ -0,0 +1,78 @@ +# 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 framesize = framesize or "{64B: 100}" %} +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf-RFC2544 + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: vfw-tg-topology.yaml + nodes: + tg__0: trafficgen_0.yardstick + vnf__0: vnf_0.yardstick + options: + framesize: + uplink: {{ framesize }} + downlink: {{ framesize }} + flow: + src_ip: [{'tg__0': 'xe0'}] + dst_ip: [{'tg__0': 'xe1'}] + count: 1 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.0001 + vnf__0: + rules: acl_1rule.yaml + vnf_config: {lb_config: 'SW', lb_count: 1, worker_config: '1C/1T', worker_threads: 1} + runner: + type: Iteration + iterations: 1 + interval: 5 +context: + # put node context first, so we don't HEAT deploy if node has errors + name: yardstick + image: yardstick-samplevnfs + flavor: + vcpus: 10 + ram: 20480 + disk: 6 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 10 + hw:cpu_threads: 1 + user: ubuntu + placement_groups: + pgrp1: + policy: "availability" + servers: + vnf_0: + floating_ip: true + placement: "pgrp1" + trafficgen_0: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + gateway_ip: 'null' + port_security_enabled: False + enable_dhcp: 'false' + xe1: + cidr: '10.0.3.0/24' + gateway_ip: 'null' + port_security_enabled: False + enable_dhcp: 'false' diff --git a/samples/vnf_samples/traffic_profiles/ixia_ipv4_latency_vbng_1port_congested-8.yaml b/samples/vnf_samples/traffic_profiles/ixia_ipv4_latency_vbng_1port_congested-8.yaml index 77bc55751..3cd6f652a 100644 --- a/samples/vnf_samples/traffic_profiles/ixia_ipv4_latency_vbng_1port_congested-8.yaml +++ b/samples/vnf_samples/traffic_profiles/ixia_ipv4_latency_vbng_1port_congested-8.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation +# Copyright (c) 2018-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. diff --git a/samples/vnf_samples/traffic_profiles/ixia_ipv4_latency_vbng_scale_up.yaml b/samples/vnf_samples/traffic_profiles/ixia_ipv4_latency_vbng_scale_up.yaml index 91658a586..cdab7d968 100644 --- a/samples/vnf_samples/traffic_profiles/ixia_ipv4_latency_vbng_scale_up.yaml +++ b/samples/vnf_samples/traffic_profiles/ixia_ipv4_latency_vbng_scale_up.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation +# Copyright (c) 2018-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. diff --git a/yardstick/benchmark/scenarios/networking/vnf_generic.py b/yardstick/benchmark/scenarios/networking/vnf_generic.py index dd5f4726f..c88ea51c3 100644 --- a/yardstick/benchmark/scenarios/networking/vnf_generic.py +++ b/yardstick/benchmark/scenarios/networking/vnf_generic.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. 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 e0b7aa000..cb8ba1771 100644 --- a/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py +++ b/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2018 Intel Corporation +# Copyright (c) 2016-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. @@ -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 e3ac4f833..aded2d347 100644 --- a/yardstick/network_services/traffic_profile/ixia_rfc2544.py +++ b/yardstick/network_services/traffic_profile/ixia_rfc2544.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. @@ -28,7 +28,6 @@ class IXIARFC2544Profile(trex_traffic_profile.TrexProfile): UPLINK = 'uplink' DOWNLINK = 'downlink' DROP_PERCENT_ROUND = 6 - RATE_ROUND = 5 STATUS_SUCCESS = "Success" STATUS_FAIL = "Failure" @@ -171,10 +170,6 @@ class IXIARFC2544Profile(trex_traffic_profile.TrexProfile): self.ports = [port for port in port_generator()] - def _get_next_rate(self): - rate = round(float(self.max_rate + self.min_rate)/2.0, self.RATE_ROUND) - return rate - def _get_framesize(self): framesizes = [] traffic = self._get_ixia_traffic_profile(self.full_profile) @@ -214,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: @@ -267,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 @@ -356,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: @@ -379,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 e33c437c9..b838bf814 100644 --- a/yardstick/network_services/traffic_profile/rfc2544.py +++ b/yardstick/network_services/traffic_profile/rfc2544.py @@ -23,7 +23,7 @@ from yardstick.common import constants from yardstick.network_services.traffic_profile import trex_traffic_profile -LOGGING = logging.getLogger(__name__) +LOG = logging.getLogger(__name__) SRC_PORT = 'sport' DST_PORT = 'dport' @@ -271,17 +271,23 @@ class RFC2544Profile(trex_traffic_profile.TrexProfile): return streams def get_drop_percentage(self, samples, tol_low, tol_high, - correlated_traffic): + correlated_traffic, resolution): """Calculate the drop percentage and run the traffic""" completed = False out_pkt_end = sum(port['out_packets'] for port in samples[-1].values()) 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 @@ -301,7 +307,13 @@ class RFC2544Profile(trex_traffic_profile.TrexProfile): completed = True last_rate = self.rate - self.rate = round(float(self.max_rate + self.min_rate) / 2.0, 5) + self.rate = self._get_next_rate() + if abs(last_rate - self.rate) < resolution: + # stop test if the difference between the rate transmission + # in two iterations is smaller than the value of the resolution + completed = True + LOG.debug("rate=%s, next_rate=%s, resolution=%s, completed=%s", + last_rate, self.rate, resolution, completed) throughput = rx_rate_fps * 2 if correlated_traffic else rx_rate_fps @@ -314,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/traffic_profile/trex_traffic_profile.py b/yardstick/network_services/traffic_profile/trex_traffic_profile.py index ed0355fa5..2d2c2d8b6 100644 --- a/yardstick/network_services/traffic_profile/trex_traffic_profile.py +++ b/yardstick/network_services/traffic_profile/trex_traffic_profile.py @@ -52,6 +52,7 @@ class TrexProfile(base.TrafficProfile): IPv6: ('ip6_packet', Pkt.IPv6), UDP: ('udp_packet', Pkt.UDP), } + RATE_ROUND = 5 def _general_single_action_partial(self, protocol): def f(field): @@ -186,6 +187,8 @@ class TrexProfile(base.TrafficProfile): self.qinq = False self.vm_flow_vars = [] self.packets = [] + self.max_rate = 0 + self.min_rate = 0 self._map_proto_actions = { # the tuple is (single value function, range value function, if the values should be @@ -337,6 +340,10 @@ class TrexProfile(base.TrafficProfile): if 'dstport' in outer_l4: self._set_proto_addr(UDP, DST_PORT, outer_l4['dstport'], outer_l4['count']) + def _get_next_rate(self): + rate = round(float(self.max_rate + self.min_rate)/2.0, self.RATE_ROUND) + return rate + @classmethod def _count_ip(cls, start_ip, end_ip): start = ipaddress.ip_address(six.u(start_ip)) diff --git a/yardstick/network_services/vnf_generic/vnf/acl_vnf.py b/yardstick/network_services/vnf_generic/vnf/acl_vnf.py index 46380e216..69d29bf76 100644 --- a/yardstick/network_services/vnf_generic/vnf/acl_vnf.py +++ b/yardstick/network_services/vnf_generic/vnf/acl_vnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/network_services/vnf_generic/vnf/agnostic_vnf.py b/yardstick/network_services/vnf_generic/vnf/agnostic_vnf.py index 5856eb6e0..d1d9667db 100644 --- a/yardstick/network_services/vnf_generic/vnf/agnostic_vnf.py +++ b/yardstick/network_services/vnf_generic/vnf/agnostic_vnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation +# Copyright (c) 2018-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. diff --git a/yardstick/network_services/vnf_generic/vnf/base.py b/yardstick/network_services/vnf_generic/vnf/base.py index 1f49b22d5..8064ae927 100644 --- a/yardstick/network_services/vnf_generic/vnf/base.py +++ b/yardstick/network_services/vnf_generic/vnf/base.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/network_services/vnf_generic/vnf/cgnapt_vnf.py b/yardstick/network_services/vnf_generic/vnf/cgnapt_vnf.py index 62e15094a..ee4a581b1 100644 --- a/yardstick/network_services/vnf_generic/vnf/cgnapt_vnf.py +++ b/yardstick/network_services/vnf_generic/vnf/cgnapt_vnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/network_services/vnf_generic/vnf/epc_vnf.py b/yardstick/network_services/vnf_generic/vnf/epc_vnf.py index 1b06c59c1..8112963e9 100644 --- a/yardstick/network_services/vnf_generic/vnf/epc_vnf.py +++ b/yardstick/network_services/vnf_generic/vnf/epc_vnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation +# Copyright (c) 2018-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. diff --git a/yardstick/network_services/vnf_generic/vnf/prox_helpers.py b/yardstick/network_services/vnf_generic/vnf/prox_helpers.py index aeb41858f..a3d0c19cd 100644 --- a/yardstick/network_services/vnf_generic/vnf/prox_helpers.py +++ b/yardstick/network_services/vnf_generic/vnf/prox_helpers.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation +# Copyright (c) 2018-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. diff --git a/yardstick/network_services/vnf_generic/vnf/prox_irq.py b/yardstick/network_services/vnf_generic/vnf/prox_irq.py index 4cc8923cb..614066e46 100644 --- a/yardstick/network_services/vnf_generic/vnf/prox_irq.py +++ b/yardstick/network_services/vnf_generic/vnf/prox_irq.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation +# Copyright (c) 2018-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. diff --git a/yardstick/network_services/vnf_generic/vnf/prox_vnf.py b/yardstick/network_services/vnf_generic/vnf/prox_vnf.py index 0d1360dd0..c9abc757e 100644 --- a/yardstick/network_services/vnf_generic/vnf/prox_vnf.py +++ b/yardstick/network_services/vnf_generic/vnf/prox_vnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation +# Copyright (c) 2018-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. diff --git a/yardstick/network_services/vnf_generic/vnf/router_vnf.py b/yardstick/network_services/vnf_generic/vnf/router_vnf.py index 90b7b215e..f1486bdb4 100644 --- a/yardstick/network_services/vnf_generic/vnf/router_vnf.py +++ b/yardstick/network_services/vnf_generic/vnf/router_vnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py index aec085057..2a477bb8d 100644 --- a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py +++ b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py @@ -14,7 +14,7 @@ import logging import decimal -from multiprocessing import Queue, Value, Process +from multiprocessing import Queue, Value, Process, JoinableQueue import os import posixpath import re @@ -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? @@ -948,6 +951,39 @@ class SampleVNFTrafficGen(GenericTrafficGen): self.traffic_finished = False self._tg_process = None self._traffic_process = None + self._tasks_queue = JoinableQueue() + self._result_queue = Queue() + + def _test_runner(self, traffic_profile, tasks, results): + self.resource_helper.run_test(traffic_profile, tasks, results) + + def _init_traffic_process(self, traffic_profile): + name = '{}-{}-{}-{}'.format(self.name, self.APP_NAME, + traffic_profile.__class__.__name__, + os.getpid()) + self._traffic_process = Process(name=name, target=self._test_runner, + args=( + traffic_profile, self._tasks_queue, + self._result_queue)) + + self._traffic_process.start() + while self.resource_helper.client_started.value == 0: + time.sleep(1) + if not self._traffic_process.is_alive(): + break + + def run_traffic_once(self, traffic_profile): + if self.resource_helper.client_started.value == 0: + self._init_traffic_process(traffic_profile) + + # continue test - run next iteration + LOG.info("Run next iteration ...") + self._tasks_queue.put('RUN_TRAFFIC') + + def wait_on_traffic(self): + self._tasks_queue.join() + result = self._result_queue.get() + return result def _start_server(self): # we can't share ssh paramiko objects to force new connection diff --git a/yardstick/network_services/vnf_generic/vnf/tg_landslide.py b/yardstick/network_services/vnf_generic/vnf/tg_landslide.py index fb8c24752..285374a92 100644 --- a/yardstick/network_services/vnf_generic/vnf/tg_landslide.py +++ b/yardstick/network_services/vnf_generic/vnf/tg_landslide.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation +# Copyright (c) 2018-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. diff --git a/yardstick/network_services/vnf_generic/vnf/tg_ping.py b/yardstick/network_services/vnf_generic/vnf/tg_ping.py index a989543f5..5c8819119 100644 --- a/yardstick/network_services/vnf_generic/vnf/tg_ping.py +++ b/yardstick/network_services/vnf_generic/vnf/tg_ping.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/network_services/vnf_generic/vnf/tg_pktgen.py b/yardstick/network_services/vnf_generic/vnf/tg_pktgen.py index e73cebc40..5da2178af 100644 --- a/yardstick/network_services/vnf_generic/vnf/tg_pktgen.py +++ b/yardstick/network_services/vnf_generic/vnf/tg_pktgen.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation +# Copyright (c) 2018-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. diff --git a/yardstick/network_services/vnf_generic/vnf/tg_prox.py b/yardstick/network_services/vnf_generic/vnf/tg_prox.py index 61ff2e036..65b7bac10 100644 --- a/yardstick/network_services/vnf_generic/vnf/tg_prox.py +++ b/yardstick/network_services/vnf_generic/vnf/tg_prox.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Intel Corporation +# Copyright (c) 2017-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. 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 d3a2d9443..5d69fc8c8 100644 --- a/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py +++ b/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py @@ -16,13 +16,8 @@ import ipaddress import logging import six import collections -import os -import time from six import moves - -from multiprocessing import Queue, Process, JoinableQueue - from yardstick.common import utils from yardstick.common import exceptions from yardstick.network_services.libs.ixia_libs.ixnet import ixnet_api @@ -65,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() @@ -89,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), @@ -613,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), @@ -844,9 +847,6 @@ class IxiaTrafficGen(SampleVNFTrafficGen): self._ixia_traffic_gen = None self.ixia_file_name = '' self.vnf_port_pairs = [] - self._traffic_process = None - self._tasks_queue = JoinableQueue() - self._result_queue = Queue() def _check_status(self): pass @@ -854,34 +854,3 @@ class IxiaTrafficGen(SampleVNFTrafficGen): def terminate(self): self.resource_helper.stop_collect() super(IxiaTrafficGen, self).terminate() - - def _test_runner(self, traffic_profile, tasks, results): - self.resource_helper.run_test(traffic_profile, tasks, results) - - def _init_traffic_process(self, traffic_profile): - name = '{}-{}-{}-{}'.format(self.name, self.APP_NAME, - traffic_profile.__class__.__name__, - os.getpid()) - self._traffic_process = Process(name=name, target=self._test_runner, - args=( - traffic_profile, self._tasks_queue, - self._result_queue)) - - self._traffic_process.start() - while self.resource_helper.client_started.value == 0: - time.sleep(1) - if not self._traffic_process.is_alive(): - break - - def run_traffic_once(self, traffic_profile): - if self.resource_helper.client_started.value == 0: - self._init_traffic_process(traffic_profile) - - # continue test - run next iteration - LOG.info("Run next iteration ...") - self._tasks_queue.put('RUN_TRAFFIC') - - def wait_on_traffic(self): - self._tasks_queue.join() - result = self._result_queue.get() - return result diff --git a/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_trex.py b/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_trex.py index 7c2079101..a9c0222ac 100644 --- a/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_trex.py +++ b/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_trex.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. @@ -15,12 +15,14 @@ import logging import time +from six import moves from yardstick.common import utils from yardstick.network_services.vnf_generic.vnf import sample_vnf from yardstick.network_services.vnf_generic.vnf import tg_trex +from trex_stl_lib.trex_stl_exceptions import STLError -LOGGING = logging.getLogger(__name__) +LOG = logging.getLogger(__name__) class TrexRfcResourceHelper(tg_trex.TrexResourceHelper): @@ -48,7 +50,8 @@ class TrexRfcResourceHelper(tg_trex.TrexResourceHelper): completed, output = traffic_profile.get_drop_percentage( samples, self.rfc2544_helper.tolerance_low, self.rfc2544_helper.tolerance_high, - self.rfc2544_helper.correlated_traffic) + self.rfc2544_helper.correlated_traffic, + self.rfc2544_helper.resolution) self._queue.put(output) return completed @@ -58,6 +61,56 @@ class TrexRfcResourceHelper(tg_trex.TrexResourceHelper): def clear_client_stats(self, ports): self.client.clear_stats(ports=ports) + def run_test(self, traffic_profile, tasks_queue, results_queue, *args): # pragma: no cover + LOG.debug("Trex resource_helper run_test") + if self._terminated.value: + return + # if we don't do this we can hang waiting for the queue to drain + # have to do this in the subprocess + self._queue.cancel_join_thread() + try: + self._build_ports() + self.client = self._connect() + self.client.reset(ports=self.all_ports) + self.client.remove_all_streams(self.all_ports) # remove all streams + traffic_profile.register_generator(self) + + completed = False + self.rfc2544_helper.iteration.value = 0 + self.client_started.value = 1 + while completed is False and not self._terminated.value: + LOG.debug("Wait for task ...") + try: + task = tasks_queue.get(True, 5) + except moves.queue.Empty: + LOG.debug("Wait for task timeout, continue waiting...") + continue + else: + if task != 'RUN_TRAFFIC': + continue + self.rfc2544_helper.iteration.value += 1 + LOG.info("Got %s task, start iteration %d", task, + self.rfc2544_helper.iteration.value) + completed = self._run_traffic_once(traffic_profile) + if completed: + LOG.debug("%s::run_test - test completed", + self.__class__.__name__) + results_queue.put('COMPLETE') + else: + results_queue.put('CONTINUE') + tasks_queue.task_done() + + self.client.stop(self.all_ports) + self.client.disconnect() + self._terminated.value = 0 + except STLError: + if self._terminated.value: + LOG.debug("traffic generator is stopped") + return # return if trex/tg server is stopped. + raise + + self.client_started.value = 0 + LOG.debug("%s::run_test done", self.__class__.__name__) class TrexTrafficGenRFC(tg_trex.TrexTrafficGen): """ diff --git a/yardstick/network_services/vnf_generic/vnf/tg_trex.py b/yardstick/network_services/vnf_generic/vnf/tg_trex.py index 43ee82629..0cb66a714 100644 --- a/yardstick/network_services/vnf_generic/vnf/tg_trex.py +++ b/yardstick/network_services/vnf_generic/vnf/tg_trex.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. @@ -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/network_services/vnf_generic/vnf/udp_replay.py b/yardstick/network_services/vnf_generic/vnf/udp_replay.py index fa92744d8..3f9994486 100644 --- a/yardstick/network_services/vnf_generic/vnf/udp_replay.py +++ b/yardstick/network_services/vnf_generic/vnf/udp_replay.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/network_services/vnf_generic/vnf/vfw_vnf.py b/yardstick/network_services/vnf_generic/vnf/vfw_vnf.py index 572243194..743f2d4bb 100644 --- a/yardstick/network_services/vnf_generic/vnf/vfw_vnf.py +++ b/yardstick/network_services/vnf_generic/vnf/vfw_vnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/network_services/vnf_generic/vnf/vpe_vnf.py b/yardstick/network_services/vnf_generic/vnf/vpe_vnf.py index 08fcb5e14..322ecd016 100644 --- a/yardstick/network_services/vnf_generic/vnf/vpe_vnf.py +++ b/yardstick/network_services/vnf_generic/vnf/vpe_vnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. 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/benchmark/scenarios/networking/test_vnf_generic.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_vnf_generic.py index 304d05564..ff8ce5796 100644 --- a/yardstick/tests/unit/benchmark/scenarios/networking/test_vnf_generic.py +++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_vnf_generic.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. 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 38ca26b08..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 @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation +# Copyright (c) 2018-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. @@ -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 38d13c385..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 @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. @@ -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_prox_irq.py b/yardstick/tests/unit/network_services/traffic_profile/test_prox_irq.py index 1a9947984..1d9eb0887 100644 --- a/yardstick/tests/unit/network_services/traffic_profile/test_prox_irq.py +++ b/yardstick/tests/unit/network_services/traffic_profile/test_prox_irq.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation +# Copyright (c) 2018-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. diff --git a/yardstick/tests/unit/network_services/traffic_profile/test_prox_profile.py b/yardstick/tests/unit/network_services/traffic_profile/test_prox_profile.py index 2660d4134..1593a0835 100644 --- a/yardstick/tests/unit/network_services/traffic_profile/test_prox_profile.py +++ b/yardstick/tests/unit/network_services/traffic_profile/test_prox_profile.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Intel Corporation +# Copyright (c) 2017-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. 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 b8fbc6344..c72a72d3d 100644 --- a/yardstick/tests/unit/network_services/traffic_profile/test_rfc2544.py +++ b/yardstick/tests/unit/network_services/traffic_profile/test_rfc2544.py @@ -255,31 +255,41 @@ 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)}} ] completed, output = rfc2544_profile.get_drop_percentage( - samples, 0, 0, False) + samples, 0, 0, False, 0.1) expected = {'DropPercentage': 50.0, '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_acl_vnf.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_acl_vnf.py index 2d7ec195f..12bb42f20 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_acl_vnf.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_acl_vnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_agnostic_vnf.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_agnostic_vnf.py index 47e464da3..7c7fe5955 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_agnostic_vnf.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_agnostic_vnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation +# Copyright (c) 2018-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. diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_base.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_base.py index ea2f84d98..1a72e042b 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_base.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_base.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py index 635ca41a2..d0672dcfd 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_epc_vnf.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_epc_vnf.py index c5bc3f59d..b1bef2e39 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_epc_vnf.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_epc_vnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation +# Copyright (c) 2018-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. diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py index 742dbfe24..32f384027 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2018 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_irq.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_irq.py index fd6f1712c..94197c3be 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_irq.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_irq.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2018 Intel Corporation +# Copyright (c) 2017-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. diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py index de436a46e..76fd74dfe 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_router_vnf.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_router_vnf.py index 3e21392be..b8f3fcaca 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_router_vnf.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_router_vnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_ixload.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_ixload.py index 469e5113f..dd1c277c3 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_ixload.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_ixload.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_landslide.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_landslide.py index 8c017d15e..2d8c01bec 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_landslide.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_landslide.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation +# Copyright (c) 2018-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. diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_ping.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_ping.py index 51f075e4a..a3e4384cf 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_ping.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_ping.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_pktgen.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_pktgen.py index 34dd640ad..1ecb6ffc9 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_pktgen.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_pktgen.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Intel Corporation +# Copyright (c) 2018-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. diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_prox.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_prox.py index 49df19378..0aaf17790 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_prox.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_prox.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Intel Corporation +# Copyright (c) 2017-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. 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, diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py index 7ef94c3d8..51b1b0d33 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2018 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_trex.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_trex.py index 350ba8448..0a441c8ce 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_trex.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_trex.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_udp_replay.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_udp_replay.py index 60f739543..cbb4ee913 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_udp_replay.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_udp_replay.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_vfw_vnf.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_vfw_vnf.py index 5911948a3..5334ce18c 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_vfw_vnf.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_vfw_vnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py index 7b67ecc37..8342f5faa 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-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. |