diff options
230 files changed, 11156 insertions, 1826 deletions
@@ -36,6 +36,7 @@ disable= dangerous-default-value, deprecated-lambda, expression-not-assigned, + fixme, global-statement, literal-comparison, no-init, @@ -69,6 +70,7 @@ disable= consider-merging-isinstance, consider-using-ternary, duplicate-code, + inconsistent-return-statements, interface-not-implemented, no-else-return, no-self-use, @@ -13,13 +13,15 @@ Repository: yardstick Committers: jorgen.w.karlsson@ericsson.com jean.gaoliang@huawei.com -vincenzo.m.riccobene@intel.com lvjing5@huawei.com wu.zhihui1@zte.com.cn 14_ykl@tongji.edu.cn limingjiang@huawei.com trevor.cooper@intel.com ross.b.brattain@intel.com +chenjiankun1@huawei.com +rodolfo.alonso.hernandez@intel.com +emma.l.foley@intel.com Link to TSC approval: http://meetbot.opnfv.org/meetings/ Link to approval of additional submitters: diff --git a/README.rst b/README.rst index 76ea9723c..5cf4fec00 100644 --- a/README.rst +++ b/README.rst @@ -48,7 +48,8 @@ For more information on Yardstick architecture, please read: Installation ------------ -Yardstick supports installation on Ubuntu 14.04 or via a Docker image. +Yardstick supports installation on Ubuntu 14.04, OpenSUSE Leap 42.2, 42.3 and +Tumbleweed or via a Docker image. To learn how to install Yardstick, consult the documentation available online at: diff --git a/ansible/build_yardstick_image.yml b/ansible/build_yardstick_image.yml index bc57bcd48..7f709873e 100644 --- a/ansible/build_yardstick_image.yml +++ b/ansible/build_yardstick_image.yml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -- hosts: localhost +- hosts: jumphost vars: boot_modes: @@ -31,7 +31,8 @@ workspace: "{{ lookup('env', 'workspace')|default('/tmp/workspace/yardstick', true) }}" raw_imgfile_basename: "yardstick-{{ release }}-server.raw" environment: - PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin + - PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin + - "{{ proxy_env }}" tasks: - group_by: @@ -40,7 +41,12 @@ - package: name=parted state=present - set_fact: - imgfile: "{{ workspace }}/yardstick-image.img" + imgfile: "{{ normal_image_file }}" + when: img_property == "normal" + + - set_fact: + imgfile: "{{ nsb_image_file }}" + when: img_property == "nsb" - set_fact: mountdir: "{{ lookup('env', 'mountdir')|default('/mnt/yardstick', true) }}" @@ -196,8 +202,13 @@ nameserver_ip: "{{ ansible_dns.nameservers[0] }}" image_type: vm -- name: include {{ img_modify_playbook }} - include: "{{ img_modify_playbook }}" +- name: include ubuntu_server_cloudimg_modify.yml + include: ubuntu_server_cloudimg_modify.yml + when: img_property == "normal" + +- name: include ubuntu_server_cloudimg_modify_samplevnfs.yml + include: ubuntu_server_cloudimg_modify_samplevnfs.yml + when: img_property == "nsb" - hosts: localhost tasks: diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index edd6564d0..359968277 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -1,6 +1,9 @@ ---
+target_os: "Ubuntu"
+YARD_IMG_ARCH: "amd64"
clone_dest: /opt/tempT
release: xenial
-target_os: Ubuntu
+normal_image_file: "{{ workspace }}/yardstick-image.img"
+nsb_image_file: "{{ workspace }}/yardstick-nsb-image.img"
ubuntu_image_file: /tmp/workspace/yardstick/yardstick-trusty-server.raw
-proxy_env: {}
\ No newline at end of file +proxy_env: {}
diff --git a/ansible/infra_deploy.yml b/ansible/infra_deploy.yml new file mode 100644 index 000000000..10f53fbad --- /dev/null +++ b/ansible/infra_deploy.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2018 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. +--- +- hosts: jumphost + + roles: + - infra_check_requirements diff --git a/ansible/inventory.ini b/ansible/inventory.ini index 31692a777..a5fbaad95 100644 --- a/ansible/inventory.ini +++ b/ansible/inventory.ini @@ -12,3 +12,6 @@ host5 ansible_host=10.1.0.54 ansible_user=root ansible_ssh_pass=root [nodes:children] controller compute + +[jumphost] +localhost ansible_connection=local diff --git a/ansible/nsb_setup.yml b/ansible/nsb_setup.yml index 90fba0b1e..bfe5d2349 100644 --- a/ansible/nsb_setup.yml +++ b/ansible/nsb_setup.yml @@ -12,37 +12,26 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -- include: ubuntu_server_baremetal_deploy_samplevnfs.yml - vars: - YARD_IMG_ARCH: amd64 - -- hosts: localhost - roles: - - install_dependencies - - docker - -- include: build_yardstick_image.yml - vars: - YARD_IMG_ARCH: amd64 - release: xenial - when: openrc_file is defined +#- name: Prepare baremetal machine +# include: ubuntu_server_baremetal_deploy_samplevnfs.yml +# vars: +# YARD_IMG_ARCH: amd64 +# +#- name: Install jumphost dependencies and configure docker +# hosts: jumphost +# environment: +# "{{ proxy_env }}" +# roles: +# - install_dependencies +# - docker -- include: clean_images.yml +- name: "handle all openstack stuff when: openrc_file is defined" + include: prepare_openstack.yml when: openrc_file is defined -- hosts: localhost - post_tasks: - - os_image: - name: yardstick-samplevnfs - is_public: yes - disk_format: qcow2 - container_format: bare - filename: "{{ raw_imgfile }}" - properties: - hw_vif_multiqueue_enabled: true - environment: "{{ openrc }}" - when: openrc_file is defined - +- name: start yardstick container on jumphost + hosts: jumphost + tasks: - name: Start yardstick container docker_container: name: yardstick diff --git a/ansible/prepare_openstack.yml b/ansible/prepare_openstack.yml new file mode 100644 index 000000000..8456c9e59 --- /dev/null +++ b/ansible/prepare_openstack.yml @@ -0,0 +1,44 @@ +# Copyright (c) 2017 Intel Corporation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +- name: convert openrc_file to openrc env dict + hosts: jumphost + vars_files: + - yardstick_config.yml + roles: + - convert_openrc + +### +# Build yardstick image for openstack quest +# check included file for other vars/env +### +- include: build_yardstick_image.yml + vars: + YARD_IMG_ARCH: amd64 + release: xenial + +### +# Delete old yardstick image and flavors +# Upload new image +### +- name: cleanup old openstack images, upload new + hosts: jumphost + vars_files: + - yardstick_config.yml + environment: + "{{ openrc }}" + roles: + - clean_images + - clean_flavors + - create_samplevnfs_image diff --git a/ansible/roles/add_custom_repos/tasks/ubuntu.yml b/ansible/roles/add_custom_repos/tasks/ubuntu.yml index c0ba89c0b..4658fe514 100644 --- a/ansible/roles/add_custom_repos/tasks/ubuntu.yml +++ b/ansible/roles/add_custom_repos/tasks/ubuntu.yml @@ -12,6 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. --- +- name: Check multiverse repository + shell: "apt-cache policy | grep {{ release }}/multiverse" + args: + executable: /bin/bash + register: multiverse_repos + ignore_errors: yes + - name: add custom repos template: src: sources.list.j2 diff --git a/ansible/roles/add_custom_repos/templates/sources.list.j2 b/ansible/roles/add_custom_repos/templates/sources.list.j2 index af741cb10..61fbe43aa 100644 --- a/ansible/roles/add_custom_repos/templates/sources.list.j2 +++ b/ansible/roles/add_custom_repos/templates/sources.list.j2 @@ -1,5 +1,8 @@ {% if YARD_IMG_ARCH == "arm64" %} deb [arch={{ YARD_IMG_ARCH }}] http://ports.ubuntu.com/ {{ release }}-backports main restricted universe multiverse {% else %} -deb http://archive.ubuntu.com/ubuntu/ {{ release }}-backports main restricted universe multiverse +deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu/ {{ release }}-backports main restricted universe multiverse + {% if multiverse_repos.rc != 0 %} +deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ {{ release }} multiverse + {% endif %} {% endif %} diff --git a/ansible/roles/archive_spec_cpu2006_result/tasks/main.yaml b/ansible/roles/archive_spec_cpu2006_result/tasks/main.yaml index 7f72e1394..0282244ae 100644 --- a/ansible/roles/archive_spec_cpu2006_result/tasks/main.yaml +++ b/ansible/roles/archive_spec_cpu2006_result/tasks/main.yaml @@ -10,6 +10,5 @@ - name: archive_spec_cpu2006_result archive: - path: /usr/cpu2006/result - dest: /usr/cpu2006/spec_cpu2006_result.zip - become: true + path: ~/cpu2006/result + dest: ~/cpu2006/spec_cpu2006_result.zip diff --git a/ansible/roles/create_image/tasks/main.yml b/ansible/roles/create_image/tasks/main.yml new file mode 100644 index 000000000..f63489d2d --- /dev/null +++ b/ansible/roles/create_image/tasks/main.yml @@ -0,0 +1,23 @@ +# Copyright (c) 2017 Intel Corporation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +- name: pre-clean openstack enviroment + hosts: yardstick + vars_files: + - yardstick_config.yml + + roles: + - convert_openrc + - clean_images + - clean_flavors diff --git a/ansible/roles/create_samplevnfs_image/tasks/main.yml b/ansible/roles/create_samplevnfs_image/tasks/main.yml new file mode 100644 index 000000000..c83cccab5 --- /dev/null +++ b/ansible/roles/create_samplevnfs_image/tasks/main.yml @@ -0,0 +1,24 @@ +# Copyright (c) 2017 Intel Corporation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +- name: create yardstick-samplevnfs image + when: openrc_file is defined + os_image: + name: yardstick-samplevnfs + is_public: yes + disk_format: qcow2 + container_format: bare + filename: "{{ raw_imgfile }}" + properties: + hw_vif_multiqueue_enabled: true diff --git a/ansible/roles/enable_hugepages_on_boot/tasks/main.yml b/ansible/roles/enable_hugepages_on_boot/tasks/main.yml index 29432d2e4..75526eb19 100755 --- a/ansible/roles/enable_hugepages_on_boot/tasks/main.yml +++ b/ansible/roles/enable_hugepages_on_boot/tasks/main.yml @@ -31,34 +31,37 @@ msg: "Hugepages already set by someone else" when: is_mine_huge.stdout == "" and is_huge.stdout != "" -- name: use 16 for auto num_hugepages and 1G size - set_fact: - num_hugepages: 8 - when: num_hugepages|default("auto") == "auto" +- name: configure hugepages as idempotent block + block: + - name: use 8 for auto num_hugepages and 1G size + set_fact: + num_hugepages: 8 + when: num_hugepages|default("auto") == "auto" -- name: set hugepages in grub - lineinfile: - dest: /etc/default/grub - regexp: '{{ hugepage_param_regex }}' - line: '{{ hugepage_param }}' - state: present + - name: set hugepages in grub + lineinfile: + dest: /etc/default/grub + regexp: '{{ hugepage_param_regex }}' + line: '{{ hugepage_param }}' + state: present -- name: create hugetables mount - file: - path: "{{ hugetable_mount }}" - state: directory + - name: create hugetables mount + file: + path: "{{ hugetable_mount }}" + state: directory -- name: mount hugetlbfs - mount: - name: "{{ hugetable_mount }}" - src: nodev - fstype: hugetlbfs - state: present + - name: mount hugetlbfs + mount: + name: "{{ hugetable_mount }}" + src: nodev + fstype: hugetlbfs + state: present -- service: - name: procps - enabled: yes + - service: + name: procps + enabled: yes -- include: manual_modify_grub.yml - # only tested on Ubuntu, kernel line is probably different on other distros - when: ansible_distribution == "Ubuntu" + - include: manual_modify_grub.yml + # only tested on Ubuntu, kernel line is probably different on other distros + when: ansible_distribution == "Ubuntu" + when: is_mine_huge.stdout == "" diff --git a/ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml b/ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml index cac10e80e..6fa0c1d25 100644 --- a/ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml +++ b/ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml @@ -20,16 +20,17 @@ recurse: yes register: grub_files +- name: check if hugepages are already enabled + command: "grep -o 'default_hugepagesz=' {{ item.path }}" + register: hugepage_enabled + ignore_errors: True + with_items: "{{ grub_files.files }}" -- name: added hugepages to grub manually because we can't run update-grub in chroot +- name: add hugepages to grub manually because we can't run update-grub in chroot replace: dest: "{{ item.path }}" - # console= should end the line - regexp: '(linux\s+/boot/vmlinuz.*console=\S+$)' - # default_hugepagesz=1G hugepagesz=1G hugepages=8 + regexp: '(linux\s+/boot/vmlinuz.*$)' replace: '\1 default_hugepagesz={{ huge_pagesize_short[huge_pagesize_mb] }} hugepagesz={{ huge_pagesize_short[huge_pagesize_mb] }} hugepages={{ num_hugepages }}' with_items: "{{ grub_files.files }}" - - - - + # we suppose consistent /boot/grub/grub.cfg files + when: hugepage_enabled['results'][0].stdout == "" diff --git a/ansible/roles/enable_hugepages_on_boot/vars/main.yml b/ansible/roles/enable_hugepages_on_boot/vars/main.yml index acdf02509..6fec347b2 100644 --- a/ansible/roles/enable_hugepages_on_boot/vars/main.yml +++ b/ansible/roles/enable_hugepages_on_boot/vars/main.yml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -hugepage_param_regex: '^GRUB_CMDLINE_LINUX="\$GRUB_CMDLINE_LINUX.*# added by hugepages role' +hugepage_param_regex: '^GRUB_CMDLINE_LINUX="\$GRUB_CMDLINE_LINUX.*" # added by hugepages role' hugepage_param: 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX default_hugepagesz={{ huge_pagesize_short[huge_pagesize_mb] }} hugepagesz={{ huge_pagesize_short[huge_pagesize_mb] }} hugepages={{ num_hugepages }}" # added by hugepages role' update_grub: diff --git a/ansible/roles/enable_iommu_on_boot/tasks/main.yml b/ansible/roles/enable_iommu_on_boot/tasks/main.yml new file mode 100644 index 000000000..1b98a50b1 --- /dev/null +++ b/ansible/roles/enable_iommu_on_boot/tasks/main.yml @@ -0,0 +1,72 @@ +# Copyright (c) 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +- name: Set iommu_boot_params for Intel + set_fact: + iommu_boot_params: ' intel_iommu=on iommu=pt' + when: hostvars[inventory_hostname]['ansible_system_vendor'] == "Intel Corporation" + +- name: Set iommu_boot_params for AMD + set_fact: + iommu_boot_params: ' amd_iommu=on iommu=pt' + when: hostvars[inventory_hostname]['ansible_system_vendor'] == "AuthenticAMD" + +- name: Set facts for this role + set_fact: + hugepages_help_string: ' # added by hugepages role' + iommu_help_string: ', added by iommu role' + hugepages_params: " default_hugepagesz=1G hugepagesz=1G hugepages=8" + iommu_original_kernel_params: 'GRUB_CMDLINE_LINUX="\$GRUB_CMDLINE_LINUX{{ hugepages_params }}' + iommu_enabled_kernel_params: '{{ iommu_original_kernel_params }}{{ iommu_boot_params }}"' + iommu_enabled_kernel_params_with_help: '{{ iommu_original_kernel_params }}{{ iommu_boot_params }}"{{ hugepages_help_string }}{{ iommu_help_string }}' + +- name: check if iommu is set by this role in /etc/default/grub + lineinfile: + path: /etc/default/grub + line: '{{ iommu_enabled_kernel_params_with_help }}' + #changed_when: no + check_mode: yes + register: is_mine_iommu_etc_grub + ignore_errors: True + +- name: check if iommu is set by someone else + command: "grep -o 'iommu' /etc/default/grub" + register: is_iommu + ignore_errors: True + +- fail: + msg: "Iommu already set by someone else" + when: is_mine_iommu_etc_grub.changed == false and is_iommu.stdout != "" + +- name: 'Configure iommu in /etc/default/grub' +# and /boot/grub/grub.cfg(when: ansible_distribution == "Ubuntu")' + lineinfile: + path: /etc/default/grub + regexp: '({{ iommu_original_kernel_params }})"{{ hugepages_help_string }}' + line: '\1{{ iommu_boot_params }}"{{ hugepages_help_string }}{{ iommu_help_string }}' + backrefs: yes + when: is_mine_iommu_etc_grub.changed == true + +- name: find boot grub.cfg + find: + paths: /boot + file_type: file + patterns: 'grub*.cfg' + recurse: yes + register: grub_files + +- include: manual_modify_grub.yml + # only tested on Ubuntu, kernel line is probably different on other distros + with_items: "{{ grub_files.files }}" + when: ansible_distribution == "Ubuntu" diff --git a/samples/vnf_samples/nsut/prox/ovs-dpdk/http_tests/tc_FileSize-1K_Requests-1M_Concurrency-100.yaml b/ansible/roles/enable_iommu_on_boot/tasks/manual_modify_grub.yml index 73fea8122..6760c3f9d 100644 --- a/samples/vnf_samples/nsut/prox/ovs-dpdk/http_tests/tc_FileSize-1K_Requests-1M_Concurrency-100.yaml +++ b/ansible/roles/enable_iommu_on_boot/tasks/manual_modify_grub.yml @@ -11,34 +11,24 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - --- -schema: "yardstick:task:0.1" - -scenarios: -- - type: NSPerf - traffic_profile: ../../../../traffic_profiles/http_tests/FileSize-1K_Requests-1M_Concurrency-100.yaml - topology: ../../acl-tg-topology-http.yaml - nodes: - vnf__0: vnf.yardstick - tg__0: trafficgen_1.yardstick - tg__1: trafficgen_2.yardstick - options: - acl: - rules: ../../acl_rules.yaml - cfg: "../../acl_config" - script: "../../acl_script" +- name: check if iommu is set by this role in /boot grub.cfg files + lineinfile: + path: "{{ item.path }}" + regexp: '{{ hugepages_params }}{{ iommu_boot_params }}' + line: '' + #changed_when: no + check_mode: yes + register: is_mine_iommu_boot_grub + ignore_errors: True - runner: - type: Duration - duration: 2 +- name: added iommu to grub manually because we can't run update-grub in chroot + replace: + path: "{{ item.path }}" + regexp: '(.*linux\s+/boot/vmlinuz.*)$' + replace: '\1{{ iommu_boot_params }}' + when: is_mine_iommu_boot_grub.msg != "line replaced" -context: - type: Node-ovs - name: yardstick - nfvi_type: ovs - vm_deploy: True - file: /etc/yardstick/nodes/pod_ovs.yaml +- debug: var=ansible_kernel diff --git a/ansible/roles/enable_iommu_on_boot/vars/main.yml b/ansible/roles/enable_iommu_on_boot/vars/main.yml new file mode 100644 index 000000000..1b642dcb5 --- /dev/null +++ b/ansible/roles/enable_iommu_on_boot/vars/main.yml @@ -0,0 +1,17 @@ +# Copyright (c) 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +update_grub: + Debian: "update-grub2" + RedHat: "grub2-mkconfig -o /boot/grub2/grub.cfg" diff --git a/ansible/roles/fetch_spec_cpu2006_result/tasks/main.yaml b/ansible/roles/fetch_spec_cpu2006_result/tasks/main.yaml index 370ec7a0c..ccc89000c 100644 --- a/ansible/roles/fetch_spec_cpu2006_result/tasks/main.yaml +++ b/ansible/roles/fetch_spec_cpu2006_result/tasks/main.yaml @@ -10,7 +10,6 @@ - name: fetch_spec_cpu2006_result fetch: - src: /usr/cpu2006/spec_cpu2006_result.zip + src: ~/cpu2006/spec_cpu2006_result.zip dest: /tmp/ flat: yes - become: true diff --git a/ansible/roles/infra_check_requirements/tasks/main.yml b/ansible/roles/infra_check_requirements/tasks/main.yml new file mode 100644 index 000000000..8d05bbdb7 --- /dev/null +++ b/ansible/roles/infra_check_requirements/tasks/main.yml @@ -0,0 +1,43 @@ +# Copyright (c) 2018 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. +--- +- name: Include + include_vars: + file: "{{rs_file}}" + name: infra_deploy_vars + +- name: Store total CPU, RAM, Disk requested resources + set_fact: + vcpu_t: "{{item.vcpus|int + vcpu_t|int}}" + vram_t: "{{item.ram|int + vram_t|int}}" + disk_t: "{{item.disk|int + disk_t|int}}" + with_items: "{{infra_deploy_vars.nodes}}" + +- name: Fail if not enough RAM + fail: + msg: "Failed, not enough RAM, required: {{ vram_t }}, available {{ ansible_memory_mb.nocache.free }}" + when: ansible_memory_mb.nocache.free < vram_t|int + +- name: Fail if not enough CPU + fail: + msg: "Failed, not enough CPU, required: {{ vcpu_t }}, available {{ ansible_processor_vcpus }}" + when: ansible_processor_vcpus < vcpu_t|int + + +- name: Fail if not enough Disk space + set_fact: + disk_avail: "{% for mount in ansible_mounts if mount.mount == '/' %}{{ (mount.size_available/1024/1024)|int }}{% endfor %}" +- fail: + msg: "Failed, not enough disk space, required {{ disk_t }}, available: {{ disk_avail }}" + when: disk_avail|int < disk_t|int diff --git a/ansible/roles/infra_check_requirements/vars/main.yml b/ansible/roles/infra_check_requirements/vars/main.yml new file mode 100644 index 000000000..219c33875 --- /dev/null +++ b/ansible/roles/infra_check_requirements/vars/main.yml @@ -0,0 +1,17 @@ +# Copyright (c) 2018 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. +--- +vcpu_t: 0 +vram_t: 0 +disk_t: 0 diff --git a/ansible/roles/install_spec_cpu2006/tasks/main.yaml b/ansible/roles/install_spec_cpu2006/tasks/main.yaml index baa9f6ca0..ea698f5a2 100644 --- a/ansible/roles/install_spec_cpu2006/tasks/main.yaml +++ b/ansible/roles/install_spec_cpu2006/tasks/main.yaml @@ -12,13 +12,11 @@ copy: src: /home/opnfv/repos/yardstick/yardstick/resources/cpu2006-1.2.iso dest: ~/cpu2006-1.2.iso - become: true - name: install SPEC CPU2006 shell: - mount -t iso9660 -o ro,exec ~/cpu2006-1.2.iso /mnt; + sudo mount -t iso9660 -o ro,exec ~/cpu2006-1.2.iso /mnt; cd /mnt; - ./install.sh -fd /usr/cpu2006; + ./install.sh -fd ~/cpu2006; args: executable: /bin/bash - become: true diff --git a/ansible/roles/unarchive_spec_cpu2006_result/tasks/main.yaml b/ansible/roles/unarchive_spec_cpu2006_result/tasks/main.yaml index 86dcc1aeb..07d15d1a9 100644 --- a/ansible/roles/unarchive_spec_cpu2006_result/tasks/main.yaml +++ b/ansible/roles/unarchive_spec_cpu2006_result/tasks/main.yaml @@ -13,4 +13,3 @@ src: /tmp/spec_cpu2006_result.zip dest: /tmp/ remote_src: True - become: true diff --git a/ansible/roles/uninstall_spec_cpu2006/tasks/main.yaml b/ansible/roles/uninstall_spec_cpu2006/tasks/main.yaml index 72d8c93ee..b2a50896e 100644 --- a/ansible/roles/uninstall_spec_cpu2006/tasks/main.yaml +++ b/ansible/roles/uninstall_spec_cpu2006/tasks/main.yaml @@ -10,9 +10,8 @@ - name: remove SPEC CPU 2006 file: - path: /usr/cpu2006 + path: ~/cpu2006 state: absent - become: true - name: umount SPEC CPU 2006 ISO shell: @@ -25,4 +24,3 @@ file: path: ~/cpu2006-1.2.iso state: absent - become: true diff --git a/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml b/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml index 42a7b2d08..479b45c92 100644 --- a/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml +++ b/ansible/ubuntu_server_baremetal_deploy_samplevnfs.yml @@ -12,10 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -- hosts: all +- hosts: yardstick-standalone:jumphost vars: clone_dir: /tmp/yardstick-clone - + environment: + "{{ proxy_env }}" roles: - add_custom_repos diff --git a/ansible/yardstick-install-inventory.ini b/ansible/yardstick-install-inventory.ini index e2647b033..e276076cc 100644 --- a/ansible/yardstick-install-inventory.ini +++ b/ansible/yardstick-install-inventory.ini @@ -1,4 +1,20 @@ # the group of systems on which to install yardstick # by default just localhost -[yardstick] +[jumphost] localhost ansible_connection=local + +# section below is only due backward compatibility. +# it will be removed later +[yardstick:children] +jumphost + +[yardstick-standalone] +# uncomment hosts below if you would to test yardstick-standalone/sriov scenarios +#yardstick-standalone-node ansible_host=192.168.1.2 +#yardstick-standalone-node-2 ansible_host=192.168.1.2 + +[all:vars] +# incomment credentials below for yardstick-standalone +#ansible_user=root +#ansible_pass=root + diff --git a/docker/Dockerfile b/docker/Dockerfile index b1eb50592..2ee5b4c06 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -26,7 +26,7 @@ ENV YARDSTICK_REPO_DIR="${REPOS_DIR}/yardstick" \ RUN apt-get update && apt-get install -y git python-setuptools python-pip && apt-get -y autoremove && apt-get clean RUN easy_install -U setuptools==30.0.0 -RUN pip install appdirs==1.4.0 +RUN pip install appdirs==1.4.0 pyopenssl==17.5.0 RUN mkdir -p ${REPOS_DIR} diff --git a/docker/Dockerfile.aarch64.patch b/docker/Dockerfile.aarch64.patch index 33c352a1b..ca933514a 100644 --- a/docker/Dockerfile.aarch64.patch +++ b/docker/Dockerfile.aarch64.patch @@ -1,14 +1,15 @@ -From: Alexandru Nemes <alexandru.nemes@enea.com> -Date: Mon, 19 Jun 2017 14:18:24 +0300 +From: Cristina Pauna <cristina.pauna@enea.com> +Date: Thu, 11 Jan 2018 19:06:26 +0200 Subject: [PATCH] Patch for Yardstick AARCH64 Docker file +Signed-off-by: Cristina Pauna <cristina.pauna@enea.com> Signed-off-by: Alexandru Nemes <alexandru.nemes@enea.com> --- - docker/Dockerfile | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) + docker/Dockerfile | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile -index 96a5d77..03307a2 100644 +index 2ee5b4c..23e5ea5 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,5 @@ @@ -22,15 +23,25 @@ index 96a5d77..03307a2 100644 # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## --FROM ubuntu:14.04 -+FROM aarch64/ubuntu:14.04 +-FROM ubuntu:16.04 ++FROM arm64v8/ubuntu:16.04 -LABEL image=opnfv/yardstick +LABEL image=opnfv/yardstick_aarch64 ARG BRANCH=master -@@ -40,8 +40,8 @@ RUN echo "daemon off;" >> /etc/nginx/nginx.conf +@@ -24,7 +24,8 @@ ENV YARDSTICK_REPO_DIR="${REPOS_DIR}/yardstick" \ + RELENG_REPO_DIR="${REPOS_DIR}/releng" \ + STORPERF_REPO_DIR="${REPOS_DIR}/storperf" + +-RUN apt-get update && apt-get install -y git python-setuptools python-pip && apt-get -y autoremove && apt-get clean ++RUN apt-get update && apt-get install -y git python-setuptools python-pip && apt-get -y autoremove && \ ++ apt-get install -y libssl-dev && apt-get -y install libffi-dev && apt-get clean + RUN easy_install -U setuptools==30.0.0 + RUN pip install appdirs==1.4.0 pyopenssl==17.5.0 + +@@ -43,8 +44,8 @@ RUN echo "daemon off;" >> /etc/nginx/nginx.conf EXPOSE 5000 @@ -39,4 +50,5 @@ index 96a5d77..03307a2 100644 +ADD http://download.cirros-cloud.net/daily/20161201/cirros-d161201-aarch64-disk.img ${IMAGE_DIR} +ADD http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-arm64-disk1.img ${IMAGE_DIR} - COPY ./exec_tests.sh /usr/local/bin/
\ No newline at end of file + COPY ./exec_tests.sh /usr/local/bin/ + diff --git a/docs/release/release-notes/release-notes.rst b/docs/release/release-notes/release-notes.rst index 873a35cf9..4ebf0eceb 100644 --- a/docs/release/release-notes/release-notes.rst +++ b/docs/release/release-notes/release-notes.rst @@ -30,13 +30,16 @@ This document describes the release note of Yardstick project. Version History --------------- -+------------------+-----------+---------------------------------+ -| *Date* | *Version* | *Comment* | -| | | | -+------------------+-----------+---------------------------------+ -| October 20, 2017 | 5.0.0 | Yardstick for Euphrates release | -| | | | -+------------------+-----------+---------------------------------+ ++-------------------+-----------+---------------------------------+ +| *Date* | *Version* | *Comment* | +| | | | ++-------------------+-----------+---------------------------------+ +| December 15, 2017 | 5.1.0 | Yardstick for Euphrates release | +| | | | ++-------------------+-----------+---------------------------------+ +| October 20, 2017 | 5.0.0 | Yardstick for Euphrates release | +| | | | ++-------------------+-----------+---------------------------------+ Important Notes @@ -129,19 +132,19 @@ Release Data | **Project** | Yardstick | | | | +--------------------------------+-----------------------+ -| **Repo/tag** | yardstick/opnfv-5.0.0 | +| **Repo/tag** | yardstick/opnfv-5.1.0 | | | | +--------------------------------+-----------------------+ -| **Yardstick Docker image tag** | opnfv-5.0.0 | +| **Yardstick Docker image tag** | opnfv-5.1.0 | | | | +--------------------------------+-----------------------+ | **Release designation** | Euphrates | | | | +--------------------------------+-----------------------+ -| **Release date** | October 20, 2017 | +| **Release date** | December 15, 2017 | | | | +--------------------------------+-----------------------+ -| **Purpose of the delivery** | OPNFV Euphrates 5.0.0 | +| **Purpose of the delivery** | OPNFV Euphrates 5.1.0 | | | | +--------------------------------+-----------------------+ @@ -161,7 +164,7 @@ Software Deliverables ^^^^^^^^^^^^^^^^^^^^^ - - The Yardstick Docker image: https://hub.docker.com/r/opnfv/yardstick (tag: opnfv-5.0.0) + - The Yardstick Docker image: https://hub.docker.com/r/opnfv/yardstick (tag: opnfv-5.1.0) New Contexts @@ -475,6 +478,52 @@ Known Issues/Faults Corrected Faults ^^^^^^^^^^^^^^^^ +Euphrates 5.1.0: + ++---------------------+-------------------------------------------------------------------------+ +| **JIRA REFERENCE** | **DESCRIPTION** | +| | | ++---------------------+-------------------------------------------------------------------------+ +| JIRA: YARDSTICK-841 | Fix various NSB license issues | ++---------------------+-------------------------------------------------------------------------+ +| JIRA: YARDSTICK-73 | How To Work with Test Cases | ++---------------------+-------------------------------------------------------------------------+ +| JIRA: YARDSTICK-500 | VNF testing documentation | ++---------------------+-------------------------------------------------------------------------+ +| JIRA: YARDSTICK-826 | Allow overriding Heat IP addresses to match traffic generator profile | ++---------------------+-------------------------------------------------------------------------+ +| JIRA: YARDSTICK-828 | Refactor doc/testing/user/userguide "Yardstick Installation" | ++---------------------+-------------------------------------------------------------------------+ +| JIRA: YARDSTICK-830 | build_yardstick_image Ansible mount module doesn't work on Ubuntu 14.04 | ++---------------------+-------------------------------------------------------------------------+ +| JIRA: YARDSTICK-833 | ansible_common transform password into lower case | ++---------------------+-------------------------------------------------------------------------+ +| JIRA: YARDSTICK-847 | tc006, tc079, tc082 miss grafana dashboard in local deployment | ++---------------------+-------------------------------------------------------------------------+ +| JIRA: YARDSTICK-849 | kill process do not accurately kill the process like "nova-api" | ++---------------------+-------------------------------------------------------------------------+ +| JIRA: YARDSTICK-850 | tc023 miss description and tc050-58 wrong description | ++---------------------+-------------------------------------------------------------------------+ +| JIRA: YARDSTICK-852 | tc078 cpu2006 fails in some situation | ++---------------------+-------------------------------------------------------------------------+ +| JIRA: YARDSTICK-854 | yardstick docker lack of trex_client | ++---------------------+-------------------------------------------------------------------------+ +| JIRA: YARDSTICK-867 | testcase tc078 have no data stored or dashboard to show results | ++---------------------+-------------------------------------------------------------------------+ +| JIRA: YARDSTICK-871 | Remove img_modify_playbook assignation in build_yardstick_image.yml | ++---------------------+-------------------------------------------------------------------------+ +| JIRA: YARDSTICK-829 | "nsb_setup.sh" doesn't parse the controller IP correctly | ++---------------------+-------------------------------------------------------------------------+ +| JIRA: YARDSTICK-839 | NSB Prox BM test cases to be fixed for incorporating scale-up | ++---------------------+-------------------------------------------------------------------------+ +| JIRA: YARDSTICK-840 | NSB Prox test documentation of vPE and LW-AFTR test cases | ++---------------------+-------------------------------------------------------------------------+ +| JIRA: YARDSTICK-848 | NSB "Prox" : Cleanup duplicated traffic profile | ++---------------------+-------------------------------------------------------------------------+ + + + + Euphrates 5.0.0: +---------------------+--------------------------------------------+ @@ -507,18 +556,6 @@ Euphratess 5.0.0 known restrictions/issues +-----------+-----------+----------------------------------------------+ -Open JIRA tickets ------------------ - -+---------------------+----------------------------------------------+ -| **JIRA REFERENCE** | **DESCRIPTION** | -| | | -+---------------------+----------------------------------------------+ -| JIRA: YARDSTICK-412 | IPv6 test case should add support for newton | -| | | -+---------------------+----------------------------------------------+ - - Useful links ------------ diff --git a/docs/testing/developer/devguide/devguide.rst b/docs/testing/developer/devguide/devguide.rst index 1d47e5605..dade49b75 100755 --- a/docs/testing/developer/devguide/devguide.rst +++ b/docs/testing/developer/devguide/devguide.rst @@ -361,7 +361,7 @@ Verify your patch locally before submitting Once you finish a patch, you can submit it to Gerrit for code review. A developer sends a new patch to Gerrit will trigger patch verify job on Jenkins -CI. The yardstick patch verify job includes python flake8 check, unit test and +CI. The yardstick patch verify job includes python pylint check, unit test and code coverage test. Before you submit your patch, it is recommended to run the patch verification in your local environment first. diff --git a/docs/testing/user/userguide/04-installation.rst b/docs/testing/user/userguide/04-installation.rst index dc528db6c..caebecc09 100644 --- a/docs/testing/user/userguide/04-installation.rst +++ b/docs/testing/user/userguide/04-installation.rst @@ -107,6 +107,12 @@ Run the Docker image to get a Yardstick container:: ======================= ==================================================== --name yardstick The name for this container +If the host is restarted +^^^^^^^^^^^^^^^^^^^^^^^^ + +The yardstick container must be started if the host is rebooted:: + + docker start yardstick Configure the Yardstick container environment ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -301,12 +307,6 @@ Prerequisite preparation:: sudo -EH pip install appdirs==1.4.0 sudo -EH pip install virtualenv -Create a virtual environment:: - - virtualenv ~/yardstick_venv - export YARDSTICK_VENV=~/yardstick_venv - source ~/yardstick_venv/bin/activate - Download the source code and install Yardstick from it:: git clone https://gerrit.opnfv.org/gerrit/yardstick @@ -314,6 +314,10 @@ Download the source code and install Yardstick from it:: cd ~/yardstick sudo -EH ./install.sh +If the host is ever restarted, nginx and uwsgi need to be restarted:: + + service nginx restart + uwsgi -i /etc/yardstick/yardstick.ini Configure the Yardstick environment (**Todo**) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -331,6 +335,91 @@ For uninstalling Yardstick, just delete the virtual environment:: rm -rf ~/yardstick_venv +Install Yardstick directly in OpenSUSE +-------------------------------------- + +.. _install-framework: + +You can install Yardstick framework directly in OpenSUSE. + + +Install Yardstick +^^^^^^^^^^^^^^^^^ + +Prerequisite preparation:: + + sudo -EH zypper -n install -y gcc \ + wget \ + git \ + sshpass \ + qemu-tools \ + kpartx \ + libffi-devel \ + libopenssl-devel \ + python \ + python-devel \ + python-virtualenv \ + libxml2-devel \ + libxslt-devel \ + python-setuptools-git + +Create a virtual environment:: + + virtualenv ~/yardstick_venv + export YARDSTICK_VENV=~/yardstick_venv + source ~/yardstick_venv/bin/activate + sudo -EH easy_install -U setuptools + +Download the source code and install Yardstick from it:: + + git clone https://gerrit.opnfv.org/gerrit/yardstick + export YARDSTICK_REPO_DIR=~/yardstick + cd yardstick + sudo -EH python setup.py install + sudo -EH pip install -r requirements.txt + +Install missing python modules:: + + sudo -EH pip install pyyaml \ + oslo_utils \ + oslo_serialization \ + oslo_config \ + paramiko \ + python.heatclient \ + python.novaclient \ + python.glanceclient \ + python.neutronclient \ + scp \ + jinja2 + + +Configure the Yardstick environment +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Source the OpenStack environment variables:: + + source DEVSTACK_DIRECTORY/openrc + +Export the Openstack external network. The default installation of Devstack +names the external network public:: + + export EXTERNAL_NETWORK=public + export OS_USERNAME=demo + +Change the API version used by Yardstick to v2.0 (the devstack openrc sets it +to v3):: + + export OS_AUTH_URL=http://PUBLIC_IP_ADDRESS:5000/v2.0 + + +Uninstall Yardstick +^^^^^^^^^^^^^^^^^^^ + +For unistalling Yardstick, just delete the virtual environment:: + + rm -rf ~/yardstick_venv + + Verify the installation ----------------------- diff --git a/docs/testing/user/userguide/12-nsb_installation.rst b/docs/testing/user/userguide/12-nsb_installation.rst index 8cc26acd5..a584ca231 100644 --- a/docs/testing/user/userguide/12-nsb_installation.rst +++ b/docs/testing/user/userguide/12-nsb_installation.rst @@ -112,12 +112,52 @@ Download the source code and install Yardstick from it # git checkout <tag or stable branch> git checkout stable/euphrates - # For Bare-Metal or Standalone Virtualization - ./nsb_setup.sh +Configure the network proxy, either using the environment variables or setting +the global environment file: - # For OpenStack - ./nsb_setup.sh <path to admin-openrc.sh> +.. code-block:: ini + cat /etc/environment + http_proxy='http://proxy.company.com:port' + https_proxy='http://proxy.company.com:port' +.. code-block:: console + export http_proxy='http://proxy.company.com:port' + export https_proxy='http://proxy.company.com:port' + +The last step is to modify the Yardstick installation inventory, used by +Ansible: + +.. code-block:: ini + cat ./ansible/yardstick-install-inventory.ini + [jumphost] + localhost ansible_connection=local + + [yardstick-standalone] + yardstick-standalone-node ansible_host=192.168.1.2 + yardstick-standalone-node-2 ansible_host=192.168.1.3 + + # section below is only due backward compatibility. + # it will be removed later + [yardstick:children] + jumphost + + [all:vars] + ansible_user=root + ansible_pass=root + + +To execute an installation for a Bare-Metal or a Standalone context: + +.. code-block:: console + + ./nsb_setup.sh + + +To execute an installation for an OpenStack context: + +.. code-block:: console + + ./nsb_setup.sh <path to admin-openrc.sh> Above command setup docker with latest yardstick code. To execute diff --git a/docs/testing/user/userguide/nsb/nsb-list-of-tcs.rst b/docs/testing/user/userguide/nsb/nsb-list-of-tcs.rst index 43aa3d69a..895837283 100644 --- a/docs/testing/user/userguide/nsb/nsb-list-of-tcs.rst +++ b/docs/testing/user/userguide/nsb/nsb-list-of-tcs.rst @@ -26,3 +26,5 @@ NSB PROX Test Case Descriptions tc_prox_context_mpls_tagging_port tc_prox_context_buffering_port tc_prox_context_load_balancer_port + tc_prox_context_vpe_port + tc_prox_context_lw_after_port diff --git a/docs/testing/user/userguide/nsb/tc_prox_context_lw_aftr_port.rst b/docs/testing/user/userguide/nsb/tc_prox_context_lw_aftr_port.rst new file mode 100644 index 000000000..5a1fada05 --- /dev/null +++ b/docs/testing/user/userguide/nsb/tc_prox_context_lw_aftr_port.rst @@ -0,0 +1,107 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International +.. License. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) OPNFV, 2017 Intel Corporation. + +************************************************ +Yardstick Test Case Description: NSB PROX LwAFTR +************************************************ + ++-----------------------------------------------------------------------------+ +|NSB PROX test for NFVI characterization | +| | ++--------------+--------------------------------------------------------------+ +|test case id | tc_prox_{context}_lw_aftr-{port_num} | +| | | +| | * context = baremetal or heat_context; | +| | * port_num = 4; | +| | | ++--------------+--------------------------------------------------------------+ +|metric | * Network Throughput; | +| | * TG Packets Out; | +| | * TG Packets In; | +| | * VNF Packets Out; | +| | * VNF Packets In; | +| | * Dropped packets; | +| | | ++--------------+--------------------------------------------------------------+ +|test purpose | The PROX LW_AFTR test will take packets in from one | +| | port and remove the ipv6 encapsulation and forward them to | +| | another port. While forwarded packets in other direction | +| | will be encapsulated in an ipv6 header. | +| | | +| | The lw_aftr test cases are implemented to run in baremetal | +| | and heat context an require 4 port topology to run the | +| | default configuration. | +| | | ++--------------+--------------------------------------------------------------+ +|configuration | The LW_AFTR test cases are listed below: | +| | | +| | * tc_prox_baremetal_lw_aftr-4.yaml | +| | * tc_prox_heat_context_lw_aftr-4.yaml | +| | | +| | Test duration is set as 300sec for each test. | +| | The minimum packet size for MPLS test is 68 bytes. This is | +| | set in the traffic profile and can be configured to use | +| | higher packet sizes. | +| | | ++--------------+--------------------------------------------------------------+ +|test tool | PROX | +| | PROX is a DPDK application that can simulate VNF workloads | +| | and can generate traffic and used for NFVI characterization | +| | | ++--------------+--------------------------------------------------------------+ +|applicability | The PROX lwAFTR test cases can be configured with | +| | different: | +| | | +| | * packet sizes; | +| | * test durations; | +| | * tolerated loss; | +| | | +| | Default values exist. | +| | | ++--------------+--------------------------------------------------------------+ +|pre-test | For Openstack test case image (yardstick-samplevnfs) needs | +|conditions | to be installed into Glance with Prox and Dpdk included in | +| | it. | +| | | +| | For Baremetal tests cases Prox and Dpdk must be installed in | +| | the hosts where the test is executed. The pod.yaml file must | +| | have the necessary system and NIC information | +| | | ++--------------+--------------------------------------------------------------+ +|test sequence | description and expected result | +| | | ++--------------+--------------------------------------------------------------+ +|step 1 | For Baremetal test: The TG and VNF are started on the hosts | +| | based on the pod file. | +| | | +| | For Heat test: Two host VMs are booted, as Traffic generator | +| | and VNF(LW_AFTR workload) based on the test flavor. | +| | | ++--------------+--------------------------------------------------------------+ +|step 2 | Yardstick is connected with the TG and VNF by using ssh. | +| | The test will resolve the topology and instantiate the VNF | +| | and TG and collect the KPI's/metrics. | +| | | ++--------------+--------------------------------------------------------------+ +|step 3 | The TG will send packets to the VNF. If the number of | +| | dropped packets is more than the tolerated loss the line | +| | rate or throughput is halved. This is done until the dropped | +| | packets are within an acceptable tolerated loss. | +| | | +| | The KPI is the number of packets per second for 86 bytes | +| | packet size with an accepted minimal packet loss for the | +| | default configuration. | +| | | ++--------------+--------------------------------------------------------------+ +|step 4 | In Baremetal test: The test quits the application and unbind | +| | the dpdk ports. | +| | | +| | In Heat test: Two host VMs are deleted on test completion. | +| | | ++--------------+--------------------------------------------------------------+ +|test verdict | The test case will achieve a Throughput with an accepted | +| | minimal tolerated packet loss. | ++--------------+--------------------------------------------------------------+ + diff --git a/docs/testing/user/userguide/nsb/tc_prox_context_vpe_port.rst b/docs/testing/user/userguide/nsb/tc_prox_context_vpe_port.rst new file mode 100644 index 000000000..6827b0525 --- /dev/null +++ b/docs/testing/user/userguide/nsb/tc_prox_context_vpe_port.rst @@ -0,0 +1,108 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International +.. License. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) OPNFV, 2017 Intel Corporation. + +********************************************** +Yardstick Test Case Description: NSB PROXi VPE +********************************************** + ++-----------------------------------------------------------------------------+ +|NSB PROX test for NFVI characterization | +| | ++--------------+--------------------------------------------------------------+ +|test case id | tc_prox_{context}_vpe-{port_num} | +| | | +| | * context = baremetal or heat_context; | +| | * port_num = 4; | +| | | ++--------------+--------------------------------------------------------------+ +|metric | * Network Throughput; | +| | * TG Packets Out; | +| | * TG Packets In; | +| | * VNF Packets Out; | +| | * VNF Packets In; | +| | * Dropped packets; | +| | | ++--------------+--------------------------------------------------------------+ +|test purpose | The PROX VPE test handles packet processing, routing, QinQ | +| | encapsulation, flows, ACL rules, adds/removes MPLS tagging | +| | and performs QoS before forwarding packet to another port. | +| | The reverse applies to forwarded packets in the other | +| | direction. | +| | | +| | The VPE test cases are implemented to run in baremetal | +| | and heat context an require 4 port topology to run the | +| | default configuration. | +| | | ++--------------+--------------------------------------------------------------+ +|configuration | The VPE test cases are listed below: | +| | | +| | * tc_prox_baremetal_vpe-4.yaml | +| | * tc_prox_heat_context_vpe-4.yaml | +| | | +| | Test duration is set as 300sec for each test. | +| | The minimum packet size for VPE test is 68 bytes. This is | +| | set in the traffic profile and can be configured to use | +| | higher packet sizes. | +| | | ++--------------+--------------------------------------------------------------+ +|test tool | PROX | +| | PROX is a DPDK application that can simulate VNF workloads | +| | and can generate traffic and used for NFVI characterization | +| | | ++--------------+--------------------------------------------------------------+ +|applicability | The PROX VPE test cases can be configured with | +| | different: | +| | | +| | * packet sizes; | +| | * test durations; | +| | * tolerated loss; | +| | | +| | Default values exist. | +| | | ++--------------+--------------------------------------------------------------+ +|pre-test | For Openstack test case image (yardstick-samplevnfs) needs | +|conditions | to be installed into Glance with Prox and Dpdk included in | +| | it. | +| | | +| | For Baremetal tests cases Prox and Dpdk must be installed in | +| | the hosts where the test is executed. The pod.yaml file must | +| | have the necessary system and NIC information | +| | | ++--------------+--------------------------------------------------------------+ +|test sequence | description and expected result | +| | | ++--------------+--------------------------------------------------------------+ +|step 1 | For Baremetal test: The TG and VNF are started on the hosts | +| | based on the pod file. | +| | | +| | For Heat test: Two host VMs are booted, as Traffic generator | +| | and VNF(VPE workload) based on the test flavor. | +| | | ++--------------+--------------------------------------------------------------+ +|step 2 | Yardstick is connected with the TG and VNF by using ssh. | +| | The test will resolve the topology and instantiate the VNF | +| | and TG and collect the KPI's/metrics. | +| | | ++--------------+--------------------------------------------------------------+ +|step 3 | The TG will send packets to the VNF. If the number of | +| | dropped packets is more than the tolerated loss the line | +| | rate or throughput is halved. This is done until the dropped | +| | packets are within an acceptable tolerated loss. | +| | | +| | The KPI is the number of packets per second for 68 bytes | +| | packet size with an accepted minimal packet loss for the | +| | default configuration. | +| | | ++--------------+--------------------------------------------------------------+ +|step 4 | In Baremetal test: The test quits the application and unbind | +| | the dpdk ports. | +| | | +| | In Heat test: Two host VMs are deleted on test completion. | +| | | ++--------------+--------------------------------------------------------------+ +|test verdict | The test case will achieve a Throughput with an accepted | +| | minimal tolerated packet loss. | ++--------------+--------------------------------------------------------------+ + diff --git a/docs/testing/user/userguide/opnfv_yardstick_tc081.rst b/docs/testing/user/userguide/opnfv_yardstick_tc081.rst index 90af8a382..793c3fdd5 100644 --- a/docs/testing/user/userguide/opnfv_yardstick_tc081.rst +++ b/docs/testing/user/userguide/opnfv_yardstick_tc081.rst @@ -4,7 +4,7 @@ .. (c) OPNFV, Huawei Technologies Co.,Ltd and others. ************************************* -Yardstick Test Case Description TC080 +Yardstick Test Case Description TC081 ************************************* .. _cirros-image: https://download.cirros-cloud.net @@ -21,7 +21,7 @@ Yardstick Test Case Description TC080 |metric | RTT (Round Trip Time) | | | | +--------------+--------------------------------------------------------------+ -|test purpose | The purpose of TC080 is to do a basic verification that | +|test purpose | The purpose of TC081 is to do a basic verification that | | | network latency is within acceptable boundaries when packets | | | travel between a containers and a VM. | | | | diff --git a/docs/testing/user/userguide/opnfv_yardstick_tc084.rst b/docs/testing/user/userguide/opnfv_yardstick_tc084.rst new file mode 100644 index 000000000..2e7b28e25 --- /dev/null +++ b/docs/testing/user/userguide/opnfv_yardstick_tc084.rst @@ -0,0 +1,140 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International +.. License. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) OPNFV, Huawei Technologies Co.,Ltd and others. + +************************************* +Yardstick Test Case Description TC084 +************************************* + +.. _spec_cpu_2006: https://www.spec.org/cpu2006/ + ++-----------------------------------------------------------------------------+ +|Compute Performance | +| | ++--------------+--------------------------------------------------------------+ +|test case id | OPNFV_YARDSTICK_TC084_SPEC CPU 2006 FOR VM | +| | | ++--------------+--------------------------------------------------------------+ +|metric | compute-intensive performance | +| | | ++--------------+--------------------------------------------------------------+ +|test purpose | The purpose of TC084 is to evaluate the IaaS compute | +| | performance by using SPEC CPU 2006 benchmark. The SPEC CPU | +| | 2006 benchmark has several different ways to measure | +| | computer performance. One way is to measure how fast the | +| | computer completes a single task; this is called a speed | +| | measurement. Another way is to measure how many tasks | +| | computer can accomplish in a certain amount of time; this is | +| | called a throughput, capacity or rate measurement. | +| | | ++--------------+--------------------------------------------------------------+ +|test tool | SPEC CPU 2006 | +| | | +| | The SPEC CPU 2006 benchmark is SPEC's industry-standardized, | +| | CPU-intensive benchmark suite, stressing a system's | +| | processor, memory subsystem and compiler. This benchmark | +| | suite includes the SPECint benchmarks and the SPECfp | +| | benchmarks. The SPECint 2006 benchmark contains 12 different | +| | benchmark tests and the SPECfp 2006 benchmark contains 19 | +| | different benchmark tests. | +| | | +| | SPEC CPU 2006 is not always part of a Linux distribution. | +| | SPEC requires that users purchase a license and agree with | +| | their terms and conditions. For this test case, users must | +| | manually download cpu2006-1.2.iso from the SPEC website and | +| | save it under the yardstick/resources folder (e.g. /home/ | +| | opnfv/repos/yardstick/yardstick/resources/cpu2006-1.2.iso) | +| | SPEC CPU® 2006 benchmark is available for purchase via the | +| | SPEC order form (https://www.spec.org/order.html). | +| | | ++--------------+--------------------------------------------------------------+ +|test | This test case uses SPEC CPU 2006 benchmark to measure | +|description | compute-intensive performance of VMs. | +| | | ++--------------+--------------------------------------------------------------+ +|configuration | file: opnfv_yardstick_tc084.yaml | +| | | +| | benchmark_subset is set to int. | +| | | +| | SLA is not available in this test case. | +| | | ++--------------+--------------------------------------------------------------+ +|applicability | Test can be configured with different: | +| | | +| | * benchmark_subset - a subset of SPEC CPU 2006 benchmarks | +| | to run; | +| | * SPECint_benchmark - a SPECint benchmark to run; | +| | * SPECint_benchmark - a SPECfp benchmark to run; | +| | * output_format - desired report format; | +| | * runspec_config - SPEC CPU 2006 config file provided to | +| | the runspec binary; | +| | * runspec_iterations - the number of benchmark iterations | +| | to execute. For a reportable run, must be 3; | +| | * runspec_tune - tuning to use (base, peak, or all). For a | +| | reportable run, must be either base or all. Reportable | +| | runs do base first, then (optionally) peak; | +| | * runspec_size - size of input data to run (test, train, or | +| | ref). Reportable runs ensure that your binaries can | +| | produce correct results with the test and train workloads | +| | | ++--------------+--------------------------------------------------------------+ +|usability | This test case is used for executing SPEC CPU 2006 benchmark | +| | on virtual machines. The SPECint 2006 benchmark takes | +| | approximately 5 hours. (The time may vary due to different | +| | VM cpu configurations) | +| | | ++--------------+--------------------------------------------------------------+ +|references | spec_cpu_2006_ | +| | | +| | ETSI-NFV-TST001 | +| | | ++--------------+--------------------------------------------------------------+ +|pre-test | To run and install SPEC CPU 2006, the following are | +|conditions | required: | +| | * For SPECint 2006: Both C99 and C++98 compilers are | +| | installed in VM images; | +| | * For SPECfp 2006: All three of C99, C++98 and Fortran-95 | +| | compilers installed in VM images; | +| | * At least 4GB of disk space availabile on VM. | +| | | +| | gcc 4.8.* and g++ 4.8.* version have been tested in Ubuntu | +| | 14.04, Ubuntu 16.04 and Redhat Enterprise Linux 7.4 image. | +| | Higher gcc and g++ version may cause compiling error. | +| | | +| | For more SPEC CPU 2006 dependencies please visit | +| | (https://www.spec.org/cpu2006/Docs/techsupport.html) | +| | | ++--------------+--------------------------------------------------------------+ +|test sequence | description and expected result | +| | | ++--------------+--------------------------------------------------------------+ +|step 1 | cpu2006-1.2.iso has been saved under the yardstick/resources | +| | folder (e.g. /home/opnfv/repos/yardstick/yardstick/resources | +| | /cpu2006-1.2.iso). Additionally, to use your custom runspec | +| | config file you can save it under the yardstick/resources/ | +| | files folder and specify the config file name in the | +| | runspec_config parameter. | +| | | ++--------------+--------------------------------------------------------------+ +|step 2 | Upload SPEC CPU 2006 ISO to the target VM using scp and | +| | install SPEC CPU 2006. | +| | | ++--------------+--------------------------------------------------------------+ +|step 3 | Connect to the target server using SSH. | +| | If custom runspec config file is used, copy this file from | +| | yardstick to the target VM via the SSH tunnel. | +| | | ++--------------+--------------------------------------------------------------+ +|step 4 | SPEC CPU 2006 benchmark is invoked and SPEC CPU 2006 metrics | +| | are generated. | +| | | ++--------------+--------------------------------------------------------------+ +|step 5 | Text, HTML, CSV, PDF, and Configuration file outputs for the | +| | SPEC CPU 2006 metrics are fetched from the VM and stored | +| | under /tmp/result folder. | +| | | ++--------------+--------------------------------------------------------------+ +|test verdict | None. SPEC CPU 2006 results are collected and stored. | +| | | ++--------------+--------------------------------------------------------------+ diff --git a/etc/infra/infra_deploy.yaml.sample b/etc/infra/infra_deploy.yaml.sample new file mode 100644 index 000000000..fb162d35b --- /dev/null +++ b/etc/infra/infra_deploy.yaml.sample @@ -0,0 +1,34 @@ +nodes: + - name: Yardstick VM + hostname: yardstickvm + interfaces: + - network: management + ip: 192.168.1.10 + netmask: 255.255.255.0 + user: ubuntu + pasword: password + image: /tmp/image1.qcow + disk: 50000 + ram: 8192 + vcpus: 4 + + - name Controller_Compute VM + openstack_node: controller_compute + hostname: controller_compute + interfaces: + - network: management + ip: 192.168.1.20 + netmask: 255.255.255.0 + - network: traffic + ip: 192.20.1.20 + netmask: 255.255.255.0 + user: ubuntu + pasword: password + image: /tmp/image_2.qcow + disk: 40000 + ram: 32768 + vcpus: 4 + +networks: + - name: management + host_ip: 192.168.1.1 # not mandatory diff --git a/etc/yardstick/nodes/zte_pod1.yaml b/etc/yardstick/nodes/zte_pod1.yaml deleted file mode 100644 index ec6e46460..000000000 --- a/etc/yardstick/nodes/zte_pod1.yaml +++ /dev/null @@ -1,50 +0,0 @@ -############################################################################## -# Copyright (c) 2017 ZTE corporation and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- -# sample config file about the POD information, including the -# name/IP/user/ssh key of Bare Metal and Controllers/Computes -# -# The options of this config file include: -# name: the name of this node -# role: node's role, support role: Master/Controller/Comupte/BareMetal -# ip: the node's IP address -# user: the username for login -# key_filename:the path of the private key file for login - -nodes: -- - name: node1 - role: Controller - ip: 10.20.0.20 - user: root - key_filename: /root/.ssh/id_rsa -- - name: node2 - role: Controller - ip: 10.20.0.21 - user: root - key_filename: /root/.ssh/id_rsa -- - name: node3 - role: Controller - ip: 10.20.0.22 - user: root - key_filename: /root/.ssh/id_rsa -- - name: node4 - role: Compute - ip: 10.20.0.23 - user: root - key_filename: /root/.ssh/id_rsa -- - name: node5 - role: Compute - ip: 10.20.0.24 - user: root - key_filename: /root/.ssh/id_rsa diff --git a/nsb_setup.sh b/nsb_setup.sh index 40293fef9..a983f4de7 100755 --- a/nsb_setup.sh +++ b/nsb_setup.sh @@ -13,37 +13,48 @@ # See the License for the specific language governing permissions and # limitations under the License. -apt-get update > /dev/null 2>&1 -pkg=(python-pip build-essential libssl-dev libffi-dev python3-dev python-dev) -for i in "${pkg[@]}"; do - dpkg-query -W --showformat='${Status}\n' "${i}"|grep "install ok installed" - if [ "$?" -eq "1" ]; then - apt-get -y install "${i}"; - fi -done - -pip install ansible==2.3.2 shade==1.17.0 docker-py==1.10.6 - +# OPENRC handling has to be first due no_proxy if [ $# -eq 1 ]; then OPENRC=$(readlink -f -- "$1") - extra_args="-e openrc_file=${OPENRC}" + extra_args="${extra_args} -e openrc_file=${OPENRC}" source "${OPENRC}" CONTROLLER_IP=$(echo ${OS_AUTH_URL} | sed -ne "s#http://\([0-9a-zA-Z.\-]*\):*[0-9]*/.*#\1#p") - export no_proxy="localhost,127.0.0.1,${CONTROLLER_IP},$no_proxy" fi -if [ "$http_proxy" != "" ] || [ "$https_proxy" != "" ]; then - extra_args="${extra_args} -e @/tmp/proxy.yml" +env_http_proxy=$(sed -ne "s/^http_proxy=[\"\']\(.*\)[\"\']/\1/p" /etc/environment) +if [[ -z ${http_proxy} ]] && [[ ! -z ${env_http_proxy} ]]; then + export http_proxy=${env_http_proxy} +fi +env_https_proxy=$(sed -ne "s/^https_proxy=[\"\']\(.*\)[\"\']/\1/p" /etc/environment) +if [[ -z ${https_proxy} ]] && [[ ! -z ${env_https_proxy} ]]; then + export https_proxy=${env_https_proxy} +fi + +# if http[s]_proxy is set (from env or /etc/environment) prepare proxy for ansible +if [[ ! -z ${http_proxy} ]] || [[ ! -z ${https_proxy} ]]; then + export no_proxy="localhost,127.0.0.1,${CONTROLLER_IP},${no_proxy}" + extra_args="${extra_args} -e @/tmp/proxy.yml " cat <<EOF > /tmp/proxy.yml --- proxy_env: - http_proxy: $http_proxy - https_proxy: $https_proxy - no_proxy: $no_proxy + http_proxy: ${http_proxy} + https_proxy: ${https_proxy} + no_proxy: ${no_proxy} EOF fi +apt-get update > /dev/null 2>&1 +pkg=(python-pip build-essential libssl-dev libffi-dev python3-dev python-dev) +for i in "${pkg[@]}"; do + dpkg-query -W --showformat='${Status}\n' "${i}"|grep "install ok installed" + if [ "$?" -eq "1" ]; then + apt-get -y install "${i}"; + fi +done + +pip install ansible==2.3.2 shade==1.17.0 docker-py==1.10.6 + ANSIBLE_SCRIPTS="ansible" cd ${ANSIBLE_SCRIPTS} &&\ diff --git a/requirements.txt b/requirements.txt index 7715f8510..88c0e659a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,80 +8,59 @@ ############################################################################## Babel==2.3.4 # BSD; OSI Approved BSD License -Jinja2==2.8.1 # BSD; OSI Approved BSD License -MarkupSafe==0.23 # BSD; OSI Approved BSD License -PyYAML==3.12 # MIT; OSI Approved MIT License -SQLAlchemy==1.1.4 # MIT License; OSI Approved MIT License -ansible==2.3.2 # GPLv3; OSI Approved GNU General Public License v3 or later (GPLv3+) -appdirs==1.4.3 # MIT; OSI Approved MIT License +Jinja2==2.9.6 # BSD; OSI Approved BSD License +SQLAlchemy==1.1.12 # MIT License; OSI Approved MIT License +PTable==0.9.2 # BSD (3 clause); OSI Approved BSD License +ansible==2.4.2 # GPLv3; OSI Approved GNU General Public License v3 or later (GPLv3+) backport-ipaddress==0.1; python_version <= "2.7" # OSI Approved Python Software Foundation License chainmap==1.0.2 # Python Software Foundation License; OSI Approved Python Software Foundation License -cliff==2.4.0 # OSI Approved Apache Software License -cmd2==0.6.9 # MIT; OSI Approved MIT License -debtcollector==1.11.0 # OSI Approved Apache Software License django==1.8.17 # BSD; OSI Approved BSD License + # NOTE(ralonsoh): django must be bumped to 1.11.8; consider the migration notes [1] + # [1] https://docs.djangoproject.com/ja/1.11/ref/templates/upgrading/ docker-py==1.10.6 # OSI Approved Apache Software License -ecdsa==0.13 # MIT extras==1.0.0 # OSI Approved MIT License flasgger==0.5.13 # MIT -flask-restful-swagger==0.19 # MIT +flask-restful-swagger==0.19 # MIT flask-restful==0.3.5 # BSD; OSI Approved BSD License flask==0.11.1 # BSD; OSI Approved BSD License -funcsigs==1.0.2 # ASL; OSI Approved Apache Software License functools32==3.2.3.post2; python_version <= "2.7" # PSF license -futures==3.0.5 # BSD; OSI Approved BSD License -influxdb==4.0.0 # MIT License; OSI Approved MIT License -iso8601==0.1.11 # MIT; OSI Approved MIT License -jsonpatch==1.15 # Modified BSD License; OSI Approved BSD License -jsonpointer==1.10 # Modified BSD License; OSI Approved BSD License -jsonschema==2.5.1 # MIT; OSI Approved MIT License +futures==3.1.1;python_version=='2.7' # BSD; OSI Approved BSD License +influxdb==4.1.1 # MIT License; OSI Approved MIT License jinja2schema==0.1.4 # OSI Approved BSD License -keystoneauth1==2.18.0 # OSI Approved Apache Software License +keystoneauth1==3.1.0 # OSI Approved Apache Software License kubernetes==3.0.0a1 # OSI Approved Apache Software License -linecache2==1.0.0 # OSI Approved Python Software Foundation License -lxml==3.7.2 # OSI Approved BSD License -# upgrade to version 2.0.0 to match python3 unittest.mock features mock==2.0.0 # OSI Approved BSD License; `BSD License`_; http://github.com/testing-cabal/mock/blob/master/LICENSE.txt -monotonic==1.2 # Apache; OSI Approved Apache Software License msgpack-python==0.4.8 # OSI Approved Apache Software License netaddr==0.7.19 # BSD License; OSI Approved BSD License; OSI Approved MIT License -netifaces==0.10.5 # MIT License; OSI Approved MIT License -openstacksdk==0.9.13 # OSI Approved Apache Software License -os-client-config==1.26.0 # OSI Approved Apache Software License -osc-lib==1.3.0 # OSI Approved Apache Software License -oslo.config==3.22.0 # OSI Approved Apache Software License -oslo.i18n==3.12.0 # OSI Approved Apache Software License -oslo.serialization==2.16.0 # OSI Approved Apache Software License -oslo.utils==3.22.0 # OSI Approved Apache Software License -paramiko==2.1.1 # LGPL; OSI Approved GNU Library or Lesser General Public License (LGPL) -pbr==1.10.0 # OSI Approved Apache Software License; Apache License, Version 2.0 -# version 14.5.0 for compatibility with trex traffic generator +netifaces==0.10.6 # MIT License; OSI Approved MIT License +os-client-config==1.28.0 # OSI Approved Apache Software License +osc-lib==1.7.0 # OSI Approved Apache Software License +oslo.config==4.11.1 # OSI Approved Apache Software License +oslo.i18n==3.17.0 # OSI Approved Apache Software License +oslo.serialization==2.20.1 # OSI Approved Apache Software License +oslo.utils==3.28.0 # OSI Approved Apache Software License +paramiko==2.2.1 # LGPL; OSI Approved GNU Library or Lesser General Public License (LGPL) +pbr==3.1.1 # OSI Approved Apache Software License; Apache License, Version 2.0 pika==0.10.0 # BSD; OSI Approved BSD License -positional==1.1.1 # OSI Approved Apache Software License -prettytable==0.7.2 # BSD (3 clause); OSI Approved BSD License +positional==1.1.2 # OSI Approved Apache Software License pycrypto==2.6.1 # Public Domain -pyparsing==2.1.10 # MIT License; OSI Approved MIT License -pyroute2==0.4.12 # dual license GPLv2+ and Apache v2; OSI Approved GNU General Public License v2 or later (GPLv2+); OSI Approved Apache Software License -pyrsistent==0.11.12 # LICENSE.mit; OSI Approved MIT License -python-cinderclient==1.11.0 # OSI Approved Apache Software License -python-glanceclient==2.6.0 # OSI Approved Apache Software License -python-heatclient==1.8.1 # OSI Approved Apache Software License -python-keystoneclient==3.10.0 # OSI Approved Apache Software License -python-mimeparse==1.6.0 # OSI Approved MIT License -python-neutronclient==6.1.0 # OSI Approved Apache Software License -python-novaclient==7.1.1 # OSI Approved Apache Software License -python-openstackclient==3.8.1 # OSI Approved Apache Software License -python-swiftclient==3.3.0 # OSI Approved Apache Software License -pytz==2016.10 # MIT; OSI Approved MIT License -pyzmq==14.5.0 # LGPL+BSD; OSI Approved GNU Library or Lesser General Public License (LGPL); OSI Approved BSD License -requests==2.13.0 # Apache 2.0; OSI Approved Apache Software License -requestsexceptions==1.1.3 # OSI Approved Apache Software License +pyparsing==2.2.0 # MIT License; OSI Approved MIT License +pyroute2==0.4.21 # dual license GPLv2+ and Apache v2; OSI Approved GNU General Public License v2 or later (GPLv2+); OSI Approved Apache Software License +pyrsistent==0.14.1 # LICENSE.mit; OSI Approved MIT License +python-cinderclient==3.1.0 # OSI Approved Apache Software License +python-glanceclient==2.8.0 # OSI Approved Apache Software License +python-heatclient==1.11.1 # OSI Approved Apache Software License +python-keystoneclient==3.13.0 # OSI Approved Apache Software License +python-neutronclient==6.5.0 # OSI Approved Apache Software License +python-novaclient==9.1.1 # OSI Approved Apache Software License +pyzmq==16.0.2 # LGPL+BSD; OSI Approved GNU Library or Lesser General Public License (LGPL); OSI Approved BSD License +requests==2.18.2 # Apache 2.0; OSI Approved Apache Software License +requestsexceptions==1.3.0 # OSI Approved Apache Software License scp==0.10.2 # LGPL -shade==1.17.0 # OSI Approved Apache Software License -simplejson==3.10.0 # MIT License; OSI Approved MIT License; OSI Approved Academic Free License (AFL) +shade==1.22.2 # OSI Approved Apache Software License +simplejson==3.13.2 # MIT License; OSI Approved MIT License; OSI Approved Academic Free License (AFL) six==1.10.0 # MIT; OSI Approved MIT License -stevedore==1.20.0 # OSI Approved Apache Software License +stevedore==1.25.0 # OSI Approved Apache Software License traceback2==1.4.0 # OSI Approved Python Software Foundation License unicodecsv==0.14.1 # BSD License; OSI Approved BSD License -warlock==1.2.0 # OSI Approved Apache Software License -wrapt==1.10.8 # BSD +wrapt==1.10.10 # BSD diff --git a/samples/vnf_samples/nsut/prox/ovs-dpdk/throughput/tc_ipv4_worstcaserules_1flow_1518B_packetsize.yaml b/samples/vnf_samples/nsut/prox/ovs-dpdk/throughput/tc_ipv4_worstcaserules_1flow_1518B_packetsize.yaml deleted file mode 100644 index cbe3e97ae..000000000 --- a/samples/vnf_samples/nsut/prox/ovs-dpdk/throughput/tc_ipv4_worstcaserules_1flow_1518B_packetsize.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - ---- -schema: yardstick:task:0.1 -scenarios: -- type: NSPerf - traffic_profile: "../../../../traffic_profiles/ipv4_throughput.yaml" - topology: ../../acl-tg-topology.yaml - nodes: - tg__0: trafficgen_1.yardstick - vnf__0: vnf.yardstick - tg__1: trafficgen_2.yardstick - tc_options: - rfc2544: - allowed_drop_rate: 0.8 - 1 - options: - acl: - rules: ../../acl_worstcaserules.yaml - cfg: "../../acl_config" - script: "../../acl_script" - runner: - type: Duration - duration: 400 - interval: 35 - traffic_options: - flow: "../../../../traffic_profiles/ipv4_1flow_Packets.yaml" - imix: "../../../../traffic_profiles/imix_storage.yaml" -context: - type: Node-ovs - name: yardstick - nfvi_type: ovs - vm_deploy: True - file: /etc/yardstick/nodes/pod_ovs.yaml diff --git a/samples/vnf_samples/nsut/prox/ovs-dpdk/throughput/tc_ipv4_worstcaserules_1flow_64B_packetsize.yaml b/samples/vnf_samples/nsut/prox/ovs-dpdk/throughput/tc_ipv4_worstcaserules_1flow_64B_packetsize.yaml deleted file mode 100644 index 707b46e7f..000000000 --- a/samples/vnf_samples/nsut/prox/ovs-dpdk/throughput/tc_ipv4_worstcaserules_1flow_64B_packetsize.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - ---- -schema: yardstick:task:0.1 -scenarios: -- type: NSPerf - traffic_profile: "../../../../traffic_profiles/ipv4_throughput.yaml" - topology: ../../acl-tg-topology.yaml - nodes: - tg__0: trafficgen_1.yardstick - vnf__0: vnf.yardstick - tg__1: trafficgen_2.yardstick - tc_options: - rfc2544: - allowed_drop_rate: 0.8 - 1 - options: - acl: - rules: ../../acl_worstcaserules.yaml - cfg: "../../acl_config" - script: "../../acl_script" - runner: - type: Duration - duration: 400 - interval: 35 - traffic_options: - flow: "../../../../traffic_profiles/ipv4_1flow_Packets.yaml" - imix: "../../../../traffic_profiles/imix_voice.yaml" -context: - type: Node-ovs - name: yardstick - nfvi_type: ovs - vm_deploy: True - file: /etc/yardstick/nodes/pod_ovs.yaml diff --git a/samples/vnf_samples/nsut/prox/ovs-dpdk/throughput/tc_ipv4_worstcaserules_1flow_IMIX_packetsize.yaml b/samples/vnf_samples/nsut/prox/ovs-dpdk/throughput/tc_ipv4_worstcaserules_1flow_IMIX_packetsize.yaml deleted file mode 100644 index b1003df3d..000000000 --- a/samples/vnf_samples/nsut/prox/ovs-dpdk/throughput/tc_ipv4_worstcaserules_1flow_IMIX_packetsize.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - ---- -schema: yardstick:task:0.1 -scenarios: -- type: NSPerf - traffic_profile: "../../../../traffic_profiles/ipv4_throughput.yaml" - topology: ../../acl-tg-topology.yaml - nodes: - tg__0: trafficgen_1.yardstick - vnf__0: vnf.yardstick - tg__1: trafficgen_2.yardstick - tc_options: - rfc2544: - allowed_drop_rate: 0.8 - 1 - options: - acl: - rules: ../../acl_worstcaserules.yaml - cfg: "../../acl_config" - script: "../../acl_script" - runner: - type: Duration - duration: 400 - interval: 35 - traffic_options: - flow: "../../../../traffic_profiles/ipv4_1flow_Packets.yaml" - imix: "../../../../traffic_profiles/imix_video.yaml" -context: - type: Node-ovs - name: yardstick - nfvi_type: ovs - vm_deploy: True - file: /etc/yardstick/nodes/pod_ovs.yaml diff --git a/samples/vnf_samples/nsut/prox/sriov/http_tests/tc_FileSize-1K_Requests-1M_Concurrency-100.yaml b/samples/vnf_samples/nsut/prox/sriov/http_tests/tc_FileSize-1K_Requests-1M_Concurrency-100.yaml deleted file mode 100644 index 15892b886..000000000 --- a/samples/vnf_samples/nsut/prox/sriov/http_tests/tc_FileSize-1K_Requests-1M_Concurrency-100.yaml +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################## -# Copyright 2012 - 2016 Intel Corporation All Rights Reserved. -# deepak.s@intel.com -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - ---- -schema: "yardstick:task:0.1" - -scenarios: -- - type: NSPerf - traffic_profile: ../../../../traffic_profiles/http_tests/FileSize-1K_Requests-1M_Concurrency-100.yaml - topology: ../../acl-tg-topology-http.yaml - - nodes: - tg__0: trafficgen_1.yardstick - vnf__0: vnf.yardstick - tg__1: trafficgen_2.yardstick - - options: - acl: - rules: ../../acl_rules.yaml - cfg: "../../acl_config" - script: "../../acl_script" - - runner: - type: Duration - duration: 2 - -context: - type: Node-sriov - name: yardstick - nfvi_type: sriov - vm_deploy: True - file: /etc/yardstick/nodes/pod_sriov.yaml diff --git a/samples/vnf_samples/nsut/prox/sriov/throughput/tc_ipv4_1rule_1flow_1518B_packetsize.yaml b/samples/vnf_samples/nsut/prox/sriov/throughput/tc_ipv4_1rule_1flow_1518B_packetsize.yaml deleted file mode 100644 index 1238ed41c..000000000 --- a/samples/vnf_samples/nsut/prox/sriov/throughput/tc_ipv4_1rule_1flow_1518B_packetsize.yaml +++ /dev/null @@ -1,40 +0,0 @@ -############################################################################## -# Copyright 2012 - 2016 Intel Corporation All Rights Reserved. -# deepak.s@intel.com -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - ---- -schema: yardstick:task:0.1 -scenarios: -- type: NSPerf - traffic_profile: "../../../../traffic_profiles/ipv4_throughput.yaml" - topology: ../../acl-tg-topology.yaml - nodes: - tg__0: trafficgen_1.yardstick - vnf__0: vnf.yardstick - tg__1: trafficgen_2.yardstick - tc_options: - rfc2544: - allowed_drop_rate: 0.8 - 1 - options: - acl: - rules: ../../acl_1rule.yaml - cfg: "../../acl_config" - script: "../../acl_script" - runner: - type: Duration - duration: 400 - interval: 35 - traffic_options: - flow: "../../../../traffic_profiles/ipv4_1flow_Packets.yaml" - imix: "../../../../traffic_profiles/imix_storage.yaml" -context: - type: Node-sriov - name: yardstick - nfvi_type: sriov - vm_deploy: True - file: /etc/yardstick/nodes/pod_sriov.yaml diff --git a/samples/vnf_samples/nsut/prox/sriov/throughput/tc_ipv4_1rule_1flow_64B_packetsize.yaml b/samples/vnf_samples/nsut/prox/sriov/throughput/tc_ipv4_1rule_1flow_64B_packetsize.yaml deleted file mode 100644 index 059a6502f..000000000 --- a/samples/vnf_samples/nsut/prox/sriov/throughput/tc_ipv4_1rule_1flow_64B_packetsize.yaml +++ /dev/null @@ -1,40 +0,0 @@ -############################################################################## -# Copyright 2012 - 2016 Intel Corporation All Rights Reserved. -# deepak.s@intel.com -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - ---- -schema: yardstick:task:0.1 -scenarios: -- type: NSPerf - traffic_profile: "../../../../traffic_profiles/ipv4_throughput.yaml" - topology: ../../acl-tg-topology.yaml - nodes: - tg__0: trafficgen_1.yardstick - vnf__0: vnf.yardstick - tg__1: trafficgen_2.yardstick - tc_options: - rfc2544: - allowed_drop_rate: 0.8 - 1 - options: - acl: - rules: ../../acl_1rule.yaml - cfg: "../../acl_config" - script: "../../acl_script" - runner: - type: Duration - duration: 400 - interval: 35 - traffic_options: - flow: "../../../../traffic_profiles/ipv4_1flow_Packets.yaml" - imix: "../../../../traffic_profiles/imix_voice.yaml" -context: - type: Node-sriov - name: yardstick - nfvi_type: sriov - vm_deploy: True - file: /etc/yardstick/nodes/pod_sriov.yaml diff --git a/samples/vnf_samples/nsut/prox/sriov/throughput/tc_ipv4_1rule_1flow_IMIX_packetsize.yaml b/samples/vnf_samples/nsut/prox/sriov/throughput/tc_ipv4_1rule_1flow_IMIX_packetsize.yaml deleted file mode 100644 index b6aa48a0e..000000000 --- a/samples/vnf_samples/nsut/prox/sriov/throughput/tc_ipv4_1rule_1flow_IMIX_packetsize.yaml +++ /dev/null @@ -1,40 +0,0 @@ -############################################################################## -# Copyright 2012 - 2016 Intel Corporation All Rights Reserved. -# deepak.s@intel.com -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - ---- -schema: yardstick:task:0.1 -scenarios: -- type: NSPerf - traffic_profile: "../../../../traffic_profiles/ipv4_throughput.yaml" - topology: ../../acl-tg-topology.yaml - nodes: - tg__0: trafficgen_1.yardstick - vnf__0: vnf.yardstick - tg__1: trafficgen_2.yardstick - tc_options: - rfc2544: - allowed_drop_rate: 0.8 - 1 - options: - acl: - rules: ../../acl_1rule.yaml - cfg: "../../acl_config" - script: "../../acl_script" - runner: - type: Duration - duration: 400 - interval: 35 - traffic_options: - flow: "../../../../traffic_profiles/ipv4_1flow_Packets.yaml" - imix: "../../../../traffic_profiles/imix_video.yaml" -context: - type: Node-sriov - name: yardstick - nfvi_type: sriov - vm_deploy: True - file: /etc/yardstick/nodes/pod_sriov.yaml diff --git a/samples/vnf_samples/nsut/prox/sriov/throughput/tc_ipv4_worstcaserules_1flow_1518B_packetsize.yaml b/samples/vnf_samples/nsut/prox/sriov/throughput/tc_ipv4_worstcaserules_1flow_1518B_packetsize.yaml deleted file mode 100644 index baa4b5997..000000000 --- a/samples/vnf_samples/nsut/prox/sriov/throughput/tc_ipv4_worstcaserules_1flow_1518B_packetsize.yaml +++ /dev/null @@ -1,40 +0,0 @@ -############################################################################## -# Copyright 2012 - 2016 Intel Corporation All Rights Reserved. -# deepak.s@intel.com -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - ---- -schema: yardstick:task:0.1 -scenarios: -- type: NSPerf - traffic_profile: "../../../../traffic_profiles/ipv4_throughput.yaml" - topology: ../../acl-tg-topology.yaml - nodes: - tg__0: trafficgen_1.yardstick - vnf__0: vnf.yardstick - tg__1: trafficgen_2.yardstick - tc_options: - rfc2544: - allowed_drop_rate: 0.8 - 1 - options: - acl: - rules: ../../acl_worstcaserules.yaml - cfg: "../../acl_config" - script: "../../acl_script" - runner: - type: Duration - duration: 400 - interval: 35 - traffic_options: - flow: "../../../../traffic_profiles/ipv4_1flow_Packets.yaml" - imix: "../../../../traffic_profiles/imix_storage.yaml" -context: - type: Node-sriov - name: yardstick - nfvi_type: sriov - vm_deploy: True - file: /etc/yardstick/nodes/pod_sriov.yaml diff --git a/samples/vnf_samples/nsut/prox/sriov/throughput/tc_ipv4_worstcaserules_1flow_64B_packetsize.yaml b/samples/vnf_samples/nsut/prox/sriov/throughput/tc_ipv4_worstcaserules_1flow_64B_packetsize.yaml deleted file mode 100644 index 590150602..000000000 --- a/samples/vnf_samples/nsut/prox/sriov/throughput/tc_ipv4_worstcaserules_1flow_64B_packetsize.yaml +++ /dev/null @@ -1,40 +0,0 @@ -############################################################################## -# Copyright 2012 - 2016 Intel Corporation All Rights Reserved. -# deepak.s@intel.com -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - ---- -schema: yardstick:task:0.1 -scenarios: -- type: NSPerf - traffic_profile: "../../../../traffic_profiles/ipv4_throughput.yaml" - topology: ../../acl-tg-topology.yaml - nodes: - tg__0: trafficgen_1.yardstick - vnf__0: vnf.yardstick - tg__1: trafficgen_2.yardstick - tc_options: - rfc2544: - allowed_drop_rate: 0.8 - 1 - options: - acl: - rules: ../../acl_worstcaserules.yaml - cfg: "../../acl_config" - script: "../../acl_script" - runner: - type: Duration - duration: 400 - interval: 35 - traffic_options: - flow: "../../../../traffic_profiles/ipv4_1flow_Packets.yaml" - imix: "../../../../traffic_profiles/imix_voice.yaml" -context: - type: Node-sriov - name: yardstick - nfvi_type: sriov - vm_deploy: True - file: /etc/yardstick/nodes/pod_sriov.yaml diff --git a/samples/vnf_samples/nsut/prox/sriov/throughput/tc_ipv4_worstcaserules_1flow_IMIX_packetsize.yaml b/samples/vnf_samples/nsut/prox/sriov/throughput/tc_ipv4_worstcaserules_1flow_IMIX_packetsize.yaml deleted file mode 100644 index 517dd9024..000000000 --- a/samples/vnf_samples/nsut/prox/sriov/throughput/tc_ipv4_worstcaserules_1flow_IMIX_packetsize.yaml +++ /dev/null @@ -1,40 +0,0 @@ -############################################################################## -# Copyright 2012 - 2016 Intel Corporation All Rights Reserved. -# deepak.s@intel.com -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - ---- -schema: yardstick:task:0.1 -scenarios: -- type: NSPerf - traffic_profile: "../../../../traffic_profiles/ipv4_throughput.yaml" - topology: ../../acl-tg-topology.yaml - nodes: - tg__0: trafficgen_1.yardstick - vnf__0: vnf.yardstick - tg__1: trafficgen_2.yardstick - tc_options: - rfc2544: - allowed_drop_rate: 0.8 - 1 - options: - acl: - rules: ../../acl_worstcaserules.yaml - cfg: "../../acl_config" - script: "../../acl_script" - runner: - type: Duration - duration: 400 - interval: 35 - traffic_options: - flow: "../../../../traffic_profiles/ipv4_1flow_Packets.yaml" - imix: "../../../../traffic_profiles/imix_video.yaml" -context: - type: Node-sriov - name: yardstick - nfvi_type: sriov - vm_deploy: True - file: /etc/yardstick/nodes/pod_sriov.yaml diff --git a/samples/vnf_samples/nsut/router/router-tg-topology-4port.yaml b/samples/vnf_samples/nsut/router/router-tg-topology-4port.yaml new file mode 100644 index 000000000..94c64e800 --- /dev/null +++ b/samples/vnf_samples/nsut/router/router-tg-topology-4port.yaml @@ -0,0 +1,70 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +nsd:nsd-catalog: + nsd: + - id: router-tg-topology + name: router-tg-topology + short-name: router-tg-topology + description: router-tg-topology + constituent-vnfd: + - member-vnf-index: '1' + vnfd-id-ref: tg__0 + VNF model: ../../vnf_descriptors/tg_rfc2544_tpl.yaml #VNF type + - member-vnf-index: '2' + vnfd-id-ref: vnf__0 + VNF model: ../../vnf_descriptors/router_vnf.yaml #VNF type + + vld: + - id: uplink_0 + name: tg__0 to vnf__0 link 1 + type: ELAN + vnfd-connection-point-ref: + - member-vnf-index-ref: '1' + vnfd-connection-point-ref: xe0 + vnfd-id-ref: tg__0 + - member-vnf-index-ref: '2' + vnfd-connection-point-ref: xe0 + vnfd-id-ref: vnf__0 + - id: downlink_0 + name: vnf__0 to tg__0 link 2 + type: ELAN + vnfd-connection-point-ref: + - member-vnf-index-ref: '2' + vnfd-connection-point-ref: xe1 + vnfd-id-ref: vnf__0 + - member-vnf-index-ref: '1' + vnfd-connection-point-ref: xe1 + vnfd-id-ref: tg__0 + + - id: uplink_1 + name: tg__0 to vnf__0 link 3 + type: ELAN + vnfd-connection-point-ref: + - member-vnf-index-ref: '1' + vnfd-connection-point-ref: xe2 + vnfd-id-ref: tg__0 + - member-vnf-index-ref: '2' + vnfd-connection-point-ref: xe2 + vnfd-id-ref: vnf__0 + - id: downlink_1 + name: vnf__0 to tg__0 link 4 + type: ELAN + vnfd-connection-point-ref: + - member-vnf-index-ref: '2' + vnfd-connection-point-ref: xe3 + vnfd-id-ref: vnf__0 + - member-vnf-index-ref: '1' + vnfd-connection-point-ref: xe3 + vnfd-id-ref: tg__0 diff --git a/samples/vnf_samples/nsut/router/router-tg-topology-6port.yaml b/samples/vnf_samples/nsut/router/router-tg-topology-6port.yaml new file mode 100644 index 000000000..57695784e --- /dev/null +++ b/samples/vnf_samples/nsut/router/router-tg-topology-6port.yaml @@ -0,0 +1,90 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +nsd:nsd-catalog: + nsd: + - id: router-tg-topology + name: router-tg-topology + short-name: router-tg-topology + description: router-tg-topology + constituent-vnfd: + - member-vnf-index: '1' + vnfd-id-ref: tg__0 + VNF model: ../../vnf_descriptors/tg_rfc2544_tpl.yaml #VNF type + - member-vnf-index: '2' + vnfd-id-ref: vnf__0 + VNF model: ../../vnf_descriptors/router_vnf.yaml #VNF type + + vld: + - id: uplink_0 + name: tg__0 to vnf__0 link 1 + type: ELAN + vnfd-connection-point-ref: + - member-vnf-index-ref: '1' + vnfd-connection-point-ref: xe0 + vnfd-id-ref: tg__0 + - member-vnf-index-ref: '2' + vnfd-connection-point-ref: xe0 + vnfd-id-ref: vnf__0 + - id: downlink_0 + name: vnf__0 to tg__0 link 2 + type: ELAN + vnfd-connection-point-ref: + - member-vnf-index-ref: '2' + vnfd-connection-point-ref: xe1 + vnfd-id-ref: vnf__0 + - member-vnf-index-ref: '1' + vnfd-connection-point-ref: xe1 + vnfd-id-ref: tg__0 + + - id: uplink_1 + name: tg__0 to vnf__0 link 3 + type: ELAN + vnfd-connection-point-ref: + - member-vnf-index-ref: '1' + vnfd-connection-point-ref: xe2 + vnfd-id-ref: tg__0 + - member-vnf-index-ref: '2' + vnfd-connection-point-ref: xe2 + vnfd-id-ref: vnf__0 + - id: downlink_1 + name: vnf__0 to tg__0 link 4 + type: ELAN + vnfd-connection-point-ref: + - member-vnf-index-ref: '2' + vnfd-connection-point-ref: xe3 + vnfd-id-ref: vnf__0 + - member-vnf-index-ref: '1' + vnfd-connection-point-ref: xe3 + vnfd-id-ref: tg__0 + - id: uplink_2 + name: tg__0 to vnf__0 link 5 + type: ELAN + vnfd-connection-point-ref: + - member-vnf-index-ref: '1' + vnfd-connection-point-ref: xe4 + vnfd-id-ref: tg__0 + - member-vnf-index-ref: '2' + vnfd-connection-point-ref: xe4 + vnfd-id-ref: vnf__0 + - id: downlink_2 + name: vnf__0 to tg__0 link 6 + type: ELAN + vnfd-connection-point-ref: + - member-vnf-index-ref: '2' + vnfd-connection-point-ref: xe5 + vnfd-id-ref: vnf__0 + - member-vnf-index-ref: '1' + vnfd-connection-point-ref: xe5 + vnfd-id-ref: tg__0 diff --git a/samples/vnf_samples/nsut/router/router-tg-topology.yaml b/samples/vnf_samples/nsut/router/router-tg-topology.yaml new file mode 100644 index 000000000..6e63760eb --- /dev/null +++ b/samples/vnf_samples/nsut/router/router-tg-topology.yaml @@ -0,0 +1,50 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +nsd:nsd-catalog: + nsd: + - id: 2node-topology + name: 2node-topology + short-name: 2node-topology + description: 2node-topology + constituent-vnfd: + - member-vnf-index: '1' + vnfd-id-ref: tg__0 + VNF model: ../../vnf_descriptors/tg_rfc2544_tpl.yaml #VNF type + - member-vnf-index: '2' + vnfd-id-ref: vnf__0 + VNF model: ../../vnf_descriptors/router_vnf.yaml #VNF type + + vld: + - id: uplink_0 + name: tg__0 to vnf__0 link 1 + type: ELAN + vnfd-connection-point-ref: + - member-vnf-index-ref: '1' + vnfd-connection-point-ref: xe0 + vnfd-id-ref: tg__0 + - member-vnf-index-ref: '2' + vnfd-connection-point-ref: xe0 + vnfd-id-ref: vnf__0 + + - id: downlink_0 + name: vnf__0 to tg__0 link 2 + type: ELAN + vnfd-connection-point-ref: + - member-vnf-index-ref: '2' + vnfd-connection-point-ref: xe1 + vnfd-id-ref: vnf__0 + - member-vnf-index-ref: '1' + vnfd-connection-point-ref: xe1 + vnfd-id-ref: tg__0 diff --git a/samples/vnf_samples/nsut/prox/baremetal/throughput/tc_ipv4_1flow_64B_packetsize.yaml b/samples/vnf_samples/nsut/router/tc_baremetal_rfc2544_ipv4_1flow_64B_trex.yaml index 1fe2ed943..7b4db0e64 100644 --- a/samples/vnf_samples/nsut/prox/baremetal/throughput/tc_ipv4_1flow_64B_packetsize.yaml +++ b/samples/vnf_samples/nsut/router/tc_baremetal_rfc2544_ipv4_1flow_64B_trex.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Intel Corporation +# Copyright (c) 2016-2017 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,21 +16,32 @@ schema: yardstick:task:0.1 scenarios: - type: NSPerf - traffic_profile: "../../../../traffic_profiles/ipv4_throughput.yaml" - topology: "../../prox-tg-topology.yaml" + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml nodes: tg__0: trafficgen_1.yardstick vnf__0: vnf.yardstick - tc_options: + options: + framesize: + uplink: {64B: 100} + downlink: {64B: 100} + flow: + src_ip: + - '152.16.100.26' + dst_ip: + - '152.16.40.26' + count: 1 + traffic_type: 4 rfc2544: - allowed_drop_rate: 0.8 - 1 + allowed_drop_rate: 0.0001 - 0.0001 + tg__0: + queues_per_port: 4 + vnf__0: + nfvi_enable: True runner: - type: Duration - duration: 400 + type: Iteration + iterations: 10 interval: 35 - traffic_options: - flow: "../../../../traffic_profiles/ipv4_1flow_Packets.yaml" - imix: "../../../../traffic_profiles/imix_voice.yaml" context: type: Node name: yardstick diff --git a/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_1024B.yaml b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_1024B.yaml new file mode 100644 index 000000000..5b268d09e --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_1024B.yaml @@ -0,0 +1,102 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.baremetal + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: compute_0.compute_nodes + options: + framesize: + uplink: {1024B: 100} + downlink: {1024B: 100} + flow: + src_ip: + - '10.0.2.26-10.0.2.105' + dst_ip: + - '10.0.3.26-10.0.3.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: compute_nodes + type: Node + file: /etc/yardstick/nodes/compute.yaml + + - name: baremetal + type: Node + file: /etc/yardstick/nodes/pod.yaml + + - name: yardstick + image: vrouter_affinity_2c2p + flavor: + vcpus: 5 + ram: 20480 + disk: 10 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 5 + hw:cpu_threads: 1 + hw:mem_page_size: large + hw:cpu_policy: dedicated + hw:cpu_thread_policy: prefer + hw:numa_nodes: 1 + hw:numa_mempolicy: preffered + hw:numa_cpus.0: 0,1,2,3,4 + hw:numa_mem.0: 20480 + user: "root" + password: "password" + placement_groups: + pgrp1: + policy: "availability" + servers: + vnf: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False + enable_dhcp: 'false' + xe1: + cidr: '10.0.3.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant3 + port_security_enabled: False + enable_dhcp: 'false' diff --git a/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_1280B.yaml b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_1280B.yaml new file mode 100644 index 000000000..20305df7c --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_1280B.yaml @@ -0,0 +1,102 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.baremetal + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: compute_0.compute_nodes + options: + framesize: + uplink: {1280B: 100} + downlink: {1280B: 100} + flow: + src_ip: + - '10.0.2.26-10.0.2.105' + dst_ip: + - '10.0.3.26-10.0.3.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: compute_nodes + type: Node + file: /etc/yardstick/nodes/compute.yaml + + - name: baremetal + type: Node + file: /etc/yardstick/nodes/pod.yaml + + - name: yardstick + image: vrouter_affinity_2c2p + flavor: + vcpus: 5 + ram: 20480 + disk: 10 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 5 + hw:cpu_threads: 1 + hw:mem_page_size: large + hw:cpu_policy: dedicated + hw:cpu_thread_policy: prefer + hw:numa_nodes: 1 + hw:numa_mempolicy: preffered + hw:numa_cpus.0: 0,1,2,3,4 + hw:numa_mem.0: 20480 + user: "root" + password: "password" + placement_groups: + pgrp1: + policy: "availability" + servers: + vnf: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False + enable_dhcp: 'false' + xe1: + cidr: '10.0.3.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant3 + port_security_enabled: False + enable_dhcp: 'false' diff --git a/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_128B.yaml b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_128B.yaml new file mode 100644 index 000000000..73459c340 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_128B.yaml @@ -0,0 +1,102 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.baremetal + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: compute_0.compute_nodes + options: + framesize: + uplink: {128B: 100} + downlink: {128B: 100} + flow: + src_ip: + - '10.0.2.26-10.0.2.105' + dst_ip: + - '10.0.3.26-10.0.3.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: compute_nodes + type: Node + file: /etc/yardstick/nodes/compute.yaml + + - name: baremetal + type: Node + file: /etc/yardstick/nodes/pod.yaml + + - name: yardstick + image: vrouter_affinity_2c2p + flavor: + vcpus: 5 + ram: 20480 + disk: 10 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 5 + hw:cpu_threads: 1 + hw:mem_page_size: large + hw:cpu_policy: dedicated + hw:cpu_thread_policy: prefer + hw:numa_nodes: 1 + hw:numa_mempolicy: preffered + hw:numa_cpus.0: 0,1,2,3,4 + hw:numa_mem.0: 20480 + user: "root" + password: "password" + placement_groups: + pgrp1: + policy: "availability" + servers: + vnf: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False + enable_dhcp: 'false' + xe1: + cidr: '10.0.3.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant3 + port_security_enabled: False + enable_dhcp: 'false' diff --git a/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_1518B.yaml b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_1518B.yaml new file mode 100644 index 000000000..fb7f48a2f --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_1518B.yaml @@ -0,0 +1,102 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.baremetal + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: compute_0.compute_nodes + options: + framesize: + uplink: {1518B: 100} + downlink: {1518B: 100} + flow: + src_ip: + - '10.0.2.26-10.0.2.105' + dst_ip: + - '10.0.3.26-10.0.3.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 2 + interval: 35 +contexts: + - name: compute_nodes + type: Node + file: /etc/yardstick/nodes/compute.yaml + + - name: baremetal + type: Node + file: /etc/yardstick/nodes/pod.yaml + + - name: yardstick + image: vrouter_affinity_2c2p + flavor: + vcpus: 5 + ram: 20480 + disk: 10 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 5 + hw:cpu_threads: 1 + hw:mem_page_size: large + hw:cpu_policy: dedicated + hw:cpu_thread_policy: prefer + hw:numa_nodes: 1 + hw:numa_mempolicy: preffered + hw:numa_cpus.0: 0,1,2,3,4 + hw:numa_mem.0: 20480 + user: "root" + password: "password" + placement_groups: + pgrp1: + policy: "availability" + servers: + vnf: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False + enable_dhcp: 'false' + xe1: + cidr: '10.0.3.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant3 + port_security_enabled: False + enable_dhcp: 'false' diff --git a/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_256B.yaml b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_256B.yaml new file mode 100644 index 000000000..c2bc0b7d2 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_256B.yaml @@ -0,0 +1,102 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.baremetal + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: compute_0.compute_nodes + options: + framesize: + uplink: {256B: 100} + downlink: {256B: 100} + flow: + src_ip: + - '10.0.2.26-10.0.2.105' + dst_ip: + - '10.0.3.26-10.0.3.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: compute_nodes + type: Node + file: /etc/yardstick/nodes/compute.yaml + + - name: baremetal + type: Node + file: /etc/yardstick/nodes/pod.yaml + + - name: yardstick + image: vrouter_affinity_2c2p + flavor: + vcpus: 5 + ram: 20480 + disk: 10 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 5 + hw:cpu_threads: 1 + hw:mem_page_size: large + hw:cpu_policy: dedicated + hw:cpu_thread_policy: prefer + hw:numa_nodes: 1 + hw:numa_mempolicy: preffered + hw:numa_cpus.0: 0,1,2,3,4 + hw:numa_mem.0: 20480 + user: "root" + password: "password" + placement_groups: + pgrp1: + policy: "availability" + servers: + vnf: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False + enable_dhcp: 'false' + xe1: + cidr: '10.0.3.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant3 + port_security_enabled: False + enable_dhcp: 'false' diff --git a/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_512B.yaml b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_512B.yaml new file mode 100644 index 000000000..bb17eb4b2 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_512B.yaml @@ -0,0 +1,102 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.baremetal + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: compute_0.compute_nodes + options: + framesize: + uplink: {512B: 100} + downlink: {512B: 100} + flow: + src_ip: + - '10.0.2.26-10.0.2.105' + dst_ip: + - '10.0.3.26-10.0.3.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: compute_nodes + type: Node + file: /etc/yardstick/nodes/compute.yaml + + - name: baremetal + type: Node + file: /etc/yardstick/nodes/pod.yaml + + - name: yardstick + image: vrouter_affinity_2c2p + flavor: + vcpus: 5 + ram: 20480 + disk: 10 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 5 + hw:cpu_threads: 1 + hw:mem_page_size: large + hw:cpu_policy: dedicated + hw:cpu_thread_policy: prefer + hw:numa_nodes: 1 + hw:numa_mempolicy: preffered + hw:numa_cpus.0: 0,1,2,3,4 + hw:numa_mem.0: 20480 + user: "root" + password: "password" + placement_groups: + pgrp1: + policy: "availability" + servers: + vnf: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False + enable_dhcp: 'false' + xe1: + cidr: '10.0.3.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant3 + port_security_enabled: False + enable_dhcp: 'false' diff --git a/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_64B.yaml b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_64B.yaml new file mode 100644 index 000000000..0726e1063 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_5cores_2ports_64B.yaml @@ -0,0 +1,102 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.baremetal + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: compute_0.compute_nodes + options: + framesize: + uplink: {64B: 100} + downlink: {64B: 100} + flow: + src_ip: + - '10.0.2.26-10.0.2.105' + dst_ip: + - '10.0.3.26-10.0.3.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: compute_nodes + type: Node + file: /etc/yardstick/nodes/compute.yaml + + - name: baremetal + type: Node + file: /etc/yardstick/nodes/pod.yaml + + - name: yardstick + image: vrouter_affinity_2c2p + flavor: + vcpus: 5 + ram: 20480 + disk: 10 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 5 + hw:cpu_threads: 1 + hw:mem_page_size: large + hw:cpu_policy: dedicated + hw:cpu_thread_policy: prefer + hw:numa_nodes: 1 + hw:numa_mempolicy: preffered + hw:numa_cpus.0: 0,1,2,3,4 + hw:numa_mem.0: 20480 + user: "root" + password: "password" + placement_groups: + pgrp1: + policy: "availability" + servers: + vnf: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False + enable_dhcp: 'false' + xe1: + cidr: '10.0.3.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant3 + port_security_enabled: False + enable_dhcp: 'false' diff --git a/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_1024B.yaml b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_1024B.yaml new file mode 100644 index 000000000..6efc69c40 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_1024B.yaml @@ -0,0 +1,120 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.baremetal + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: compute_0.compute_nodes + options: + framesize: + uplink: {1024B: 100} + downlink: {1024B: 100} + flow: + src_ip: + - '10.0.2.26-10.0.2.105' + - '10.0.4.26-10.0.4.105' + dst_ip: + - '10.0.3.26-10.0.3.105' + - '10.0.5.26-10.0.5.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: compute_nodes + type: Node + file: /etc/yardstick/nodes/compute.yaml + + - name: baremetal + type: Node + file: /etc/yardstick/nodes/pod_4p.yaml + + - name: yardstick + image: vrouter_affinity_2c4p + flavor: + vcpus: 9 + ram: 8192 + disk: 10 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + hw:mem_page_size: large + hw:cpu_policy: dedicated + hw:cpu_thread_policy: prefer + hw:numa_nodes: 2 + hw:numa_mempolicy: preffered + hw:numa_cpus.0: 0,1,2,3,4 + hw:numa_cpus.1: 5,6,7,8 + hw:numa_mem.0: 4096 + hw:numa_mem.1: 4096 + user: "root" + password: "password" + placement_groups: + pgrp1: + policy: "availability" + servers: + vnf: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False + enable_dhcp: 'false' + xe1: + cidr: '10.0.3.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant3 + port_security_enabled: False + enable_dhcp: 'false' + xe2: + cidr: '10.0.4.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant4 + port_security_enabled: False + enable_dhcp: 'false' + xe3: + cidr: '10.0.5.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant5 + port_security_enabled: False + enable_dhcp: 'false' diff --git a/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_1280B.yaml b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_1280B.yaml new file mode 100644 index 000000000..be08b5b39 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_1280B.yaml @@ -0,0 +1,120 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.baremetal + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: compute_0.compute_nodes + options: + framesize: + uplink: {1280B: 100} + downlink: {1280B: 100} + flow: + src_ip: + - '10.0.2.26-10.0.2.105' + - '10.0.4.26-10.0.4.105' + dst_ip: + - '10.0.3.26-10.0.3.105' + - '10.0.5.26-10.0.5.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: compute_nodes + type: Node + file: /etc/yardstick/nodes/compute.yaml + + - name: baremetal + type: Node + file: /etc/yardstick/nodes/pod_4p.yaml + + - name: yardstick + image: vrouter_affinity_2c4p + flavor: + vcpus: 9 + ram: 8192 + disk: 10 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + hw:mem_page_size: large + hw:cpu_policy: dedicated + hw:cpu_thread_policy: prefer + hw:numa_nodes: 2 + hw:numa_mempolicy: preffered + hw:numa_cpus.0: 0,1,2,3,4 + hw:numa_cpus.1: 5,6,7,8 + hw:numa_mem.0: 4096 + hw:numa_mem.1: 4096 + user: "root" + password: "password" + placement_groups: + pgrp1: + policy: "availability" + servers: + vnf: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False + enable_dhcp: 'false' + xe1: + cidr: '10.0.3.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant3 + port_security_enabled: False + enable_dhcp: 'false' + xe2: + cidr: '10.0.4.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant4 + port_security_enabled: False + enable_dhcp: 'false' + xe3: + cidr: '10.0.5.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant5 + port_security_enabled: False + enable_dhcp: 'false' diff --git a/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_128B.yaml b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_128B.yaml new file mode 100644 index 000000000..afc4a6839 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_128B.yaml @@ -0,0 +1,120 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.baremetal + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: compute_0.compute_nodes + options: + framesize: + uplink: {128B: 100} + downlink: {128B: 100} + flow: + src_ip: + - '10.0.2.26-10.0.2.105' + - '10.0.4.26-10.0.4.105' + dst_ip: + - '10.0.3.26-10.0.3.105' + - '10.0.5.26-10.0.5.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: compute_nodes + type: Node + file: /etc/yardstick/nodes/compute.yaml + + - name: baremetal + type: Node + file: /etc/yardstick/nodes/pod_4p.yaml + + - name: yardstick + image: vrouter_affinity_2c4p + flavor: + vcpus: 9 + ram: 8192 + disk: 10 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + hw:mem_page_size: large + hw:cpu_policy: dedicated + hw:cpu_thread_policy: prefer + hw:numa_nodes: 2 + hw:numa_mempolicy: preffered + hw:numa_cpus.0: 0,1,2,3,4 + hw:numa_cpus.1: 5,6,7,8 + hw:numa_mem.0: 4096 + hw:numa_mem.1: 4096 + user: "root" + password: "password" + placement_groups: + pgrp1: + policy: "availability" + servers: + vnf: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False + enable_dhcp: 'false' + xe1: + cidr: '10.0.3.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant3 + port_security_enabled: False + enable_dhcp: 'false' + xe2: + cidr: '10.0.4.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant4 + port_security_enabled: False + enable_dhcp: 'false' + xe3: + cidr: '10.0.5.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant5 + port_security_enabled: False + enable_dhcp: 'false' diff --git a/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_1518B.yaml b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_1518B.yaml new file mode 100644 index 000000000..c0bbc8cdc --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_1518B.yaml @@ -0,0 +1,120 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.baremetal + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: compute_0.compute_nodes + options: + framesize: + uplink: {1518B: 100} + downlink: {1518B: 100} + flow: + src_ip: + - '10.0.2.26-10.0.2.105' + - '10.0.4.26-10.0.4.105' + dst_ip: + - '10.0.3.26-10.0.3.105' + - '10.0.5.26-10.0.5.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: compute_nodes + type: Node + file: /etc/yardstick/nodes/compute.yaml + + - name: baremetal + type: Node + file: /etc/yardstick/nodes/pod_4p.yaml + + - name: yardstick + image: vrouter_affinity_2c4p + flavor: + vcpus: 9 + ram: 8192 + disk: 10 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + hw:mem_page_size: large + hw:cpu_policy: dedicated + hw:cpu_thread_policy: prefer + hw:numa_nodes: 2 + hw:numa_mempolicy: preffered + hw:numa_cpus.0: 0,1,2,3,4 + hw:numa_cpus.1: 5,6,7,8 + hw:numa_mem.0: 4096 + hw:numa_mem.1: 4096 + user: "root" + password: "password" + placement_groups: + pgrp1: + policy: "availability" + servers: + vnf: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False + enable_dhcp: 'false' + xe1: + cidr: '10.0.3.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant3 + port_security_enabled: False + enable_dhcp: 'false' + xe2: + cidr: '10.0.4.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant4 + port_security_enabled: False + enable_dhcp: 'false' + xe3: + cidr: '10.0.5.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant5 + port_security_enabled: False + enable_dhcp: 'false' diff --git a/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_256B.yaml b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_256B.yaml new file mode 100644 index 000000000..c78f0c2c1 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_256B.yaml @@ -0,0 +1,120 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.baremetal + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: compute_0.compute_nodes + options: + framesize: + uplink: {256B: 100} + downlink: {256B: 100} + flow: + src_ip: + - '10.0.2.26-10.0.2.105' + - '10.0.4.26-10.0.4.105' + dst_ip: + - '10.0.3.26-10.0.3.105' + - '10.0.5.26-10.0.5.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: compute_nodes + type: Node + file: /etc/yardstick/nodes/compute.yaml + + - name: baremetal + type: Node + file: /etc/yardstick/nodes/pod_4p.yaml + + - name: yardstick + image: vrouter_affinity_2c4p + flavor: + vcpus: 9 + ram: 8192 + disk: 10 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + hw:mem_page_size: large + hw:cpu_policy: dedicated + hw:cpu_thread_policy: prefer + hw:numa_nodes: 2 + hw:numa_mempolicy: preffered + hw:numa_cpus.0: 0,1,2,3,4 + hw:numa_cpus.1: 5,6,7,8 + hw:numa_mem.0: 4096 + hw:numa_mem.1: 4096 + user: "root" + password: "password" + placement_groups: + pgrp1: + policy: "availability" + servers: + vnf: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False + enable_dhcp: 'false' + xe1: + cidr: '10.0.3.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant3 + port_security_enabled: False + enable_dhcp: 'false' + xe2: + cidr: '10.0.4.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant4 + port_security_enabled: False + enable_dhcp: 'false' + xe3: + cidr: '10.0.5.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant5 + port_security_enabled: False + enable_dhcp: 'false' diff --git a/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_512B.yaml b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_512B.yaml new file mode 100644 index 000000000..9d223299a --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_512B.yaml @@ -0,0 +1,120 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.baremetal + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: compute_0.compute_nodes + options: + framesize: + uplink: {512B: 100} + downlink: {512B: 100} + flow: + src_ip: + - '10.0.2.26-10.0.2.105' + - '10.0.4.26-10.0.4.105' + dst_ip: + - '10.0.3.26-10.0.3.105' + - '10.0.5.26-10.0.5.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: compute_nodes + type: Node + file: /etc/yardstick/nodes/compute.yaml + + - name: baremetal + type: Node + file: /etc/yardstick/nodes/pod_4p.yaml + + - name: yardstick + image: vrouter_affinity_2c4p + flavor: + vcpus: 9 + ram: 8192 + disk: 10 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + hw:mem_page_size: large + hw:cpu_policy: dedicated + hw:cpu_thread_policy: prefer + hw:numa_nodes: 2 + hw:numa_mempolicy: preffered + hw:numa_cpus.0: 0,1,2,3,4 + hw:numa_cpus.1: 5,6,7,8 + hw:numa_mem.0: 4096 + hw:numa_mem.1: 4096 + user: "root" + password: "password" + placement_groups: + pgrp1: + policy: "availability" + servers: + vnf: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False + enable_dhcp: 'false' + xe1: + cidr: '10.0.3.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant3 + port_security_enabled: False + enable_dhcp: 'false' + xe2: + cidr: '10.0.4.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant4 + port_security_enabled: False + enable_dhcp: 'false' + xe3: + cidr: '10.0.5.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant5 + port_security_enabled: False + enable_dhcp: 'false' diff --git a/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_64B.yaml b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_64B.yaml new file mode 100644 index 000000000..45a8c2c5a --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_heat_external_rfc2544_ipv4_128Kflows_9cores_4ports_64B.yaml @@ -0,0 +1,120 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.baremetal + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: compute_0.compute_nodes + options: + framesize: + uplink: {64B: 100} + downlink: {64B: 100} + flow: + src_ip: + - '10.0.2.26-10.0.2.105' + - '10.0.4.26-10.0.4.105' + dst_ip: + - '10.0.3.26-10.0.3.105' + - '10.0.5.26-10.0.5.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: compute_nodes + type: Node + file: /etc/yardstick/nodes/compute.yaml + + - name: baremetal + type: Node + file: /etc/yardstick/nodes/pod_4p.yaml + + - name: yardstick + image: vrouter_affinity_2c4p + flavor: + vcpus: 9 + ram: 8192 + disk: 10 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + hw:mem_page_size: large + hw:cpu_policy: dedicated + hw:cpu_thread_policy: prefer + hw:numa_nodes: 2 + hw:numa_mempolicy: preffered + hw:numa_cpus.0: 0,1,2,3,4 + hw:numa_cpus.1: 5,6,7,8 + hw:numa_mem.0: 4096 + hw:numa_mem.1: 4096 + user: "root" + password: "password" + placement_groups: + pgrp1: + policy: "availability" + servers: + vnf: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False + enable_dhcp: 'false' + xe1: + cidr: '10.0.3.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant3 + port_security_enabled: False + enable_dhcp: 'false' + xe2: + cidr: '10.0.4.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant4 + port_security_enabled: False + enable_dhcp: 'false' + xe3: + cidr: '10.0.5.0/24' + gateway_ip: 'null' + provider: true + physical_network: phystenant5 + port_security_enabled: False + enable_dhcp: 'false' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_1024B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_1024B_trex.yaml new file mode 100644 index 000000000..b3e4157f5 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_1024B_trex.yaml @@ -0,0 +1,116 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {1024B: 100} + downlink: {1024B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 4 + # override pmd_threads; use specific cpus + pmd_cpu_mask: "0x78" + lcore_mask: "0x4" + ram: + socket_0: 2048 + socket_1: 2048 + queues: 4 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu_5cores.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 5 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='11'/> + <vcpupin vcpu='1' cpuset='12'/> + <vcpupin vcpu='2' cpuset='13'/> + <vcpupin vcpu='3' cpuset='14'/> + <vcpupin vcpu='4' cpuset='15'/> + </cputune>" + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/30' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:1a:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:18:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.100.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_1280B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_1280B_trex.yaml new file mode 100644 index 000000000..6d1353297 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_1280B_trex.yaml @@ -0,0 +1,116 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {1280B: 100} + downlink: {1280B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 4 + # override pmd_threads; Use specific cpus + pmd_cpu_mask: "0x78" + lcore_mask: "0x4" + ram: + socket_0: 2048 + socket_1: 2048 + queues: 4 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu_5cores.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 5 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='11'/> + <vcpupin vcpu='1' cpuset='12'/> + <vcpupin vcpu='2' cpuset='13'/> + <vcpupin vcpu='3' cpuset='14'/> + <vcpupin vcpu='4' cpuset='15'/> + </cputune>" + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:1a:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:18:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.100.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_128B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_128B_trex.yaml new file mode 100644 index 000000000..99e9b8d0e --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_128B_trex.yaml @@ -0,0 +1,116 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {128B: 100} + downlink: {128B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 4 + # override pmd_threads; use specific CPUs + pmd_cpu_mask: "0x78" + lcore_mask: "0x4" + ram: + socket_0: 2048 + socket_1: 2048 + queues: 4 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu_5cores.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 5 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='11'/> + <vcpupin vcpu='1' cpuset='12'/> + <vcpupin vcpu='2' cpuset='13'/> + <vcpupin vcpu='3' cpuset='14'/> + <vcpupin vcpu='4' cpuset='15'/> + </cputune>" + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:1a:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:18:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.100.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_1518B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_1518B_trex.yaml new file mode 100644 index 000000000..1a1be3732 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_1518B_trex.yaml @@ -0,0 +1,115 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {1518B: 100} + downlink: {1518B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 2 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 4 + pmd_cpu_mask: "0x78" + lcore_mask: "0x4" + ram: + socket_0: 2048 + socket_1: 2048 + queues: 4 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu_5cores.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 5 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='11'/> + <vcpupin vcpu='1' cpuset='12'/> + <vcpupin vcpu='2' cpuset='13'/> + <vcpupin vcpu='3' cpuset='14'/> + <vcpupin vcpu='4' cpuset='15'/> + </cputune>" + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:1a:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:18:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_256B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_256B_trex.yaml new file mode 100644 index 000000000..6c30b621e --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_256B_trex.yaml @@ -0,0 +1,116 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {256B: 100} + downlink: {256B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 4 + # override pmd_threads to use specific cpus + pmd_cpu_mask: "0x78" + lcore_mask: "0x4" + ram: + socket_0: 2048 + socket_1: 2048 + queues: 4 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu_5cores.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 5 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='11'/> + <vcpupin vcpu='1' cpuset='12'/> + <vcpupin vcpu='2' cpuset='13'/> + <vcpupin vcpu='3' cpuset='14'/> + <vcpupin vcpu='4' cpuset='15'/> + </cputune>" + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:1a:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:18:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.100.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_512B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_512B_trex.yaml new file mode 100644 index 000000000..ddb59cbe6 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_512B_trex.yaml @@ -0,0 +1,116 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {512B: 100} + downlink: {512B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 4 + # override pmd_threads to use specific cpus + pmd_cpu_mask: "0x78" + lcore_mask: "0x4" + ram: + socket_0: 2048 + socket_1: 2048 + queues: 4 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu_5cores.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 5 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='11'/> + <vcpupin vcpu='1' cpuset='12'/> + <vcpupin vcpu='2' cpuset='13'/> + <vcpupin vcpu='3' cpuset='14'/> + <vcpupin vcpu='4' cpuset='15'/> + </cputune>" + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:1a:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:18:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.100.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_64B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_64B_trex.yaml new file mode 100644 index 000000000..c141f4e57 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_5cores_2ports_64B_trex.yaml @@ -0,0 +1,116 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {64B: 100} + downlink: {64B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 4 + # override pmd_threads to use specific cpus + pmd_cpu_mask: "0x78" + lcore_mask: "0x4" + ram: + socket_0: 2048 + socket_1: 2048 + queues: 4 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu_5cores.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 5 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='11'/> + <vcpupin vcpu='1' cpuset='12'/> + <vcpupin vcpu='2' cpuset='13'/> + <vcpupin vcpu='3' cpuset='14'/> + <vcpupin vcpu='4' cpuset='15'/> + </cputune>" + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:1a:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:18:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.100.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_1024B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_1024B_trex.yaml new file mode 100644 index 000000000..bfa5ba4f0 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_1024B_trex.yaml @@ -0,0 +1,106 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {1024B: 100} + downlink: {1024B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 4 + ram: + socket_0: 2048 + socket_1: 2048 + queues: 4 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 7 + hw:cpu_threads: 1 + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/30' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:1a:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:18:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.100.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_1280B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_1280B_trex.yaml new file mode 100644 index 000000000..ea5fb16a9 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_1280B_trex.yaml @@ -0,0 +1,106 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {1280B: 100} + downlink: {1280B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 4 + ram: + socket_0: 2048 + socket_1: 2048 + queues: 4 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 7 + hw:cpu_threads: 1 + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:1a:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:18:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.100.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_128B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_128B_trex.yaml new file mode 100644 index 000000000..fea64f5e7 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_128B_trex.yaml @@ -0,0 +1,106 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {128B: 100} + downlink: {128B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 4 + ram: + socket_0: 2048 + socket_1: 2048 + queues: 4 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 7 + hw:cpu_threads: 1 + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:1a:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:18:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.100.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_1518B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_1518B_trex.yaml new file mode 100644 index 000000000..ac38751e9 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_1518B_trex.yaml @@ -0,0 +1,106 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {1518B: 100} + downlink: {1518B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 4 + ram: + socket_0: 2048 + socket_1: 2048 + queues: 4 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 7 + hw:cpu_threads: 1 + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:1a:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:18:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_256B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_256B_trex.yaml new file mode 100644 index 000000000..145f69d89 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_256B_trex.yaml @@ -0,0 +1,106 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {256B: 100} + downlink: {256B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 4 + ram: + socket_0: 2048 + socket_1: 2048 + queues: 4 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 7 + hw:cpu_threads: 1 + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:1a:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:18:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.100.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_512B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_512B_trex.yaml new file mode 100644 index 000000000..6417d9342 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_512B_trex.yaml @@ -0,0 +1,106 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {512B: 100} + downlink: {512B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 4 + ram: + socket_0: 2048 + socket_1: 2048 + queues: 4 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 7 + hw:cpu_threads: 1 + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:1a:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:18:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.100.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_64B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_64B_trex.yaml new file mode 100644 index 000000000..ae46b865f --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_7cores_2ports_64B_trex.yaml @@ -0,0 +1,106 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {64B: 100} + downlink: {64B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 7 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 4 + ram: + socket_0: 2048 + socket_1: 2048 + queues: 4 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 7 + hw:cpu_threads: 1 + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:1a:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:18:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.100.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_1024B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_1024B_trex.yaml new file mode 100644 index 000000000..d947e254f --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_1024B_trex.yaml @@ -0,0 +1,141 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput-2.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {1024B: 100} + downlink: {1024B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 8 + # override pmd_threads to use NUMA 1 vcpus + pmd_cpu_mask: "0x3FC00000" + lcore_mask: "0x200000" + ram: + socket_0: 0 + socket_1: 4096 + queues: 2 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu_9cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='31'/> + <vcpupin vcpu='1' cpuset='32'/> + <vcpupin vcpu='2' cpuset='33'/> + <vcpupin vcpu='3' cpuset='34'/> + <vcpupin vcpu='4' cpuset='35'/> + <vcpupin vcpu='5' cpuset='36'/> + <vcpupin vcpu='6' cpuset='37'/> + <vcpupin vcpu='7' cpuset='38'/> + <vcpupin vcpu='8' cpuset='39'/> + <emulatorpin cpuset='31-39'/> + </cputune>" + + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + port_num: 2 + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + port_num: 3 + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_1280B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_1280B_trex.yaml new file mode 100644 index 000000000..0467436ba --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_1280B_trex.yaml @@ -0,0 +1,141 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput-2.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {1280B: 100} + downlink: {1280B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 8 + # override pmd_threads to use NUMA 1 vcpus + pmd_cpu_mask: "0x3FC00000" + lcore_mask: "0x200000" + ram: + socket_0: 0 + socket_1: 4096 + queues: 2 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu_9cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='31'/> + <vcpupin vcpu='1' cpuset='32'/> + <vcpupin vcpu='2' cpuset='33'/> + <vcpupin vcpu='3' cpuset='34'/> + <vcpupin vcpu='4' cpuset='35'/> + <vcpupin vcpu='5' cpuset='36'/> + <vcpupin vcpu='6' cpuset='37'/> + <vcpupin vcpu='7' cpuset='38'/> + <vcpupin vcpu='8' cpuset='39'/> + <emulatorpin cpuset='31-39'/> + </cputune>" + + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + #gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + #gateway_ip: '152.16.40.20' + uplink_1: + port_num: 2 + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + port_num: 3 + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_128B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_128B_trex.yaml new file mode 100644 index 000000000..30119c76d --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_128B_trex.yaml @@ -0,0 +1,141 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput-2.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {128B: 100} + downlink: {128B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 8 + # override pmd_threads to use NUMA 1 vcpus + pmd_cpu_mask: "0x3FC00000" + lcore_mask: "0x200000" + ram: + socket_0: 0 + socket_1: 4096 + queues: 2 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu_9cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='31'/> + <vcpupin vcpu='1' cpuset='32'/> + <vcpupin vcpu='2' cpuset='33'/> + <vcpupin vcpu='3' cpuset='34'/> + <vcpupin vcpu='4' cpuset='35'/> + <vcpupin vcpu='5' cpuset='36'/> + <vcpupin vcpu='6' cpuset='37'/> + <vcpupin vcpu='7' cpuset='38'/> + <vcpupin vcpu='8' cpuset='39'/> + <emulatorpin cpuset='31-39'/> + </cputune>" + + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + port_num: 2 + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + port_num: 3 + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_1518B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_1518B_trex.yaml new file mode 100644 index 000000000..ac52c29c5 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_1518B_trex.yaml @@ -0,0 +1,142 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput-2.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {1518B: 100} + downlink: {1518B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 5 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 8 + # override pmd_threads to use NUMA 1 vcpus + # 8 cores (CPU 22-29) in NUMA 1 of a 2 socket 20 cpus per socket + pmd_cpu_mask: "0x3FC00000" + lcore_mask: "0x200000" + ram: + socket_0: 0 + socket_1: 4096 + queues: 2 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu_9cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='31'/> + <vcpupin vcpu='1' cpuset='32'/> + <vcpupin vcpu='2' cpuset='33'/> + <vcpupin vcpu='3' cpuset='34'/> + <vcpupin vcpu='4' cpuset='35'/> + <vcpupin vcpu='5' cpuset='36'/> + <vcpupin vcpu='6' cpuset='37'/> + <vcpupin vcpu='7' cpuset='38'/> + <vcpupin vcpu='8' cpuset='39'/> + <emulatorpin cpuset='31-39'/> + </cputune>" + + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + port_num: 2 + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + port_num: 3 + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_256B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_256B_trex.yaml new file mode 100644 index 000000000..2767851a6 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_256B_trex.yaml @@ -0,0 +1,141 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput-2.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {256B: 100} + downlink: {256B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 8 + # override pmd_threads to use NUMA 1 vcpus + pmd_cpu_mask: "0x3FC00000" + lcore_mask: "0x200000" + ram: + socket_0: 0 + socket_1: 4096 + queues: 2 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu_9cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='31'/> + <vcpupin vcpu='1' cpuset='32'/> + <vcpupin vcpu='2' cpuset='33'/> + <vcpupin vcpu='3' cpuset='34'/> + <vcpupin vcpu='4' cpuset='35'/> + <vcpupin vcpu='5' cpuset='36'/> + <vcpupin vcpu='6' cpuset='37'/> + <vcpupin vcpu='7' cpuset='38'/> + <vcpupin vcpu='8' cpuset='39'/> + <emulatorpin cpuset='31-39'/> + </cputune>" + + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + port_num: 2 + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + port_num: 3 + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_512B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_512B_trex.yaml new file mode 100644 index 000000000..006718fa2 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_512B_trex.yaml @@ -0,0 +1,141 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput-2.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {512B: 100} + downlink: {512B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 8 + # override pmd_threads to use NUMA 1 vcpus + pmd_cpu_mask: "0x3FC00000" + lcore_mask: "0x200000" + ram: + socket_0: 0 + socket_1: 4096 + queues: 2 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu_9cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='31'/> + <vcpupin vcpu='1' cpuset='32'/> + <vcpupin vcpu='2' cpuset='33'/> + <vcpupin vcpu='3' cpuset='34'/> + <vcpupin vcpu='4' cpuset='35'/> + <vcpupin vcpu='5' cpuset='36'/> + <vcpupin vcpu='6' cpuset='37'/> + <vcpupin vcpu='7' cpuset='38'/> + <vcpupin vcpu='8' cpuset='39'/> + <emulatorpin cpuset='31-39'/> + </cputune>" + + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + port_num: 2 + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + port_num: 3 + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' diff --git a/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_64B_trex.yaml b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_64B_trex.yaml new file mode 100644 index 000000000..601d30891 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_ovs_rfc2544_ipv4_128Kflows_9cores_4ports_64B_trex.yaml @@ -0,0 +1,140 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput-2.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: ovs_dpdk.yardstick + options: + framesize: + uplink: {64B: 100} + downlink: {64B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + + - name: yardstick + type: StandaloneOvsDpdk + file: /etc/yardstick/nodes/standalone/pod_ovs.yaml + vm_deploy: True + ovs_properties: + version: + ovs: 2.7.0 + dpdk: 16.11.1 + pmd_threads: 8 + # override pmd_threads to use NUMA 1 vcpus + pmd_cpu_mask: "0x3FC00000" + lcore_mask: "0x200000" + ram: + socket_0: 0 + socket_1: 4096 + queues: 2 + vpath: "/usr/local" + + flavor: + images: "/var/lib/libvirt/images/ubuntu_9cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='31'/> + <vcpupin vcpu='1' cpuset='32'/> + <vcpupin vcpu='2' cpuset='33'/> + <vcpupin vcpu='3' cpuset='34'/> + <vcpupin vcpu='4' cpuset='35'/> + <vcpupin vcpu='5' cpuset='36'/> + <vcpupin vcpu='6' cpuset='37'/> + <vcpupin vcpu='7' cpuset='38'/> + <vcpupin vcpu='8' cpuset='39'/> + <emulatorpin cpuset='31-39'/> + </cputune>" + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + port_num: 0 + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + port_num: 1 + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + port_num: 2 + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + port_num: 3 + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_1024B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_1024B_trex.yaml new file mode 100644 index 000000000..18e25e25d --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_1024B_trex.yaml @@ -0,0 +1,125 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: sriov.yardstick + options: + framesize: + uplink: {1024B: 100} + downlink: {1024B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + - type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + name: yardstick + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu_13cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 13 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='27'/> + <vcpupin vcpu='1' cpuset='28'/> + <vcpupin vcpu='2' cpuset='29'/> + <vcpupin vcpu='3' cpuset='30'/> + <vcpupin vcpu='4' cpuset='31'/> + <vcpupin vcpu='5' cpuset='32'/> + <vcpupin vcpu='6' cpuset='33'/> + <vcpupin vcpu='7' cpuset='34'/> + <vcpupin vcpu='8' cpuset='35'/> + <vcpupin vcpu='9' cpuset='36'/> + <vcpupin vcpu='10' cpuset='37'/> + <vcpupin vcpu='11' cpuset='38'/> + <vcpupin vcpu='12' cpuset='39'/> + <emulatorpin cpuset='27-39'/> + </cputune>" + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' + diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_1280B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_1280B_trex.yaml new file mode 100644 index 000000000..bfaf74b5c --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_1280B_trex.yaml @@ -0,0 +1,125 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: sriov.yardstick + options: + framesize: + uplink: {1280B: 100} + downlink: {1280B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + - type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + name: yardstick + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu_13cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 13 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='27'/> + <vcpupin vcpu='1' cpuset='28'/> + <vcpupin vcpu='2' cpuset='29'/> + <vcpupin vcpu='3' cpuset='30'/> + <vcpupin vcpu='4' cpuset='31'/> + <vcpupin vcpu='5' cpuset='32'/> + <vcpupin vcpu='6' cpuset='33'/> + <vcpupin vcpu='7' cpuset='34'/> + <vcpupin vcpu='8' cpuset='35'/> + <vcpupin vcpu='9' cpuset='36'/> + <vcpupin vcpu='10' cpuset='37'/> + <vcpupin vcpu='11' cpuset='38'/> + <vcpupin vcpu='12' cpuset='39'/> + <emulatorpin cpuset='27-39'/> + </cputune>" + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' + diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_128B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_128B_trex.yaml new file mode 100644 index 000000000..529c8a5ef --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_128B_trex.yaml @@ -0,0 +1,125 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: sriov.yardstick + options: + framesize: + uplink: {128B: 100} + downlink: {128B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + - type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + name: yardstick + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu_13cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 13 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='27'/> + <vcpupin vcpu='1' cpuset='28'/> + <vcpupin vcpu='2' cpuset='29'/> + <vcpupin vcpu='3' cpuset='30'/> + <vcpupin vcpu='4' cpuset='31'/> + <vcpupin vcpu='5' cpuset='32'/> + <vcpupin vcpu='6' cpuset='33'/> + <vcpupin vcpu='7' cpuset='34'/> + <vcpupin vcpu='8' cpuset='35'/> + <vcpupin vcpu='9' cpuset='36'/> + <vcpupin vcpu='10' cpuset='37'/> + <vcpupin vcpu='11' cpuset='38'/> + <vcpupin vcpu='12' cpuset='39'/> + <emulatorpin cpuset='27-39'/> + </cputune>" + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' + diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_1518B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_1518B_trex.yaml new file mode 100644 index 000000000..0d2cdfbc0 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_1518B_trex.yaml @@ -0,0 +1,125 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: sriov.yardstick + options: + framesize: + uplink: {1518B: 100} + downlink: {1518B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + - type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + name: yardstick + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu_13cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 13 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='27'/> + <vcpupin vcpu='1' cpuset='28'/> + <vcpupin vcpu='2' cpuset='29'/> + <vcpupin vcpu='3' cpuset='30'/> + <vcpupin vcpu='4' cpuset='31'/> + <vcpupin vcpu='5' cpuset='32'/> + <vcpupin vcpu='6' cpuset='33'/> + <vcpupin vcpu='7' cpuset='34'/> + <vcpupin vcpu='8' cpuset='35'/> + <vcpupin vcpu='9' cpuset='36'/> + <vcpupin vcpu='10' cpuset='37'/> + <vcpupin vcpu='11' cpuset='38'/> + <vcpupin vcpu='12' cpuset='39'/> + <emulatorpin cpuset='27-39'/> + </cputune>" + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' + diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_256B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_256B_trex.yaml new file mode 100644 index 000000000..9e1e8ebd3 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_256B_trex.yaml @@ -0,0 +1,125 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: sriov.yardstick + options: + framesize: + uplink: {256B: 100} + downlink: {256B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + - type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + name: yardstick + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu_13cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 13 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='27'/> + <vcpupin vcpu='1' cpuset='28'/> + <vcpupin vcpu='2' cpuset='29'/> + <vcpupin vcpu='3' cpuset='30'/> + <vcpupin vcpu='4' cpuset='31'/> + <vcpupin vcpu='5' cpuset='32'/> + <vcpupin vcpu='6' cpuset='33'/> + <vcpupin vcpu='7' cpuset='34'/> + <vcpupin vcpu='8' cpuset='35'/> + <vcpupin vcpu='9' cpuset='36'/> + <vcpupin vcpu='10' cpuset='37'/> + <vcpupin vcpu='11' cpuset='38'/> + <vcpupin vcpu='12' cpuset='39'/> + <emulatorpin cpuset='27-39'/> + </cputune>" + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' + diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_512B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_512B_trex.yaml new file mode 100644 index 000000000..4b3fbe4b3 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_512B_trex.yaml @@ -0,0 +1,125 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: sriov.yardstick + options: + framesize: + uplink: {512B: 100} + downlink: {512B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + - type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + name: yardstick + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu_13cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 13 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='27'/> + <vcpupin vcpu='1' cpuset='28'/> + <vcpupin vcpu='2' cpuset='29'/> + <vcpupin vcpu='3' cpuset='30'/> + <vcpupin vcpu='4' cpuset='31'/> + <vcpupin vcpu='5' cpuset='32'/> + <vcpupin vcpu='6' cpuset='33'/> + <vcpupin vcpu='7' cpuset='34'/> + <vcpupin vcpu='8' cpuset='35'/> + <vcpupin vcpu='9' cpuset='36'/> + <vcpupin vcpu='10' cpuset='37'/> + <vcpupin vcpu='11' cpuset='38'/> + <vcpupin vcpu='12' cpuset='39'/> + <emulatorpin cpuset='27-39'/> + </cputune>" + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' + diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_64B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_64B_trex.yaml new file mode 100644 index 000000000..d23ab4e69 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_4ports_64B_trex.yaml @@ -0,0 +1,125 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: sriov.yardstick + options: + framesize: + uplink: {64B: 100} + downlink: {64B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + - type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + name: yardstick + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu_13cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 13 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='27'/> + <vcpupin vcpu='1' cpuset='28'/> + <vcpupin vcpu='2' cpuset='29'/> + <vcpupin vcpu='3' cpuset='30'/> + <vcpupin vcpu='4' cpuset='31'/> + <vcpupin vcpu='5' cpuset='32'/> + <vcpupin vcpu='6' cpuset='33'/> + <vcpupin vcpu='7' cpuset='34'/> + <vcpupin vcpu='8' cpuset='35'/> + <vcpupin vcpu='9' cpuset='36'/> + <vcpupin vcpu='10' cpuset='37'/> + <vcpupin vcpu='11' cpuset='38'/> + <vcpupin vcpu='12' cpuset='39'/> + <emulatorpin cpuset='27-39'/> + </cputune>" + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' + diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_6ports_1518B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_6ports_1518B_trex.yaml new file mode 100644 index 000000000..0353b3875 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_13cores_6ports_1518B_trex.yaml @@ -0,0 +1,141 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput-3.yaml + topology: router-tg-topology-6port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: sriov.yardstick + options: + framesize: + uplink: {1518B: 100} + downlink: {1518B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + - '152.16.102.26-152.16.102.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + - '152.16.42.26-152.16.42.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_6ports.yaml + - type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + name: yardstick + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu_13cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 13 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='27'/> + <vcpupin vcpu='1' cpuset='28'/> + <vcpupin vcpu='2' cpuset='29'/> + <vcpupin vcpu='3' cpuset='30'/> + <vcpupin vcpu='4' cpuset='31'/> + <vcpupin vcpu='5' cpuset='32'/> + <vcpupin vcpu='6' cpuset='33'/> + <vcpupin vcpu='7' cpuset='34'/> + <vcpupin vcpu='8' cpuset='35'/> + <vcpupin vcpu='9' cpuset='36'/> + <vcpupin vcpu='10' cpuset='37'/> + <vcpupin vcpu='11' cpuset='38'/> + <vcpupin vcpu='12' cpuset='39'/> + <emulatorpin cpuset='27-39'/> + </cputune>" + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + xe4: + - uplink_2 + xe5: + - downlink_2 + networks: + uplink_0: + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + phy_port: "0000:81:00.1" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' + uplink_2: + phy_port: "0000:86:00.0" + vpci: "0000:00:0b.0" + cidr: '152.16.102.19/24' + gateway_ip: '152.16.102.20' + downlink_2: + phy_port: "0000:86:00.1" + vpci: "0000:00:0c.0" + cidr: '152.16.42.19/24' + gateway_ip: '152.16.42.20' + diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_1024B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_1024B_trex.yaml new file mode 100644 index 000000000..4fa22975f --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_1024B_trex.yaml @@ -0,0 +1,93 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick + cpt__0: sriov.yardstick + options: + framesize: + uplink: {1024B: 100} + downlink: {1024B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 4 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 6 + hw:cpu_threads: 2 + user: "root" + password: "password" + servers: + vnf: + network_ports: + mgmt: + ip: '192.168.18.185' + cidr: '192.168.18.185/30' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + phy_port: "0000:07:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:07:00.1" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_1280B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_1280B_trex.yaml new file mode 100644 index 000000000..a7acbafdd --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_1280B_trex.yaml @@ -0,0 +1,93 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick + cpt__0: sriov.yardstick + options: + framesize: + uplink: {1280B: 100} + downlink: {1280B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 4 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 7 + hw:cpu_threads: 1 + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '192.168.18.185' + cidr: '192.168.18.185/30' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + phy_port: "0000:07:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:07:00.1" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_128B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_128B_trex.yaml new file mode 100644 index 000000000..121aaec4b --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_128B_trex.yaml @@ -0,0 +1,93 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick + cpt__0: sriov.yardstick + options: + framesize: + uplink: {128B: 100} + downlink: {128B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 4 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 7 + hw:cpu_threads: 1 + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '192.168.18.185' + cidr: '192.168.18.185/30' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + phy_port: "0000:07:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:07:00.1" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.100.20' diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_1518B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_1518B_trex.yaml new file mode 100644 index 000000000..6e856c80e --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_1518B_trex.yaml @@ -0,0 +1,93 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick + cpt__0: sriov.yardstick + options: + framesize: + uplink: {1518B: 100} + downlink: {1518B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 4 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 7 + hw:cpu_threads: 1 + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '192.168.18.185' + cidr: '192.168.18.185/30' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + phy_port: "0000:07:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:07:00.1" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_256B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_256B_trex.yaml new file mode 100644 index 000000000..54a26bc49 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_256B_trex.yaml @@ -0,0 +1,92 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick + cpt__0: sriov.yardstick + options: + framesize: + uplink: {256B: 100} + downlink: {256B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 4 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 7 + hw:cpu_threads: 1 + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '192.168.18.185' + cidr: '192.168.18.185/30' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + phy_port: "0000:07:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:07:00.1" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.100.20' diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_512B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_512B_trex.yaml new file mode 100644 index 000000000..1ed39c236 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_512B_trex.yaml @@ -0,0 +1,93 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick + cpt__0: sriov.yardstick + options: + framesize: + uplink: {512B: 100} + downlink: {512B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 4 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 7 + hw:cpu_threads: 1 + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '192.168.18.185' + cidr: '192.168.18.185/30' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + phy_port: "0000:07:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:07:00.1" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.100.20' diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_64B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_64B_trex.yaml new file mode 100644 index 000000000..c128df37b --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_7cores_2ports_64B_trex.yaml @@ -0,0 +1,92 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick + cpt__0: sriov.yardstick + options: + framesize: + uplink: {64B: 100} + downlink: {64B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 4 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex.yaml + + - name: yardstick + type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu.qcow2" + ram: 4096 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 7 + hw:cpu_threads: 1 + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '192.168.18.185' + cidr: '192.168.18.185/30' + xe0: + - uplink_0 + xe1: + - downlink_0 + networks: + uplink_0: + phy_port: "0000:07:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:07:00.1" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.100.20' diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_1024B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_1024B_trex.yaml new file mode 100644 index 000000000..7be7c991c --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_1024B_trex.yaml @@ -0,0 +1,121 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: sriov.yardstick + options: + framesize: + uplink: {1024B: 100} + downlink: {1024B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + - type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + name: yardstick + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu_9cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='31'/> + <vcpupin vcpu='1' cpuset='32'/> + <vcpupin vcpu='2' cpuset='33'/> + <vcpupin vcpu='3' cpuset='34'/> + <vcpupin vcpu='4' cpuset='35'/> + <vcpupin vcpu='5' cpuset='36'/> + <vcpupin vcpu='6' cpuset='37'/> + <vcpupin vcpu='7' cpuset='38'/> + <vcpupin vcpu='8' cpuset='39'/> + <emulatorpin cpuset='31-39'/> + </cputune>" + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' + diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_1280B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_1280B_trex.yaml new file mode 100644 index 000000000..cf73e1690 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_1280B_trex.yaml @@ -0,0 +1,121 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: sriov.yardstick + options: + framesize: + uplink: {1280B: 100} + downlink: {1280B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + - type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + name: yardstick + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu_9cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='31'/> + <vcpupin vcpu='1' cpuset='32'/> + <vcpupin vcpu='2' cpuset='33'/> + <vcpupin vcpu='3' cpuset='34'/> + <vcpupin vcpu='4' cpuset='35'/> + <vcpupin vcpu='5' cpuset='36'/> + <vcpupin vcpu='6' cpuset='37'/> + <vcpupin vcpu='7' cpuset='38'/> + <vcpupin vcpu='8' cpuset='39'/> + <emulatorpin cpuset='31-39'/> + </cputune>" + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' + diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_128B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_128B_trex.yaml new file mode 100644 index 000000000..493acb20b --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_128B_trex.yaml @@ -0,0 +1,121 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: sriov.yardstick + options: + framesize: + uplink: {128B: 100} + downlink: {128B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + - type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + name: yardstick + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu_9cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='31'/> + <vcpupin vcpu='1' cpuset='32'/> + <vcpupin vcpu='2' cpuset='33'/> + <vcpupin vcpu='3' cpuset='34'/> + <vcpupin vcpu='4' cpuset='35'/> + <vcpupin vcpu='5' cpuset='36'/> + <vcpupin vcpu='6' cpuset='37'/> + <vcpupin vcpu='7' cpuset='38'/> + <vcpupin vcpu='8' cpuset='39'/> + <emulatorpin cpuset='31-39'/> + </cputune>" + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' + diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_1518B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_1518B_trex.yaml new file mode 100644 index 000000000..6a88e3b8c --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_1518B_trex.yaml @@ -0,0 +1,121 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: sriov.yardstick + options: + framesize: + uplink: {1518B: 100} + downlink: {1518B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + - type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + name: yardstick + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu_9cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='31'/> + <vcpupin vcpu='1' cpuset='32'/> + <vcpupin vcpu='2' cpuset='33'/> + <vcpupin vcpu='3' cpuset='34'/> + <vcpupin vcpu='4' cpuset='35'/> + <vcpupin vcpu='5' cpuset='36'/> + <vcpupin vcpu='6' cpuset='37'/> + <vcpupin vcpu='7' cpuset='38'/> + <vcpupin vcpu='8' cpuset='39'/> + <emulatorpin cpuset='31-39'/> + </cputune>" + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' + diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_256B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_256B_trex.yaml new file mode 100644 index 000000000..79aba6043 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_256B_trex.yaml @@ -0,0 +1,121 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: sriov.yardstick + options: + framesize: + uplink: {256B: 100} + downlink: {256B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + - type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + name: yardstick + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu_9cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='31'/> + <vcpupin vcpu='1' cpuset='32'/> + <vcpupin vcpu='2' cpuset='33'/> + <vcpupin vcpu='3' cpuset='34'/> + <vcpupin vcpu='4' cpuset='35'/> + <vcpupin vcpu='5' cpuset='36'/> + <vcpupin vcpu='6' cpuset='37'/> + <vcpupin vcpu='7' cpuset='38'/> + <vcpupin vcpu='8' cpuset='39'/> + <emulatorpin cpuset='31-39'/> + </cputune>" + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' + diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_512B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_512B_trex.yaml new file mode 100644 index 000000000..f83c78872 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_512B_trex.yaml @@ -0,0 +1,121 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: sriov.yardstick + options: + framesize: + uplink: {512B: 100} + downlink: {512B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + - type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + name: yardstick + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu_9cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='31'/> + <vcpupin vcpu='1' cpuset='32'/> + <vcpupin vcpu='2' cpuset='33'/> + <vcpupin vcpu='3' cpuset='34'/> + <vcpupin vcpu='4' cpuset='35'/> + <vcpupin vcpu='5' cpuset='36'/> + <vcpupin vcpu='6' cpuset='37'/> + <vcpupin vcpu='7' cpuset='38'/> + <vcpupin vcpu='8' cpuset='39'/> + <emulatorpin cpuset='31-39'/> + </cputune>" + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' + diff --git a/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_64B_trex.yaml b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_64B_trex.yaml new file mode 100644 index 000000000..2c4397233 --- /dev/null +++ b/samples/vnf_samples/nsut/router/tc_sriov_rfc2544_ipv4_128Kflows_9cores_4ports_64B_trex.yaml @@ -0,0 +1,121 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ipv4_throughput.yaml + topology: router-tg-topology-4port.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick +# Required for enabling NFVi collection + cpt__0: sriov.yardstick + options: + framesize: + uplink: {64B: 100} + downlink: {64B: 100} + flow: + src_ip: + - '152.16.100.26-152.16.100.105' + - '152.16.101.26-152.16.101.105' + dst_ip: + - '152.16.40.26-152.16.40.105' + - '152.16.41.26-152.16.41.105' + src_port: + - '1234-1238' + dst_port: + - '2001-2004' + count: 128000 + traffic_type: 4 + rfc2544: + allowed_drop_rate: 0.0001 - 0.1 + tg__0: + queues_per_port: 8 + vnf__0: + nfvi_enable: True + runner: + type: Iteration + iterations: 10 + interval: 35 +contexts: + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + - name: yardstick + type: Node + file: /etc/yardstick/nodes/standalone/pod_trex_4ports.yaml + - type: StandaloneSriov + file: /etc/yardstick/nodes/standalone/host_sriov.yaml + name: yardstick + vm_deploy: True + flavor: + images: "/var/lib/libvirt/images/ubuntu_9cores.qcow2" + ram: 4096 + hw_socket: 1 + extra_specs: + hw:cpu_sockets: 1 + hw:cpu_cores: 9 + hw:cpu_threads: 1 + cputune: "<cputune> + <vcpupin vcpu='0' cpuset='31'/> + <vcpupin vcpu='1' cpuset='32'/> + <vcpupin vcpu='2' cpuset='33'/> + <vcpupin vcpu='3' cpuset='34'/> + <vcpupin vcpu='4' cpuset='35'/> + <vcpupin vcpu='5' cpuset='36'/> + <vcpupin vcpu='6' cpuset='37'/> + <vcpupin vcpu='7' cpuset='38'/> + <vcpupin vcpu='8' cpuset='39'/> + <emulatorpin cpuset='31-39'/> + </cputune>" + user: root + password: password + servers: + vnf: + network_ports: + mgmt: + ip: '10.166.31.252' + cidr: '10.166.31.252/28' + xe0: + - uplink_0 + xe1: + - downlink_0 + xe2: + - uplink_1 + xe3: + - downlink_1 + networks: + uplink_0: + phy_port: "0000:88:00.0" + vpci: "0000:00:07.0" + cidr: '152.16.100.19/24' + gateway_ip: '152.16.100.20' + downlink_0: + phy_port: "0000:d8:00.0" + vpci: "0000:00:08.0" + cidr: '152.16.40.19/24' + gateway_ip: '152.16.40.20' + uplink_1: + phy_port: "0000:81:00.0" + vpci: "0000:00:09.0" + cidr: '152.16.101.19/24' + gateway_ip: '152.16.101.20' + downlink_1: + phy_port: "0000:86:00.0" + vpci: "0000:00:0a.0" + cidr: '152.16.41.19/24' + gateway_ip: '152.16.41.20' + diff --git a/samples/vnf_samples/nsut/vfw/tc_baremetal_http_ixload_1024k_Requests-65000_Concurrency.yaml b/samples/vnf_samples/nsut/vfw/tc_baremetal_http_ixload_1024k_Requests-65000_Concurrency.yaml new file mode 100644 index 000000000..a87996c1a --- /dev/null +++ b/samples/vnf_samples/nsut/vfw/tc_baremetal_http_ixload_1024k_Requests-65000_Concurrency.yaml @@ -0,0 +1,44 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: "../../traffic_profiles/http_tests/HTTP_1024k-requests_65000_concurrency.yaml" + topology: vfw_vnf_topology_ixload.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick + options: + framesize: + uplink: {64B: 100} + downlink: {64B: 100} + 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: Duration + duration: 2 + ixia_profile: ../../traffic_profiles/vfw/HTTP-vFW_IPv4_2Ports.rxf # Need vlan update +context: + type: Node + name: yardstick + nfvi_type: baremetal + file: /etc/yardstick/nodes/pod_ixia.yaml + diff --git a/samples/vnf_samples/nsut/prox/ovs-dpdk/throughput/tc_ipv4_1rule_1flow_1518B_packetsize.yaml b/samples/vnf_samples/nsut/vfw/tc_baremetal_http_ixload_256k_Requests-65000_Concurrency.yaml index 0ca0005b2..82cdd6210 100644 --- a/samples/vnf_samples/nsut/prox/ovs-dpdk/throughput/tc_ipv4_1rule_1flow_1518B_packetsize.yaml +++ b/samples/vnf_samples/nsut/vfw/tc_baremetal_http_ixload_256k_Requests-65000_Concurrency.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Intel Corporation +# Copyright (c) 2016-2017 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,30 +16,29 @@ schema: yardstick:task:0.1 scenarios: - type: NSPerf - traffic_profile: "../../../../traffic_profiles/ipv4_throughput.yaml" - topology: ../../acl-tg-topology.yaml + traffic_profile: "../../traffic_profiles/http_tests/HTTP_256k-requests_65000_concurrency.yaml" + topology: vfw_vnf_topology_ixload.yaml nodes: tg__0: trafficgen_1.yardstick vnf__0: vnf.yardstick - tg__1: trafficgen_2.yardstick - tc_options: - rfc2544: - allowed_drop_rate: 0.8 - 1 options: - acl: - rules: ../../acl_1rule.yaml - cfg: "../../acl_config" - script: "../../acl_script" + framesize: + uplink: {64B: 100} + downlink: {64B: 100} + 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: Duration - duration: 400 - interval: 35 - traffic_options: - flow: "../../../../traffic_profiles/ipv4_1flow_Packets.yaml" - imix: "../../../../traffic_profiles/imix_storage.yaml" + duration: 2 + ixia_profile: ../../traffic_profiles/vfw/HTTP-vFW_IPv4_2Ports.rxf # Need vlan update context: - type: Node-ovs + type: Node name: yardstick - nfvi_type: ovs - vm_deploy: True - file: /etc/yardstick/nodes/pod_ovs.yaml + nfvi_type: baremetal + file: /etc/yardstick/nodes/pod_ixia.yaml + diff --git a/samples/vnf_samples/nsut/prox/ovs-dpdk/throughput/tc_ipv4_1rule_1flow_64B_packetsize.yaml b/samples/vnf_samples/nsut/vfw/tc_baremetal_http_ixload_4k_Requests-65000_Concurrency.yaml index d51b42f84..00131b5f9 100644 --- a/samples/vnf_samples/nsut/prox/ovs-dpdk/throughput/tc_ipv4_1rule_1flow_64B_packetsize.yaml +++ b/samples/vnf_samples/nsut/vfw/tc_baremetal_http_ixload_4k_Requests-65000_Concurrency.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Intel Corporation +# Copyright (c) 2016-2017 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,30 +16,29 @@ schema: yardstick:task:0.1 scenarios: - type: NSPerf - traffic_profile: "../../../../traffic_profiles/ipv4_throughput.yaml" - topology: ../../acl-tg-topology.yaml + traffic_profile: "../../traffic_profiles/http_tests/HTTP_4k-requests_65000_concurrency.yaml" + topology: vfw_vnf_topology_ixload.yaml nodes: tg__0: trafficgen_1.yardstick vnf__0: vnf.yardstick - tg__1: trafficgen_2.yardstick - tc_options: - rfc2544: - allowed_drop_rate: 0.8 - 1 options: - acl: - rules: ../../acl_1rule.yaml - cfg: "../../acl_config" - script: "../../acl_script" + framesize: + uplink: {64B: 100} + downlink: {64B: 100} + 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: Duration - duration: 400 - interval: 35 - traffic_options: - flow: "../../../../traffic_profiles/ipv4_1flow_Packets.yaml" - imix: "../../../../traffic_profiles/imix_voice.yaml" + duration: 2 + ixia_profile: ../../traffic_profiles/vfw/HTTP-vFW_IPv4_2Ports.rxf # Need vlan update context: - type: Node-ovs + type: Node name: yardstick - nfvi_type: ovs - vm_deploy: True - file: /etc/yardstick/nodes/pod_ovs.yaml + nfvi_type: baremetal + file: /etc/yardstick/nodes/pod_ixia.yaml + diff --git a/samples/vnf_samples/nsut/vfw/tc_baremetal_http_ixload_512k_Requests-65000_Concurrency.yaml b/samples/vnf_samples/nsut/vfw/tc_baremetal_http_ixload_512k_Requests-65000_Concurrency.yaml new file mode 100644 index 000000000..8fcd66e31 --- /dev/null +++ b/samples/vnf_samples/nsut/vfw/tc_baremetal_http_ixload_512k_Requests-65000_Concurrency.yaml @@ -0,0 +1,44 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: "../../traffic_profiles/http_tests/HTTP_512k-requests_65000_concurrency.yaml" + topology: vfw_vnf_topology_ixload.yaml + nodes: + tg__0: trafficgen_1.yardstick + vnf__0: vnf.yardstick + options: + framesize: + uplink: {64B: 100} + downlink: {64B: 100} + 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: Duration + duration: 2 + ixia_profile: ../../traffic_profiles/vfw/HTTP-vFW_IPv4_2Ports.rxf # Need vlan update +context: + type: Node + name: yardstick + nfvi_type: baremetal + file: /etc/yardstick/nodes/pod_ixia.yaml + diff --git a/samples/vnf_samples/nsut/prox/ovs-dpdk/throughput/tc_ipv4_1rule_1flow_IMIX_packetsize.yaml b/samples/vnf_samples/nsut/vfw/tc_baremetal_http_ixload_64k_Requests-65000_Concurrency.yaml index 37da8e6c7..3b354243b 100644 --- a/samples/vnf_samples/nsut/prox/ovs-dpdk/throughput/tc_ipv4_1rule_1flow_IMIX_packetsize.yaml +++ b/samples/vnf_samples/nsut/vfw/tc_baremetal_http_ixload_64k_Requests-65000_Concurrency.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Intel Corporation +# Copyright (c) 2016-2017 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,30 +16,28 @@ schema: yardstick:task:0.1 scenarios: - type: NSPerf - traffic_profile: "../../../../traffic_profiles/ipv4_throughput.yaml" - topology: ../../acl-tg-topology.yaml + traffic_profile: "../../traffic_profiles/http_tests/HTTP_64k-requests_65000_concurrency.yaml" + topology: vfw_vnf_topology_ixload.yaml nodes: tg__0: trafficgen_1.yardstick vnf__0: vnf.yardstick - tg__1: trafficgen_2.yardstick - tc_options: - rfc2544: - allowed_drop_rate: 0.8 - 1 options: - acl: - rules: ../../acl_1rule.yaml - cfg: "../../acl_config" - script: "../../acl_script" + framesize: + uplink: {64B: 100} + downlink: {64B: 100} + 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: Duration - duration: 400 - interval: 35 - traffic_options: - flow: "../../../../traffic_profiles/ipv4_1flow_Packets.yaml" - imix: "../../../../traffic_profiles/imix_video.yaml" + duration: 2 + ixia_profile: ../../traffic_profiles/vfw/HTTP-vFW_IPv4_2Ports.rxf # Need vlan update context: - type: Node-ovs + type: Node name: yardstick - nfvi_type: ovs - vm_deploy: True - file: /etc/yardstick/nodes/pod_ovs.yaml + nfvi_type: baremetal + file: /etc/yardstick/nodes/pod_ixia.yaml diff --git a/samples/vnf_samples/nsut/vfw/tc_heat_external_rfc2544_ipv4_1rule_1flow_1024B_ixia.yaml b/samples/vnf_samples/nsut/vfw/tc_heat_external_rfc2544_ipv4_1rule_1flow_1024B_ixia.yaml new file mode 100644 index 000000000..1e95c8c2d --- /dev/null +++ b/samples/vnf_samples/nsut/vfw/tc_heat_external_rfc2544_ipv4_1rule_1flow_1024B_ixia.yaml @@ -0,0 +1,83 @@ +# Copyright (c) 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ixia_ipv4_latency.yaml + topology: vfw_vnf_topology_ixia.yaml + nodes: + tg__0: trafficgen_1.yardstick1 + vnf__0: vnf.yardstick + options: + framesize: + uplink: {1024B: 100} + downlink: {1024B: 100} + 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: 10 + interval: 35 + ixia_profile: ../../traffic_profiles/vfw/vfw_ipv4_profile_1flows.ixncfg +contexts: + # put node context first, so we don't HEAT deploy if node has errors + - name: yardstick1 + type: Node + file: ixia.yml + - 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: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + vld_id: downlink_0 + gateway_ip: 'null' + provider: true + physical_network: phystenant1 + port_security_enabled: False + xe1: + cidr: '10.0.3.0/24' + vld_id: uplink_0 + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False + diff --git a/samples/vnf_samples/nsut/vfw/tc_heat_external_rfc2544_ipv4_1rule_1flow_1280B_ixia.yaml b/samples/vnf_samples/nsut/vfw/tc_heat_external_rfc2544_ipv4_1rule_1flow_1280B_ixia.yaml new file mode 100644 index 000000000..1a7e147aa --- /dev/null +++ b/samples/vnf_samples/nsut/vfw/tc_heat_external_rfc2544_ipv4_1rule_1flow_1280B_ixia.yaml @@ -0,0 +1,83 @@ +# Copyright (c) 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ixia_ipv4_latency.yaml + topology: vfw_vnf_topology_ixia.yaml + nodes: + tg__0: trafficgen_1.yardstick1 + vnf__0: vnf.yardstick + options: + framesize: + uplink: {1280B: 100} + downlink: {1280B: 100} + 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: 10 + interval: 35 + ixia_profile: ../../traffic_profiles/vfw/vfw_ipv4_profile_1flows.ixncfg +contexts: + # put node context first, so we don't HEAT deploy if node has errors + - name: yardstick1 + type: Node + file: ixia.yml + - 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: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + vld_id: downlink_0 + gateway_ip: 'null' + provider: true + physical_network: phystenant1 + port_security_enabled: False + xe1: + cidr: '10.0.3.0/24' + vld_id: uplink_0 + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False + diff --git a/samples/vnf_samples/nsut/vfw/tc_heat_external_rfc2544_ipv4_1rule_1flow_128B_ixia.yaml b/samples/vnf_samples/nsut/vfw/tc_heat_external_rfc2544_ipv4_1rule_1flow_128B_ixia.yaml new file mode 100644 index 000000000..9a4e60be1 --- /dev/null +++ b/samples/vnf_samples/nsut/vfw/tc_heat_external_rfc2544_ipv4_1rule_1flow_128B_ixia.yaml @@ -0,0 +1,83 @@ +# Copyright (c) 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ixia_ipv4_latency.yaml + topology: vfw_vnf_topology_ixia.yaml + nodes: + tg__0: trafficgen_1.yardstick1 + vnf__0: vnf.yardstick + options: + framesize: + uplink: {128B: 100} + downlink: {128B: 100} + 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: 10 + interval: 35 + ixia_profile: ../../traffic_profiles/vfw/vfw_ipv4_profile_1flows.ixncfg +contexts: + # put node context first, so we don't HEAT deploy if node has errors + - name: yardstick1 + type: Node + file: ixia.yml + - 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: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + vld_id: downlink_0 + gateway_ip: 'null' + provider: true + physical_network: phystenant1 + port_security_enabled: False + xe1: + cidr: '10.0.3.0/24' + vld_id: uplink_0 + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False + diff --git a/samples/vnf_samples/nsut/vfw/tc_heat_external_rfc2544_ipv4_1rule_1flow_1518B_ixia.yaml b/samples/vnf_samples/nsut/vfw/tc_heat_external_rfc2544_ipv4_1rule_1flow_1518B_ixia.yaml new file mode 100644 index 000000000..7a1ffd82c --- /dev/null +++ b/samples/vnf_samples/nsut/vfw/tc_heat_external_rfc2544_ipv4_1rule_1flow_1518B_ixia.yaml @@ -0,0 +1,82 @@ +# Copyright (c) 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ixia_ipv4_latency.yaml + topology: vfw_vnf_topology_ixia.yaml + nodes: + tg__0: trafficgen_1.yardstick1 + vnf__0: vnf.yardstick + options: + framesize: + uplink: {1518B: 100} + downlink: {1518B: 100} + 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: 10 + interval: 35 + ixia_profile: ../../traffic_profiles/vfw/vfw_ipv4_profile_1flows.ixncfg +contexts: + # put node context first, so we don't HEAT deploy if node has errors + - name: yardstick1 + type: Node + file: ixia.yml + - 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: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + vld_id: downlink_0 + gateway_ip: 'null' + provider: true + physical_network: phystenant1 + port_security_enabled: False + xe1: + cidr: '10.0.3.0/24' + vld_id: uplink_0 + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False diff --git a/samples/vnf_samples/nsut/vfw/tc_heat_external_rfc2544_ipv4_1rule_1flow_256B_ixia.yaml b/samples/vnf_samples/nsut/vfw/tc_heat_external_rfc2544_ipv4_1rule_1flow_256B_ixia.yaml new file mode 100644 index 000000000..c06c9ad1a --- /dev/null +++ b/samples/vnf_samples/nsut/vfw/tc_heat_external_rfc2544_ipv4_1rule_1flow_256B_ixia.yaml @@ -0,0 +1,82 @@ +# Copyright (c) 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ixia_ipv4_latency.yaml + topology: vfw_vnf_topology_ixia.yaml + nodes: + tg__0: trafficgen_1.yardstick1 + vnf__0: vnf.yardstick + options: + framesize: + uplink: {256B: 100} + downlink: {256B: 100} + 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: 10 + interval: 35 + ixia_profile: ../../traffic_profiles/vfw/vfw_ipv4_profile_1flows.ixncfg +contexts: + # put node context first, so we don't HEAT deploy if node has errors + - name: yardstick1 + type: Node + file: ixia.yml + - 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: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + vld_id: downlink_0 + gateway_ip: 'null' + provider: true + physical_network: phystenant1 + port_security_enabled: False + xe1: + cidr: '10.0.3.0/24' + vld_id: uplink_0 + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False diff --git a/samples/vnf_samples/nsut/vfw/tc_heat_external_rfc2544_ipv4_1rule_1flow_512B_ixia.yaml b/samples/vnf_samples/nsut/vfw/tc_heat_external_rfc2544_ipv4_1rule_1flow_512B_ixia.yaml new file mode 100644 index 000000000..798dca293 --- /dev/null +++ b/samples/vnf_samples/nsut/vfw/tc_heat_external_rfc2544_ipv4_1rule_1flow_512B_ixia.yaml @@ -0,0 +1,82 @@ +# Copyright (c) 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +schema: yardstick:task:0.1 +scenarios: +- type: NSPerf + traffic_profile: ../../traffic_profiles/ixia_ipv4_latency.yaml + topology: vfw_vnf_topology_ixia.yaml + nodes: + tg__0: trafficgen_1.yardstick1 + vnf__0: vnf.yardstick + options: + framesize: + uplink: {512B: 100} + downlink: {512B: 100} + 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: 10 + interval: 35 + ixia_profile: ../../traffic_profiles/vfw/vfw_ipv4_profile_1flows.ixncfg +contexts: + # put node context first, so we don't HEAT deploy if node has errors + - name: yardstick1 + type: Node + file: ixia.yml + - 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: + floating_ip: true + placement: "pgrp1" + networks: + mgmt: + cidr: '10.0.1.0/24' + xe0: + cidr: '10.0.2.0/24' + vld_id: downlink_0 + gateway_ip: 'null' + provider: true + physical_network: phystenant1 + port_security_enabled: False + xe1: + cidr: '10.0.3.0/24' + vld_id: uplink_0 + gateway_ip: 'null' + provider: true + physical_network: phystenant2 + port_security_enabled: False diff --git a/samples/vnf_samples/traffic_profiles/ipv4_throughput-2.yaml b/samples/vnf_samples/traffic_profiles/ipv4_throughput-2.yaml index 328e76fb6..a3218879b 100644 --- a/samples/vnf_samples/traffic_profiles/ipv4_throughput-2.yaml +++ b/samples/vnf_samples/traffic_profiles/ipv4_throughput-2.yaml @@ -57,6 +57,8 @@ uplink_0: 373b: "{{ get(imix, 'imix.uplink.373B', '0') }}" 512B: "{{ get(imix, 'imix.uplink.512B', '0') }}" 570B: "{{get(imix, 'imix.uplink.570B', '0') }}" + 1024B: "{{get(imix, 'imix.uplink.1024B', '0') }}" + 1280B: "{{get(imix, 'imix.uplink.1280B', '0') }}" 1400B: "{{get(imix, 'imix.uplink.1400B', '0') }}" 1500B: "{{get(imix, 'imix.uplink.1500B', '0') }}" 1518B: "{{get(imix, 'imix.uplink.1518B', '0') }}" @@ -82,6 +84,8 @@ downlink_0: 373b: "{{ get(imix, 'imix.downlink.373B', '0') }}" 512B: "{{ get(imix, 'imix.downlink.512B', '0') }}" 570B: "{{get(imix, 'imix.downlink.570B', '0') }}" + 1024B: "{{get(imix, 'imix.downlink.1024B', '0') }}" + 1280B: "{{get(imix, 'imix.downlink.1280B', '0') }}" 1400B: "{{get(imix, 'imix.downlink.1400B', '0') }}" 1500B: "{{get(imix, 'imix.downlink.1500B', '0') }}" 1518B: "{{get(imix, 'imix.downlink.1518B', '0') }}" @@ -108,6 +112,8 @@ uplink_1: 373b: "{{ get(imix, 'imix.uplink.373B', '0') }}" 512B: "{{ get(imix, 'imix.uplink.512B', '0') }}" 570B: "{{get(imix, 'imix.uplink.570B', '0') }}" + 1024B: "{{get(imix, 'imix.uplink.1024B', '0') }}" + 1280B: "{{get(imix, 'imix.uplink.1280B', '0') }}" 1400B: "{{get(imix, 'imix.uplink.1400B', '0') }}" 1500B: "{{get(imix, 'imix.uplink.1500B', '0') }}" 1518B: "{{get(imix, 'imix.uplink.1518B', '0') }}" @@ -133,6 +139,8 @@ downlink_1: 373b: "{{ get(imix, 'imix.downlink.373B', '0') }}" 512B: "{{ get(imix, 'imix.downlink.512B', '0') }}" 570B: "{{get(imix, 'imix.downlink.570B', '0') }}" + 1024B: "{{get(imix, 'imix.downlink.1024B', '0') }}" + 1280B: "{{get(imix, 'imix.downlink.1280B', '0') }}" 1400B: "{{get(imix, 'imix.downlink.1400B', '0') }}" 1500B: "{{get(imix, 'imix.downlink.1500B', '0') }}" 1518B: "{{get(imix, 'imix.downlink.1518B', '0') }}" diff --git a/samples/vnf_samples/traffic_profiles/ipv4_throughput-3.yaml b/samples/vnf_samples/traffic_profiles/ipv4_throughput-3.yaml new file mode 100644 index 000000000..d849ed8ab --- /dev/null +++ b/samples/vnf_samples/traffic_profiles/ipv4_throughput-3.yaml @@ -0,0 +1,213 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# flow definition for ACL tests - 1K flows - ipv4 only +# +# the number of flows defines the widest range of parameters +# for example if srcip_range=1.0.0.1-1.0.0.255 and dst_ip_range=10.0.0.1-10.0.1.255 +# and it should define only 16 flows +# +# there is assumption that packets generated will have a random sequences of following addresses pairs +# in the packets +# 1. src=1.x.x.x(x.x.x =random from 1..255) dst=10.x.x.x (random from 1..512) +# 2. src=1.x.x.x(x.x.x =random from 1..255) dst=10.x.x.x (random from 1..512) +# ... +# 512. src=1.x.x.x(x.x.x =random from 1..255) dst=10.x.x.x (random from 1..512) +# +# not all combination should be filled +# Any other field with random range will be added to flow definition +# +# the example.yaml provides all possibilities for traffic generation +# +# the profile defines a public and private side to make limited traffic correlation +# between private and public side same way as it is made by IXIA solution. +# +--- +schema: "nsb:traffic_profile:0.1" + +# This file is a template, it will be filled with values from tc.yaml before passing to the traffic generator + +name: rfc2544 +description: Traffic profile to run RFC2544 latency +traffic_profile: + traffic_type: RFC2544Profile # defines traffic behavior - constant or look for highest possible throughput + frame_rate: 100 # pc of linerate + # that specifies a range (e.g. ipv4 address, port) + + +uplink_0: + ipv4: + id: 1 + outer_l2: + framesize: + 64B: "{{ get(imix, 'imix.uplink.64B', '0') }}" + 128B: "{{ get(imix, 'imix.uplink.128B', '0') }}" + 256B: "{{ get(imix, 'imix.uplink.256B', '0') }}" + 373b: "{{ get(imix, 'imix.uplink.373B', '0') }}" + 512B: "{{ get(imix, 'imix.uplink.512B', '0') }}" + 570B: "{{get(imix, 'imix.uplink.570B', '0') }}" + 1024B: "{{get(imix, 'imix.uplink.1024B', '0') }}" + 1280B: "{{get(imix, 'imix.uplink.1280B', '0') }}" + 1400B: "{{get(imix, 'imix.uplink.1400B', '0') }}" + 1500B: "{{get(imix, 'imix.uplink.1500B', '0') }}" + 1518B: "{{get(imix, 'imix.uplink.1518B', '0') }}" + outer_l3v4: + proto: "udp" + srcip4: "{{get(flow, 'flow.src_ip_0', '1.1.1.1-1.1.255.255') }}" + dstip4: "{{get(flow, 'flow.dst_ip_0', '90.90.1.1-90.90.255.255') }}" + count: "{{get(flow, 'flow.count', '1') }}" + ttl: 32 + dscp: 0 + outer_l4: + srcport: "{{get(flow, 'flow.src_port_0', '1234-4321') }}" + dstport: "{{get(flow, 'flow.dst_port_0', '2001-4001') }}" + count: "{{get(flow, 'flow.count', '1') }}" +downlink_0: + ipv4: + id: 2 + outer_l2: + framesize: + 64B: "{{ get(imix, 'imix.downlink.64B', '0') }}" + 128B: "{{ get(imix, 'imix.downlink.128B', '0') }}" + 256B: "{{ get(imix, 'imix.downlink.256B', '0') }}" + 373b: "{{ get(imix, 'imix.downlink.373B', '0') }}" + 512B: "{{ get(imix, 'imix.downlink.512B', '0') }}" + 570B: "{{get(imix, 'imix.downlink.570B', '0') }}" + 1024B: "{{get(imix, 'imix.downlink.1024B', '0') }}" + 1280B: "{{get(imix, 'imix.downlink.1280B', '0') }}" + 1400B: "{{get(imix, 'imix.downlink.1400B', '0') }}" + 1500B: "{{get(imix, 'imix.downlink.1500B', '0') }}" + 1518B: "{{get(imix, 'imix.downlink.1518B', '0') }}" + + outer_l3v4: + proto: "udp" + srcip4: "{{get(flow, 'flow.dst_ip_0', '90.90.1.1-90.90.255.255') }}" + dstip4: "{{get(flow, 'flow.src_ip_0', '1.1.1.1-1.1.255.255') }}" + count: "{{get(flow, 'flow.count', '1') }}" + ttl: 32 + dscp: 0 + outer_l4: + srcport: "{{get(flow, 'flow.dst_port_0', '1234-4321') }}" + dstport: "{{get(flow, 'flow.src_port_0', '2001-4001') }}" + count: "{{get(flow, 'flow.count', '1') }}" +uplink_1: + ipv4: + id: 3 + outer_l2: + framesize: + 64B: "{{ get(imix, 'imix.uplink.64B', '0') }}" + 128B: "{{ get(imix, 'imix.uplink.128B', '0') }}" + 256B: "{{ get(imix, 'imix.uplink.256B', '0') }}" + 373b: "{{ get(imix, 'imix.uplink.373B', '0') }}" + 512B: "{{ get(imix, 'imix.uplink.512B', '0') }}" + 570B: "{{get(imix, 'imix.uplink.570B', '0') }}" + 1024B: "{{get(imix, 'imix.uplink.1024B', '0') }}" + 1280B: "{{get(imix, 'imix.uplink.1280B', '0') }}" + 1400B: "{{get(imix, 'imix.uplink.1400B', '0') }}" + 1500B: "{{get(imix, 'imix.uplink.1500B', '0') }}" + 1518B: "{{get(imix, 'imix.uplink.1518B', '0') }}" + outer_l3v4: + proto: "udp" + srcip4: "{{get(flow, 'flow.src_ip_1', '1.1.1.1-1.1.255.255') }}" + dstip4: "{{get(flow, 'flow.dst_ip_1', '90.90.1.1-90.90.255.255') }}" + count: "{{get(flow, 'flow.count', '1') }}" + ttl: 32 + dscp: 0 + outer_l4: + srcport: "{{get(flow, 'flow.src_port_1', '1234-4321') }}" + dstport: "{{get(flow, 'flow.dst_port_1', '2001-4001') }}" + count: "{{get(flow, 'flow.count', '1') }}" +downlink_1: + ipv4: + id: 4 + outer_l2: + framesize: + 64B: "{{ get(imix, 'imix.downlink.64B', '0') }}" + 128B: "{{ get(imix, 'imix.downlink.128B', '0') }}" + 256B: "{{ get(imix, 'imix.downlink.256B', '0') }}" + 373b: "{{ get(imix, 'imix.downlink.373B', '0') }}" + 512B: "{{ get(imix, 'imix.downlink.512B', '0') }}" + 570B: "{{get(imix, 'imix.downlink.570B', '0') }}" + 1024B: "{{get(imix, 'imix.downlink.1024B', '0') }}" + 1280B: "{{get(imix, 'imix.downlink.1280B', '0') }}" + 1400B: "{{get(imix, 'imix.downlink.1400B', '0') }}" + 1500B: "{{get(imix, 'imix.downlink.1500B', '0') }}" + 1518B: "{{get(imix, 'imix.downlink.1518B', '0') }}" + + outer_l3v4: + proto: "udp" + srcip4: "{{get(flow, 'flow.dst_ip_1', '90.90.1.1-90.90.255.255') }}" + dstip4: "{{get(flow, 'flow.src_ip_1', '1.1.1.1-1.1.255.255') }}" + count: "{{get(flow, 'flow.count', '1') }}" + ttl: 32 + dscp: 0 + outer_l4: + srcport: "{{get(flow, 'flow.dst_port_1', '1234-4321') }}" + dstport: "{{get(flow, 'flow.src_port_1', '2001-4001') }}" + count: "{{get(flow, 'flow.count', '1') }}" +uplink_2: + ipv4: + id: 5 + outer_l2: + framesize: + 64B: "{{ get(imix, 'imix.uplink.64B', '0') }}" + 128B: "{{ get(imix, 'imix.uplink.128B', '0') }}" + 256B: "{{ get(imix, 'imix.uplink.256B', '0') }}" + 373b: "{{ get(imix, 'imix.uplink.373B', '0') }}" + 512B: "{{ get(imix, 'imix.uplink.512B', '0') }}" + 570B: "{{get(imix, 'imix.uplink.570B', '0') }}" + 1024B: "{{get(imix, 'imix.uplink.1024B', '0') }}" + 1280B: "{{get(imix, 'imix.uplink.1280B', '0') }}" + 1400B: "{{get(imix, 'imix.uplink.1400B', '0') }}" + 1500B: "{{get(imix, 'imix.uplink.1500B', '0') }}" + 1518B: "{{get(imix, 'imix.uplink.1518B', '0') }}" + outer_l3v4: + proto: "udp" + srcip4: "{{get(flow, 'flow.src_ip_1', '1.1.1.1-1.1.255.255') }}" + dstip4: "{{get(flow, 'flow.dst_ip_1', '90.90.1.1-90.90.255.255') }}" + count: "{{get(flow, 'flow.count', '1') }}" + ttl: 32 + dscp: 0 + outer_l4: + srcport: "{{get(flow, 'flow.src_port_1', '1234-4321') }}" + dstport: "{{get(flow, 'flow.dst_port_1', '2001-4001') }}" + count: "{{get(flow, 'flow.count', '1') }}" +downlink_2: + ipv4: + id: 6 + outer_l2: + framesize: + 64B: "{{ get(imix, 'imix.downlink.64B', '0') }}" + 128B: "{{ get(imix, 'imix.downlink.128B', '0') }}" + 256B: "{{ get(imix, 'imix.downlink.256B', '0') }}" + 373b: "{{ get(imix, 'imix.downlink.373B', '0') }}" + 512B: "{{ get(imix, 'imix.downlink.512B', '0') }}" + 570B: "{{get(imix, 'imix.downlink.570B', '0') }}" + 1024B: "{{get(imix, 'imix.downlink.1024B', '0') }}" + 1280B: "{{get(imix, 'imix.downlink.1280B', '0') }}" + 1400B: "{{get(imix, 'imix.downlink.1400B', '0') }}" + 1500B: "{{get(imix, 'imix.downlink.1500B', '0') }}" + 1518B: "{{get(imix, 'imix.downlink.1518B', '0') }}" + + outer_l3v4: + proto: "udp" + srcip4: "{{get(flow, 'flow.dst_ip_1', '90.90.1.1-90.90.255.255') }}" + dstip4: "{{get(flow, 'flow.src_ip_1', '1.1.1.1-1.1.255.255') }}" + count: "{{get(flow, 'flow.count', '1') }}" + ttl: 32 + dscp: 0 + outer_l4: + srcport: "{{get(flow, 'flow.dst_port_1', '1234-4321') }}" + dstport: "{{get(flow, 'flow.src_port_1', '2001-4001') }}" + count: "{{get(flow, 'flow.count', '1') }}" diff --git a/samples/vnf_samples/vnf_descriptors/router_vnf.yaml b/samples/vnf_samples/vnf_descriptors/router_vnf.yaml new file mode 100644 index 000000000..3325540b3 --- /dev/null +++ b/samples/vnf_samples/vnf_descriptors/router_vnf.yaml @@ -0,0 +1,48 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +vnfd:vnfd-catalog: + vnfd: + - id: RouterVNF + name: RouterVNF + short-name: RouterVnf + description: RouterVNF + mgmt-interface: + vdu-id: routervnf-baremetal + {% if user is defined %} + user: '{{user}}' # Value filled by vnfdgen + {% endif %} + {% if password is defined %} + password: '{{password}}' # Value filled by vnfdgen + {% endif %} + {% if ip is defined %} + ip: '{{ip}}' # Value filled by vnfdgen + {% endif %} + {% if key_filename is defined %} + key_filename: '{{key_filename}}' # Value filled by vnfdgen + {% endif %} + vdu: + - id: routervnf-baremetal + name: routervnf-baremetal + description: RouterVNF + vm-flavor: + vcpu-count: '4' + memory-mb: '4096' + routing_table: {{ routing_table }} + nd_route_tbl: {{ nd_route_tbl }} + benchmark: + kpi: + - packets_in + - packets_fwd + - packets_dropped diff --git a/test-requirements.txt b/test-requirements.txt index a635bd1d6..f933df29a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,16 +2,14 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -coverage==4.3.4 # Apache 2.0; OSI Approved Apache Software License; http://www.apache.org/licenses/LICENSE-2.0; http://www.apache.org/licenses/LICENSE-2.0 +coverage==4.4.2 # Apache 2.0; OSI Approved Apache Software License; http://www.apache.org/licenses/LICENSE-2.0; http://www.apache.org/licenses/LICENSE-2.0 fixtures==3.0.0 # OSI Approved BSD License; OSI Approved Apache Software License -flake8==2.5.4 # MIT; OSI Approved MIT License packaging==16.8.0 # BSD or Apache License, Version 2.0 -pep8==1.7.0 # Expat license; OSI Approved MIT License pyflakes==1.0.0 # MIT; OSI Approved MIT License -pylint +pylint==1.8.1 # GPLv2 python-subunit==1.2.0 # OSI Approved Apache Software License; OSI Approved BSD License testrepository==0.0.20 # OSI Approved BSD License; OSI Approved Apache Software License -testtools==2.2.0 # OSI Approved MIT License +testtools==2.3.0 # OSI Approved MIT License unittest2==1.1.0 # OSI Approved BSD License # Yardstick F release <-> OpenStack Pike release diff --git a/tests/ci/load_images.sh b/tests/ci/load_images.sh index 666a78b40..caaba9e8b 100755 --- a/tests/ci/load_images.sh +++ b/tests/ci/load_images.sh @@ -66,10 +66,7 @@ build_yardstick_image() ANSIBLE_SCRIPTS="${0%/*}/../../ansible" cd ${ANSIBLE_SCRIPTS} &&\ ansible-playbook \ - -e img_modify_playbook='ubuntu_server_cloudimg_modify.yml' \ - -e target_os='Ubuntu' \ - -e YARD_IMG_ARCH='amd64' \ - -e ubuntu_img_file="${QCOW_IMAGE}" \ + -e img_property="normal" \ -vvv -i inventory.ini build_yardstick_image.yml if [ ! -f "${QCOW_IMAGE}" ]; then @@ -136,7 +133,7 @@ load_cirros_image() CIRROS_IMAGE_PATH="/home/opnfv/images/cirros-d161201-aarch64-disk.img" EXTRA_PARAMS="--property hw_video_model=vga --property short_id=ubuntu16.04" else - CIRROS_IMAGE_VERSION="Cirros-0.3.5" + CIRROS_IMAGE_VERSION="cirros-0.3.5" CIRROS_IMAGE_PATH="/home/opnfv/images/cirros-0.3.5-x86_64-disk.img" fi diff --git a/tests/functional/utils.py b/tests/functional/utils.py deleted file mode 100755 index b96d2dd50..000000000 --- a/tests/functional/utils.py +++ /dev/null @@ -1,63 +0,0 @@ -############################################################################## -# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -from __future__ import absolute_import - -import copy -import os -import subprocess - -from oslo_serialization import jsonutils -from oslo_utils import encodeutils - - -class Yardstick(object): - """Create and represent separate yardstick installation. - - Usage: - yardstick = yardstick() - output = yardstick("runner list") - - """ - - def __init__(self, fake=False): - - self.args = ["yardstick"] - self.env = copy.deepcopy(os.environ) - - def __del__(self): - pass - - def __call__(self, cmd, getjson=False, report_path=None, raw=False, - suffix=None, extension=None, keep_old=False, - write_report=False): - """Call yardstick in the shell - - :param cmd: yardstick command - :param getjson: in cases, when yardstick prints JSON, you can catch - output deserialized - TO DO: - :param report_path: if present, yardstick command and its output will - be written to file with passed file name - :param raw: don't write command itself to report file. Only output - will be written - """ - - if not isinstance(cmd, list): - cmd = cmd.split(" ") - try: - output = encodeutils.safe_decode(subprocess.check_output( - self.args + cmd, stderr=subprocess.STDOUT, env=self.env), - 'utf-8') - - if getjson: - return jsonutils.loads(output) - return output - except subprocess.CalledProcessError as e: - raise e diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml index d729169a6..08037d9fa 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml @@ -16,6 +16,7 @@ description: > {% set file = file or '/etc/yardstick/pod.yaml' %} {% set attack_host = attack_host or "node1" %} +{% set attack_process = attack_process or "nova-api" %} scenarios: - @@ -23,7 +24,7 @@ scenarios: options: attackers: - fault_type: "kill-process" - process_name: "nova-api" + process_name: "{{ attack_process }}" host: {{attack_host}} wait_time: 10 @@ -35,7 +36,7 @@ scenarios: sla: max_outage_time: 5 - monitor_type: "process" - process_name: "nova-api" + process_name: "{{ attack_process }}" host: {{attack_host}} monitor_time: 30 monitor_number: 3 diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml index 6a3465cc9..bc7cd3d28 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml @@ -15,6 +15,7 @@ description: > {% set file = file or '/etc/yardstick/pod.yaml' %} {% set attack_host = attack_host or "node1" %} +{% set attack_process = attack_process or "neutron-server" %} scenarios: - @@ -22,7 +23,7 @@ scenarios: options: attackers: - fault_type: "kill-process" - process_name: "neutron-server" + process_name: "{{ attack_process }}" host: {{attack_host}} monitors: @@ -33,7 +34,7 @@ scenarios: sla: max_outage_time: 5 - monitor_type: "process" - process_name: "neutron-server" + process_name: "{{ attack_process }}" host: {{attack_host}} monitor_time: 30 monitor_number: 3 diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml index 200bdfc81..3b04cc4bd 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml @@ -15,6 +15,7 @@ description: > {% set file = file or '/etc/yardstick/pod.yaml' %} {% set attack_host = attack_host or "node1" %} +{% set attack_process = attack_process or "keystone" %} scenarios: - @@ -22,7 +23,7 @@ scenarios: options: attackers: - fault_type: "kill-process" - process_name: "keystone" + process_name: "{{ attack_process }}" host: {{attack_host}} monitors: @@ -33,7 +34,7 @@ scenarios: sla: max_outage_time: 5 - monitor_type: "process" - process_name: "keystone" + process_name: "{{ attack_process }}" host: {{attack_host}} monitor_time: 30 monitor_number: 3 diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml index d7c69c0d3..d199e5117 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml @@ -15,6 +15,7 @@ description: > {% set file = file or '/etc/yardstick/pod.yaml' %} {% set attack_host = attack_host or "node1" %} +{% set attack_process = attack_process or "glance-api" %} scenarios: - @@ -22,7 +23,7 @@ scenarios: options: attackers: - fault_type: "kill-process" - process_name: "glance-api" + process_name: "{{ attack_process }}" host: {{attack_host}} monitors: @@ -33,7 +34,7 @@ scenarios: sla: max_outage_time: 5 - monitor_type: "process" - process_name: "glance-api" + process_name: "{{ attack_process }}" host: {{attack_host}} monitor_time: 30 monitor_number: 3 diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml index ddc62bb16..2bca1fb9d 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml @@ -15,6 +15,7 @@ description: > {% set file = file or '/etc/yardstick/pod.yaml' %} {% set attack_host = attack_host or "node1" %} +{% set attack_process = attack_process or "cinder-api" %} scenarios: - @@ -22,7 +23,7 @@ scenarios: options: attackers: - fault_type: "kill-process" - process_name: "cinder-api" + process_name: "{{ attack_process }}" host: {{attack_host}} monitors: @@ -33,7 +34,7 @@ scenarios: sla: max_outage_time: 5 - monitor_type: "process" - process_name: "cinder-api" + process_name: "{{ attack_process }}" host: {{attack_host}} monitor_time: 30 monitor_number: 3 diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml index b23bb330f..a3df57ce8 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml @@ -15,6 +15,7 @@ description: > {% set file = file or '/etc/yardstick/pod.yaml' %} {% set attack_host = attack_host or "node1" %} +{% set attack_process = attack_process or "swift-proxy" %} scenarios: - @@ -22,7 +23,7 @@ scenarios: options: attackers: - fault_type: "kill-process" - process_name: "swift-proxy" + process_name: "{{ attack_process }}" host: {{attack_host}} monitors: @@ -33,7 +34,7 @@ scenarios: sla: max_outage_time: 5 - monitor_type: "process" - process_name: "swift-proxy" + process_name: "{{ attack_process }}" host: {{attack_host}} monitor_time: 30 monitor_number: 3 diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml index bcf5902fa..c2a4f9ede 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml @@ -15,6 +15,7 @@ description: > {% set file = file or '/etc/yardstick/pod.yaml' %} {% set attack_host = attack_host or "node1" %} +{% set attack_process = attack_process or "haproxy" %} scenarios: - @@ -25,13 +26,13 @@ scenarios: fault_type: "kill-process" host: {{attack_host}} key: "kill-process" - process_name: "haproxy" + process_name: "{{ attack_process }}" monitors: - monitor_type: "process" key: "service-status" - process_name: "haproxy" + process_name: "{{ attack_process }}" host: {{attack_host}} monitor_time: 30 monitor_number: 3 diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc056.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc056.yaml index 0035a1f07..9194d9d4e 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc056.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc056.yaml @@ -17,6 +17,7 @@ description: > {% set attack_host = attack_host or 'node1' %} {% set monitor_time = monitor_time or 10 %} {% set monitor_number = monitor_number or 3 %} +{% set attack_process = attack_process or "rabbitmq-server" %} scenarios: - @@ -24,7 +25,7 @@ scenarios: options: attackers: - fault_type: "kill-process" - process_name: "rabbitmq-server" + process_name: "{{ attack_process }}" host: {{attack_host}} monitors: @@ -57,7 +58,7 @@ scenarios: max_outage_time: 5 - monitor_type: "process" - process_name: "rabbitmq-server" + process_name: "{{ attack_process }}" host: {{attack_host}} monitor_time: 30 sla: diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc057.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc057.yaml index 6d710910a..f6a35e915 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc057.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc057.yaml @@ -20,6 +20,7 @@ description: > {% set check_host = check_host or 'node2' %} {% set monitor_time = monitor_time or 10 %} {% set monitor_number = monitor_number or 3 %} +{% set attack_process = attack_process or "corosync" %} scenarios: - @@ -32,7 +33,7 @@ scenarios: key: "kill-process" attack_key: "kill-corosync" action_parameter: - process_name: "corosync" + process_name: "{{ attack_process }}" monitors: - diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc058.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc058.yaml index 77b9172a9..06d460032 100644 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc058.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc058.yaml @@ -17,6 +17,7 @@ description: > {% set image = image or 'yardstick-image' %} {% set flavor = flavor or 'yardstick-flavor' %} {% set attack_host = attack_host or 'node1' %} +{% set attack_process = attack_process or "neutron-l3-agent" %} scenarios: - @@ -27,12 +28,12 @@ scenarios: fault_type: "kill-process" host: {{attack_host}} key: "kill-process" - process_name: "neutron-l3-agent" + process_name: "{{ attack_process }}" monitors: - monitor_type: "process" - process_name: "neutron-l3-agent" + process_name: "{{ attack_process }}" host: {{attack_host}} key: "monitor-recovery" monitor_time: 30 diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc078.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc078.yaml index d20045b25..e5cf6ce36 100644..100755 --- a/tests/opnfv/test_cases/opnfv_yardstick_tc078.yaml +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc078.yaml @@ -10,22 +10,26 @@ schema: "yardstick:task:0.1" description: > - Yardstick TC078 config file; Measure CPU performance using SPEC CPU2006; {% set file = file or "/etc/yardstick/pod.yaml" %} {% set host = host or 'node1' %} +{% set benchmark = benchmark or 'int' %} +{% set runspec_iterations = runspec_iterations or 1 %} +{% set runspec_tune = runspec_tune or 'base' %} +{% set runspec_size = runspec_size or 'ref' %} +{% set runspec_rate = runspec_rate or 1 %} scenarios: - type: SpecCPU2006 options: - SPECint_benchmark: int^429 - runspec_iterations: 1 - runspec_tune: base - runspec_size: ref - runspec_rate: 1 + SPECint_benchmark: {{benchmark}} + runspec_iterations: {{runspec_iterations}} + runspec_tune: {{runspec_tune}} + runspec_size: {{runspec_size}} + runspec_rate: {{runspec_rate}} host: {{host}}.yardstick-TC078 diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc084.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc084.yaml new file mode 100644 index 000000000..472aabe07 --- /dev/null +++ b/tests/opnfv/test_cases/opnfv_yardstick_tc084.yaml @@ -0,0 +1,67 @@ +############################################################################## +# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +--- + +schema: "yardstick:task:0.1" +description: > + Yardstick TC084 config file; + Measure CPU performance using SPEC CPU2006 in Virtual machines; + +{% set provider = provider or none %} +{% set physical_network = physical_network or 'physnet1' %} +{% set segmentation_id = segmentation_id or none %} + +{% set benchmark = benchmark or 'int' %} +{% set runspec_iterations = runspec_iterations or 1 %} +{% set runspec_tune = runspec_tune or 'base' %} +{% set runspec_size = runspec_size or 'ref' %} +{% set runspec_rate = runspec_rate or 1 %} + +scenarios: +- + type: SpecCPU2006_for_VM + + options: + SPECint_benchmark: {{benchmark}} + runspec_iterations: {{runspec_iterations}} + runspec_tune: {{runspec_tune}} + runspec_size: {{runspec_size}} + runspec_rate: {{runspec_rate}} + + host: spec.yardstick-TC084 + + runner: + type: Iteration + iterations: 1 + +context: + name: yardstick-TC084 + image: yardstick-image + flavor: yardstick-flavor + user: ubuntu + + placement_groups: + pgrp1: + policy: "availability" + + servers: + spec: + floating_ip: true + placement: "pgrp1" + + networks: + test: + cidr: '10.0.1.0/24' + {% if provider == "vlan" %} + provider: {{provider}} + physical_network: {{physical_network}} + {% if segmentation_id %} + segmentation_id: {{segmentation_id}} + {% endif %} + {% endif %} diff --git a/tests/unit/benchmark/contexts/standalone/test_model.py b/tests/unit/benchmark/contexts/standalone/test_model.py index 4159e5ae8..021c18860 100644 --- a/tests/unit/benchmark/contexts/standalone/test_model.py +++ b/tests/unit/benchmark/contexts/standalone/test_model.py @@ -131,9 +131,9 @@ class ModelLibvirtTestCase(unittest.TestCase): as mock_parse: xml = copy.deepcopy(self.xml) mock_parse.return_value = xml - vf_pci = '0001:05:04.2' + vm_pci = '0001:05:04.2' model.Libvirt.add_sriov_interfaces( - self.pci_address_str, vf_pci, self.mac, xml_input) + vm_pci, self.pci_address_str, self.mac, xml_input) mock_parse.assert_called_once_with(xml_input) self.mock_write_xml.assert_called_once_with(xml_input) interface = xml.find('devices').find('interface') @@ -142,8 +142,29 @@ class ModelLibvirtTestCase(unittest.TestCase): mac = interface.find('mac') self.assertEqual(self.mac, mac.get('address')) source = interface.find('source') + source_address = source.find('address') self.assertIsNotNone(source.find('address')) - self.assertIsNotNone(interface.find('address')) + + self.assertEqual('pci', source_address.get('type')) + self.assertEqual('0x' + self.pci_address_str.split(':')[0], + source_address.get('domain')) + self.assertEqual('0x' + self.pci_address_str.split(':')[1], + source_address.get('bus')) + self.assertEqual('0x' + self.pci_address_str.split(':')[2].split('.')[0], + source_address.get('slot')) + self.assertEqual('0x' + self.pci_address_str.split(':')[2].split('.')[1], + source_address.get('function')) + + interface_address = interface.find('address') + self.assertEqual('pci', interface_address.get('type')) + self.assertEqual('0x' + vm_pci.split(':')[0], + interface_address.get('domain')) + self.assertEqual('0x' + vm_pci.split(':')[1], + interface_address.get('bus')) + self.assertEqual('0x' + vm_pci.split(':')[2].split('.')[0], + interface_address.get('slot')) + self.assertEqual('0x' + vm_pci.split(':')[2].split('.')[1], + interface_address.get('function')) def test_create_snapshot_qemu(self): result = "/var/lib/libvirt/images/0.qcow2" diff --git a/tests/unit/benchmark/scenarios/availability/test_util.py b/tests/unit/benchmark/scenarios/availability/test_util.py index 0974f385a..03dc70e2a 100644 --- a/tests/unit/benchmark/scenarios/availability/test_util.py +++ b/tests/unit/benchmark/scenarios/availability/test_util.py @@ -16,36 +16,42 @@ import unittest from yardstick.benchmark.scenarios.availability import util -@mock.patch('yardstick.benchmark.scenarios.availability.util.subprocess') class ExecuteShellTestCase(unittest.TestCase): def setUp(self): self.param_config = {'serviceName': '@serviceName', 'value': 1} self.intermediate_variables = {'@serviceName': 'nova-api'} self.std_output = '| id | 1 |' - self.cmd_config = {'cmd':'ls','param':'-a'} + self.cmd_config = {'cmd':'ls', 'param':'-a'} - def test_util_build_command_shell(self,mock_subprocess): + self._mock_subprocess = mock.patch.object(util, 'subprocess') + self.mock_subprocess = self._mock_subprocess.start() + self.addCleanup(self._stop_mock) + + def _stop_mock(self): + self._mock_subprocess.stop() + + def test_util_build_command_shell(self): result = util.build_shell_command(self.param_config, True, self.intermediate_variables) - self.assertEqual("nova-api" in result, True) + self.assertIn("nova-api", result) - def test_read_stdout_item(self,mock_subprocess): - result = util.read_stdout_item(self.std_output,'id') - self.assertEquals('1',result) + def test_read_stdout_item(self): + result = util.read_stdout_item(self.std_output, 'id') + self.assertEquals('1', result) - def test_buildshellparams(self,mock_subprocess): - result = util.buildshellparams(self.cmd_config,True) + def test_buildshellparams(self): + result = util.buildshellparams(self.cmd_config, True) self.assertEquals('/bin/bash -s {0} {1}', result) - def test__fun_execute_shell_command_successful(self, mock_subprocess): + def test__fun_execute_shell_command_successful(self): cmd = "env" - mock_subprocess.check_output.return_value = (0, 'unittest') - exitcode, output = util.execute_shell_command(cmd) + self.mock_subprocess.check_output.return_value = (0, 'unittest') + exitcode, _ = util.execute_shell_command(cmd) self.assertEqual(exitcode, 0) - def test__fun_execute_shell_command_fail_cmd_exception(self, mock_subprocess): + def test__fun_execute_shell_command_fail_cmd_exception(self): cmd = "env" - mock_subprocess.check_output.side_effect = RuntimeError - exitcode, output = util.execute_shell_command(cmd) + self.mock_subprocess.check_output.side_effect = RuntimeError + exitcode, _ = util.execute_shell_command(cmd) self.assertEqual(exitcode, -1) diff --git a/tests/unit/benchmark/scenarios/compute/test_spec_cpu_for_vm.py b/tests/unit/benchmark/scenarios/compute/test_spec_cpu_for_vm.py new file mode 100644 index 000000000..c428e1fb8 --- /dev/null +++ b/tests/unit/benchmark/scenarios/compute/test_spec_cpu_for_vm.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python + +############################################################################## +# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +# Unittest for yardstick.benchmark.scenarios.compute.spec_cpu_for_vm.SpecCPUforVM + +from __future__ import absolute_import + +import unittest + +import mock + +from yardstick.benchmark.scenarios.compute import spec_cpu_for_vm + + +@mock.patch('yardstick.benchmark.scenarios.compute.spec_cpu_for_vm.ssh') +class SpecCPUforVMTestCase(unittest.TestCase): + + def setUp(self): + self.ctx = { + 'host': { + 'ip': '172.16.0.137', + 'user': 'root', + 'key_filename': "mykey.key" + } + } + + self.result = {} + + def test_spec_cpu_successful_setup(self, mock_ssh): + + options = { + "SPECint_benchmark": "perlbench", + "runspec_tune": "all", + "output_format": "all", + "runspec_iterations": "1", + "runspec_size": "test" + } + args = {"options": options} + s = spec_cpu_for_vm.SpecCPUforVM(args, self.ctx) + mock_ssh.SSH.from_node().execute.return_value = (0, '', '') + + s.setup() + self.assertIsNotNone(s.client) + self.assertTrue(s.setup_done, True) + + def test_spec_cpu_successful__run_no_sla(self, mock_ssh): + + options = { + "SPECint_benchmark": "perlbench", + "runspec_tune": "all", + "output_format": "all" + } + args = {"options": options} + s = spec_cpu_for_vm.SpecCPUforVM(args, self.ctx) + + mock_ssh.SSH.from_node().execute.return_value = (0, '', '') + mock_ssh.SSH.from_node().get.return_value = (0, '', '') + s.run(self.result) + expected_result = {'SPEC_CPU_result': ''} + self.assertEqual(self.result, expected_result) + + def test_spec_cpu_unsuccessful_script_error(self, mock_ssh): + options = { + "benchmark_subset": "int" + } + args = {"options": options} + s = spec_cpu_for_vm.SpecCPUforVM(args, self.ctx) + + mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR') + self.assertRaises(RuntimeError, s.run, self.result) + +def main(): + unittest.main() + +if __name__ == '__main__': + main() diff --git a/tests/unit/benchmark/scenarios/lib/test_create_volume.py b/tests/unit/benchmark/scenarios/lib/test_create_volume.py index fc633139e..ef2c0ccaf 100644 --- a/tests/unit/benchmark/scenarios/lib/test_create_volume.py +++ b/tests/unit/benchmark/scenarios/lib/test_create_volume.py @@ -9,28 +9,79 @@ import unittest import mock -from yardstick.benchmark.scenarios.lib.create_volume import CreateVolume +import yardstick.benchmark.scenarios.lib.create_volume class CreateVolumeTestCase(unittest.TestCase): + def setUp(self): + self._mock_cinder_client = mock.patch( + 'yardstick.common.openstack_utils.get_cinder_client') + self.mock_cinder_client = self._mock_cinder_client.start() + self._mock_glance_client = mock.patch( + 'yardstick.common.openstack_utils.get_glance_client') + self.mock_glance_client = self._mock_glance_client.start() + self.addCleanup(self._stop_mock) + + self.scenario_cfg = { + "options" : + { + 'volume_name': 'yardstick_test_volume_01', + 'size': '256', + 'image': 'cirros-0.3.5' + } + } + + self.scenario = ( + yardstick.benchmark.scenarios.lib.create_volume.CreateVolume( + scenario_cfg=self.scenario_cfg, + context_cfg={})) + + def _stop_mock(self): + self._mock_cinder_client.stop() + self._mock_glance_client.stop() + + def test_init(self): + self.mock_cinder_client.return_value = "All volumes are equal" + self.mock_glance_client.return_value = "Images are more equal" + + expected_vol_name = self.scenario_cfg["options"]["volume_name"] + expected_vol_size = self.scenario_cfg["options"]["size"] + expected_im_name = self.scenario_cfg["options"]["image"] + expected_im_id = None + + scenario = ( + yardstick.benchmark.scenarios.lib.create_volume.CreateVolume( + scenario_cfg=self.scenario_cfg, + context_cfg={})) + + self.assertEqual(expected_vol_name, scenario.volume_name) + self.assertEqual(expected_vol_size, scenario.volume_size) + self.assertEqual(expected_im_name, scenario.image_name) + self.assertEqual(expected_im_id, scenario.image_id) + self.assertEqual("All volumes are equal", scenario.cinder_client) + self.assertEqual("Images are more equal", scenario.glance_client) + + def test_setup(self): + self.assertFalse(self.scenario.setup_done) + self.scenario.setup() + self.assertTrue(self.scenario.setup_done) + @mock.patch('yardstick.common.openstack_utils.create_volume') @mock.patch('yardstick.common.openstack_utils.get_image_id') - @mock.patch('yardstick.common.openstack_utils.get_cinder_client') - @mock.patch('yardstick.common.openstack_utils.get_glance_client') - def test_create_volume(self, mock_get_glance_client, mock_get_cinder_client, mock_image_id, mock_create_volume): - options = { - 'volume_name': 'yardstick_test_volume_01', - 'size': '256', - 'image': 'cirros-0.3.5' - } - args = {"options": options} - obj = CreateVolume(args, {}) - obj.run({}) - self.assertTrue(mock_create_volume.called) - self.assertTrue(mock_image_id.called) - self.assertTrue(mock_get_glance_client.called) - self.assertTrue(mock_get_cinder_client.called) + def test_run(self, mock_image_id, mock_create_volume): + self.scenario.run() + + mock_image_id.assert_called_once() + mock_create_volume.assert_called_once() + + @mock.patch.object( + yardstick.benchmark.scenarios.lib.create_volume.CreateVolume, 'setup') + def test_run_no_setup(self, scenario_setup): + self.scenario.setup_done = False + self.scenario.run() + scenario_setup.assert_called_once() + def main(): unittest.main() diff --git a/tests/unit/common/test_process.py b/tests/unit/common/test_process.py deleted file mode 100644 index 5eee55bcc..000000000 --- a/tests/unit/common/test_process.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2017 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import unittest - -import mock - -from yardstick.common import process - - -class ProcessTestcase(unittest.TestCase): - def test_check_if_procces_failed_None(self): - p = mock.MagicMock(**{"exitcode": None, "name": "debug"}) - process.check_if_process_failed(p) - - def test_check_if_procces_failed_0(self): - p = mock.MagicMock(**{"exitcode": 0, "name": "debug"}) - process.check_if_process_failed(p) - - def test_check_if_procces_failed_1(self): - p = mock.MagicMock(**{"exitcode": 1, "name": "debug"}) - with self.assertRaises(RuntimeError): - process.check_if_process_failed(p) - - -@mock.patch("yardstick.common.process.multiprocessing") -class TerminateChildrenTestcase(unittest.TestCase): - def test_some_children(self, mock_multiprocessing): - p1 = mock.MagicMock() - p2 = mock.MagicMock() - mock_multiprocessing.active_children.return_value = [p1, p2] - process.terminate_children() - - def test_no_children(self, mock_multiprocessing): - mock_multiprocessing.active_children.return_value = [] - process.terminate_children() diff --git a/tests/unit/network_services/nfvi/test_resource.py b/tests/unit/network_services/nfvi/test_resource.py index 5c2f890e8..4584b093d 100644 --- a/tests/unit/network_services/nfvi/test_resource.py +++ b/tests/unit/network_services/nfvi/test_resource.py @@ -12,11 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import -import unittest - import errno + import mock +import unittest from yardstick.network_services.nfvi.resource import ResourceProfile from yardstick.network_services.nfvi import resource, collectd @@ -105,14 +104,16 @@ class TestResourceProfile(unittest.TestCase): def test___init__(self): self.assertEqual(True, self.resource_profile.enable) - def test_check_if_sa_running(self): - self.assertEqual(self.resource_profile.check_if_sa_running("collectd"), + def test_check_if_system_agent_running(self): + self.assertEqual(self.resource_profile.check_if_system_agent_running("collectd"), (0, "")) - def test_check_if_sa_running_excetion(self): + def test_check_if_system_agent_running_excetion(self): with mock.patch.object(self.resource_profile.connection, "execute") as mock_execute: mock_execute.side_effect = OSError(errno.ECONNRESET, "error") - self.assertEqual(self.resource_profile.check_if_sa_running("collectd"), (1, None)) + self.assertEqual( + self.resource_profile.check_if_system_agent_running("collectd"), + (1, None)) def test_get_cpu_data(self): reskey = ["", "cpufreq", "cpufreq-0"] @@ -139,8 +140,7 @@ class TestResourceProfile(unittest.TestCase): self.resource_profile._setup_ovs_stats(self.ssh_mock)) @mock.patch("yardstick.network_services.nfvi.resource.open") - @mock.patch("yardstick.network_services.nfvi.resource.os") - def test__provide_config_file(self, mock_open, mock_os): + def test__provide_config_file(self, *args): loadplugin = range(5) port_names = range(5) kwargs = { @@ -152,13 +152,13 @@ class TestResourceProfile(unittest.TestCase): self.ssh_mock.execute.assert_called_once() @mock.patch("yardstick.network_services.nfvi.resource.open") - def test_initiate_systemagent(self, mock_open): + def test_initiate_systemagent(self, *args): self.resource_profile._start_collectd = mock.Mock() self.assertIsNone( self.resource_profile.initiate_systemagent("/opt/nsb_bin")) @mock.patch("yardstick.network_services.nfvi.resource.open") - def test_initiate_systemagent_raise(self, mock_open): + def test_initiate_systemagent_raise(self, *args): self.resource_profile._start_collectd = mock.Mock(side_effect=RuntimeError) with self.assertRaises(RuntimeError): self.resource_profile.initiate_systemagent("/opt/nsb_bin") @@ -267,8 +267,10 @@ class TestResourceProfile(unittest.TestCase): def test_stop(self): self.assertIsNone(self.resource_profile.stop()) - def test_stop(self): + def test_stop_amqp_not_running(self): self.resource_profile.amqp_client = mock.MagicMock() + # TODO(efoley): Fix this incorrect test. + # Should check that we don't try to stop amqp when it's not running self.assertIsNone(self.resource_profile.stop()) if __name__ == '__main__': diff --git a/tests/unit/network_services/vnf_generic/vnf/test_acl_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_acl_vnf.py index e9444b493..2a2647a91 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_acl_vnf.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_acl_vnf.py @@ -15,8 +15,6 @@ # limitations under the License. # -from __future__ import absolute_import - import unittest import mock import os @@ -241,14 +239,14 @@ class TestAclApproxVnf(unittest.TestCase): 'password': 'r00t', 'VNF model': 'acl_vnf.yaml'}}} - def test___init__(self, mock_process): + def test___init__(self, *args): vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] acl_approx_vnf = AclApproxVnf(name, vnfd) self.assertIsNone(acl_approx_vnf._vnf_process) @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") @mock.patch(SSH_HELPER) - def test_collect_kpi(self, ssh, mock_time, mock_process): + def test_collect_kpi(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -263,7 +261,7 @@ class TestAclApproxVnf(unittest.TestCase): @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") @mock.patch(SSH_HELPER) - def test_vnf_execute_command(self, ssh, mock_time, mock_process): + def test_vnf_execute_command(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -275,7 +273,7 @@ class TestAclApproxVnf(unittest.TestCase): self.assertEqual("", acl_approx_vnf.vnf_execute(cmd)) @mock.patch(SSH_HELPER) - def test_get_stats(self, ssh, mock_process): + def test_get_stats(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -296,7 +294,7 @@ class TestAclApproxVnf(unittest.TestCase): @mock.patch("yardstick.network_services.vnf_generic.vnf.acl_vnf.eval") @mock.patch('yardstick.network_services.vnf_generic.vnf.acl_vnf.open') @mock.patch(SSH_HELPER) - def test_run_acl(self, ssh, mock_open, mock_eval, mock_hex, mock_process): + def test_run_acl(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -317,7 +315,7 @@ class TestAclApproxVnf(unittest.TestCase): @mock.patch("yardstick.network_services.vnf_generic.vnf.acl_vnf.find_relative_file") @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.Context") @mock.patch(SSH_HELPER) - def test_instantiate(self, ssh, mock_context, mock_yang, mock_find, mock_process): + def test_instantiate(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -333,16 +331,9 @@ class TestAclApproxVnf(unittest.TestCase): self.assertIsNone(acl_approx_vnf.instantiate(self.scenario_cfg, self.context_cfg)) - def test_scale(self, mock_process): - vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] - acl_approx_vnf = AclApproxVnf(name, vnfd) - flavor = "" - with self.assertRaises(NotImplementedError): - acl_approx_vnf.scale(flavor) - @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") @mock.patch(SSH_HELPER) - def test_terminate(self, ssh, mock_time, mock_process): + def test_terminate(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -355,6 +346,3 @@ class TestAclApproxVnf(unittest.TestCase): acl_approx_vnf.dpdk_nic_bind = "dpdk_nic_bind.py" acl_approx_vnf._resource_collect_stop = mock.Mock() self.assertEqual(None, acl_approx_vnf.terminate()) - -if __name__ == '__main__': - unittest.main() diff --git a/tests/unit/network_services/vnf_generic/vnf/test_base.py b/tests/unit/network_services/vnf_generic/vnf/test_base.py index f812d67ef..e9488f76f 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_base.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_base.py @@ -17,20 +17,20 @@ # Unittest for yardstick.network_services.vnf_generic.vnf.test_base -from __future__ import absolute_import -import unittest +import multiprocessing import os + import mock -from multiprocessing import Queue +import unittest -from yardstick.network_services.vnf_generic.vnf.base import \ - QueueFileWrapper, GenericVNF, GenericTrafficGen +from yardstick.network_services.vnf_generic.vnf import base from yardstick.ssh import SSH -IP_PIPELINE_CFG_FILE_TPL = """ -arp_route_tbl = ({port0_local_ip_hex},{port0_netmask_hex},1,""" -"""{port1_local_ip_hex}) ({port1_local_ip_hex},{port1_netmask_hex},0,""" -"""{port0_local_ip_hex})""" + +IP_PIPELINE_CFG_FILE_TPL = ("arp_route_tbl = ({port0_local_ip_hex}," + "{port0_netmask_hex},1,{port1_local_ip_hex}) " + "({port1_local_ip_hex},{port1_netmask_hex},0," + "{port0_local_ip_hex})") IP_PIPELINE_ND_CFG_FILE_TPL = """ nd_route_tbl = ({port1_dst_ip_hex6},""" @@ -38,6 +38,111 @@ nd_route_tbl = ({port1_dst_ip_hex6},""" _LOCAL_OBJECT = object() +VNFD_0 = { + 'short-name': 'VpeVnf', + 'vdu': [ + { + 'routing_table': [ + { + 'network': '152.16.100.20', + 'netmask': '255.255.255.0', + 'gateway': '152.16.100.20', + 'if': 'xe0' + }, + { + 'network': '152.16.40.20', + 'netmask': '255.255.255.0', + 'gateway': '152.16.40.20', + 'if': 'xe1' + }, + ], + 'description': 'VPE approximation using DPDK', + 'name': 'vpevnf-baremetal', + 'nd_route_tbl': [ + { + 'network': '0064:ff9b:0:0:0:0:9810:6414', + 'netmask': '112', + 'gateway': '0064:ff9b:0:0:0:0:9810:6414', + 'if': 'xe0' + }, + { + 'network': '0064:ff9b:0:0:0:0:9810:2814', + 'netmask': '112', + 'gateway': '0064:ff9b:0:0:0:0:9810:2814', + 'if': 'xe1' + }, + ], + 'id': 'vpevnf-baremetal', + 'external-interface': [ + { + 'virtual-interface': { + 'dst_mac': '00:00:00:00:00:03', + 'vpci': '0000:05:00.0', + 'local_ip': '152.16.100.19', + 'type': 'PCI-PASSTHROUGH', + 'netmask': '255.255.255.0', + 'dpdk_port_num': 0, + 'bandwidth': '10 Gbps', + 'dst_ip': '152.16.100.20', + 'local_mac': '00:00:00:00:00:01' + }, + 'vnfd-connection-point-ref': 'xe0', + 'name': 'xe0' + }, + { + 'virtual-interface': { + 'dst_mac': '00:00:00:00:00:04', + 'vpci': '0000:05:00.1', + 'local_ip': '152.16.40.19', + 'type': 'PCI-PASSTHROUGH', + 'netmask': '255.255.255.0', + 'dpdk_port_num': 1, + 'bandwidth': '10 Gbps', + 'dst_ip': '152.16.40.20', + 'local_mac': '00:00:00:00:00:02' + }, + 'vnfd-connection-point-ref': 'xe1', + 'name': 'xe1' + }, + ], + }, + ], + 'description': 'Vpe approximation using DPDK', + 'mgmt-interface': { + 'vdu-id': 'vpevnf-baremetal', + 'host': '1.1.1.1', + 'password': 'r00t', + 'user': 'root', + 'ip': '1.1.1.1' + }, + 'benchmark': { + 'kpi': [ + 'packets_in', + 'packets_fwd', + 'packets_dropped', + ], + }, + 'connection-point': [ + { + 'type': 'VPORT', + 'name': 'xe0', + }, + { + 'type': 'VPORT', + 'name': 'xe1', + }, + ], + 'id': 'VpeApproxVnf', 'name': 'VPEVnfSsh' +} + +VNFD = { + 'vnfd:vnfd-catalog': { + 'vnfd': [ + VNFD_0, + ] + } +} + class FileAbsPath(object): def __init__(self, module_file): @@ -70,17 +175,17 @@ def mock_ssh(mock_ssh_type, spec=None, exec_result=_LOCAL_OBJECT, run_result=_LO class TestQueueFileWrapper(unittest.TestCase): def setUp(self): self.prompt = "pipeline>" - self.q_in = Queue() - self.q_out = Queue() + self.q_in = multiprocessing.Queue() + self.q_out = multiprocessing.Queue() def test___init__(self): queue_file_wrapper = \ - QueueFileWrapper(self.q_in, self.q_out, self.prompt) + base.QueueFileWrapper(self.q_in, self.q_out, self.prompt) self.assertEqual(queue_file_wrapper.prompt, self.prompt) def test_clear(self): queue_file_wrapper = \ - QueueFileWrapper(self.q_in, self.q_out, self.prompt) + base.QueueFileWrapper(self.q_in, self.q_out, self.prompt) queue_file_wrapper.bufsize = 5 queue_file_wrapper.write("pipeline>") queue_file_wrapper.close() @@ -89,167 +194,45 @@ class TestQueueFileWrapper(unittest.TestCase): def test_close(self): queue_file_wrapper = \ - QueueFileWrapper(self.q_in, self.q_out, self.prompt) + base.QueueFileWrapper(self.q_in, self.q_out, self.prompt) self.assertEqual(None, queue_file_wrapper.close()) def test_read(self): queue_file_wrapper = \ - QueueFileWrapper(self.q_in, self.q_out, self.prompt) + base.QueueFileWrapper(self.q_in, self.q_out, self.prompt) queue_file_wrapper.q_in.put("pipeline>") self.assertEqual("pipeline>", queue_file_wrapper.read(20)) def test_write(self): queue_file_wrapper = \ - QueueFileWrapper(self.q_in, self.q_out, self.prompt) + base.QueueFileWrapper(self.q_in, self.q_out, self.prompt) queue_file_wrapper.write("pipeline>") self.assertIsNotNone(queue_file_wrapper.q_out.empty()) class TestGenericVNF(unittest.TestCase): - VNFD_0 = { - 'short-name': 'VpeVnf', - 'vdu': [ - { - 'routing_table': [ - { - 'network': '152.16.100.20', - 'netmask': '255.255.255.0', - 'gateway': '152.16.100.20', - 'if': 'xe0' - }, - { - 'network': '152.16.40.20', - 'netmask': '255.255.255.0', - 'gateway': '152.16.40.20', - 'if': 'xe1' - }, - ], - 'description': 'VPE approximation using DPDK', - 'name': 'vpevnf-baremetal', - 'nd_route_tbl': [ - { - 'network': '0064:ff9b:0:0:0:0:9810:6414', - 'netmask': '112', - 'gateway': '0064:ff9b:0:0:0:0:9810:6414', - 'if': 'xe0' - }, - { - 'network': '0064:ff9b:0:0:0:0:9810:2814', - 'netmask': '112', - 'gateway': '0064:ff9b:0:0:0:0:9810:2814', - 'if': 'xe1' - }, - ], - 'id': 'vpevnf-baremetal', - 'external-interface': [ - { - 'virtual-interface': { - 'dst_mac': '00:00:00:00:00:03', - 'vpci': '0000:05:00.0', - 'local_ip': '152.16.100.19', - 'type': 'PCI-PASSTHROUGH', - 'netmask': '255.255.255.0', - 'dpdk_port_num': 0, - 'bandwidth': '10 Gbps', - 'dst_ip': '152.16.100.20', - 'local_mac': '00:00:00:00:00:01' - }, - 'vnfd-connection-point-ref': 'xe0', - 'name': 'xe0' - }, - { - 'virtual-interface': { - 'dst_mac': '00:00:00:00:00:04', - 'vpci': '0000:05:00.1', - 'local_ip': '152.16.40.19', - 'type': 'PCI-PASSTHROUGH', - 'netmask': '255.255.255.0', - 'dpdk_port_num': 1, - 'bandwidth': '10 Gbps', - 'dst_ip': '152.16.40.20', - 'local_mac': '00:00:00:00:00:02' - }, - 'vnfd-connection-point-ref': 'xe1', - 'name': 'xe1' - }, - ], - }, - ], - 'description': 'Vpe approximation using DPDK', - 'mgmt-interface': { - 'vdu-id': 'vpevnf-baremetal', - 'host': '1.1.1.1', - 'password': 'r00t', - 'user': 'root', - 'ip': '1.1.1.1' - }, - 'benchmark': { - 'kpi': [ - 'packets_in', - 'packets_fwd', - 'packets_dropped', - ], - }, - 'connection-point': [ - { - 'type': 'VPORT', - 'name': 'xe0', - }, - { - 'type': 'VPORT', - 'name': 'xe1', - }, - ], - 'id': 'VpeApproxVnf', 'name': 'VPEVnfSsh' - } - - VNFD = { - 'vnfd:vnfd-catalog': { - 'vnfd': [ - VNFD_0, - ] - } - } - - def test___init__(self): - generic_vnf = GenericVNF('vnf1', self.VNFD_0) - assert generic_vnf.kpi - - def test_collect_kpi(self): - generic_vnf = GenericVNF('vnf1', self.VNFD_0) - self.assertRaises(NotImplementedError, generic_vnf.collect_kpi) - - def test__get_kpi_definition(self): - vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] - generic_vnf = GenericVNF('vnf1', vnfd) - kpi = generic_vnf._get_kpi_definition() - self.assertEqual(kpi, ['packets_in', 'packets_fwd', 'packets_dropped']) - - def test_instantiate(self): - generic_vnf = GenericVNF('vnf1', self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]) - with self.assertRaises(NotImplementedError): - generic_vnf.instantiate({}, {}) - - def test_scale(self): - generic_vnf = GenericVNF('vnf1', self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]) - with self.assertRaises(NotImplementedError): - generic_vnf.scale() - - def test_terminate(self): - generic_vnf = GenericVNF('vnf1', self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]) - with self.assertRaises(NotImplementedError): - generic_vnf.terminate() + def test_definition(self): + """Make sure that the abstract class cannot be instantiated""" + with self.assertRaises(TypeError) as exc: + # pylint: disable=abstract-class-instantiated + base.GenericVNF('vnf1', VNFD['vnfd:vnfd-catalog']['vnfd'][0]) + msg = ("Can't instantiate abstract class GenericVNF with abstract " + "methods collect_kpi, instantiate, scale, terminate, " + "wait_for_instantiate") + self.assertEqual(msg, str(exc.exception)) class TestGenericTrafficGen(unittest.TestCase): def test_definition(self): """Make sure that the abstract class cannot be instantiated""" - vnfd = TestGenericVNF.VNFD['vnfd:vnfd-catalog']['vnfd'][0] + vnfd = VNFD['vnfd:vnfd-catalog']['vnfd'][0] name = 'vnf1' with self.assertRaises(TypeError) as exc: - GenericTrafficGen(name, vnfd) + # pylint: disable=abstract-class-instantiated + base.GenericTrafficGen(name, vnfd) msg = ("Can't instantiate abstract class GenericTrafficGen with " - "abstract methods run_traffic, terminate") + "abstract methods collect_kpi, instantiate, run_traffic, " + "scale, terminate") self.assertEqual(msg, str(exc.exception)) diff --git a/tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py index 832509ea7..f2ce18fb3 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py @@ -15,14 +15,11 @@ # limitations under the License. # -from __future__ import absolute_import - +from copy import deepcopy import os import unittest import mock -from copy import deepcopy - from tests.unit import STL_MOCKS from tests.unit.network_services.vnf_generic.vnf.test_base import mock_ssh @@ -305,14 +302,14 @@ class TestCgnaptApproxVnf(unittest.TestCase): def setUp(self): self.scenario_cfg = deepcopy(self.SCENARIO_CFG) - def test___init__(self, mock_process): + def test___init__(self, *args): vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] cgnapt_approx_vnf = CgnaptApproxVnf(name, vnfd) self.assertIsNone(cgnapt_approx_vnf._vnf_process) @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time') @mock.patch(SSH_HELPER) - def test_collect_kpi(self, ssh, mock_time, mock_process): + def test_collect_kpi(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -328,7 +325,7 @@ class TestCgnaptApproxVnf(unittest.TestCase): @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time') @mock.patch(SSH_HELPER) - def test_vnf_execute_command(self, ssh, mock_time, mock_process): + def test_vnf_execute_command(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -340,7 +337,7 @@ class TestCgnaptApproxVnf(unittest.TestCase): self.assertEqual("", cgnapt_approx_vnf.vnf_execute(cmd)) @mock.patch(SSH_HELPER) - def test_get_stats(self, ssh, mock_process): + def test_get_stats(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -362,7 +359,7 @@ class TestCgnaptApproxVnf(unittest.TestCase): @mock.patch("yardstick.network_services.vnf_generic.vnf.cgnapt_vnf.eval") @mock.patch('yardstick.network_services.vnf_generic.vnf.cgnapt_vnf.open') @mock.patch(SSH_HELPER) - def test_run_vcgnapt(self, ssh, mock_hex, mock_eval, mock_open, mock_process): + def test_run_vcgnapt(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -377,7 +374,7 @@ class TestCgnaptApproxVnf(unittest.TestCase): @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.Context") @mock.patch(SSH_HELPER) - def test_instantiate(self, ssh, mock_context, mock_process): + def test_instantiate(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -393,15 +390,9 @@ class TestCgnaptApproxVnf(unittest.TestCase): self.assertIsNone(cgnapt_approx_vnf.instantiate(self.scenario_cfg, self.context_cfg)) - def test_scale(self, mock_process): - vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] - cgnapt_approx_vnf = CgnaptApproxVnf(name, vnfd) - flavor = "" - self.assertRaises(NotImplementedError, cgnapt_approx_vnf.scale, flavor) - @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") @mock.patch(SSH_HELPER) - def test_terminate(self, ssh, mock_time, mock_process): + def test_terminate(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -417,7 +408,7 @@ class TestCgnaptApproxVnf(unittest.TestCase): @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") @mock.patch(SSH_HELPER) - def test__vnf_up_post(self, ssh, mock_time, mock_process): + def test__vnf_up_post(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -433,7 +424,7 @@ class TestCgnaptApproxVnf(unittest.TestCase): @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") @mock.patch(SSH_HELPER) - def test__vnf_up_post_short(self, ssh, mock_time, mock_process): + def test__vnf_up_post_short(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -444,7 +435,3 @@ class TestCgnaptApproxVnf(unittest.TestCase): cgnapt_approx_vnf.scenario_helper.scenario_cfg = self.scenario_cfg cgnapt_approx_vnf._resource_collect_stop = mock.Mock() cgnapt_approx_vnf._vnf_up_post() - - -if __name__ == '__main__': - unittest.main() diff --git a/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py b/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py index 84eb5dc0d..0ac46c632 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py @@ -15,17 +15,18 @@ # limitations under the License. # -from __future__ import absolute_import - +from itertools import repeat, chain import os import socket -import unittest -from itertools import repeat, chain +import time + import mock +import unittest from tests.unit import STL_MOCKS from yardstick.network_services.vnf_generic.vnf.base import VnfdHelper + STLClient = mock.MagicMock() stl_patch = mock.patch.dict("sys.modules", STL_MOCKS) stl_patch.start() @@ -288,29 +289,32 @@ no data length value """ -@mock.patch('yardstick.network_services.vnf_generic.vnf.prox_helpers.time') class TestProxSocketHelper(unittest.TestCase): + + def setUp(self): + self.mock_time_sleep = mock.patch.object(time, 'sleep').start() + @mock.patch('yardstick.network_services.vnf_generic.vnf.prox_helpers.socket') - def test___init__(self, mock_socket, mock_time): + def test___init__(self, mock_socket): expected = mock_socket.socket() prox = ProxSocketHelper() result = prox._sock self.assertEqual(result, expected) - def test_connect(self, mock_time): + def test_connect(self): mock_sock = mock.MagicMock() prox = ProxSocketHelper(mock_sock) prox.connect('10.20.30.40', 23456) self.assertEqual(mock_sock.connect.call_count, 1) - def test_get_sock(self, mock_time): + def test_get_sock(self): mock_sock = mock.MagicMock() prox = ProxSocketHelper(mock_sock) result = prox.get_socket() self.assertIs(result, mock_sock) @mock.patch('yardstick.network_services.vnf_generic.vnf.prox_helpers.select') - def test_get_data(self, mock_select, mock_time): + def test_get_data(self, mock_select): mock_select.select.side_effect = [[1], [0]] mock_socket = mock.MagicMock() mock_recv = mock_socket.recv() @@ -336,7 +340,7 @@ class TestProxSocketHelper(unittest.TestCase): self.assertEqual(ret, 'jumped over') self.assertEqual(len(prox._pkt_dumps), 3) - def test__parse_socket_data_mixed_data(self, mock_time): + def test__parse_socket_data_mixed_data(self): prox = ProxSocketHelper(mock.MagicMock()) ret = prox._parse_socket_data(PACKET_DUMP_NON_1, False) self.assertEqual(ret, 'not_a_dump,1,2') @@ -346,7 +350,7 @@ class TestProxSocketHelper(unittest.TestCase): self.assertEqual(ret, 'not_a_dump,1,2') self.assertEqual(len(prox._pkt_dumps), 1) - def test__parse_socket_data_bad_data(self, mock_time): + def test__parse_socket_data_bad_data(self): prox = ProxSocketHelper(mock.MagicMock()) with self.assertRaises(ValueError): prox._parse_socket_data(PACKET_DUMP_BAD_1, False) @@ -357,7 +361,7 @@ class TestProxSocketHelper(unittest.TestCase): ret = prox._parse_socket_data(PACKET_DUMP_BAD_3, False) self.assertEqual(ret, 'pktdump,3') - def test__parse_socket_data_pkt_dump_only(self, mock_time): + def test__parse_socket_data_pkt_dump_only(self): prox = ProxSocketHelper(mock.MagicMock()) ret = prox._parse_socket_data('', True) self.assertFalse(ret) @@ -368,20 +372,20 @@ class TestProxSocketHelper(unittest.TestCase): ret = prox._parse_socket_data(PACKET_DUMP_2, True) self.assertTrue(ret) - def test_put_command(self, mock_time): + def test_put_command(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.put_command("data") mock_socket.sendall.assert_called_once() - def test_put_command_socket_error(self, mock_time): + def test_put_command_socket_error(self): mock_socket = mock.MagicMock() mock_socket.sendall.side_effect = OSError prox = ProxSocketHelper(mock_socket) prox.put_command("data") mock_socket.sendall.assert_called_once() - def test_get_packet_dump(self, mock_time): + def test_get_packet_dump(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox._pkt_dumps = [] @@ -391,67 +395,67 @@ class TestProxSocketHelper(unittest.TestCase): self.assertEqual(prox.get_packet_dump(), 234) self.assertEqual(prox._pkt_dumps, []) - def test_stop_all_reset(self, mock_time): + def test_stop_all_reset(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.stop_all_reset() mock_socket.sendall.assert_called() - def test_stop_all(self, mock_time): + def test_stop_all(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.stop_all() mock_socket.sendall.assert_called() - def test_stop(self, mock_time): + def test_stop(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.stop([3, 4, 5], 16) mock_socket.sendall.assert_called() - def test_start_all(self, mock_time): + def test_start_all(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.start_all() mock_socket.sendall.assert_called() - def test_start(self, mock_time): + def test_start(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.start([3, 4, 5]) mock_socket.sendall.assert_called() - def test_reset_stats(self, mock_time): + def test_reset_stats(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.reset_stats() mock_socket.sendall.assert_called() - def test_set_pkt_size(self, mock_time): + def test_set_pkt_size(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.set_pkt_size([3, 4, 5], 1024) self.assertEqual(mock_socket.sendall.call_count, 3) - def test_set_value(self, mock_time): + def test_set_value(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.set_value([3, 4, 5], 10, 20, 30) self.assertEqual(mock_socket.sendall.call_count, 3) - def test_reset_values(self, mock_time): + def test_reset_values(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.reset_values([3, 4, 5]) self.assertEqual(mock_socket.sendall.call_count, 3) - def test_set_speed(self, mock_time): + def test_set_speed(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.set_speed([3, 4, 5], 1000) self.assertEqual(mock_socket.sendall.call_count, 3) - def test_slope_speed(self, mock_time): + def test_slope_speed(self): core_data = [ { 'cores': [3, 4, 5], @@ -473,13 +477,13 @@ class TestProxSocketHelper(unittest.TestCase): prox.slope_speed(core_data, 5, 5) self.assertEqual(set_speed.call_count, 10) - def test_set_pps(self, mock_time): + def test_set_pps(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.set_pps([3, 4, 5], 1000, 512) self.assertEqual(mock_socket.sendall.call_count, 3) - def test_lat_stats(self, mock_time): + def test_lat_stats(self): latency_output = [ '1, 2 , 3', # has white space '4,5', # too short @@ -510,7 +514,7 @@ class TestProxSocketHelper(unittest.TestCase): self.assertEqual(mock_socket.sendall.call_count, 5) self.assertEqual(result, expected) - def test_get_all_tot_stats_error(self, mock_time): + def test_get_all_tot_stats_error(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.get_data = mock.MagicMock(return_value='3,4,5') @@ -518,7 +522,7 @@ class TestProxSocketHelper(unittest.TestCase): result = prox.get_all_tot_stats() self.assertEqual(result, expected) - def test_get_all_tot_stats(self, mock_time): + def test_get_all_tot_stats(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.get_data = mock.MagicMock(return_value='3,4,5,6') @@ -526,7 +530,7 @@ class TestProxSocketHelper(unittest.TestCase): result = prox.get_all_tot_stats() self.assertEqual(result, expected) - def test_hz(self, mock_time): + def test_hz(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.get_data = mock.MagicMock(return_value='3,4,5,6') @@ -534,7 +538,7 @@ class TestProxSocketHelper(unittest.TestCase): result = prox.hz() self.assertEqual(result, expected) - def test_core_stats(self, mock_time): + def test_core_stats(self): core_stats = [ '3,4,5,6', '7,8,9,10,NaN', @@ -548,7 +552,7 @@ class TestProxSocketHelper(unittest.TestCase): result = prox.core_stats([3, 4, 5], 16) self.assertEqual(result, expected) - def test_port_stats(self, mock_time): + def test_port_stats(self): port_stats = [ ','.join(str(n) for n in range(3, 15)), ','.join(str(n) for n in range(8, 32, 2)), @@ -562,7 +566,7 @@ class TestProxSocketHelper(unittest.TestCase): result = prox.port_stats([3, 4, 5]) self.assertEqual(result, expected) - def test_measure_tot_stats(self, mock_time): + def test_measure_tot_stats(self): start_tot = 3, 4, 5, 6 end_tot = 7, 9, 11, 13 delta_tot = 4, 5, 6, 7 @@ -584,7 +588,7 @@ class TestProxSocketHelper(unittest.TestCase): pass self.assertEqual(result, expected) - def test_tot_stats(self, mock_time): + def test_tot_stats(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.get_data = mock.MagicMock(return_value='3,4,5,6') @@ -592,7 +596,7 @@ class TestProxSocketHelper(unittest.TestCase): result = prox.tot_stats() self.assertEqual(result, expected) - def test_tot_ierrors(self, mock_time): + def test_tot_ierrors(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.get_data = mock.MagicMock(return_value='3,4,5,6') @@ -600,25 +604,25 @@ class TestProxSocketHelper(unittest.TestCase): result = prox.tot_ierrors() self.assertEqual(result, expected) - def test_set_count(self, mock_time): + def test_set_count(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.set_count(432, [3, 4, 5]) self.assertEqual(mock_socket.sendall.call_count, 3) - def test_dump_rx(self, mock_time): + def test_dump_rx(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.dump_rx(3, 5, 8) self.assertEqual(mock_socket.sendall.call_count, 1) - def test_quit(self, mock_time): + def test_quit(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.quit() mock_socket.sendall.assert_called() - def test_force_quit(self, mock_time): + def test_force_quit(self): mock_socket = mock.MagicMock() prox = ProxSocketHelper(mock_socket) prox.force_quit() @@ -1062,8 +1066,7 @@ class TestProxDpdkVnfSetupEnvHelper(unittest.TestCase): self.assertEqual(helper._prox_config_data, '44') self.assertEqual(helper.remote_path, '55') - @mock.patch('yardstick.network_services.vnf_generic.vnf.prox_helpers.find_relative_file') - def test_build_config(self, mock_find_path): + def test_build_config(self): vnf1 = { 'prox_args': {'-f': ""}, 'prox_path': '/opt/nsb_bin/prox', @@ -1075,10 +1078,9 @@ class TestProxDpdkVnfSetupEnvHelper(unittest.TestCase): ], } - mock_find_path.side_effect = ['1', '2'] - vnfd_helper = mock.MagicMock() - ssh_helper = mock.MagicMock() - ssh_helper.provision_tool.return_value = "/opt/nsb_bin/prox" + vnfd_helper = mock.Mock() + ssh_helper = mock.Mock() + ssh_helper.join_bin_path.return_value = '/opt/nsb_bin/prox' scenario_helper = ScenarioHelper('vnf1') scenario_helper.scenario_cfg = { 'task_path': 'a/b', @@ -1087,12 +1089,16 @@ class TestProxDpdkVnfSetupEnvHelper(unittest.TestCase): }, } - helper = ProxDpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, scenario_helper) - helper.remote_path = "/tmp/prox.cfg" - expected = "sudo bash -c 'cd /opt/nsb_bin; /opt/nsb_bin/prox -o cli -f -f /tmp/prox.cfg '" - with mock.patch.object(helper, "build_config_file") as mock_build_config: + expected = ("sudo bash -c 'cd /opt/nsb_bin; /opt/nsb_bin/prox -o cli " + "-f -f /tmp/prox.cfg '") + + helper = ProxDpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, + scenario_helper) + with mock.patch.object(helper, 'build_config_file') as mock_cfg_file: + helper.remote_path = '/tmp/prox.cfg' prox_cmd = helper.build_config() self.assertEqual(prox_cmd, expected) + mock_cfg_file.assert_called_once() def test__insert_additional_file(self): vnfd_helper = mock.MagicMock() @@ -1256,16 +1262,6 @@ class TestProxDpdkVnfSetupEnvHelper(unittest.TestCase): result = helper.put_string_to_file('my long string', 'a/b') self.assertEqual(result, expected) - def test__build_pipeline_kwarags(self): - vnfd_helper = mock.MagicMock() - ssh_helper = mock.MagicMock() - ssh_helper.provision_tool.return_value = "/tmp/nosuch" - scenario_helper = mock.MagicMock() - - helper = ProxDpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, scenario_helper) - helper._build_pipeline_kwargs() - self.assertEqual(helper.pipeline_kwargs, {'tool_path': '/tmp/nosuch', 'tool_dir': '/tmp'}) - def test_copy_to_target(self): vnfd_helper = mock.MagicMock() vnfd_helper.interfaces = [] @@ -1416,7 +1412,7 @@ class TestProxResourceHelper(unittest.TestCase): @mock.patch('yardstick.network_services.vnf_generic.vnf.prox_helpers.RETRY_INTERVAL', 0) @mock.patch('yardstick.network_services.vnf_generic.vnf.prox_helpers.ProxSocketHelper') - def test_sut(self, mock_socket_helper): + def test_sut(self, *args): helper = ProxResourceHelper(mock.MagicMock()) self.assertIsNone(helper.client) result = helper.sut @@ -1439,9 +1435,9 @@ class TestProxResourceHelper(unittest.TestCase): helper = ProxResourceHelper(mock.MagicMock()) helper.resource = resource = mock.MagicMock() - resource.check_if_sa_running.return_value = 0, '1234' + resource.check_if_system_agent_running.return_value = 0, '1234' resource.amqp_collect_nfvi_kpi.return_value = 543 - resource.check_if_sa_running.return_value = (0, None) + resource.check_if_system_agent_running.return_value = (0, None) expected = {'core': 543} result = helper.collect_collectd_kpi() @@ -1453,9 +1449,9 @@ class TestProxResourceHelper(unittest.TestCase): helper._result = {'z': 123} helper.resource = resource = mock.MagicMock() - resource.check_if_sa_running.return_value = 0, '1234' + resource.check_if_system_agent_running.return_value = 0, '1234' resource.amqp_collect_nfvi_kpi.return_value = 543 - resource.check_if_sa_running.return_value = (0, None) + resource.check_if_system_agent_running.return_value = (0, None) queue.empty.return_value = False queue.get.return_value = {'a': 789} @@ -1466,7 +1462,7 @@ class TestProxResourceHelper(unittest.TestCase): @mock.patch('yardstick.network_services.vnf_generic.vnf.prox_helpers.time') @mock.patch('yardstick.network_services.vnf_generic.vnf.prox_helpers.ProxSocketHelper') - def test__connect(self, mock_socket_helper_type, mock_time): + def test__connect(self, mock_socket_helper_type, *args): client = mock_socket_helper_type() client.connect.side_effect = chain(repeat(socket.error, 5), [None]) @@ -1869,7 +1865,7 @@ class TestProxProfileHelper(unittest.TestCase): self.assertIs(result, expected) @mock.patch('yardstick.network_services.vnf_generic.vnf.prox_helpers.time') - def test_traffic_context(self, mock_time): + def test_traffic_context(self, *args): setup_helper = mock.MagicMock() setup_helper.vnfd_helper.interfaces = [] diff --git a/tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py index e29e8ddcd..769279066 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py @@ -15,8 +15,6 @@ # limitations under the License. # -from __future__ import absolute_import - import errno import os import unittest @@ -316,13 +314,13 @@ class TestProxApproxVnf(unittest.TestCase): } @mock.patch(SSH_HELPER) - def test___init__(self, ssh, mock_time): + def test___init__(self, ssh, *args): mock_ssh(ssh) prox_approx_vnf = ProxApproxVnf(NAME, self.VNFD0) self.assertIsNone(prox_approx_vnf._vnf_process) @mock.patch(SSH_HELPER) - def test_collect_kpi_no_client(self, ssh, mock_time): + def test_collect_kpi_no_client(self, ssh, *args): mock_ssh(ssh) prox_approx_vnf = ProxApproxVnf(NAME, self.VNFD0) @@ -337,7 +335,7 @@ class TestProxApproxVnf(unittest.TestCase): self.assertEqual(result, expected) @mock.patch(SSH_HELPER) - def test_collect_kpi(self, ssh, mock_time): + def test_collect_kpi(self, ssh, *args): mock_ssh(ssh) resource_helper = mock.MagicMock() @@ -357,7 +355,7 @@ class TestProxApproxVnf(unittest.TestCase): self.assertEqual(result, expected) @mock.patch(SSH_HELPER) - def test_collect_kpi_error(self, ssh, mock_time): + def test_collect_kpi_error(self, ssh, *args): mock_ssh(ssh) resource_helper = mock.MagicMock() @@ -370,31 +368,13 @@ class TestProxApproxVnf(unittest.TestCase): with self.assertRaises(RuntimeError): prox_approx_vnf.collect_kpi() - def _get_file_abspath(self, filename, mock_time): + def _get_file_abspath(self, filename, *args): curr_path = os.path.dirname(os.path.abspath(__file__)) file_path = os.path.join(curr_path, filename) return file_path - @mock.patch('yardstick.benchmark.scenarios.networking.vnf_generic.open', create=True) - @mock.patch('yardstick.network_services.helpers.iniparser.open', create=True) - @mock.patch(SSH_HELPER) - def test_run_prox(self, ssh, *_): - mock_ssh(ssh) - - prox_approx_vnf = ProxApproxVnf(NAME, self.VNFD0) - prox_approx_vnf.scenario_helper.scenario_cfg = self.SCENARIO_CFG - prox_approx_vnf.ssh_helper.provision_tool.return_value = '/tool_path12/tool_file34' - prox_approx_vnf.setup_helper.remote_path = 'configs/file56.cfg' - - expected = "sudo bash -c 'cd /tool_path12; " \ - "/tool_path12/tool_file34 -o cli -t -f /tmp/l3-swap-2.cfg '" - - prox_approx_vnf._run() - result = prox_approx_vnf.ssh_helper.run.call_args[0][0] - self.assertEqual(result, expected) - @mock.patch(SSH_HELPER) - def bad_test_instantiate(self, ssh, mock_time): + def bad_test_instantiate(self, *args): prox_approx_vnf = ProxApproxVnf(NAME, self.VNFD0) prox_approx_vnf.scenario_helper = mock.MagicMock() prox_approx_vnf.setup_helper = mock.MagicMock() @@ -403,7 +383,7 @@ class TestProxApproxVnf(unittest.TestCase): prox_approx_vnf.setup_helper.build_config.assert_called_once() @mock.patch(SSH_HELPER) - def test_wait_for_instantiate_panic(self, ssh, mock_time): + def test_wait_for_instantiate_panic(self, ssh, *args): mock_ssh(ssh, exec_result=(1, "", "")) prox_approx_vnf = ProxApproxVnf(NAME, self.VNFD0) prox_approx_vnf._vnf_process = mock.MagicMock(**{"is_alive.return_value": True}) @@ -413,16 +393,9 @@ class TestProxApproxVnf(unittest.TestCase): with self.assertRaises(RuntimeError): prox_approx_vnf.wait_for_instantiate() - @mock.patch(SSH_HELPER) - def test_scale(self, ssh, mock_time): - mock_ssh(ssh) - prox_approx_vnf = ProxApproxVnf(NAME, self.VNFD0) - with self.assertRaises(NotImplementedError): - prox_approx_vnf.scale() - @mock.patch('yardstick.network_services.vnf_generic.vnf.prox_helpers.socket') @mock.patch(SSH_HELPER) - def test_terminate(self, ssh, mock_socket, mock_time): + def test_terminate(self, ssh, *args): mock_ssh(ssh) prox_approx_vnf = ProxApproxVnf(NAME, self.VNFD0) prox_approx_vnf._vnf_process = mock.MagicMock() @@ -434,7 +407,7 @@ class TestProxApproxVnf(unittest.TestCase): self.assertIsNone(prox_approx_vnf.terminate()) @mock.patch(SSH_HELPER) - def test__vnf_up_post(self, ssh, mock_time): + def test__vnf_up_post(self, ssh, *args): mock_ssh(ssh) prox_approx_vnf = ProxApproxVnf(NAME, self.VNFD0) prox_approx_vnf.resource_helper = resource_helper = mock.Mock() @@ -443,7 +416,7 @@ class TestProxApproxVnf(unittest.TestCase): self.assertEqual(resource_helper.up_post.call_count, 1) @mock.patch(SSH_HELPER) - def test_vnf_execute_oserror(self, ssh, mock_time): + def test_vnf_execute_oserror(self, ssh, *args): mock_ssh(ssh) prox_approx_vnf = ProxApproxVnf(NAME, self.VNFD0) prox_approx_vnf.resource_helper = resource_helper = mock.Mock() @@ -457,6 +430,3 @@ class TestProxApproxVnf(unittest.TestCase): resource_helper.execute.side_effect = OSError(errno.EADDRINUSE, "") with self.assertRaises(OSError): prox_approx_vnf.vnf_execute("", _ignore_errors=True) - -if __name__ == '__main__': - unittest.main() diff --git a/tests/unit/network_services/vnf_generic/vnf/test_router_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_router_vnf.py new file mode 100644 index 000000000..9ed6fd5b3 --- /dev/null +++ b/tests/unit/network_services/vnf_generic/vnf/test_router_vnf.py @@ -0,0 +1,267 @@ +#!/usr/bin/env python + +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from __future__ import absolute_import + +import unittest +import mock + +from tests.unit import STL_MOCKS +from tests.unit.network_services.vnf_generic.vnf.test_base import mock_ssh + + +STLClient = mock.MagicMock() +stl_patch = mock.patch.dict("sys.modules", STL_MOCKS) +stl_patch.start() + +if stl_patch: + from yardstick.network_services.vnf_generic.vnf.router_vnf import RouterVNF + + +TEST_FILE_YAML = 'nsb_test_case.yaml' +SSH_HELPER = 'yardstick.network_services.vnf_generic.vnf.sample_vnf.VnfSshHelper' + + +name = 'vnf__1' + + +class TestRouterVNF(unittest.TestCase): + VNFD = {'vnfd:vnfd-catalog': + {'vnfd': + [{'short-name': 'RouterVNF', + 'vdu': + [{'routing_table': [], + 'description': 'RouterVNF', + 'name': 'router-baremetal', + 'nd_route_tbl': [], + 'id': 'router-baremetal', + 'external-interface': + [{'virtual-interface': + {'dst_mac': '00:00:00:00:00:04', + 'vpci': '0000:05:00.0', + 'local_ip': '152.16.100.19', + 'type': 'PCI-PASSTHROUGH', + 'netmask': '255.255.255.0', + 'dpdk_port_num': 0, + 'bandwidth': '10 Gbps', + 'driver': "i40e", + 'dst_ip': '152.16.100.20', + 'local_iface_name': 'xe0', + 'local_mac': '00:00:00:00:00:02'}, + 'vnfd-connection-point-ref': 'xe0', + 'name': 'xe0'}, + {'virtual-interface': + {'dst_mac': '00:00:00:00:00:03', + 'vpci': '0000:05:00.1', + 'local_ip': '152.16.40.19', + 'type': 'PCI-PASSTHROUGH', + 'driver': "i40e", + 'netmask': '255.255.255.0', + 'dpdk_port_num': 1, + 'bandwidth': '10 Gbps', + 'dst_ip': '152.16.40.20', + 'local_iface_name': 'xe1', + 'local_mac': '00:00:00:00:00:01'}, + 'vnfd-connection-point-ref': 'xe1', + 'name': 'xe1'}]}], + 'description': 'RouterVNF', + 'mgmt-interface': + {'vdu-id': 'router-baremetal', + 'host': '1.2.1.1', + 'password': 'r00t', + 'user': 'root', + 'ip': '1.2.1.1'}, + 'benchmark': + {'kpi': ['packets_in', 'packets_fwd', 'packets_dropped']}, + 'connection-point': [{'type': 'VPORT', 'name': 'xe0'}, + {'type': 'VPORT', 'name': 'xe1'}], + 'id': 'RouterVNF', 'name': 'VPEVnfSsh'}]}} + + scenario_cfg = {'nodes': {'cpt__0': 'compute_0.compute_nodes', + 'tg__0': 'trafficgen_1.baremetal', + 'vnf__0': 'vnf.yardstick'}, + 'options': {'flow': {'count': 128000, + 'dst_ip': ['10.0.3.26-10.0.3.105'], + 'dst_port': ['2001-2004'], + 'src_ip': ['10.0.2.26-10.0.2.105'], + 'src_port': ['1234-1238']}, + 'framesize': {'downlink': {'1024B': 100}, + 'uplink': {'1024B': 100}}, + 'rfc2544': {'allowed_drop_rate': '0.0001 - 0.1'}, + 'tg__0': {'queues_per_port': 7}, + 'traffic_type': 4, + 'vnf__0': {'nfvi_enable': True}}, + 'runner': {'interval': 35, + 'iterations': 10, + 'type': 'Iteration'}, + 'topology': 'router-tg-topology.yaml', + 'traffic_profile': '../../traffic_profiles/ipv4_throughput.yaml', + 'type': 'NSPerf'} + + context_cfg = {'nodes': {'tg__1': + {'member-vnf-index': '1', + 'role': 'TrafficGen', + 'name': 'trafficgen_1.yardstick', + 'vnfd-id-ref': 'tg__1', + 'ip': '1.2.1.1', + 'interfaces': + {'xe0': {'local_iface_name': 'ens785f0', + 'vld_id': RouterVNF.UPLINK, + 'netmask': '255.255.255.0', + 'local_ip': '152.16.100.20', + 'dst_mac': '00:00:00:00:00:02', + 'local_mac': '00:00:00:00:00:04', + 'dst_ip': '152.16.100.19', + 'driver': 'i40e', + 'vpci': '0000:05:00.0', + 'dpdk_port_num': 0}, + 'xe1': {'local_iface_name': 'ens785f1', + 'netmask': '255.255.255.0', + 'local_ip': '152.16.100.21', + 'local_mac': '00:00:00:00:00:01', + 'driver': 'i40e', + 'vpci': '0000:05:00.1', + 'dpdk_port_num': 1}}, + 'password': 'r00t', + 'VNF model': 'tg_rfc2544_tpl.yaml', + 'user': 'root'}, + 'vnf__1': + {'name': 'vnf.yardstick', + 'vnfd-id-ref': 'vnf__1', + 'ip': '1.2.1.1', + 'interfaces': + {'xe0': {'local_iface_name': 'ens786f0', + 'vld_id': RouterVNF.UPLINK, + 'netmask': '255.255.255.0', + 'local_ip': '152.16.100.19', + 'dst_mac': '00:00:00:00:00:04', + 'local_mac': '00:00:00:00:00:02', + 'dst_ip': '152.16.100.20', + 'driver': 'i40e', + 'vpci': '0000:05:00.0', + 'dpdk_port_num': 0}, + 'xe1': {'local_iface_name': 'ens786f1', + 'vld_id': RouterVNF.DOWNLINK, + 'netmask': '255.255.255.0', + 'local_ip': '152.16.40.19', + 'dst_mac': '00:00:00:00:00:03', + 'local_mac': '00:00:00:00:00:01', + 'dst_ip': '152.16.40.20', + 'driver': 'i40e', + 'vpci': '0000:05:00.1', + 'dpdk_port_num': 1}}, + 'routing_table': [], + 'member-vnf-index': '2', + 'host': '1.2.1.1', + 'role': 'vnf', + 'user': 'root', + 'nd_route_tbl': [], + 'password': 'r00t', + 'VNF model': 'router_vnf.yaml'}}} + + IP_SHOW_STATS_OUTPUT = """\ +2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 + link/ether d4:c9:ef:52:7c:4d brd ff:ff:ff:ff:ff:ff + RX: bytes packets errors dropped overrun mcast + 2781945429 3202213 0 0 0 30131 + RX errors: length crc frame fifo missed + 0 0 0 0 0 + TX: bytes packets errors dropped carrier collsns + 646221183 2145799 0 0 0 0 + TX errors: aborted fifo window heartbeat + 0 0 0 0 +""" + STATS = { + 'RX:bytes': '2781945429', + 'RX:dropped': '0', + 'RX:errors': '0', + 'RX:mcast': '30131', + 'RX:overrun': '0', + 'RX:packets': '3202213', + 'RX errors:length': '0', + 'RX errors:crc': '0', + 'RX errors:frame': '0', + 'RX errors:fifo': '0', + 'RX errors:missed': '0', + 'TX:bytes': '646221183', + 'TX:carrier': '0', + 'TX:collsns': '0', + 'TX:dropped': '0', + 'TX:errors': '0', + 'TX:packets': '2145799', + 'TX errors:aborted': '0', + 'TX errors:fifo': '0', + 'TX errors:window': '0', + 'TX errors:heartbeat': '0', + } + + def test___init__(self): + vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] + router_vnf = RouterVNF(name, vnfd) + self.assertIsNone(router_vnf._vnf_process) + + def test_get_stats(self): + stats = RouterVNF.get_stats(self.IP_SHOW_STATS_OUTPUT) + self.assertDictEqual(stats, self.STATS) + + @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") + @mock.patch(SSH_HELPER) + def test_collect_kpi(self, ssh, _): + m = mock_ssh(ssh) + + vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] + router_vnf = RouterVNF(name, vnfd) + router_vnf.ssh_helper = m + result = {'packets_dropped': 0, 'packets_fwd': 0, 'packets_in': 0, 'link_stats': {}} + self.assertEqual(result, router_vnf.collect_kpi()) + + @mock.patch(SSH_HELPER) + def test_run_router(self, ssh): + mock_ssh(ssh) + + vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] + router_vnf = RouterVNF(name, vnfd) + router_vnf.scenario_helper.scenario_cfg = self.scenario_cfg + router_vnf._run() + router_vnf.ssh_helper.drop_connection.assert_called_once() + + @mock.patch("yardstick.network_services.vnf_generic.vnf.router_vnf.Context") + @mock.patch(SSH_HELPER) + def test_instantiate(self, ssh, _): + mock_ssh(ssh) + + vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] + router_vnf = RouterVNF(name, vnfd) + router_vnf.WAIT_TIME = 0 + router_vnf.INTERFACE_WAIT = 0 + self.scenario_cfg.update({"nodes": {"vnf__1": ""}}) + self.assertIsNone(router_vnf.instantiate(self.scenario_cfg, + self.context_cfg)) + + @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") + @mock.patch(SSH_HELPER) + def test_terminate(self, ssh, _): + mock_ssh(ssh) + + vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] + router_vnf = RouterVNF(name, vnfd) + router_vnf._vnf_process = mock.MagicMock() + router_vnf._vnf_process.terminate = mock.Mock() + self.assertEqual(None, router_vnf.terminate()) + +if __name__ == '__main__': + unittest.main() diff --git a/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py index 85b10c5a9..beb4f8f9f 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py @@ -15,10 +15,6 @@ # limitations under the License. # -# Unittest for yardstick.network_services.vnf_generic.vnf.sample_vnf - -from __future__ import absolute_import - import unittest import mock from copy import deepcopy @@ -26,8 +22,8 @@ from copy import deepcopy from tests.unit.network_services.vnf_generic.vnf.test_base import mock_ssh from tests.unit import STL_MOCKS from yardstick.benchmark.contexts.base import Context +from yardstick.common import exceptions as y_exceptions from yardstick.network_services.nfvi.resource import ResourceProfile -from yardstick.network_services.traffic_profile.base import TrafficProfile from yardstick.network_services.vnf_generic.vnf.base import VnfdHelper @@ -571,7 +567,7 @@ class TestDpdkVnfSetupEnvHelper(unittest.TestCase): @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.open') @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.find_relative_file') @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.MultiPortConfig') - def test_build_config(self, mock_multi_port_config_class, mock_find, _): + def test_build_config(self, mock_multi_port_config_class, mock_find, *args): mock_multi_port_config = mock_multi_port_config_class() vnfd_helper = VnfdHelper(self.VNFD_0) ssh_helper = mock.Mock() @@ -610,8 +606,8 @@ class TestDpdkVnfSetupEnvHelper(unittest.TestCase): @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time') @mock.patch('yardstick.ssh.SSH') - def test_setup_vnf_environment(self, _, mock_time): - def execute(cmd, *args, **kwargs): + def test_setup_vnf_environment(self, *args): + def execute(cmd): if cmd.startswith('which '): return exec_failure return exec_success @@ -643,7 +639,7 @@ class TestDpdkVnfSetupEnvHelper(unittest.TestCase): @mock.patch('yardstick.ssh.SSH') def test__setup_dpdk_short(self, _): - def execute_side(cmd, *args, **kwargs): + def execute_side(cmd): if 'joined_path' in cmd: return 0, 'output', '' return 1, 'bad output', 'error output' @@ -691,7 +687,7 @@ class TestDpdkVnfSetupEnvHelper(unittest.TestCase): self.assertEqual(dpdk_setup_helper.socket, 1) @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time') - def test__detect_and_bind_drivers(self, mock_time): + def test__detect_and_bind_drivers(self, *args): vnfd_helper = VnfdHelper(deepcopy(self.VNFD_0)) ssh_helper = mock.Mock() # ssh_helper.execute = mock.Mock(return_value = (0, 'text', '')) @@ -1002,7 +998,7 @@ class TestClientResourceHelper(unittest.TestCase): @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.LOG') @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.STLError', new_callable=lambda: MockError) - def test_get_stats_not_connected(self, mock_state_error, mock_logger): + def test_get_stats_not_connected(self, mock_state_error, *args): vnfd_helper = VnfdHelper(self.VNFD_0) ssh_helper = mock.Mock() scenario_helper = mock.Mock() @@ -1221,7 +1217,7 @@ class TestClientResourceHelper(unittest.TestCase): @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.LOG') @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.STLError', new_callable=lambda: MockError) - def test__connect_with_failures(self, mock_error, mock_logger, mock_time): + def test__connect_with_failures(self, mock_error, *args): vnfd_helper = VnfdHelper(self.VNFD_0) ssh_helper = mock.Mock() scenario_helper = mock.Mock() @@ -1393,7 +1389,7 @@ class TestSampleVNFDeployHelper(unittest.TestCase): @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time') @mock.patch('subprocess.check_output') - def test_deploy_vnfs_disabled(self, mock_check_output, mock_time): + def test_deploy_vnfs_disabled(self, *args): vnfd_helper = mock.Mock() ssh_helper = mock.Mock() ssh_helper.join_bin_path.return_value = 'joined_path' @@ -1408,7 +1404,7 @@ class TestSampleVNFDeployHelper(unittest.TestCase): @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time') @mock.patch('subprocess.check_output') - def test_deploy_vnfs(self, mock_check_output, mock_time): + def test_deploy_vnfs(self, *args): vnfd_helper = mock.Mock() ssh_helper = mock.Mock() ssh_helper.join_bin_path.return_value = 'joined_path' @@ -1422,7 +1418,7 @@ class TestSampleVNFDeployHelper(unittest.TestCase): self.assertEqual(ssh_helper.put.call_count, 1) @mock.patch('subprocess.check_output') - def test_deploy_vnfs_early_success(self, mock_check_output): + def test_deploy_vnfs_early_success(self, *args): vnfd_helper = mock.Mock() ssh_helper = mock.Mock() ssh_helper.join_bin_path.return_value = 'joined_path' @@ -1700,7 +1696,7 @@ class TestSampleVnf(unittest.TestCase): self.assertEqual(result, expected) @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.Process') - def test__start_vnf(self, mock_process_type): + def test__start_vnf(self, *args): vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] sample_vnf = SampleVNF('vnf1', vnfd) sample_vnf._run = mock.Mock() @@ -1754,7 +1750,7 @@ class TestSampleVnf(unittest.TestCase): @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") @mock.patch("yardstick.ssh.SSH") - def test_wait_for_instantiate_empty_queue(self, ssh, mock_time): + def test_wait_for_instantiate_empty_queue(self, ssh, *args): mock_ssh(ssh, exec_result=(1, "", "")) queue_size_list = [ @@ -1798,7 +1794,7 @@ class TestSampleVnf(unittest.TestCase): self.assertIsNotNone(sample_vnf.my_ports) @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") - def test_vnf_execute_with_queue_data(self, mock_time): + def test_vnf_execute_with_queue_data(self, *args): queue_size_list = [ 1, 1, @@ -1843,7 +1839,7 @@ class TestSampleVnf(unittest.TestCase): vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] sample_vnf = SampleVNF('vnf1', vnfd) sample_vnf.APP_NAME = 'sample1' - sample_vnf.COLLECT_KPI = '\s(\d+)\D*(\d+)\D*(\d+)' + sample_vnf.COLLECT_KPI = r'\s(\d+)\D*(\d+)\D*(\d+)' sample_vnf.COLLECT_MAP = { 'k1': 3, 'k2': 1, @@ -1866,7 +1862,7 @@ class TestSampleVnf(unittest.TestCase): vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] sample_vnf = SampleVNF('vnf1', vnfd) sample_vnf.APP_NAME = 'sample1' - sample_vnf.COLLECT_KPI = '\s(\d+)\D*(\d+)\D*(\d+)' + sample_vnf.COLLECT_KPI = r'\s(\d+)\D*(\d+)\D*(\d+)' sample_vnf.get_stats = mock.Mock(return_value='') expected = { @@ -1877,6 +1873,29 @@ class TestSampleVnf(unittest.TestCase): result = sample_vnf.collect_kpi() self.assertDictEqual(result, expected) + def test_scale(self): + vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] + sample_vnf = SampleVNF('vnf1', vnfd) + self.assertRaises(y_exceptions.FunctionNotImplemented, + sample_vnf.scale) + + def test__run(self): + test_cmd = 'test cmd' + run_kwargs = {'arg1': 'val1', 'arg2': 'val2'} + vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] + sample_vnf = SampleVNF('vnf1', vnfd) + sample_vnf.ssh_helper = mock.Mock() + sample_vnf.setup_helper = mock.Mock() + with mock.patch.object(sample_vnf, '_build_config', + return_value=test_cmd), \ + mock.patch.object(sample_vnf, '_build_run_kwargs'): + sample_vnf.run_kwargs = run_kwargs + sample_vnf._run() + sample_vnf.ssh_helper.drop_connection.assert_called_once() + sample_vnf.ssh_helper.run.assert_called_once_with(test_cmd, + **run_kwargs) + sample_vnf.setup_helper.kill_vnf.assert_called_once() + class TestSampleVNFTrafficGen(unittest.TestCase): @@ -2051,3 +2070,8 @@ class TestSampleVNFTrafficGen(unittest.TestCase): self.assertEqual(sample_vnf_tg._wait_for_process(), 234) mock_proc.is_alive.assert_has_calls([mock.call(), mock.call()]) mock_status.assert_has_calls([mock.call(), mock.call()]) + + def test_scale(self): + sample_vnf_tg = SampleVNFTrafficGen('tg1', self.VNFD_0) + self.assertRaises(y_exceptions.FunctionNotImplemented, + sample_vnf_tg.scale) diff --git a/tests/unit/network_services/vnf_generic/vnf/test_tg_ping.py b/tests/unit/network_services/vnf_generic/vnf/test_tg_ping.py index c1b2d27eb..63b2ac4ab 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_tg_ping.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_tg_ping.py @@ -228,7 +228,7 @@ class TestPingTrafficGen(unittest.TestCase): CMD_KWARGS = { 'target_ip': u'152.16.100.20', 'local_ip': u'152.16.100.19', - 'local_if_name': u'xe0', + 'local_if_name': u'xe0_fake', } @mock.patch("yardstick.ssh.SSH") @@ -270,7 +270,7 @@ class TestPingTrafficGen(unittest.TestCase): mock_ssh(ssh, spec=VnfSshHelper, exec_result=(0, "success", "")) ping_traffic_gen = PingTrafficGen('vnf1', self.VNFD_0) ping_traffic_gen.setup_helper.ssh_helper = mock.MagicMock( - **{"execute.return_value": (0, "success", "")}) + **{"execute.return_value": (0, "xe0_fake", "")}) self.assertIsInstance(ping_traffic_gen.ssh_helper, mock.Mock) self.assertEqual(ping_traffic_gen._result, {}) @@ -278,24 +278,16 @@ class TestPingTrafficGen(unittest.TestCase): self.assertEqual( ping_traffic_gen.vnfd_helper.interfaces[0]['virtual-interface']['local_iface_name'], - 'success') + 'xe0_fake') self.assertEqual(self.CMD_KWARGS, ping_traffic_gen.resource_helper.cmd_kwargs) self.assertIsNotNone(ping_traffic_gen._result) @mock.patch("yardstick.ssh.SSH") - def test_listen_traffic(self, ssh): + def test_listen_traffic(self, *args): ping_traffic_gen = PingTrafficGen('vnf1', self.VNFD_0) self.assertIsNone(ping_traffic_gen.listen_traffic({})) @mock.patch("yardstick.ssh.SSH") - def test_scale_negative(self, ssh): - ssh.from_node.return_value.execute.return_value = 0, "success", "" - ssh.from_node.return_value.run.return_value = 0, "success", "" - - ping_traffic_gen = PingTrafficGen('vnf1', self.VNFD_0) - ping_traffic_gen.scale() - - @mock.patch("yardstick.ssh.SSH") def test_terminate(self, ssh): ssh.from_node.return_value.execute.return_value = 0, "success", "" ssh.from_node.return_value.run.return_value = 0, "success", "" diff --git a/tests/unit/network_services/vnf_generic/vnf/test_tg_prox.py b/tests/unit/network_services/vnf_generic/vnf/test_tg_prox.py index 23d448c5e..0104e7f63 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_tg_prox.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_tg_prox.py @@ -13,14 +13,13 @@ # limitations under the License. # -from __future__ import absolute_import - import unittest import mock from tests.unit.network_services.vnf_generic.vnf.test_base import mock_ssh from tests.unit import STL_MOCKS + SSH_HELPER = 'yardstick.network_services.vnf_generic.vnf.sample_vnf.VnfSshHelper' NAME = 'vnf__1' @@ -319,26 +318,28 @@ class TestProxTrafficGen(unittest.TestCase): 'upper_bound': 100.0}} @mock.patch(SSH_HELPER) - def test___init__(self, ssh, mock_time): + def test___init__(self, ssh, *args): mock_ssh(ssh) prox_traffic_gen = ProxTrafficGen(NAME, self.VNFD0) self.assertIsNone(prox_traffic_gen._tg_process) self.assertIsNone(prox_traffic_gen._traffic_process) @mock.patch(SSH_HELPER) - def test_collect_kpi(self, ssh, mock_time): + def test_collect_kpi(self, ssh, *args): mock_ssh(ssh) prox_traffic_gen = ProxTrafficGen(NAME, self.VNFD0) prox_traffic_gen._vnf_wrapper.resource_helper.resource = mock.MagicMock( - **{"check_if_sa_running.return_value": [False]}) + **{"self.check_if_system_agent_running.return_value": [False]}) prox_traffic_gen._vnf_wrapper.vnf_execute = mock.Mock(return_value="") self.assertEqual({}, prox_traffic_gen.collect_kpi()) - @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.CpuSysCores') + @mock.patch('yardstick.network_services.vnf_generic.vnf.prox_helpers.find_relative_file') + @mock.patch( + 'yardstick.network_services.vnf_generic.vnf.sample_vnf.CpuSysCores') @mock.patch(SSH_HELPER) - def bad_test_instantiate(self, ssh, mock_find, mock_cpu_sys_cores, mock_time): + def bad_test_instantiate(self, ssh, mock_cpu_sys_cores, *args): mock_ssh(ssh) mock_cpu_sys_cores.get_core_socket.return_value = {'0': '01234'} @@ -381,7 +382,7 @@ class TestProxTrafficGen(unittest.TestCase): prox_traffic_gen.instantiate(scenario_cfg, {}) @mock.patch(SSH_HELPER) - def test__traffic_runner(self, ssh, mock_time): + def test__traffic_runner(self, ssh, *args): mock_ssh(ssh) mock_traffic_profile = mock.Mock(autospec=TrafficProfile) @@ -399,17 +400,9 @@ class TestProxTrafficGen(unittest.TestCase): sut._connect_client.get_stats = mock.Mock(return_value="0") sut._traffic_runner(mock_traffic_profile) - @mock.patch(SSH_HELPER) - def test_scale(self, ssh, mock_time): - mock_ssh(ssh, exec_result=(1, "", "")) - vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] - prox_traffic_gen = ProxTrafficGen(NAME, vnfd) - with self.assertRaises(NotImplementedError): - prox_traffic_gen.scale('') - @mock.patch('yardstick.network_services.vnf_generic.vnf.prox_helpers.socket') @mock.patch(SSH_HELPER) - def test_listen_traffic(self, ssh, mock_socket, mock_time): + def test_listen_traffic(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] prox_traffic_gen = ProxTrafficGen(NAME, vnfd) @@ -417,7 +410,7 @@ class TestProxTrafficGen(unittest.TestCase): @mock.patch('yardstick.network_services.vnf_generic.vnf.prox_helpers.socket') @mock.patch(SSH_HELPER) - def test_terminate(self, ssh, mock_socket, mock_time): + def test_terminate(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] prox_traffic_gen = ProxTrafficGen(NAME, vnfd) diff --git a/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py b/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py index f62a0fb3b..e9f718cb7 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py @@ -15,8 +15,6 @@ # limitations under the License. # -from __future__ import absolute_import - import os import unittest import mock @@ -40,14 +38,14 @@ NAME = "tg__1" @mock.patch("yardstick.network_services.vnf_generic.vnf.tg_rfc2544_ixia.IxNextgen") class TestIxiaResourceHelper(unittest.TestCase): - def test___init___with_custom_rfc_helper(self, mock_ix_nextgen): + def test___init___with_custom_rfc_helper(self, *args): class MyRfcHelper(IxiaRfc2544Helper): pass ixia_resource_helper = IxiaResourceHelper(mock.Mock(), MyRfcHelper) self.assertIsInstance(ixia_resource_helper.rfc_helper, MyRfcHelper) - def test_stop_collect_with_client(self, mock_ix_nextgen): + def test_stop_collect_with_client(self, *args): mock_client = mock.Mock() ixia_resource_helper = IxiaResourceHelper(mock.Mock()) @@ -154,16 +152,17 @@ class TestIXIATrafficGen(unittest.TestCase): 'file': '/etc/yardstick/nodes/pod.yaml'}, 'schema': 'yardstick:task:0.1'} - def test___init__(self, mock_ixnextgen): + def test___init__(self, *args): with mock.patch("yardstick.ssh.SSH") as ssh: ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] - ixnet_traffic_gen = IxiaTrafficGen(NAME, vnfd) + # NOTE(ralonsoh): check the object returned. + IxiaTrafficGen(NAME, vnfd) - def test_listen_traffic(self, mock_ixnextgen): + def test_listen_traffic(self, *args): with mock.patch("yardstick.ssh.SSH") as ssh: ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ @@ -173,7 +172,7 @@ class TestIXIATrafficGen(unittest.TestCase): ixnet_traffic_gen = IxiaTrafficGen(NAME, vnfd) self.assertEqual(None, ixnet_traffic_gen.listen_traffic({})) - def test_instantiate(self, mock_ixnextgen): + def test_instantiate(self, *args): with mock.patch("yardstick.ssh.SSH") as ssh: ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ @@ -203,7 +202,7 @@ class TestIXIATrafficGen(unittest.TestCase): IOError, ixnet_traffic_gen.instantiate(scenario_cfg, {})) - def test_collect_kpi(self, mock_ixnextgen): + def test_collect_kpi(self, *args): with mock.patch("yardstick.ssh.SSH") as ssh: ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ @@ -215,7 +214,7 @@ class TestIXIATrafficGen(unittest.TestCase): restult = ixnet_traffic_gen.collect_kpi() self.assertEqual({}, restult) - def test_terminate(self, mock_ixnextgen): + def test_terminate(self, *args): with mock.patch("yardstick.ssh.SSH") as ssh: vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] ssh_mock = mock.Mock(autospec=ssh.SSH) @@ -236,19 +235,14 @@ class TestIXIATrafficGen(unittest.TestCase): file_path = os.path.join(curr_path, filename) return file_path - def test_scale(self, mock_ix_nextgen): - vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] - sut = IxiaTrafficGen('vnf1', vnfd) - sut.scale() - - def test__check_status(self, mock_ix_nextgen): + def test__check_status(self, *args): vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] sut = IxiaTrafficGen('vnf1', vnfd) sut._check_status() @mock.patch("yardstick.network_services.vnf_generic.vnf.tg_rfc2544_ixia.time") @mock.patch("yardstick.ssh.SSH") - def test_traffic_runner(self, mock_ixnextgen, mock_ssh, mock_time): + def test_traffic_runner(self, mock_ssh, *args): mock_traffic_profile = mock.Mock(autospec=TrafficProfile) mock_traffic_profile.get_traffic_definition.return_value = "64" mock_traffic_profile.params = self.TRAFFIC_PROFILE diff --git a/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py b/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py index 637706fb4..7342cfcdc 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py @@ -331,15 +331,6 @@ class TestTrexTrafficGenRFC(unittest.TestCase): trex_traffic_gen.resource_helper.ssh_helper = mock.MagicMock() self.assertIsNone(trex_traffic_gen.resource_helper.generate_cfg()) - def test_scale(self): - with mock.patch(SSH_HELPER) as ssh: - ssh_mock = mock.Mock(autospec=ssh.SSH) - ssh_mock.execute = mock.Mock(return_value=(0, "", "")) - ssh_mock.run = mock.Mock(return_value=(0, "", "")) - ssh.from_node.return_value = ssh_mock - trex_traffic_gen = TrexTrafficGenRFC('vnf1', self.VNFD_0) - trex_traffic_gen.scale('') - def test_terminate(self): with mock.patch(SSH_HELPER) as ssh: ssh_mock = mock.Mock(autospec=ssh.SSH) diff --git a/tests/unit/network_services/vnf_generic/vnf/test_tg_trex.py b/tests/unit/network_services/vnf_generic/vnf/test_tg_trex.py index a2a5058fc..618071507 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_tg_trex.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_tg_trex.py @@ -15,18 +15,16 @@ # limitations under the License. # -from __future__ import absolute_import - -import unittest - import copy import mock -SSH_HELPER = 'yardstick.network_services.vnf_generic.vnf.sample_vnf.VnfSshHelper' +import unittest from tests.unit.network_services.vnf_generic.vnf.test_base import mock_ssh from tests.unit import STL_MOCKS + +SSH_HELPER = 'yardstick.network_services.vnf_generic.vnf.sample_vnf.VnfSshHelper' NAME = 'vnf_1' STLClient = mock.MagicMock() @@ -469,13 +467,6 @@ class TestTrexTrafficGen(unittest.TestCase): self.assertIsNotNone(result) @mock.patch(SSH_HELPER) - def test_scale(self, ssh): - mock_ssh(ssh, exec_result=(1, "", "")) - vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] - trex_traffic_gen = TrexTrafficGen(NAME, vnfd) - trex_traffic_gen.scale('') - - @mock.patch(SSH_HELPER) def test_terminate(self, ssh): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] diff --git a/tests/unit/network_services/vnf_generic/vnf/test_udp_replay.py b/tests/unit/network_services/vnf_generic/vnf/test_udp_replay.py index d4d3439f3..635ce2735 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_udp_replay.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_udp_replay.py @@ -15,26 +15,24 @@ # limitations under the License. # -from __future__ import absolute_import - import unittest import mock import os from tests.unit import STL_MOCKS -SSH_HELPER = 'yardstick.network_services.vnf_generic.vnf.sample_vnf.VnfSshHelper' +from tests.unit.network_services.vnf_generic.vnf.test_base import mock_ssh +SSH_HELPER = 'yardstick.network_services.vnf_generic.vnf.sample_vnf.VnfSshHelper' + STLClient = mock.MagicMock() stl_patch = mock.patch.dict("sys.modules", STL_MOCKS) stl_patch.start() if stl_patch: from yardstick.network_services.vnf_generic.vnf.udp_replay import UdpReplayApproxVnf - from yardstick.network_services.nfvi.resource import ResourceProfile from yardstick.network_services.vnf_generic.vnf.sample_vnf import ScenarioHelper -from tests.unit.network_services.vnf_generic.vnf.test_base import mock_ssh TEST_FILE_YAML = 'nsb_test_case.yaml' @@ -329,13 +327,13 @@ class TestUdpReplayApproxVnf(unittest.TestCase): } } - def test___init__(self, _): + def test___init__(self, *args): udp_replay_approx_vnf = UdpReplayApproxVnf(NAME, self.VNFD_0) self.assertIsNone(udp_replay_approx_vnf._vnf_process) @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") @mock.patch(SSH_HELPER) - def test_collect_kpi(self, ssh, mock_time, _): + def test_collect_kpi(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD_0 @@ -354,7 +352,7 @@ class TestUdpReplayApproxVnf(unittest.TestCase): self.assertEqual(result, udp_replay_approx_vnf.collect_kpi()) @mock.patch(SSH_HELPER) - def test_get_stats(self, ssh, _): + def test_get_stats(self, ssh, *args): mock_ssh(ssh) udp_replay_approx_vnf = UdpReplayApproxVnf(NAME, self.VNFD_0) @@ -376,7 +374,7 @@ class TestUdpReplayApproxVnf(unittest.TestCase): @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.Context") @mock.patch(SSH_HELPER) - def test__build_config(self, ssh, mock_context, *_): + def test__build_config(self, ssh, mock_context, *args): mock_ssh(ssh) udp_replay_approx_vnf = UdpReplayApproxVnf(NAME, self.VNFD_0) @@ -397,7 +395,7 @@ class TestUdpReplayApproxVnf(unittest.TestCase): @mock.patch('yardstick.network_services.vnf_generic.vnf.udp_replay.open') @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.Context") @mock.patch(SSH_HELPER) - def test__build_pipeline_kwargs(self, ssh, mock_context, *_): + def test__build_pipeline_kwargs(self, ssh, mock_context, *args): mock_ssh(ssh) udp_replay_approx_vnf = UdpReplayApproxVnf(NAME, self.VNFD_0) udp_replay_approx_vnf.nfvi_context = mock_context @@ -420,7 +418,7 @@ class TestUdpReplayApproxVnf(unittest.TestCase): }) @mock.patch(SSH_HELPER) - def test_run_udp_replay(self, ssh, _): + def test_run_udp_replay(self, ssh, *args): mock_ssh(ssh) udp_replay_approx_vnf = UdpReplayApproxVnf(NAME, self.VNFD_0) @@ -434,11 +432,9 @@ class TestUdpReplayApproxVnf(unittest.TestCase): @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.Context") @mock.patch(SSH_HELPER) - def test_instantiate(self, ssh, *_): + def test_instantiate(self, ssh, *args): mock_ssh(ssh) - resource = mock.Mock(autospec=ResourceProfile) - udp_replay_approx_vnf = UdpReplayApproxVnf(NAME, self.VNFD_0) udp_replay_approx_vnf.q_out.put("Replay>") udp_replay_approx_vnf.WAIT_TIME = 0 @@ -456,7 +452,7 @@ class TestUdpReplayApproxVnf(unittest.TestCase): @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.Context") @mock.patch('yardstick.ssh.SSH') @mock.patch(SSH_HELPER) - def test_instantiate_panic(self, ssh, resource_ssh, *_): + def test_instantiate_panic(self, *args): udp_replay_approx_vnf = UdpReplayApproxVnf(NAME, self.VNFD_0) udp_replay_approx_vnf.WAIT_TIME = 0 udp_replay_approx_vnf.q_out.put("some text PANIC some text") @@ -467,15 +463,9 @@ class TestUdpReplayApproxVnf(unittest.TestCase): with self.assertRaises(RuntimeError): udp_replay_approx_vnf.wait_for_instantiate() - def test_scale(self, _): - udp_replay_approx_vnf = UdpReplayApproxVnf(NAME, self.VNFD_0) - flavor = "" - - self.assertRaises(NotImplementedError, udp_replay_approx_vnf.scale, flavor) - @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") @mock.patch(SSH_HELPER) - def test_terminate(self, ssh, mock_time, _): + def test_terminate(self, ssh, *args): mock_ssh(ssh) udp_replay_approx_vnf = UdpReplayApproxVnf(NAME, self.VNFD_0) @@ -484,6 +474,3 @@ class TestUdpReplayApproxVnf(unittest.TestCase): udp_replay_approx_vnf.used_drivers = {"01:01.0": "i40e", "01:01.1": "i40e"} udp_replay_approx_vnf.dpdk_nic_bind = "dpdk_nic_bind.py" self.assertEqual(None, udp_replay_approx_vnf.terminate()) - -if __name__ == '__main__': - unittest.main() diff --git a/tests/unit/network_services/vnf_generic/vnf/test_vfw_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_vfw_vnf.py index 958099a03..d128db0b4 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_vfw_vnf.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_vfw_vnf.py @@ -15,8 +15,6 @@ # limitations under the License. # -from __future__ import absolute_import - import unittest import mock import os @@ -32,10 +30,10 @@ if stl_patch: from yardstick.network_services.vnf_generic.vnf.vfw_vnf import FWApproxVnf from yardstick.network_services.nfvi.resource import ResourceProfile + TEST_FILE_YAML = 'nsb_test_case.yaml' SSH_HELPER = 'yardstick.network_services.vnf_generic.vnf.sample_vnf.VnfSshHelper' - name = 'vnf__1' @@ -239,7 +237,7 @@ class TestFWApproxVnf(unittest.TestCase): 'password': 'r00t', 'VNF model': 'vfw_vnf.yaml'}}} - def test___init__(self, mock_process): + def test___init__(self, *args): vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] vfw_approx_vnf = FWApproxVnf(name, vnfd) self.assertIsNone(vfw_approx_vnf._vnf_process) @@ -260,7 +258,7 @@ pipeline> @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") @mock.patch(SSH_HELPER) - def test_collect_kpi(self, ssh, mock_time, mock_process): + def test_collect_kpi(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -282,7 +280,7 @@ pipeline> @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") @mock.patch(SSH_HELPER) - def test_vnf_execute_command(self, ssh, mock_time, mock_process): + def test_vnf_execute_command(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -294,7 +292,7 @@ pipeline> self.assertEqual(vfw_approx_vnf.vnf_execute(cmd), "") @mock.patch(SSH_HELPER) - def test_get_stats(self, ssh, mock_process): + def test_get_stats(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -314,7 +312,7 @@ pipeline> @mock.patch("yardstick.network_services.vnf_generic.vnf.vfw_vnf.eval") @mock.patch("yardstick.network_services.vnf_generic.vnf.vfw_vnf.open") @mock.patch(SSH_HELPER) - def test_run_vfw(self, ssh, mock_open, mock_eval, mock_hex, mock_process): + def test_run_vfw(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -337,7 +335,7 @@ pipeline> @mock.patch("yardstick.network_services.vnf_generic.vnf.vfw_vnf.YangModel") @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.Context") @mock.patch(SSH_HELPER) - def test_instantiate(self, ssh, mock_context, mock_yang, mock_find, mock_process): + def test_instantiate(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -351,16 +349,9 @@ pipeline> self.scenario_cfg.update({"nodes": {"vnf__1": ""}}) self.assertIsNone(vfw_approx_vnf.instantiate(self.scenario_cfg, self.context_cfg)) - def test_scale(self, mock_process): - vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] - vfw_approx_vnf = FWApproxVnf(name, vnfd) - flavor = "" - with self.assertRaises(NotImplementedError): - vfw_approx_vnf.scale(flavor) - @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") @mock.patch(SSH_HELPER) - def test_terminate(self, ssh, mock_time, mock_process): + def test_terminate(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -372,6 +363,3 @@ pipeline> vfw_approx_vnf.dpdk_nic_bind = "dpdk_nic_bind.py" vfw_approx_vnf._resource_collect_stop = mock.Mock() self.assertIsNone(vfw_approx_vnf.terminate()) - -if __name__ == '__main__': - unittest.main() diff --git a/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py index 4103d7825..1abc53688 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py @@ -15,15 +15,17 @@ # limitations under the License. # -from __future__ import absolute_import -import six.moves.configparser as configparser - +from multiprocessing import Process, Queue import os -import unittest +import time + import mock -from multiprocessing import Process, Queue +import six.moves.configparser as configparser +import unittest from tests.unit import STL_MOCKS +from tests.unit.network_services.vnf_generic.vnf.test_base import FileAbsPath +from tests.unit.network_services.vnf_generic.vnf.test_base import mock_ssh from yardstick.network_services.vnf_generic.vnf.base import QueueFileWrapper from yardstick.network_services.vnf_generic.vnf.base import VnfdHelper @@ -40,9 +42,6 @@ if stl_patch: from yardstick.network_services.vnf_generic.vnf.vpe_vnf import \ VpeApproxVnf, VpeApproxSetupEnvHelper -from tests.unit.network_services.vnf_generic.vnf.test_base import FileAbsPath -from tests.unit.network_services.vnf_generic.vnf.test_base import mock_ssh - TEST_FILE_YAML = 'nsb_test_case.yaml' @@ -227,28 +226,6 @@ class TestConfigCreate(unittest.TestCase): self.assertNotEqual(result, '') def test_create_vpe_config(self): - uplink_ports = [ - { - 'index': 0, - 'dpdk_port_num': 1, - 'peer_intf': { - 'dpdk_port_num': 2, - 'index': 3, - }, - }, - ] - - downlink_ports = [ - { - 'index': 2, - 'dpdk_port_num': 3, - 'peer_intf': { - 'dpdk_port_num': 0, - 'index': 1, - }, - }, - ] - vnfd_helper = VnfdHelper(self.VNFD_0) config_create = ConfigCreate(vnfd_helper, 23) config_create.downlink_ports = ['xe1'] @@ -260,7 +237,6 @@ class TestConfigCreate(unittest.TestCase): os.system("git checkout -- %s" % vnf_cfg) -@mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time') class TestVpeApproxVnf(unittest.TestCase): VNFD_0 = { @@ -556,18 +532,21 @@ class TestVpeApproxVnf(unittest.TestCase): }, } - def test___init__(self, _): + def setUp(self): + self.mock_sleep = mock.patch.object(time, 'sleep').start() + + def test___init__(self): vpe_approx_vnf = VpeApproxVnf(NAME, self.VNFD_0) self.assertIsNone(vpe_approx_vnf._vnf_process) @mock.patch(SSH_HELPER) - def test_collect_kpi_sa_not_running(self, ssh, _): + def test_collect_kpi_sa_not_running(self, ssh): mock_ssh(ssh) resource = mock.Mock(autospec=ResourceProfile) - resource.check_if_sa_running.return_value = 1, '' + resource.check_if_system_agent_running.return_value = 1, '' resource.amqp_collect_nfvi_kpi.return_value = {'foo': 234} - resource.check_if_sa_running.return_value = (1, None) + resource.check_if_system_agent_running.return_value = (1, None) vpe_approx_vnf = VpeApproxVnf(NAME, self.VNFD_0) vpe_approx_vnf.q_in = mock.MagicMock() @@ -585,11 +564,11 @@ class TestVpeApproxVnf(unittest.TestCase): self.assertEqual(vpe_approx_vnf.collect_kpi(), expected) @mock.patch(SSH_HELPER) - def test_collect_kpi_sa_running(self, ssh, _): + def test_collect_kpi_sa_running(self, ssh): mock_ssh(ssh) resource = mock.Mock(autospec=ResourceProfile) - resource.check_if_sa_running.return_value = 0, '1234' + resource.check_if_system_agent_running.return_value = 0, '1234' resource.amqp_collect_nfvi_kpi.return_value = {'foo': 234} vpe_approx_vnf = VpeApproxVnf(NAME, self.VNFD_0) @@ -608,7 +587,7 @@ class TestVpeApproxVnf(unittest.TestCase): self.assertEqual(vpe_approx_vnf.collect_kpi(), expected) @mock.patch(SSH_HELPER) - def test_vnf_execute(self, ssh, _): + def test_vnf_execute(self, ssh): mock_ssh(ssh) vpe_approx_vnf = VpeApproxVnf(NAME, self.VNFD_0) vpe_approx_vnf.q_in = mock.MagicMock() @@ -617,7 +596,7 @@ class TestVpeApproxVnf(unittest.TestCase): self.assertEqual(vpe_approx_vnf.vnf_execute("quit", 0), '') @mock.patch(SSH_HELPER) - def test_run_vpe(self, ssh, _): + def test_run_vpe(self, ssh): mock_ssh(ssh) vpe_approx_vnf = VpeApproxVnf(NAME, self.VNFD_0) @@ -651,7 +630,7 @@ class TestVpeApproxVnf(unittest.TestCase): @mock.patch("yardstick.network_services.vnf_generic.vnf.vpe_vnf.ConfigCreate") @mock.patch("yardstick.network_services.vnf_generic.vnf.vpe_vnf.open") @mock.patch(SSH_HELPER) - def test_build_config(self, mock_mul, mock_context, mock_config, mock_open, ssh, _): + def test_build_config(self, ssh, *args): mock_ssh(ssh) vpe_approx_vnf = VpeApproxSetupEnvHelper(mock.MagicMock(), mock.MagicMock, mock.MagicMock) @@ -684,7 +663,7 @@ class TestVpeApproxVnf(unittest.TestCase): self.assertIsNotNone(vpe_approx_vnf.build_config()) @mock.patch(SSH_HELPER) - def test_wait_for_instantiate(self, ssh, _): + def test_wait_for_instantiate(self, ssh): mock_ssh(ssh) mock_process = mock.Mock(autospec=Process) @@ -707,7 +686,7 @@ class TestVpeApproxVnf(unittest.TestCase): self.assertEqual(vpe_approx_vnf.wait_for_instantiate(), 432) @mock.patch(SSH_HELPER) - def test_wait_for_instantiate_fragmented(self, ssh, _): + def test_wait_for_instantiate_fragmented(self, ssh): mock_ssh(ssh) mock_process = mock.Mock(autospec=Process) @@ -730,7 +709,7 @@ class TestVpeApproxVnf(unittest.TestCase): self.assertEqual(vpe_approx_vnf.wait_for_instantiate(), 432) @mock.patch(SSH_HELPER) - def test_wait_for_instantiate_crash(self, ssh, _): + def test_wait_for_instantiate_crash(self, ssh): mock_ssh(ssh, exec_result=(1, "", "")) mock_process = mock.Mock(autospec=Process) @@ -749,7 +728,7 @@ class TestVpeApproxVnf(unittest.TestCase): self.assertIn('VNF process died', str(raised.exception)) @mock.patch(SSH_HELPER) - def test_wait_for_instantiate_panic(self, ssh, _): + def test_wait_for_instantiate_panic(self, ssh): mock_ssh(ssh, exec_result=(1, "", "")) mock_process = mock.Mock(autospec=Process) @@ -769,7 +748,7 @@ class TestVpeApproxVnf(unittest.TestCase): self.assertIn('Error starting', str(raised.exception)) @mock.patch(SSH_HELPER) - def test_wait_for_instantiate_panic_fragmented(self, ssh, _): + def test_wait_for_instantiate_panic_fragmented(self, ssh): mock_ssh(ssh, exec_result=(1, "", "")) mock_process = mock.Mock(autospec=Process) @@ -793,13 +772,8 @@ class TestVpeApproxVnf(unittest.TestCase): self.assertIn('Error starting', str(raised.exception)) - def test_scale(self, _): - vpe_approx_vnf = VpeApproxVnf(NAME, self.VNFD_0) - with self.assertRaises(NotImplementedError): - vpe_approx_vnf.scale('') - @mock.patch(SSH_HELPER) - def test_terminate(self, ssh, _): + def test_terminate(self, ssh): mock_ssh(ssh) vpe_approx_vnf = VpeApproxVnf(NAME, self.VNFD_0) @@ -808,7 +782,3 @@ class TestVpeApproxVnf(unittest.TestCase): vpe_approx_vnf.resource_helper = mock.MagicMock() self.assertIsNone(vpe_approx_vnf.terminate()) - - -if __name__ == '__main__': - unittest.main() diff --git a/tests/functional/__init__.py b/tests/unit/test_cmd/__init__.py index e69de29bb..e69de29bb 100755..100644 --- a/tests/functional/__init__.py +++ b/tests/unit/test_cmd/__init__.py diff --git a/tests/unit/apiserver/resources/__init__.py b/tests/unit/test_cmd/commands/__init__.py index e69de29bb..e69de29bb 100644 --- a/tests/unit/apiserver/resources/__init__.py +++ b/tests/unit/test_cmd/commands/__init__.py diff --git a/tests/unit/cmd/commands/test_env.py b/tests/unit/test_cmd/commands/test_env.py index 73cd5af47..13c3ed44a 100644 --- a/tests/unit/cmd/commands/test_env.py +++ b/tests/unit/test_cmd/commands/test_env.py @@ -49,6 +49,9 @@ class EnvCommandTestCase(unittest.TestCase): @mock.patch('yardstick.cmd.commands.env.HttpClient.get') @mock.patch('yardstick.cmd.commands.env.EnvCommand._print_status') def test_check_status(self, print_mock, get_mock): + # pylint: disable=unused-argument + # NOTE(ralonsoh): the pylint exception must be removed. The mocked + # command call must be tested. task_id = str(uuid.uuid4()) get_mock.return_value = {'status': 2, 'result': 'error'} status = EnvCommand()._check_status(task_id, 'hello world') @@ -57,7 +60,8 @@ class EnvCommandTestCase(unittest.TestCase): def test_print_status(self): try: EnvCommand()._print_status('hello', 'word') - except Exception as e: + except Exception as e: # pylint: disable=broad-except + # NOTE(ralonsoh): try to reduce the scope of this exception. self.assertIsInstance(e, IndexError) diff --git a/tests/unit/cmd/commands/test_testcase.py b/tests/unit/test_cmd/commands/test_testcase.py index 7ef157c19..7ef157c19 100644 --- a/tests/unit/cmd/commands/test_testcase.py +++ b/tests/unit/test_cmd/commands/test_testcase.py diff --git a/tests/unit/cmd/test_NSBperf.py b/tests/unit/test_cmd/test_NSBperf.py index e1b4da7fc..19eb0afa0 100644 --- a/tests/unit/cmd/test_NSBperf.py +++ b/tests/unit/test_cmd/test_NSBperf.py @@ -27,7 +27,8 @@ from yardstick.cmd import NSBperf @mock.patch('six.moves.input', return_value='0') class TestHandler(unittest.TestCase): - def test_handler(self, test): + + def test_handler(self, *args): subprocess.call = mock.Mock(return_value=0) self.assertRaises(SystemExit, NSBperf.sigint_handler) diff --git a/tools/coding-checks.sh b/tools/coding-checks.sh index 4ee909988..615f2c3de 100644 --- a/tools/coding-checks.sh +++ b/tools/coding-checks.sh @@ -28,6 +28,7 @@ process_options () { run_pylint () { local target="${scriptargs:-all}" + local output_format="" if [ "$target" = "all" ]; then files="ansible api tests yardstick" @@ -37,11 +38,15 @@ run_pylint () { *) echo "$target is an unrecognized basecommit"; exit 1;; esac fi - + # make Jenkins output parseable because Jenkins doesn't handle color + # enventually we should use the Jenkins Pylint plugin or other tools + if [ -n "${BRANCH:-}" ] ; then + output_format="--output-format=parseable" + fi echo "Running pylint..." echo "You can speed this up by running it on 'HEAD~[0-9]' (e.g. HEAD~0, this change only)..." if [ -n "${files}" ]; then - pylint --rcfile=.pylintrc ${files} + pylint --rcfile=.pylintrc ${output_format} ${files} else echo "No python changes in this commit, pylint check not required." exit 0 diff --git a/tools/cover.sh b/tools/cover.sh index 780a85a22..c6e928d1a 100644 --- a/tools/cover.sh +++ b/tools/cover.sh @@ -42,17 +42,17 @@ run_coverage_test() { git checkout HEAD^ baseline_report=$(mktemp -t yardstick_coverageXXXXXXX) - ls -l .testrepository - # workaround 'db type could not be determined' bug - # https://bugs.launchpad.net/testrepository/+bug/1229445 - rm -rf .testrepository find . -type f -name "*.pyc" -delete - #python setup.py testr --coverage --testr-args="" - python setup.py testr --coverage --slowest --testr-args="$*" - testr failing - coverage report > ${baseline_report} + # Temporarily run tests from two directories, until all tests have moved + coverage run -p -m unittest discover ./tests/unit + coverage run -p -m unittest discover ./yardstick/tests/unit + coverage combine + + # Temporarily omit yardstick/tests from the report + coverage report --omit=yardstick/tests/*/* > ${baseline_report} + coverage erase # debug awk tail -1 ${baseline_report} @@ -69,17 +69,17 @@ run_coverage_test() { # Generate and save coverage report current_report=$(mktemp -t yardstick_coverageXXXXXXX) - ls -l .testrepository - # workaround 'db type could not be determined' bug - # https://bugs.launchpad.net/testrepository/+bug/1229445 - rm -rf .testrepository find . -type f -name "*.pyc" -delete - #python setup.py testr --coverage --testr-args="" - python setup.py testr --coverage --slowest --testr-args="$*" - testr failing - coverage report > ${current_report} + # Temporarily run tests from two directories, until all tests have moved + coverage run -p -m unittest discover ./tests/unit + coverage run -p -m unittest discover ./yardstick/tests/unit + coverage combine + + # Temporarily omit yardstick/tests from the report + coverage report --omit=yardstick/tests/*/* > ${current_report} + coverage erase rm -rf cover-$PY_VER coverage html -d cover-$PY_VER diff --git a/tools/run_tests.sh b/tools/run_tests.sh index f253327e5..32c4f19e4 100755 --- a/tools/run_tests.sh +++ b/tools/run_tests.sh @@ -29,8 +29,17 @@ run_tests() { echo "Running unittest ... " if [ $FILE_OPTION == "f" ]; then python -m unittest discover -v -s tests/unit > $logfile 2>&1 + if [ $? -ne 0 ]; then + echo "FAILED, results in $logfile" + exit 1 + fi + python -m unittest discover -v -s yardstick/tests/unit >> $logfile 2>&1 else python -m unittest discover -v -s tests/unit + if [ $? -ne 0 ]; then + exit 1 + fi + python -m unittest discover -v -s yardstick/tests/unit fi if [ $? -ne 0 ]; then @@ -53,7 +62,7 @@ run_coverage() { run_functional_test() { mkdir -p .testrepository - python -m subunit.run discover tests/functional > .testrepository/subunit.log + python -m subunit.run discover yardstick/tests/functional > .testrepository/subunit.log subunit2pyunit < .testrepository/subunit.log EXIT_CODE=$? diff --git a/tools/virt_ci_rampup.sh b/tools/virt_ci_rampup.sh new file mode 100755 index 000000000..210e6ed40 --- /dev/null +++ b/tools/virt_ci_rampup.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# Copyright (c) 2018 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. + +ANSIBLE_SCRIPTS="${0%/*}/../ansible" + +cd ${ANSIBLE_SCRIPTS} &&\ +ansible-playbook \ + -e rs_file='../etc/infra/infra_deploy.yaml' \ + -i inventory.ini infra_deploy.yml @@ -5,7 +5,7 @@ envlist = py{27,3},pep8,functional{,-py3},coverage [testenv] usedevelop=True -passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY +passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY BRANCH deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt diff --git a/yardstick/benchmark/contexts/standalone/model.py b/yardstick/benchmark/contexts/standalone/model.py index ea8eb5d09..30170832a 100644 --- a/yardstick/benchmark/contexts/standalone/model.py +++ b/yardstick/benchmark/contexts/standalone/model.py @@ -43,6 +43,7 @@ VM_TEMPLATE = """ <hugepages /> </memoryBacking> <vcpu cpuset='{cpuset}'>{vcpu}</vcpu> + {cputune} <os> <type arch="x86_64" machine="pc-i440fx-utopic">hvm</type> <boot dev="hd" /> @@ -217,9 +218,8 @@ class Libvirt(object): mac.set('address', vf_mac) source = ET.SubElement(interface, 'source') - addr = ET.SubElement(source, 'address') pci_address = PciAddress(vf_pci.strip()) - cls._add_interface_address(addr, pci_address) + cls._add_interface_address(source, pci_address) pci_vm_address = PciAddress(vm_pci.strip()) cls._add_interface_address(interface, pci_vm_address) @@ -248,6 +248,7 @@ class Libvirt(object): hw_socket = flavor.get('hw_socket', '0') cpuset = Libvirt.pin_vcpu_for_perf(connection, hw_socket) + cputune = extra_spec.get('cputune', '') mac = StandaloneContextHelper.get_mac_address(0x00) image = cls.create_snapshot_qemu(connection, index, flavor.get("images", None)) @@ -258,7 +259,7 @@ class Libvirt(object): memory=memory, vcpu=vcpu, cpu=cpu, numa_cpus=numa_cpus, socket=socket, threads=threads, - vm_image=image, cpuset=cpuset) + vm_image=image, cpuset=cpuset, cputune=cputune) write_file(cfg, vm_xml) @@ -275,6 +276,7 @@ class Libvirt(object): sys_obj = CpuSysCores(connection) soc_cpu = sys_obj.get_core_socket() sys_cpu = int(soc_cpu["cores_per_socket"]) + socket = str(socket) cores = "%s-%s" % (soc_cpu[socket][0], soc_cpu[socket][sys_cpu - 1]) if int(soc_cpu["thread_per_core"]) > 1: threads = "%s-%s" % (soc_cpu[socket][sys_cpu], soc_cpu[socket][-1]) diff --git a/yardstick/benchmark/contexts/standalone/ovs_dpdk.py b/yardstick/benchmark/contexts/standalone/ovs_dpdk.py index a6c35de53..3755b84e9 100644 --- a/yardstick/benchmark/contexts/standalone/ovs_dpdk.py +++ b/yardstick/benchmark/contexts/standalone/ovs_dpdk.py @@ -129,13 +129,21 @@ class OvsDpdkContext(Context): ovs_sock_path = '/var/run/openvswitch/db.sock' log_path = '/var/log/openvswitch/ovs-vswitchd.log' + pmd_cpu_mask = self.ovs_properties.get("pmd_cpu_mask", '') pmd_mask = hex(sum(2 ** num for num in range(pmd_nums)) << 1) + if pmd_cpu_mask: + pmd_mask = pmd_cpu_mask + socket0 = self.ovs_properties.get("ram", {}).get("socket_0", "2048") socket1 = self.ovs_properties.get("ram", {}).get("socket_1", "2048") ovs_other_config = "ovs-vsctl {0}set Open_vSwitch . other_config:{1}" detach_cmd = "ovs-vswitchd unix:{0}{1} --pidfile --detach --log-file={2}" + lcore_mask = self.ovs_properties.get("lcore_mask", '') + if lcore_mask: + lcore_mask = ovs_other_config.format("--no-wait ", "dpdk-lcore-mask='%s'" % lcore_mask) + cmd_list = [ "mkdir -p /usr/local/var/run/openvswitch", "mkdir -p {}".format(os.path.dirname(log_path)), @@ -143,6 +151,7 @@ class OvsDpdkContext(Context): ovs_sock_path), ovs_other_config.format("--no-wait ", "dpdk-init=true"), ovs_other_config.format("--no-wait ", "dpdk-socket-mem='%s,%s'" % (socket0, socket1)), + lcore_mask, detach_cmd.format(vpath, ovs_sock_path, log_path), ovs_other_config.format("", "pmd-cpu-mask=%s" % pmd_mask), ] @@ -296,8 +305,7 @@ class OvsDpdkContext(Context): except StopIteration: pass else: - raise ValueError("Duplicate nodes!!! Nodes: %s %s", - (node, duplicate)) + raise ValueError("Duplicate nodes!!! Nodes: %s %s" % (node, duplicate)) node["name"] = attr_name return node diff --git a/yardstick/benchmark/core/__init__.py b/yardstick/benchmark/core/__init__.py index 70036ea1e..3e3aa99a1 100644 --- a/yardstick/benchmark/core/__init__.py +++ b/yardstick/benchmark/core/__init__.py @@ -6,10 +6,15 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +""" +Yardstick benchmark core. +""" + from __future__ import print_function class Param(object): + """This class converts a parameter dictionary to an object.""" def __init__(self, kwargs): # list @@ -31,10 +36,3 @@ class Param(object): # list self.type = kwargs.get('type') - - -def print_hbar(barlen): - """print to stdout a horizontal bar""" - print("+") - print("-" * barlen) - print("+") diff --git a/yardstick/benchmark/core/runner.py b/yardstick/benchmark/core/runner.py index 64acdaa99..b5e457c41 100644 --- a/yardstick/benchmark/core/runner.py +++ b/yardstick/benchmark/core/runner.py @@ -10,9 +10,10 @@ """ Handler for yardstick command 'runner' """ from __future__ import absolute_import -from __future__ import print_function + +import prettytable + from yardstick.benchmark.runners.base import Runner -from yardstick.benchmark.core import print_hbar class Runners(object): # pragma: no cover @@ -21,16 +22,15 @@ class Runners(object): # pragma: no cover Set of commands to discover and display runner types. """ - def list_all(self, args): + def list_all(self, *args): """List existing runner types""" types = Runner.get_types() - print_hbar(78) - print("| %-16s | %-60s" % ("Type", "Description")) - print_hbar(78) + runner_table = prettytable.PrettyTable(['Type', 'Description']) + runner_table.align = 'l' for rtype in types: - print("| %-16s | %-60s" % (rtype.__execution_type__, - rtype.__doc__.split("\n")[0])) - print_hbar(78) + runner_table.add_row([rtype.__execution_type__, + rtype.__doc__.split("\n")[0]]) + print(runner_table) def show(self, args): """Show details of a specific runner type""" diff --git a/yardstick/benchmark/core/scenario.py b/yardstick/benchmark/core/scenario.py index 28eb65230..3366172a5 100644 --- a/yardstick/benchmark/core/scenario.py +++ b/yardstick/benchmark/core/scenario.py @@ -10,8 +10,9 @@ """ Handler for yardstick command 'scenario' """ from __future__ import absolute_import +import prettytable + from yardstick.benchmark.scenarios.base import Scenario -from yardstick.benchmark.core import print_hbar class Scenarios(object): # pragma: no cover @@ -20,16 +21,15 @@ class Scenarios(object): # pragma: no cover Set of commands to discover and display scenario types. """ - def list_all(self, args): + def list_all(self, *args): """List existing scenario types""" types = Scenario.get_types() - print_hbar(78) - print("| %-16s | %-60s" % ("Type", "Description")) - print_hbar(78) + scenario_table = prettytable.PrettyTable(['Type', 'Description']) + scenario_table.align = 'l' for scenario_class in types: - print("| %-16s | %-60s" % (scenario_class.get_scenario_type(), - scenario_class.get_description())) - print_hbar(78) + scenario_table.add_row([scenario_class.get_scenario_type(), + scenario_class.get_description()]) + print(scenario_table) def show(self, args): """Show details of a specific scenario type""" diff --git a/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash b/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash index eec86e133..d34ce9338 100755 --- a/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash +++ b/yardstick/benchmark/scenarios/availability/ha_tools/fault_process_kill.bash @@ -26,7 +26,7 @@ elif [ "$process_name" = "haproxy" ]; then kill -9 "${pid}" done else - for pid in $(pgrep -f "/usr/.*/${process_name}"); + for pid in $(pgrep -fa [^-_a-zA-Z0-9]${process_name} | grep -iv heartbeat | awk '{print $1}'); do kill -9 "${pid}" done diff --git a/yardstick/benchmark/scenarios/compute/spec_cpu.py b/yardstick/benchmark/scenarios/compute/spec_cpu.py index df361cd94..39cd3fb8c 100644 --- a/yardstick/benchmark/scenarios/compute/spec_cpu.py +++ b/yardstick/benchmark/scenarios/compute/spec_cpu.py @@ -10,6 +10,7 @@ from __future__ import absolute_import import logging import pkg_resources +import os import yardstick.ssh as ssh from yardstick.benchmark.scenarios import base @@ -66,6 +67,8 @@ class SpecCPU(base.Scenario): default: na """ __scenario_type__ = "SpecCPU2006" + CPU2006_DIR = "~/cpu2006" + CPU2006_RESULT_FILE = os.path.join(CPU2006_DIR, "result/CINT2006.001.ref.txt") def __init__(self, scenario_cfg, context_cfg): self.scenario_cfg = scenario_cfg @@ -87,8 +90,9 @@ class SpecCPU(base.Scenario): "yardstick.resources", 'files/' + self.runspec_config) # copy SPEC CPU2006 config file to host if given - self.client._put_file_shell(self.runspec_config_file, - '/usr/cpu2006/config/yardstick_spec_cpu2006.cfg') + cfg_path = os.path.join(self.CPU2006_DIR, + 'config/yardstick_spec_cpu2006.cfg') + self.client._put_file_shell(self.runspec_config_file, cfg_path) else: self.runspec_config = "Example-linux64-amd64-gcc43+.cfg" @@ -100,7 +104,8 @@ class SpecCPU(base.Scenario): if not self.setup_done: self.setup() - cmd = "cd /usr/cpu2006/ && . ./shrc && runspec --config %s" % self.runspec_config + cmd = "cd %s && . ./shrc && runspec --config %s" % ( + self.CPU2006_DIR, self.runspec_config) cmd_args = "" if "rate" in self.options: @@ -140,5 +145,12 @@ class SpecCPU(base.Scenario): if status: raise RuntimeError(stderr) + cmd = "cat %s" % self.CPU2006_RESULT_FILE + LOG.debug("Executing command: %s", cmd) + status, stdout, stderr = self.client.execute(cmd, timeout=30) + if status: + raise RuntimeError(stderr) + if stdout: + LOG.info("SPEC CPU2006 result is:\n%s", stdout) LOG.info('SPEC CPU2006 benchmark completed, please find benchmark reports \ at /tmp/result directory') diff --git a/yardstick/benchmark/scenarios/compute/spec_cpu_for_vm.py b/yardstick/benchmark/scenarios/compute/spec_cpu_for_vm.py new file mode 100644 index 000000000..36489b132 --- /dev/null +++ b/yardstick/benchmark/scenarios/compute/spec_cpu_for_vm.py @@ -0,0 +1,170 @@ +############################################################################## +# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +from __future__ import absolute_import + +import logging +import pkg_resources +import os + +import yardstick.ssh as ssh +from yardstick.benchmark.scenarios import base +from yardstick.common.constants import YARDSTICK_ROOT_PATH + +LOG = logging.getLogger(__name__) + + +class SpecCPUforVM(base.Scenario): + """Spec CPU2006 benchmark for Virtual Machine + + Parameters + benchmark_subset - Specifies a subset of SPEC CPU2006 benchmarks to run + type: string + unit: na + default: na + + SPECint_benchmark - A SPECint benchmark to run + type: string + unit: na + default: na + + SPECfp_benchmark - A SPECfp benchmark to run + type: string + unit: na + default: na + + output_format - Desired report format + type: string + unit: na + default: na + + runspec_config - SPEC CPU2006 config file provided to the runspec binary + type: string + unit: na + default: "Example-linux64-amd64-gcc43+.cfg" + + runspec_iterations - The number of benchmark iterations to execute. + For a reportable run, must be 3. + type: int + unit: na + default: na + + runspec_tune - Tuning to use (base, peak, or all). For a reportable run, must be either + base or all. Reportable runs do base first, then (optionally) peak. + type: string + unit: na + default: na + + runspec_size - Size of input data to run (test, train, or ref). Reportable runs ensure + that your binaries can produce correct results with the test and train + workloads. + type: string + unit: na + default: na + """ + __scenario_type__ = "SpecCPU2006_for_VM" + CPU2006_ISO = "cpu2006-1.2.iso" + CPU2006_DIR = "~/cpu2006" + CPU2006_RESULT_FILE = os.path.join(CPU2006_DIR, "result/CINT2006.001.ref.txt") + + def __init__(self, scenario_cfg, context_cfg): + self.scenario_cfg = scenario_cfg + self.context_cfg = context_cfg + self.setup_done = False + self.options = self.scenario_cfg['options'] + + def setup(self): + """scenario setup""" + host = self.context_cfg['host'] + LOG.info("user:%s, host:%s", host['user'], host['ip']) + self.client = ssh.SSH.from_node(host, defaults={"user": "ubuntu"}) + self.client.wait(timeout=600) + + spec_cpu_iso = os.path.join(YARDSTICK_ROOT_PATH, + "yardstick/resources/files/", + self.CPU2006_ISO) + + self.client.put(spec_cpu_iso, "~/cpu2006-1.2.iso") + self.client.execute("sudo mount -t iso9660 -o ro,exec ~/cpu2006-1.2.iso /mnt") + self.client.execute("/mnt/install.sh -fd ~/cpu2006") + + if "runspec_config" in self.options: + self.runspec_config = self.options["runspec_config"] + + self.runspec_config_file = pkg_resources.resource_filename( + "yardstick.resources", 'files/' + self.runspec_config) + + # copy SPEC CPU2006 config file to host if given + cfg_path = os.path.join(self.CPU2006_DIR, + 'config/yardstick_spec_cpu2006.cfg') + self.client._put_file_shell(self.runspec_config_file, cfg_path) + else: + self.runspec_config = "Example-linux64-amd64-gcc43+.cfg" + + self.setup_done = True + + def run(self, result): + """execute the benchmark""" + + if not self.setup_done: + self.setup() + + cmd = "cd %s && . ./shrc && runspec --config %s" % ( + self.CPU2006_DIR, self.runspec_config) + cmd_args = "" + + if "rate" in self.options: + cmd_args += " --rate %s" % self.options["runspec_rate"] + + if "output_format" in self.options: + cmd_args += " --output_format %s" % self.options["output_format"] + + if "runspec_tune" in self.options: + cmd_args += " --tune %s" % self.options["runspec_tune"] + + benchmark_subset = self.options.get('benchmark_subset', None) + specint_benchmark = self.options.get('SPECint_benchmark', None) + specfp_benchmark = self.options.get('SPECfp_benchmark', None) + + if benchmark_subset: + cmd_args += " %s" % benchmark_subset + else: + cmd_args += " --noreportable" + + if "runspec_iterations" in self.options: + cmd_args += " --iterations %s" % self.options["runspec_iterations"] + + if "runspec_size" in self.options: + cmd_args += " --size %s" % self.options["runspec_size"] + + if specint_benchmark: + cmd_args += " %s" % specint_benchmark + + if specfp_benchmark: + cmd_args += " %s" % specfp_benchmark + + cmd += "%s" % cmd_args + + LOG.debug("Executing command: %s", cmd) + status, stdout, stderr = self.client.execute(cmd, timeout=86400) + if status: + raise RuntimeError(stderr) + + cmd = "cat %s" % self.CPU2006_RESULT_FILE + LOG.debug("Executing command: %s", cmd) + status, stdout, stderr = self.client.execute(cmd, timeout=30) + if status: + raise RuntimeError(stderr) + if stdout: + LOG.info("SPEC CPU2006 result is:\n%s", stdout) + + result.update({"SPEC_CPU_result": stdout}) + # fetch SPEC CPU2006 result files + self.client.get('~/cpu2006/result', '/tmp/') + LOG.info('SPEC CPU2006 benchmark completed, please find benchmark reports \ + at /tmp/result directory') diff --git a/yardstick/benchmark/scenarios/lib/create_volume.py b/yardstick/benchmark/scenarios/lib/create_volume.py index c7086d0ef..df523a5ec 100644 --- a/yardstick/benchmark/scenarios/lib/create_volume.py +++ b/yardstick/benchmark/scenarios/lib/create_volume.py @@ -44,22 +44,21 @@ class CreateVolume(base.Scenario): self.setup_done = True - def run(self, result): + def run(self): """execute the test""" if not self.setup_done: self.setup() - if self.image_name: - self.image_id = op_utils.get_image_id(self.glance_client, - self.image_name) + self.image_id = op_utils.get_image_id(self.glance_client, + self.image_name) volume = op_utils.create_volume(self.cinder_client, self.volume_name, self.volume_size, self.image_id) status = volume.status while(status == 'creating' or status == 'downloading'): - LOG.info("Volume status is: %s" % status) + LOG.info("Volume status is: %s", status) time.sleep(5) volume = op_utils.get_volume_by_name(self.volume_name) status = volume.status diff --git a/yardstick/cmd/__init__.py b/yardstick/cmd/__init__.py index 3756d9ebb..e69de29bb 100644 --- a/yardstick/cmd/__init__.py +++ b/yardstick/cmd/__init__.py @@ -1,16 +0,0 @@ -############################################################################## -# Copyright (c) 2015 Ericsson AB and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## -from __future__ import print_function - - -def print_hbar(barlen): - """print to stdout a horizontal bar""" - print(("+"), end=' ') - print(("-" * barlen), end=' ') - print("+") diff --git a/yardstick/cmd/commands/testcase.py b/yardstick/cmd/commands/testcase.py index a151871b3..7bdcdf003 100644 --- a/yardstick/cmd/commands/testcase.py +++ b/yardstick/cmd/commands/testcase.py @@ -8,11 +8,11 @@ ############################################################################## """ Handler for yardstick command 'testcase' """ -from __future__ import print_function from __future__ import absolute_import +import prettytable + from yardstick.benchmark.core.testcase import Testcase -from yardstick.benchmark.core import print_hbar from yardstick.common.utils import cliargs from yardstick.cmd.commands import change_osloobj_to_paras from yardstick.cmd.commands import Commands @@ -24,7 +24,7 @@ class TestcaseCommands(Commands): Set of commands to discover and display test cases. """ - def do_list(self, args): + def do_list(self, *args): """List existing test cases""" testcase_list = self.client.get('/yardstick/testcases')['result'] self._format_print(testcase_list) @@ -37,11 +37,8 @@ class TestcaseCommands(Commands): def _format_print(self, testcase_list): """format output""" - - print_hbar(88) - print("| %-21s | %-60s" % ("Testcase Name", "Description")) - print_hbar(88) + case_table = prettytable.PrettyTable(['Testcase Name', 'Description']) + case_table.align = 'l' for testcase_record in testcase_list: - print("| %-16s | %-60s" % (testcase_record['Name'], - testcase_record['Description'])) - print_hbar(88) + case_table.add_row([testcase_record['Name'], testcase_record['Description']]) + print(case_table) diff --git a/yardstick/common/exceptions.py b/yardstick/common/exceptions.py new file mode 100644 index 000000000..4780822a4 --- /dev/null +++ b/yardstick/common/exceptions.py @@ -0,0 +1,59 @@ +# Copyright (c) 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from oslo_utils import excutils + + +class ProcessExecutionError(RuntimeError): + def __init__(self, message, returncode): + super(ProcessExecutionError, self).__init__(message) + self.returncode = returncode + + +class YardstickException(Exception): + """Base Yardstick Exception. + + To correctly use this class, inherit from it and define + a 'message' property. That message will get printf'd + with the keyword arguments provided to the constructor. + + Based on NeutronException class. + """ + message = "An unknown exception occurred." + + def __init__(self, **kwargs): + try: + super(YardstickException, self).__init__(self.message % kwargs) + self.msg = self.message % kwargs + except Exception: # pylint: disable=broad-except + with excutils.save_and_reraise_exception() as ctxt: + if not self.use_fatal_exceptions(): + ctxt.reraise = False + # at least get the core message out if something happened + super(YardstickException, self).__init__(self.message) + + def __str__(self): + return self.msg + + def use_fatal_exceptions(self): + """Is the instance using fatal exceptions. + + :returns: Always returns False. + """ + return False + + +class FunctionNotImplemented(YardstickException): + message = ('The function "%(function_name)s" is not implemented in ' + '"%(class_name)" class.') diff --git a/yardstick/common/process.py b/yardstick/common/process.py index 812ddea94..ede6cddac 100644 --- a/yardstick/common/process.py +++ b/yardstick/common/process.py @@ -11,10 +11,19 @@ # 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. + import logging import multiprocessing +import signal +import subprocess +import time import os +from oslo_utils import encodeutils + +from yardstick.common import exceptions +from yardstick.common import utils + LOG = logging.getLogger(__name__) @@ -45,3 +54,85 @@ def terminate_children(timeout=3): for child in active_children: LOG.debug("%s %s %s, after terminate child: %s %s", current_proccess.name, current_proccess.pid, os.getpid(), child, child.pid) + + +def _additional_env_args(additional_env): + """Build arguments for adding additional environment vars with env""" + if additional_env is None: + return [] + return ['env'] + ['%s=%s' % pair for pair in additional_env.items()] + + +def _subprocess_setup(): + # Python installs a SIGPIPE handler by default. This is usually not what + # non-Python subprocesses expect. + signal.signal(signal.SIGPIPE, signal.SIG_DFL) + + +def subprocess_popen(args, stdin=None, stdout=None, stderr=None, shell=False, + env=None, preexec_fn=_subprocess_setup, close_fds=True): + return subprocess.Popen(args, shell=shell, stdin=stdin, stdout=stdout, + stderr=stderr, preexec_fn=preexec_fn, + close_fds=close_fds, env=env) + + +def create_process(cmd, run_as_root=False, additional_env=None): + """Create a process object for the given command. + + The return value will be a tuple of the process object and the + list of command arguments used to create it. + """ + if not isinstance(cmd, list): + cmd = [cmd] + cmd = list(map(str, _additional_env_args(additional_env) + cmd)) + if run_as_root: + # NOTE(ralonsoh): to handle a command executed as root, using + # a root wrapper, instead of using "sudo". + pass + LOG.debug("Running command: %s", cmd) + obj = subprocess_popen(cmd, shell=False, stdin=subprocess.PIPE, + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + return obj, cmd + + +def execute(cmd, process_input=None, additional_env=None, + check_exit_code=True, return_stderr=False, log_fail_as_error=True, + extra_ok_codes=None, run_as_root=False): + try: + if process_input is not None: + _process_input = encodeutils.to_utf8(process_input) + else: + _process_input = None + + # NOTE(ralonsoh): to handle the execution of a command as root, + # using a root wrapper, instead of using "sudo". + obj, cmd = create_process(cmd, run_as_root=run_as_root, + additional_env=additional_env) + _stdout, _stderr = obj.communicate(_process_input) + returncode = obj.returncode + obj.stdin.close() + _stdout = utils.safe_decode_utf8(_stdout) + _stderr = utils.safe_decode_utf8(_stderr) + + extra_ok_codes = extra_ok_codes or [] + if returncode and returncode not in extra_ok_codes: + msg = ("Exit code: %(returncode)d; " + "Stdin: %(stdin)s; " + "Stdout: %(stdout)s; " + "Stderr: %(stderr)s") % {'returncode': returncode, + 'stdin': process_input or '', + 'stdout': _stdout, + 'stderr': _stderr} + if log_fail_as_error: + LOG.error(msg) + if check_exit_code: + raise exceptions.ProcessExecutionError(msg, + returncode=returncode) + + finally: + # This appears to be necessary in order for the subprocess to clean up + # something between call; without it, the second process hangs when two + # execute calls are made in a row. + time.sleep(0) + + return (_stdout, _stderr) if return_stderr else _stdout diff --git a/yardstick/common/utils.py b/yardstick/common/utils.py index 51f6e1360..8604e900f 100644 --- a/yardstick/common/utils.py +++ b/yardstick/common/utils.py @@ -13,27 +13,22 @@ # License for the specific language governing permissions and limitations # under the License. -# yardstick comment: this is a modified copy of rally/rally/common/utils.py - -from __future__ import absolute_import -from __future__ import print_function - +import collections +from contextlib import closing import datetime import errno +import importlib +import ipaddress import logging import os +import random +import socket import subprocess import sys -import collections -import socket -import random -import ipaddress -from contextlib import closing import six from flask import jsonify from six.moves import configparser -from oslo_utils import importutils from oslo_serialization import jsonutils import yardstick @@ -70,27 +65,28 @@ def itersubclasses(cls, _seen=None): def import_modules_from_package(package): - """Import modules from package and append into sys.modules + """Import modules given a package name :param: package - Full package name. For example: rally.deploy.engines """ yardstick_root = os.path.dirname(os.path.dirname(yardstick.__file__)) - path = os.path.join(yardstick_root, *package.split(".")) - for root, dirs, files in os.walk(path): - matches = (filename for filename in files if filename.endswith(".py") and - not filename.startswith("__")) - new_package = os.path.relpath(root, yardstick_root).replace(os.sep, ".") + path = os.path.join(yardstick_root, *package.split('.')) + for root, _, files in os.walk(path): + matches = (filename for filename in files if filename.endswith('.py') + and not filename.startswith('__')) + new_package = os.path.relpath(root, yardstick_root).replace(os.sep, + '.') module_names = set( - ("{}.{}".format(new_package, filename.rsplit(".py", 1)[0]) for filename in matches)) - # find modules which haven't already been imported + '{}.{}'.format(new_package, filename.rsplit('.py', 1)[0]) + for filename in matches) + # Find modules which haven't already been imported missing_modules = module_names.difference(sys.modules) - logger.debug("importing %s", missing_modules) - # we have already checked for already imported modules, so we don't need to check again + logger.debug('Importing modules: %s', missing_modules) for module_name in missing_modules: try: - sys.modules[module_name] = importutils.import_module(module_name) + importlib.import_module(module_name) except (ImportError, SyntaxError): - logger.exception("unable to import %s", module_name) + logger.exception('Unable to import module %s', module_name) def makedirs(d): @@ -251,10 +247,10 @@ def set_dict_value(dic, keys, value): def get_free_port(ip): with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as s: - while True: + port = random.randint(5000, 10000) + while s.connect_ex((ip, port)) == 0: port = random.randint(5000, 10000) - if s.connect_ex((ip, port)) != 0: - return port + return port def mac_address_to_hex_list(mac): @@ -350,10 +346,13 @@ def config_to_dict(config): def validate_non_string_sequence(value, default=None, raise_exc=None): + # NOTE(ralonsoh): refactor this function to check if raise_exc is an + # Exception. Remove duplicate code, this function is duplicated in this + # repository. if isinstance(value, collections.Sequence) and not isinstance(value, six.string_types): return value if raise_exc: - raise raise_exc + raise raise_exc # pylint: disable=raising-bad-type return default @@ -365,6 +364,13 @@ def join_non_strings(separator, *non_strings): return str(separator).join(str(non_string) for non_string in non_strings) +def safe_decode_utf8(s): + """Safe decode a str from UTF""" + if six.PY3 and isinstance(s, bytes): + return s.decode('utf-8', 'surrogateescape') + return s + + class ErrorClass(object): def __init__(self, *args, **kwargs): diff --git a/yardstick/network_services/collector/subscriber.py b/yardstick/network_services/collector/subscriber.py index 4dc5a796e..7e18302eb 100644 --- a/yardstick/network_services/collector/subscriber.py +++ b/yardstick/network_services/collector/subscriber.py @@ -62,12 +62,13 @@ class Collector(object): # Result example: # {"VNF1: { "tput" : [1000, 999] }, "VNF2": { "latency": 100 }} LOG.debug("collect KPI for %s", node_name) - if resource.check_if_sa_running("collectd")[0] != 0: + if resource.check_if_system_agent_running("collectd")[0] != 0: continue try: results[node_name] = {"core": resource.amqp_collect_nfvi_kpi()} LOG.debug("%s collect KPIs %s", node_name, results[node_name]['core']) - except Exception: - LOG.exception("") + # NOTE(elfoley): catch a more specific error + except Exception as exc: # pylint: disable=broad-except + LOG.exception(exc) return results diff --git a/yardstick/network_services/nfvi/resource.py b/yardstick/network_services/nfvi/resource.py index adf4d8ae6..dc5c46a86 100644 --- a/yardstick/network_services/nfvi/resource.py +++ b/yardstick/network_services/nfvi/resource.py @@ -13,20 +13,16 @@ # limitations under the License. """ Resource collection definitions """ -from __future__ import absolute_import -from __future__ import print_function - -import logging -from itertools import chain - import errno -import jinja2 +from itertools import chain +import logging +import multiprocessing import os import os.path import re -import multiprocessing -import pkg_resources +import jinja2 +import pkg_resources from oslo_config import cfg from oslo_utils.encodeutils import safe_decode @@ -92,7 +88,7 @@ class ResourceProfile(object): return cls(node, plugins=plugins, interval=interval, timeout=timeout) - def check_if_sa_running(self, process): + def check_if_system_agent_running(self, process): """ verify if system agent is running """ try: err, pid, _ = self.connection.execute("pgrep -f %s" % process) @@ -101,7 +97,7 @@ class ResourceProfile(object): except OSError as e: if e.errno in {errno.ECONNRESET}: # if we can't connect to check, then we won't be able to connect to stop it - LOG.exception("can't connect to host to check collectd status") + LOG.exception("Can't connect to host to check %s status", process) return 1, None raise @@ -327,7 +323,7 @@ class ResourceProfile(object): self.amqp_client.terminate() LOG.debug("Check if %s is running", agent) - status, pid = self.check_if_sa_running(agent) + status, pid = self.check_if_system_agent_running(agent) LOG.debug("status %s pid %s", status, pid) if status != 0: return diff --git a/yardstick/network_services/vnf_generic/vnf/acl_vnf.py b/yardstick/network_services/vnf_generic/vnf/acl_vnf.py index 3ba38dec2..1390dd02e 100644 --- a/yardstick/network_services/vnf_generic/vnf/acl_vnf.py +++ b/yardstick/network_services/vnf_generic/vnf/acl_vnf.py @@ -61,9 +61,6 @@ class AclApproxVnf(SampleVNF): super(AclApproxVnf, self).__init__(name, vnfd, setup_env_helper_type, resource_helper_type) self.acl_rules = None - def scale(self, flavor=""): - raise NotImplementedError - def _start_vnf(self): yang_model_path = find_relative_file(self.scenario_helper.options['rules'], self.scenario_helper.task_path) diff --git a/yardstick/network_services/vnf_generic/vnf/base.py b/yardstick/network_services/vnf_generic/vnf/base.py index 8ed754dce..a776b0989 100644 --- a/yardstick/network_services/vnf_generic/vnf/base.py +++ b/yardstick/network_services/vnf_generic/vnf/base.py @@ -138,76 +138,62 @@ class VnfdHelper(dict): yield port_name, port_num -class VNFObject(object): +@six.add_metaclass(abc.ABCMeta) +class GenericVNF(object): + """Class providing file-like API for generic VNF implementation + + Currently the only class implementing this interface is + yardstick/network_services/vnf_generic/vnf/sample_vnf:SampleVNF. + """ # centralize network naming convention UPLINK = PortPairs.UPLINK DOWNLINK = PortPairs.DOWNLINK def __init__(self, name, vnfd): - super(VNFObject, self).__init__() self.name = name - self.vnfd_helper = VnfdHelper(vnfd) # fixme: parse this into a structure - - -class GenericVNF(VNFObject): - - """ Class providing file-like API for generic VNF implementation """ - def __init__(self, name, vnfd): - super(GenericVNF, self).__init__(name, vnfd) + self.vnfd_helper = VnfdHelper(vnfd) # List of statistics we can obtain from this VNF # - ETSI MANO 6.3.1.1 monitoring_parameter - self.kpi = self._get_kpi_definition() + self.kpi = self.vnfd_helper.kpi # Standard dictionary containing params like thread no, buffer size etc self.config = {} self.runs_traffic = False - def _get_kpi_definition(self): - """ Get list of KPIs defined in VNFD - - :param vnfd: - :return: list of KPIs, e.g. ['throughput', 'latency'] - """ - return self.vnfd_helper.kpi - + @abc.abstractmethod def instantiate(self, scenario_cfg, context_cfg): - """ Prepare VNF for operation and start the VNF process/VM + """Prepare VNF for operation and start the VNF process/VM - :param scenario_cfg: - :param context_cfg: + :param scenario_cfg: Scenario config + :param context_cfg: Context config :return: True/False """ - raise NotImplementedError() + @abc.abstractmethod def wait_for_instantiate(self): - """ Wait for VNF to start + """Wait for VNF to start :return: True/False """ - raise NotImplementedError() + @abc.abstractmethod def terminate(self): - """ Kill all VNF processes - - :return: - """ - raise NotImplementedError() + """Kill all VNF processes""" + @abc.abstractmethod def scale(self, flavor=""): - """ + """rest - :param flavor: + :param flavor: Name of the flavor. :return: """ - raise NotImplementedError() + @abc.abstractmethod def collect_kpi(self): - """This method should return a dictionary containing the - selected KPI at a given point of time. + """Return a dict containing the selected KPI at a given point of time :return: {"kpi": value, "kpi2": value} """ - raise NotImplementedError() @six.add_metaclass(abc.ABCMeta) diff --git a/yardstick/network_services/vnf_generic/vnf/prox_helpers.py b/yardstick/network_services/vnf_generic/vnf/prox_helpers.py index ba066333d..285ead3b6 100644 --- a/yardstick/network_services/vnf_generic/vnf/prox_helpers.py +++ b/yardstick/network_services/vnf_generic/vnf/prox_helpers.py @@ -11,7 +11,6 @@ # 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. -from __future__ import absolute_import import array import io @@ -363,9 +362,9 @@ class ProxSocketHelper(object): """ send data to the remote instance """ LOG.debug("Sending data to socket: [%s]", to_send.rstrip('\n')) try: - # TODO: sendall will block, we need a timeout + # NOTE: sendall will block, we need a timeout self._sock.sendall(to_send.encode('utf-8')) - except: + except: # pylint: disable=bare-except pass def get_packet_dump(self): @@ -539,7 +538,7 @@ class ProxSocketHelper(object): finally: container['end_tot'] = end = self.get_all_tot_stats() - container['delta'] = TotStatsTuple(end - start for start, end in zip(start, end)) + container['delta'] = TotStatsTuple(e - s for s, e in zip(start, end)) def tot_stats(self): """Get the total statistics from the remote system""" @@ -637,13 +636,6 @@ class ProxDpdkVnfSetupEnvHelper(DpdkVnfSetupEnvHelper): raise KeyError(template.format(section_key, section_name)) return result - def _build_pipeline_kwargs(self): - tool_path = self.ssh_helper.provision_tool(tool_file=self.APP_NAME) - self.pipeline_kwargs = { - 'tool_path': tool_path, - 'tool_dir': os.path.dirname(tool_path), - } - def copy_to_target(self, config_file_path, prox_file): remote_path = os.path.join("/tmp", prox_file) self.ssh_helper.put(config_file_path, remote_path) @@ -685,14 +677,13 @@ class ProxDpdkVnfSetupEnvHelper(DpdkVnfSetupEnvHelper): if port_section_name != section_name: continue - for index, section_data in enumerate(section): + for section_data in section: if section_data[0] == "mac": section_data[1] = "hardware" # search for dst mac for _, section in sections: - # for index, (item_key, item_val) in enumerate(section): - for index, section_data in enumerate(section): + for section_data in section: item_key, item_val = section_data if item_val.startswith("@@dst_mac"): tx_port_iter = re.finditer(r'\d+', item_val) @@ -713,14 +704,14 @@ class ProxDpdkVnfSetupEnvHelper(DpdkVnfSetupEnvHelper): return sections for section_name, section in sections: - for index, section_data in enumerate(section): + for section_data in section: try: if section_data[0].startswith("dofile"): section_data[0] = self._insert_additional_file(section_data[0]) if section_data[1].startswith("dofile"): section_data[1] = self._insert_additional_file(section_data[1]) - except: + except: # pylint: disable=bare-except pass return sections @@ -753,9 +744,9 @@ class ProxDpdkVnfSetupEnvHelper(DpdkVnfSetupEnvHelper): a custom method """ out = [] - for i, (section_name, section) in enumerate(prox_config): + for (section_name, section) in prox_config: out.append("[{}]".format(section_name)) - for index, item in enumerate(section): + for item in section: key, value = item if key == "__name__": continue @@ -816,7 +807,7 @@ class ProxDpdkVnfSetupEnvHelper(DpdkVnfSetupEnvHelper): self.lua = self.generate_prox_lua_file() if len(self.lua) > 0: self.upload_prox_lua("parameters.lua", self.lua) - except: + except: # pylint: disable=bare-except pass prox_files = options.get('prox_files', []) @@ -837,17 +828,20 @@ class ProxDpdkVnfSetupEnvHelper(DpdkVnfSetupEnvHelper): self.build_config_file() options = self.scenario_helper.options - prox_args = options['prox_args'] - LOG.info("Provision and start the %s", self.APP_NAME) - self._build_pipeline_kwargs() - self.pipeline_kwargs["args"] = " ".join( - " ".join([k, v if v else ""]) for k, v in prox_args.items()) - self.pipeline_kwargs["cfg_file"] = self.remote_path + tool_path = self.ssh_helper.join_bin_path(self.APP_NAME) + + self.pipeline_kwargs = { + 'tool_path': tool_path, + 'tool_dir': os.path.dirname(tool_path), + 'cfg_file': self.remote_path, + 'args': ' '.join(' '.join([str(k), str(v) if v else '']) + for k, v in prox_args.items()) + } - cmd_template = "sudo bash -c 'cd {tool_dir}; {tool_path} -o cli {args} -f {cfg_file} '" - prox_cmd = cmd_template.format(**self.pipeline_kwargs) - return prox_cmd + cmd_template = ("sudo bash -c 'cd {tool_dir}; {tool_path} -o cli " + "{args} -f {cfg_file} '") + return cmd_template.format(**self.pipeline_kwargs) # this might be bad, sometimes we want regular ResourceHelper methods, like collect_kpi @@ -1057,7 +1051,7 @@ class ProxDataHelper(object): self.tsc_hz = float(self.sut.hz()) def line_rate_to_pps(self): - # FIXME Don't hardcode 10Gb/s + # NOTE: to fix, don't hardcode 10Gb/s return self.port_count * TEN_GIGABIT / BITS_PER_BYTE / (self.pkt_size + 20) @@ -1658,7 +1652,7 @@ class ProxlwAFTRProfileHelper(ProxProfileHelper): tun_ports = [] inet_ports = [] - re_port = re.compile('port (\d+)') + re_port = re.compile(r'port (\d+)') for section_name, section in self.resource_helper.setup_helper.prox_config_data: match = re_port.search(section_name) if not match: diff --git a/yardstick/network_services/vnf_generic/vnf/router_vnf.py b/yardstick/network_services/vnf_generic/vnf/router_vnf.py new file mode 100644 index 000000000..aea27ffa6 --- /dev/null +++ b/yardstick/network_services/vnf_generic/vnf/router_vnf.py @@ -0,0 +1,185 @@ +# Copyright (c) 2016-2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" Add generic L3 forwarder implementation based on sample_vnf.py""" + +from __future__ import absolute_import +import logging +import time +import itertools + +import re +from netaddr import IPRange + +from six.moves import zip + +from yardstick.benchmark.contexts.base import Context +from yardstick.network_services.vnf_generic.vnf.sample_vnf import SampleVNF, \ + DpdkVnfSetupEnvHelper + +LOG = logging.getLogger(__name__) + + +class RouterVNF(SampleVNF): + + WAIT_TIME = 1 + + def __init__(self, name, vnfd, setup_env_helper_type=None, resource_helper_type=None): + if setup_env_helper_type is None: + setup_env_helper_type = DpdkVnfSetupEnvHelper + + # For heat test cases + vnfd['mgmt-interface'].pop("pkey", "") + vnfd['mgmt-interface']['password'] = 'password' + + super(RouterVNF, self).__init__(name, vnfd, setup_env_helper_type, resource_helper_type) + + def instantiate(self, scenario_cfg, context_cfg): + self.scenario_helper.scenario_cfg = scenario_cfg + self.context_cfg = context_cfg + self.nfvi_context = Context.get_context_from_server(self.scenario_helper.nodes[self.name]) + self.configure_routes(self.name, scenario_cfg, context_cfg) + + def wait_for_instantiate(self): + time.sleep(self.WAIT_TIME) + + def _run(self): + # we can't share ssh paramiko objects to force new connection + self.ssh_helper.drop_connection() + + def terminate(self): + self._tear_down() + self.resource_helper.stop_collect() + + def scale(self, flavor=""): + pass + + @staticmethod + def row_with_header(header, data): + """Returns dictionary per row of values for 'ip show stats'. + + Args: + header(str): output header + data(str): output data + + Returns: + dict: dictionary per row of values for 'ip show stats' + + """ + prefix, columns = header.strip().split(':') + column_names = ["{0}:{1}".format(prefix, h) for h in columns.split()] + return dict(list(zip(column_names, data.strip().split()))) + + RX_TX_RE = re.compile(r"\s+[RT]X[^:]*:") + + @classmethod + def get_stats(cls, stdout): + """Returns list of IP statistics. + + Args: + stdout(str): command output + + Returns: + dict: list of IP statistics + + """ + input_lines = stdout.splitlines() + table = {} + for n, row in enumerate(input_lines): + if cls.RX_TX_RE.match(row): + # use pairs of rows, header and data + table.update(cls.row_with_header(*input_lines[n:n + 2])) + return table + + def collect_kpi(self): + # Implement stats collection + ip_link_stats = '/sbin/ip -s link' + stdout = self.ssh_helper.execute(ip_link_stats)[1] + link_stats = self.get_stats(stdout) + # get RX/TX from link_stats and assign to results + + result = { + "packets_in": 0, + "packets_dropped": 0, + "packets_fwd": 0, + "link_stats": link_stats + } + + LOG.debug("%s collect KPIs %s", "RouterVNF", result) + return result + + INTERFACE_WAIT = 2 + + def configure_routes(self, node_name, scenario_cfg, context_cfg): + # Configure IP of dataplane ports and add static ARP entries + # + # This function should be modified to configure a 3rd party/commercial VNF. + # The current implementation works on a Linux based VNF with "ip" command. + # + # Flow contains: + # {'src_ip': ['152.16.100.26-152.16.100.27'], + # 'dst_ip': ['152.16.40.26-152.16.40.27'], 'count': 2} + + ifaces = [] + dst_macs = [] + + ip_cmd_replace = '/sbin/ip addr replace %s/24 dev %s' + ip_cmd_up = '/sbin/ip link set %s up' + ip_cmd_flush = '/sbin/ip address flush dev %s' + + # Get VNF IPs from test case file + for value in context_cfg['nodes'][node_name]['interfaces'].values(): + dst_macs.append(value['dst_mac']) + + # Get the network interface name using local_mac + iname = self.ssh_helper.execute("/sbin/ip a |grep -B 1 %s | head -n 1" + % (value['local_mac'])) + iname = iname[1].split(":")[1].strip() + ifaces.append(iname) + + self.ssh_helper.execute(ip_cmd_flush % iname) + + # Get the local_ip from context_cfg and assign to the data ports + self.ssh_helper.execute(ip_cmd_replace % (str(value['local_ip']), + iname)) + # Enable interface + self.ssh_helper.execute(ip_cmd_up % iname) + time.sleep(self.INTERFACE_WAIT) + + # Configure static ARP entries for each IP + # using SSH or REST API calls + try: + src_ips = scenario_cfg['options']['flow']['src_ip'] + dst_ips = scenario_cfg['options']['flow']['dst_ip'] + except KeyError: + raise KeyError("Missing flow definition in scenario section" + + " of the task definition file") + + # Multiport + ip_ranges = [] + for src, dst in zip(src_ips, dst_ips): + range1 = itertools.cycle(iter(src.split('-'))) + range2 = itertools.cycle(iter(dst.split('-'))) + + range1 = IPRange(next(range1), next(range1)) + range2 = IPRange(next(range2), next(range2)) + ip_ranges.append(range1) + ip_ranges.append(range2) + + ip_cmd = '/sbin/ip neigh add %s lladdr %s dev %s nud perm' + for idx, iface in enumerate(ifaces): + for addr in ip_ranges[idx]: + self.ssh_helper.execute(ip_cmd % (addr, dst_macs[idx], iface)) + + arp_status = self.ssh_helper.execute("arp -a -n") + LOG.debug('arp %s', arp_status) diff --git a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py index 20e5895ee..fbaaa0ca8 100644 --- a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py +++ b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py @@ -13,37 +13,34 @@ # limitations under the License. """ Base class implementation for generic vnf implementation """ -from __future__ import absolute_import - -import posixpath -import time +from collections import Mapping import logging +from multiprocessing import Queue, Value, Process import os +import posixpath import re -import subprocess -from collections import Mapping -from multiprocessing import Queue, Value, Process - from six.moves import cStringIO +import subprocess +import time +from trex_stl_lib.trex_stl_client import LoggerApi +from trex_stl_lib.trex_stl_client import STLClient +from trex_stl_lib.trex_stl_exceptions import STLError from yardstick.benchmark.contexts.base import Context from yardstick.benchmark.scenarios.networking.vnf_generic import find_relative_file +from yardstick.common import exceptions as y_exceptions from yardstick.common.process import check_if_process_failed +from yardstick.network_services.helpers.dpdkbindnic_helper import DpdkBindHelper from yardstick.network_services.helpers.samplevnf_helper import PortPairs from yardstick.network_services.helpers.samplevnf_helper import MultiPortConfig -from yardstick.network_services.helpers.dpdkbindnic_helper import DpdkBindHelper from yardstick.network_services.nfvi.resource import ResourceProfile +from yardstick.network_services.utils import get_nsb_option from yardstick.network_services.vnf_generic.vnf.base import GenericVNF -from yardstick.network_services.vnf_generic.vnf.base import QueueFileWrapper from yardstick.network_services.vnf_generic.vnf.base import GenericTrafficGen -from yardstick.network_services.utils import get_nsb_option - -from trex_stl_lib.trex_stl_client import STLClient -from trex_stl_lib.trex_stl_client import LoggerApi -from trex_stl_lib.trex_stl_exceptions import STLError - +from yardstick.network_services.vnf_generic.vnf.base import QueueFileWrapper from yardstick.ssh import AutoConnectSSH + DPDK_VERSION = "dpdk-16.07" LOG = logging.getLogger(__name__) @@ -308,7 +305,7 @@ class DpdkVnfSetupEnvHelper(SetupEnvHelper): if vpci == v['virtual-interface']['vpci']) # force to int intf['virtual-interface']['dpdk_port_num'] = int(dpdk_port_num) - except: + except: # pylint: disable=bare-except pass time.sleep(2) @@ -345,7 +342,7 @@ class ResourceHelper(object): def _collect_resource_kpi(self): result = {} - status = self.resource.check_if_sa_running("collectd")[0] + status = self.resource.check_if_system_agent_running("collectd")[0] if status == 0: result = self.resource.amqp_collect_nfvi_kpi() @@ -472,6 +469,11 @@ class ClientResourceHelper(ResourceHelper): self.client.clear_stats(ports=ports) def start(self, ports=None, *args, **kwargs): + # pylint: disable=keyword-arg-before-vararg + # NOTE(ralonsoh): defining keyworded arguments before variable + # positional arguments is a bug. This function definition doesn't work + # in Python 2, although it works in Python 3. Reference: + # https://www.python.org/dev/peps/pep-3102/ if ports is None: ports = self.all_ports self.client.start(ports=ports, *args, **kwargs) @@ -480,8 +482,8 @@ class ClientResourceHelper(ResourceHelper): if not self._queue.empty(): kpi = self._queue.get() self._result.update(kpi) - LOG.debug("Got KPIs from _queue for {0} {1}".format( - self.scenario_helper.name, self.RESOURCE_WORD)) + LOG.debug('Got KPIs from _queue for %s %s', + self.scenario_helper.name, self.RESOURCE_WORD) return self._result def _connect(self, client=None): @@ -670,7 +672,7 @@ class SampleVNF(GenericVNF): self.pipeline_kwargs = {} self.uplink_ports = None self.downlink_ports = None - # TODO(esm): make QueueFileWrapper invert-able so that we + # NOTE(esm): make QueueFileWrapper invert-able so that we # never have to manage the queues self.q_in = Queue() self.q_out = Queue() @@ -751,7 +753,7 @@ class SampleVNF(GenericVNF): if not self._vnf_process.is_alive(): raise RuntimeError("%s VNF process died." % self.APP_NAME) - # TODO(esm): move to QueueFileWrapper + # NOTE(esm): move to QueueFileWrapper while self.q_out.qsize() > 0: buf.append(self.q_out.get()) message = ''.join(buf) @@ -821,12 +823,12 @@ class SampleVNF(GenericVNF): self._vnf_process.terminate() # no terminate children here because we share processes with tg - def get_stats(self, *args, **kwargs): - """ - Method for checking the statistics + def get_stats(self, *args, **kwargs): # pylint: disable=unused-argument + """Method for checking the statistics + + This method could be overridden in children classes. - :return: - VNF statistics + :return: VNF statistics """ cmd = 'p {0} stats'.format(self.APP_WORD) out = self.vnf_execute(cmd) @@ -849,6 +851,11 @@ class SampleVNF(GenericVNF): LOG.debug("%s collect KPIs %s", self.APP_NAME, result) return result + def scale(self, flavor=""): + """The SampleVNF base class doesn't provide the 'scale' feature""" + raise y_exceptions.FunctionNotImplemented( + function_name='scale', class_name='SampleVNFTrafficGen') + class SampleVNFTrafficGen(GenericTrafficGen): """ Class providing file-like API for generic traffic generator """ @@ -964,3 +971,8 @@ class SampleVNFTrafficGen(GenericTrafficGen): self._tg_process.join(PROCESS_JOIN_TIMEOUT) self._tg_process.terminate() # no terminate children here because we share processes with vnf + + def scale(self, flavor=""): + """A traffic generator VFN doesn't provide the 'scale' feature""" + raise y_exceptions.FunctionNotImplemented( + function_name='scale', class_name='SampleVNFTrafficGen') diff --git a/yardstick/network_services/vnf_generic/vnf/tg_ixload.py b/yardstick/network_services/vnf_generic/vnf/tg_ixload.py index 61c045405..3ab30b53e 100644 --- a/yardstick/network_services/vnf_generic/vnf/tg_ixload.py +++ b/yardstick/network_services/vnf_generic/vnf/tg_ixload.py @@ -91,7 +91,7 @@ class IxLoadResourceHelper(ClientResourceHelper): self.result[key].append(value) def setup(self): - # TODO: fixupt scenario_helper to hanlde ixia + # NOTE: fixup scenario_helper to hanlde ixia self.resource_file_name = \ find_relative_file(self.scenario_helper.scenario_cfg['ixia_profile'], self.scenario_helper.scenario_cfg["task_path"]) @@ -113,7 +113,7 @@ class IxLoadResourceHelper(ClientResourceHelper): def collect_kpi(self): if self.data: self._result.update(self.data) - LOG.info("Collect {0} KPIs {1}".format(self.RESOURCE_WORD, self._result)) + LOG.info("Collect %s KPIs %s", self.RESOURCE_WORD, self._result) return self._result def log(self): @@ -170,9 +170,6 @@ class IxLoadTrafficGen(SampleVNFTrafficGen): self.resource_helper.log() self.resource_helper.data = self.resource_helper.make_aggregates() - def instantiate(self, scenario_cfg, context_cfg): - super(IxLoadTrafficGen, self).instantiate(scenario_cfg, context_cfg) - def terminate(self): call(["pkill", "-9", "http_ixload.py"]) super(IxLoadTrafficGen, self).terminate() diff --git a/yardstick/network_services/vnf_generic/vnf/tg_ping.py b/yardstick/network_services/vnf_generic/vnf/tg_ping.py index 30a917862..a989543f5 100644 --- a/yardstick/network_services/vnf_generic/vnf/tg_ping.py +++ b/yardstick/network_services/vnf_generic/vnf/tg_ping.py @@ -113,10 +113,6 @@ class PingTrafficGen(SampleVNFTrafficGen): resource_helper_type) self._result = {} - def scale(self, flavor=""): - """ scale vnf-based on flavor input """ - pass - def _check_status(self): return self._tg_process.is_alive() @@ -126,11 +122,10 @@ class PingTrafficGen(SampleVNFTrafficGen): "packets_received": 0, "rtt": 0, } + self.setup_helper.setup_vnf_environment() intf = self.vnfd_helper.interfaces[0]["virtual-interface"] self.resource_helper.cmd_kwargs = { 'target_ip': IPv4Interface(intf["dst_ip"]).ip.exploded, 'local_ip': IPv4Interface(intf["local_ip"]).ip.exploded, 'local_if_name': intf["local_iface_name"].split('/')[0], } - - self.setup_helper.setup_vnf_environment() 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 a8b19cfba..630c8b9c0 100644 --- a/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py +++ b/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py @@ -174,7 +174,7 @@ class IxiaResourceHelper(ClientResourceHelper): break self.client.ix_stop_traffic() - except Exception: + except Exception: # pylint: disable=broad-except LOG.exception("Run Traffic terminated") self._terminated.value = 1 @@ -201,9 +201,6 @@ class IxiaTrafficGen(SampleVNFTrafficGen): def _check_status(self): pass - def scale(self, flavor=""): - pass - def terminate(self): self.resource_helper.stop_collect() super(IxiaTrafficGen, self).terminate() diff --git a/yardstick/network_services/vnf_generic/vnf/tg_trex.py b/yardstick/network_services/vnf_generic/vnf/tg_trex.py index 4250cb7a6..0084a124c 100644 --- a/yardstick/network_services/vnf_generic/vnf/tg_trex.py +++ b/yardstick/network_services/vnf_generic/vnf/tg_trex.py @@ -126,6 +126,11 @@ class TrexResourceHelper(ClientResourceHelper): self.ssh_helper.execute(self.MAKE_INSTALL.format(ko_src)) def start(self, ports=None, *args, **kwargs): + # pylint: disable=keyword-arg-before-vararg + # NOTE(ralonsoh): defining keyworded arguments before variable + # positional arguments is a bug. This function definition doesn't work + # in Python 2, although it works in Python 3. Reference: + # https://www.python.org/dev/peps/pep-3102/ cmd = "sudo fuser -n tcp {0.SYNC_PORT} {0.ASYNC_PORT} -k > /dev/null 2>&1" self.ssh_helper.execute(cmd.format(self)) @@ -186,9 +191,6 @@ class TrexTrafficGen(SampleVNFTrafficGen): super(TrexTrafficGen, self)._start_server() self.resource_helper.start() - def scale(self, flavor=""): - pass - def terminate(self): self.resource_helper.terminate() diff --git a/yardstick/ssh.py b/yardstick/ssh.py index e98ee98b7..6ddf327f2 100644 --- a/yardstick/ssh.py +++ b/yardstick/ssh.py @@ -379,6 +379,12 @@ class SSH(object): with SCPClient(client.get_transport()) as scp: scp.put(files, remote_path, recursive) + def get(self, remote_path, local_path='/tmp/', recursive=True): + client = self._get_client() + + with SCPClient(client.get_transport()) as scp: + scp.get(remote_path, local_path, recursive) + # keep shell running in the background, e.g. screen def send_command(self, command): client = self._get_client() diff --git a/tests/unit/cmd/__init__.py b/yardstick/tests/__init__.py index e69de29bb..e69de29bb 100644 --- a/tests/unit/cmd/__init__.py +++ b/yardstick/tests/__init__.py diff --git a/tests/unit/cmd/commands/__init__.py b/yardstick/tests/functional/__init__.py index e69de29bb..e69de29bb 100644 --- a/tests/unit/cmd/commands/__init__.py +++ b/yardstick/tests/functional/__init__.py diff --git a/tests/unit/common/__init__.py b/yardstick/tests/functional/common/__init__.py index e69de29bb..e69de29bb 100644 --- a/tests/unit/common/__init__.py +++ b/yardstick/tests/functional/common/__init__.py diff --git a/tests/unit/dispatcher/__init__.py b/yardstick/tests/functional/common/fake_module/__init__.py index e69de29bb..e69de29bb 100644 --- a/tests/unit/dispatcher/__init__.py +++ b/yardstick/tests/functional/common/fake_module/__init__.py diff --git a/yardstick/tests/functional/common/fake_module/fake_library.py b/yardstick/tests/functional/common/fake_module/fake_library.py new file mode 100644 index 000000000..28c7dc694 --- /dev/null +++ b/yardstick/tests/functional/common/fake_module/fake_library.py @@ -0,0 +1,17 @@ +# Copyright (c) 2018 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. + + +class FakeClassToBeImported(object): + pass diff --git a/yardstick/tests/functional/common/test_utils.py b/yardstick/tests/functional/common/test_utils.py new file mode 100644 index 000000000..b5333bbde --- /dev/null +++ b/yardstick/tests/functional/common/test_utils.py @@ -0,0 +1,34 @@ +# Copyright (c) 2018 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. + +import unittest +import sys + +from yardstick.common import utils + + +class ImportModulesFromPackageTestCase(unittest.TestCase): + + def test_import_package(self): + module_name = 'yardstick.tests.functional.common.fake_module' + library_name = 'fake_library' + class_name = 'FakeClassToBeImported' + self.assertNotIn(module_name, sys.modules) + + utils.import_modules_from_package(module_name) + self.assertIn(module_name, sys.modules) + module_obj = sys.modules[module_name] + library_obj = getattr(module_obj, library_name) + class_obj = getattr(library_obj, class_name) + self.assertEqual(class_name, class_obj().__class__.__name__) diff --git a/tests/functional/test_cli_runner.py b/yardstick/tests/functional/test_cli_runner.py index 620edc396..2f2d7fef2 100755 --- a/tests/functional/test_cli_runner.py +++ b/yardstick/tests/functional/test_cli_runner.py @@ -7,11 +7,9 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## - -from __future__ import absolute_import import unittest -from tests.functional import utils +from yardstick.tests.functional import utils class RunnerTestCase(unittest.TestCase): diff --git a/tests/functional/test_cli_scenario.py b/yardstick/tests/functional/test_cli_scenario.py index 63b533b85..7aaacad0a 100755 --- a/tests/functional/test_cli_scenario.py +++ b/yardstick/tests/functional/test_cli_scenario.py @@ -7,11 +7,9 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## - -from __future__ import absolute_import import unittest -from tests.functional import utils +from yardstick.tests.functional import utils class ScenarioTestCase(unittest.TestCase): diff --git a/yardstick/tests/functional/utils.py b/yardstick/tests/functional/utils.py new file mode 100755 index 000000000..d889c0dfa --- /dev/null +++ b/yardstick/tests/functional/utils.py @@ -0,0 +1,45 @@ +############################################################################## +# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +import copy +import os + +from oslo_serialization import jsonutils + +from yardstick.common import process + + +class Yardstick(object): + """Create and represent separate yardstick installation. + + Usage: + yardstick = yardstick() + output = yardstick("runner list") + + """ + + def __init__(self): + self._args = ["yardstick"] + self.env = copy.deepcopy(os.environ) + + def __call__(self, cmd, getjson=False): + """Call yardstick in the shell + + :param cmd: Yardstick command. + :param getjson: If the output is a JSON object, it's deserialized. + :return Command output string. + """ + + if not isinstance(cmd, list): + cmd = cmd.split(" ") + cmd = self._args + cmd + output = process.execute(cmd=cmd) + if getjson: + return jsonutils.loads(output) + return output diff --git a/yardstick/tests/unit/__init__.py b/yardstick/tests/unit/__init__.py new file mode 100644 index 000000000..a468b272b --- /dev/null +++ b/yardstick/tests/unit/__init__.py @@ -0,0 +1,76 @@ +# Copyright (c) 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from __future__ import absolute_import
+import mock
+
+
+STL_MOCKS = {
+ 'trex_stl_lib': mock.MagicMock(),
+ 'trex_stl_lib.base64': mock.MagicMock(),
+ 'trex_stl_lib.binascii': mock.MagicMock(),
+ 'trex_stl_lib.collections': mock.MagicMock(),
+ 'trex_stl_lib.copy': mock.MagicMock(),
+ 'trex_stl_lib.datetime': mock.MagicMock(),
+ 'trex_stl_lib.functools': mock.MagicMock(),
+ 'trex_stl_lib.imp': mock.MagicMock(),
+ 'trex_stl_lib.inspect': mock.MagicMock(),
+ 'trex_stl_lib.json': mock.MagicMock(),
+ 'trex_stl_lib.linecache': mock.MagicMock(),
+ 'trex_stl_lib.math': mock.MagicMock(),
+ 'trex_stl_lib.os': mock.MagicMock(),
+ 'trex_stl_lib.platform': mock.MagicMock(),
+ 'trex_stl_lib.pprint': mock.MagicMock(),
+ 'trex_stl_lib.random': mock.MagicMock(),
+ 'trex_stl_lib.re': mock.MagicMock(),
+ 'trex_stl_lib.scapy': mock.MagicMock(),
+ 'trex_stl_lib.socket': mock.MagicMock(),
+ 'trex_stl_lib.string': mock.MagicMock(),
+ 'trex_stl_lib.struct': mock.MagicMock(),
+ 'trex_stl_lib.sys': mock.MagicMock(),
+ 'trex_stl_lib.threading': mock.MagicMock(),
+ 'trex_stl_lib.time': mock.MagicMock(),
+ 'trex_stl_lib.traceback': mock.MagicMock(),
+ 'trex_stl_lib.trex_stl_async_client': mock.MagicMock(),
+ 'trex_stl_lib.trex_stl_client': mock.MagicMock(),
+ 'trex_stl_lib.trex_stl_exceptions': mock.MagicMock(),
+ 'trex_stl_lib.trex_stl_ext': mock.MagicMock(),
+ 'trex_stl_lib.trex_stl_jsonrpc_client': mock.MagicMock(),
+ 'trex_stl_lib.trex_stl_packet_builder_interface': mock.MagicMock(),
+ 'trex_stl_lib.trex_stl_packet_builder_scapy': mock.MagicMock(),
+ 'trex_stl_lib.trex_stl_port': mock.MagicMock(),
+ 'trex_stl_lib.trex_stl_stats': mock.MagicMock(),
+ 'trex_stl_lib.trex_stl_streams': mock.MagicMock(),
+ 'trex_stl_lib.trex_stl_types': mock.MagicMock(),
+ 'trex_stl_lib.types': mock.MagicMock(),
+ 'trex_stl_lib.utils': mock.MagicMock(),
+ 'trex_stl_lib.utils.argparse': mock.MagicMock(),
+ 'trex_stl_lib.utils.collections': mock.MagicMock(),
+ 'trex_stl_lib.utils.common': mock.MagicMock(),
+ 'trex_stl_lib.utils.json': mock.MagicMock(),
+ 'trex_stl_lib.utils.os': mock.MagicMock(),
+ 'trex_stl_lib.utils.parsing_opts': mock.MagicMock(),
+ 'trex_stl_lib.utils.pwd': mock.MagicMock(),
+ 'trex_stl_lib.utils.random': mock.MagicMock(),
+ 'trex_stl_lib.utils.re': mock.MagicMock(),
+ 'trex_stl_lib.utils.string': mock.MagicMock(),
+ 'trex_stl_lib.utils.sys': mock.MagicMock(),
+ 'trex_stl_lib.utils.text_opts': mock.MagicMock(),
+ 'trex_stl_lib.utils.text_tables': mock.MagicMock(),
+ 'trex_stl_lib.utils.texttable': mock.MagicMock(),
+ 'trex_stl_lib.warnings': mock.MagicMock(),
+ 'trex_stl_lib.yaml': mock.MagicMock(),
+ 'trex_stl_lib.zlib': mock.MagicMock(),
+ 'trex_stl_lib.zmq': mock.MagicMock(),
+}
diff --git a/tests/unit/apiserver/__init__.py b/yardstick/tests/unit/apiserver/__init__.py index 5e1ed2ea1..44d163429 100644 --- a/tests/unit/apiserver/__init__.py +++ b/yardstick/tests/unit/apiserver/__init__.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2017 +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +"""Tests for yardstick/api/server.py""" from __future__ import absolute_import import mock @@ -12,14 +21,16 @@ from yardstick.common import constants as consts class APITestCase(unittest.TestCase): - + """Tests for the YardStick API server""" def setUp(self): self.db_fd, self.db_path = tempfile.mkstemp() consts.SQLITE = 'sqlite:///{}'.format(self.db_path) - # server calls gethostbyname which takes 4 seconds, and we should mock it anyway + # server calls gethostbyname which takes 4 seconds, and we should mock + # it anyway self.socket_mock = mock.patch.dict("sys.modules", {"socket": mock.MagicMock( - **{"gethostbyname.return_value": "127.0.0.1", "gethostname.return_value": "localhost"})}) + **{"gethostbyname.return_value": "127.0.0.1", + "gethostname.return_value": "localhost"})}) self.socket_mock.start() try: from api import server diff --git a/tests/unit/orchestrator/__init__.py b/yardstick/tests/unit/apiserver/resources/__init__.py index e69de29bb..e69de29bb 100644 --- a/tests/unit/orchestrator/__init__.py +++ b/yardstick/tests/unit/apiserver/resources/__init__.py diff --git a/tests/unit/apiserver/resources/test_env_action.py b/yardstick/tests/unit/apiserver/resources/test_env_action.py index 5417ad953..cf646a29c 100644 --- a/tests/unit/apiserver/resources/test_env_action.py +++ b/yardstick/tests/unit/apiserver/resources/test_env_action.py @@ -6,12 +6,11 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -from __future__ import absolute_import import time import unittest -from tests.unit.apiserver import APITestCase +from yardstick.tests.unit.apiserver import APITestCase class EnvTestCase(APITestCase): @@ -33,7 +32,7 @@ class EnvTestCase(APITestCase): time.sleep(0) - self.assertTrue(u'status' in resp) + self.assertIn(u'status', resp) def main(): diff --git a/tests/unit/apiserver/utils/test_influx.py b/yardstick/tests/unit/apiserver/utils/test_influx.py index aff0cab5c..883608bb2 100644 --- a/tests/unit/apiserver/utils/test_influx.py +++ b/yardstick/tests/unit/apiserver/utils/test_influx.py @@ -6,13 +6,11 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -from __future__ import absolute_import import unittest import mock from api.utils import influx - -import six.moves.configparser as ConfigParser +from six.moves import configparser as ConfigParser class GetDataDbClientTestCase(unittest.TestCase): @@ -25,7 +23,7 @@ class GetDataDbClientTestCase(unittest.TestCase): mock_parser.NoOptionError = ConfigParser.NoOptionError try: influx.get_data_db_client() - except Exception as e: + except Exception as e: # pylint: disable=broad-except self.assertIsInstance(e, RuntimeError) @@ -50,7 +48,7 @@ class QueryTestCase(unittest.TestCase): try: sql = 'select * form tasklist' influx.query(sql) - except Exception as e: + except Exception as e: # pylint: disable=broad-except self.assertIsInstance(e, RuntimeError) diff --git a/yardstick/tests/unit/common/__init__.py b/yardstick/tests/unit/common/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/yardstick/tests/unit/common/__init__.py diff --git a/tests/unit/common/config_sample.yaml b/yardstick/tests/unit/common/config_sample.yaml index 09218cc79..09218cc79 100644 --- a/tests/unit/common/config_sample.yaml +++ b/yardstick/tests/unit/common/config_sample.yaml diff --git a/tests/unit/common/test_ansible_common.py b/yardstick/tests/unit/common/test_ansible_common.py index 1ef8eee5f..89ea128af 100644 --- a/tests/unit/common/test_ansible_common.py +++ b/yardstick/tests/unit/common/test_ansible_common.py @@ -49,7 +49,7 @@ class OverwriteDictTestCase(unittest.TestCase): class FilenameGeneratorTestCase(unittest.TestCase): @mock.patch('{}.NamedTemporaryFile'.format(PREFIX)) - def test__handle_existing_file(self, mock_tmp): + def test__handle_existing_file(self, _): ansible_common.FileNameGenerator._handle_existing_file("/dev/null") def test_get_generator_from_file(self): @@ -184,7 +184,7 @@ class AnsibleCommonTestCase(unittest.TestCase): self.assertEqual(a.deploy_dir, "d") @mock.patch('{}.open'.format(PREFIX)) - def test__gen_ansible_playbook_file_list(self, mock_open): + def test__gen_ansible_playbook_file_list(self, _): d = tempfile.mkdtemp() try: a = ansible_common.AnsibleCommon({}) @@ -194,7 +194,7 @@ class AnsibleCommonTestCase(unittest.TestCase): @mock.patch('{}.NamedTemporaryFile'.format(PREFIX)) @mock.patch('{}.open'.format(PREFIX)) - def test__gen_ansible_inventory_file(self, mock_open, mock_tmp): + def test__gen_ansible_inventory_file(self, _, __): nodes = [{ "name": "name", "user": "user", "password": "PASS", "role": "role", @@ -213,7 +213,7 @@ class AnsibleCommonTestCase(unittest.TestCase): @mock.patch('{}.NamedTemporaryFile'.format(PREFIX)) @mock.patch('{}.open'.format(PREFIX)) - def test__gen_ansible_playbook_file_list_multiple(self, mock_open, mock_tmp): + def test__gen_ansible_playbook_file_list_multiple(self, _, __): d = tempfile.mkdtemp() try: a = ansible_common.AnsibleCommon({}) @@ -224,7 +224,7 @@ class AnsibleCommonTestCase(unittest.TestCase): @mock.patch('{}.NamedTemporaryFile'.format(PREFIX)) @mock.patch('{}.Popen'.format(PREFIX)) @mock.patch('{}.open'.format(PREFIX)) - def test_do_install_tmp_dir(self, mock_open, mock_popen, mock_tmp): + def test_do_install_tmp_dir(self, _, mock_popen, __): mock_popen.return_value.communicate.return_value = "", "" mock_popen.return_value.wait.return_value = 0 d = tempfile.mkdtemp() @@ -237,7 +237,7 @@ class AnsibleCommonTestCase(unittest.TestCase): @mock.patch('{}.NamedTemporaryFile'.format(PREFIX)) @mock.patch('{}.Popen'.format(PREFIX)) @mock.patch('{}.open'.format(PREFIX)) - def test_execute_ansible_check(self, mock_open, mock_popen, mock_tmp): + def test_execute_ansible_check(self, _, mock_popen, __): mock_popen.return_value.communicate.return_value = "", "" mock_popen.return_value.wait.return_value = 0 d = tempfile.mkdtemp() diff --git a/tests/unit/common/test_httpClient.py b/yardstick/tests/unit/common/test_httpClient.py index eb09d1a52..eb09d1a52 100644 --- a/tests/unit/common/test_httpClient.py +++ b/yardstick/tests/unit/common/test_httpClient.py diff --git a/tests/unit/common/test_openstack_utils.py b/yardstick/tests/unit/common/test_openstack_utils.py index b3dc2d9c4..bf468489e 100644 --- a/tests/unit/common/test_openstack_utils.py +++ b/yardstick/tests/unit/common/test_openstack_utils.py @@ -21,7 +21,7 @@ from yardstick.common import openstack_utils class GetCredentialsTestCase(unittest.TestCase): @mock.patch('yardstick.common.openstack_utils.os') - def test_get_credentials(self, mock_os): + def test_get_credentials(self, _): with mock.patch.dict('os.environ', {'OS_IDENTITY_API_VERSION': '2'}, clear=True): openstack_utils.get_credentials() diff --git a/yardstick/tests/unit/common/test_process.py b/yardstick/tests/unit/common/test_process.py new file mode 100644 index 000000000..1c6dfec27 --- /dev/null +++ b/yardstick/tests/unit/common/test_process.py @@ -0,0 +1,150 @@ +# Copyright (c) 2017 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import mock +import unittest + +from oslo_utils import encodeutils + +from yardstick.common import exceptions +from yardstick.common import process + + +class ProcessTestcase(unittest.TestCase): + def test_check_if_procces_failed_None(self): + p = mock.MagicMock(**{"exitcode": None, "name": "debug"}) + process.check_if_process_failed(p) + + def test_check_if_procces_failed_0(self): + p = mock.MagicMock(**{"exitcode": 0, "name": "debug"}) + process.check_if_process_failed(p) + + def test_check_if_procces_failed_1(self): + p = mock.MagicMock(**{"exitcode": 1, "name": "debug"}) + with self.assertRaises(RuntimeError): + process.check_if_process_failed(p) + + +@mock.patch("yardstick.common.process.multiprocessing") +class TerminateChildrenTestcase(unittest.TestCase): + def test_some_children(self, mock_multiprocessing): + p1 = mock.MagicMock() + p2 = mock.MagicMock() + mock_multiprocessing.active_children.return_value = [p1, p2] + process.terminate_children() + + def test_no_children(self, mock_multiprocessing): + mock_multiprocessing.active_children.return_value = [] + process.terminate_children() + + +class ExecuteTestCase(unittest.TestCase): + + RET_CODE_OK = 0 + RET_CODE_WRONG = 1 + + def setUp(self): + self._mock_create_process = mock.patch.object(process, + 'create_process') + self.mock_create_process = self._mock_create_process.start() + self.obj = mock.Mock() + self.cmd = mock.Mock() + self.obj.communicate = mock.Mock() + self.stdout = 'std out' + self.stderr = 'std err' + self.obj.communicate.return_value = (self.stdout, self.stderr) + self.mock_create_process.return_value = (self.obj, self.cmd) + self.input_cmd = 'input cmd' + self.additional_env = mock.Mock() + + def test_execute_with_input(self): + process_input = 'process input' + self.obj.returncode = self.RET_CODE_OK + out = process.execute(self.input_cmd, process_input=process_input, + additional_env=self.additional_env) + self.obj.communicate.assert_called_once_with( + encodeutils.to_utf8(process_input)) + self.mock_create_process.assert_called_once_with( + self.input_cmd, run_as_root=False, + additional_env=self.additional_env) + self.assertEqual(self.stdout, out) + + def test_execute_no_input(self): + self.obj.returncode = self.RET_CODE_OK + out = process.execute(self.input_cmd, + additional_env=self.additional_env) + self.obj.communicate.assert_called_once_with(None) + self.mock_create_process.assert_called_once_with( + self.input_cmd, run_as_root=False, + additional_env=self.additional_env) + self.assertEqual(self.stdout, out) + + def test_execute_exception(self): + self.obj.returncode = self.RET_CODE_WRONG + self.assertRaises(exceptions.ProcessExecutionError, process.execute, + self.input_cmd, additional_env=self.additional_env) + self.obj.communicate.assert_called_once_with(None) + + def test_execute_with_extra_code(self): + self.obj.returncode = self.RET_CODE_WRONG + out = process.execute(self.input_cmd, + additional_env=self.additional_env, + extra_ok_codes=[self.RET_CODE_WRONG]) + self.obj.communicate.assert_called_once_with(None) + self.mock_create_process.assert_called_once_with( + self.input_cmd, run_as_root=False, + additional_env=self.additional_env) + self.assertEqual(self.stdout, out) + + def test_execute_exception_no_check(self): + self.obj.returncode = self.RET_CODE_WRONG + out = process.execute(self.input_cmd, + additional_env=self.additional_env, + check_exit_code=False) + self.obj.communicate.assert_called_once_with(None) + self.mock_create_process.assert_called_once_with( + self.input_cmd, run_as_root=False, + additional_env=self.additional_env) + self.assertEqual(self.stdout, out) + + +class CreateProcessTestCase(unittest.TestCase): + + @mock.patch.object(process, 'subprocess_popen') + def test_process_string_command(self, mock_subprocess_popen): + cmd = 'command' + obj = mock.Mock() + mock_subprocess_popen.return_value = obj + out1, out2 = process.create_process(cmd) + self.assertEqual(obj, out1) + self.assertEqual([cmd], out2) + + @mock.patch.object(process, 'subprocess_popen') + def test_process_list_command(self, mock_subprocess_popen): + cmd = ['command'] + obj = mock.Mock() + mock_subprocess_popen.return_value = obj + out1, out2 = process.create_process(cmd) + self.assertEqual(obj, out1) + self.assertEqual(cmd, out2) + + @mock.patch.object(process, 'subprocess_popen') + def test_process_with_env(self, mock_subprocess_popen): + cmd = ['command'] + obj = mock.Mock() + additional_env = {'var1': 'value1'} + mock_subprocess_popen.return_value = obj + out1, out2 = process.create_process(cmd, additional_env=additional_env) + self.assertEqual(obj, out1) + self.assertEqual(['env', 'var1=value1'] + cmd, out2) diff --git a/tests/unit/common/test_template_format.py b/yardstick/tests/unit/common/test_template_format.py index 2a7d80b4d..44aa80333 100644 --- a/tests/unit/common/test_template_format.py +++ b/yardstick/tests/unit/common/test_template_format.py @@ -24,6 +24,9 @@ class TemplateFormatTestCase(unittest.TestCase): def test_parse_to_value_exception(self): + # TODO(elfoley): Don't hide the error that occurs in + # template_format.parse + # TODO(elfoley): Separate these tests; one per error type with mock.patch.object(yaml, 'load') as yaml_loader: yaml_loader.side_effect = yaml.scanner.ScannerError() self.assertRaises(ValueError, template_format.parse, 'FOOBAR') diff --git a/tests/unit/common/test_utils.py b/yardstick/tests/unit/common/test_utils.py index 42b75d1f0..033bb0243 100644 --- a/tests/unit/common/test_utils.py +++ b/yardstick/tests/unit/common/test_utils.py @@ -7,19 +7,16 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -# Unittest for yardstick.common.utils - -from __future__ import absolute_import - -import ipaddress -import os -import unittest from copy import deepcopy -from itertools import product, chain - import errno +import importlib +import ipaddress +from itertools import product, chain import mock +import os +import six from six.moves import configparser +import unittest import yardstick from yardstick.common import utils @@ -60,8 +57,8 @@ class ImportModulesFromPackageTestCase(unittest.TestCase): utils.import_modules_from_package('foo.bar') @mock.patch('yardstick.common.utils.os.walk') - @mock.patch('yardstick.common.utils.importutils') - def test_import_modules_from_package(self, mock_importutils, mock_walk): + @mock.patch.object(importlib, 'import_module') + def test_import_modules_from_package(self, mock_import_module, mock_walk): yardstick_root = os.path.dirname(os.path.dirname(yardstick.__file__)) mock_walk.return_value = ([ @@ -69,7 +66,7 @@ class ImportModulesFromPackageTestCase(unittest.TestCase): ]) utils.import_modules_from_package('foo.bar') - mock_importutils.import_module.assert_called_with('bar.baz') + mock_import_module.assert_called_once_with('bar.baz') class GetParaFromYaml(unittest.TestCase): @@ -775,7 +772,8 @@ class RemoveFileTestCase(unittest.TestCase): def test_remove_file(self): try: utils.remove_file('notexistfile.txt') - except Exception as e: + except Exception as e: # pylint: disable=broad-except + # NOTE(ralonsoh): to narrow the scope of this exception. self.assertTrue(isinstance(e, OSError)) @@ -997,7 +995,8 @@ class TestUtilsIpAddrMethods(unittest.TestCase): self.assertEqual(utils.safe_ip_address(addr), expected, addr) @mock.patch("yardstick.common.utils.logging") - def test_safe_ip_address_negative(self, mock_logging): + def test_safe_ip_address_negative(self, *args): + # NOTE(ralonsoh): check the calls to mocked functions. for value in self.INVALID_IP_ADDRESS_STR_LIST: self.assertIsNone(utils.safe_ip_address(value), value) @@ -1026,7 +1025,8 @@ class TestUtilsIpAddrMethods(unittest.TestCase): self.assertEqual(utils.get_ip_version(addr), 6, addr) @mock.patch("yardstick.common.utils.logging") - def test_get_ip_version_negative(self, mock_logging): + def test_get_ip_version_negative(self, *args): + # NOTE(ralonsoh): check the calls to mocked functions. for value in self.INVALID_IP_ADDRESS_STR_LIST: self.assertIsNone(utils.get_ip_version(value), value) @@ -1055,7 +1055,8 @@ class TestUtilsIpAddrMethods(unittest.TestCase): self.assertEqual(utils.ip_to_hex(value), value) @mock.patch("yardstick.common.utils.logging") - def test_ip_to_hex_negative(self, mock_logging): + def test_ip_to_hex_negative(self, *args): + # NOTE(ralonsoh): check the calls to mocked functions. addr_list = self.GOOD_IP_V4_ADDRESS_STR_LIST mask_list = self.GOOD_IP_V4_MASK_STR_LIST value_iter = (''.join(pair) for pair in product(addr_list, mask_list)) @@ -1063,6 +1064,17 @@ class TestUtilsIpAddrMethods(unittest.TestCase): self.assertEqual(utils.ip_to_hex(value), value) +class SafeDecodeUtf8TestCase(unittest.TestCase): + + @unittest.skipIf(six.PY2, + 'This test should only be launched with Python 3.x') + def test_safe_decode_utf8(self): + _bytes = b'this is a byte array' + out = utils.safe_decode_utf8(_bytes) + self.assertIs(type(out), str) + self.assertEqual('this is a byte array', out) + + def main(): unittest.main() diff --git a/tests/unit/common/test_yaml_loader.py b/yardstick/tests/unit/common/test_yaml_loader.py index 90cbb8157..90cbb8157 100644 --- a/tests/unit/common/test_yaml_loader.py +++ b/yardstick/tests/unit/common/test_yaml_loader.py diff --git a/yardstick/tests/unit/dispatcher/__init__.py b/yardstick/tests/unit/dispatcher/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/yardstick/tests/unit/dispatcher/__init__.py diff --git a/tests/unit/dispatcher/test_influxdb.py b/yardstick/tests/unit/dispatcher/test_influxdb.py index 7ebe8c90b..bca94e385 100644 --- a/tests/unit/dispatcher/test_influxdb.py +++ b/yardstick/tests/unit/dispatcher/test_influxdb.py @@ -11,20 +11,15 @@ # Unittest for yardstick.dispatcher.influxdb -from __future__ import absolute_import +import mock import unittest +from yardstick.dispatcher.influxdb import InfluxdbDispatcher +from yardstick import _init_logging -try: - from unittest import mock -except ImportError: - import mock -from yardstick import _init_logging _init_logging() -from yardstick.dispatcher.influxdb import InfluxdbDispatcher - class InfluxdbDispatcherTestCase(unittest.TestCase): diff --git a/tests/unit/dispatcher/test_influxdb_line_protocol.py b/yardstick/tests/unit/dispatcher/test_influxdb_line_protocol.py index 51dc39e3c..641e97fae 100644 --- a/tests/unit/dispatcher/test_influxdb_line_protocol.py +++ b/yardstick/tests/unit/dispatcher/test_influxdb_line_protocol.py @@ -11,7 +11,6 @@ # yardstick comment: this file is a modified copy of # influxdb-python/influxdb/tests/test_line_protocol.py -from __future__ import absolute_import import unittest from third_party.influxdb.influxdb_line_protocol import make_lines diff --git a/yardstick/tests/unit/orchestrator/__init__.py b/yardstick/tests/unit/orchestrator/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/yardstick/tests/unit/orchestrator/__init__.py diff --git a/tests/unit/orchestrator/test_heat.py b/yardstick/tests/unit/orchestrator/test_heat.py index c34ea53fc..faf70cdbc 100644 --- a/tests/unit/orchestrator/test_heat.py +++ b/yardstick/tests/unit/orchestrator/test_heat.py @@ -13,10 +13,11 @@ from contextlib import contextmanager from itertools import count from tempfile import NamedTemporaryFile -import unittest -import uuid import time +import uuid + import mock +import unittest from yardstick.benchmark.contexts import node from yardstick.orchestrator import heat @@ -65,6 +66,7 @@ class HeatContextTestCase(unittest.TestCase): self.assertEqual(heat.HEAT_KEY_UUID_LENGTH, len(k)) self.assertIn(k, str(u)) + class HeatTemplateTestCase(unittest.TestCase): def setUp(self): @@ -73,38 +75,63 @@ class HeatTemplateTestCase(unittest.TestCase): def test_add_tenant_network(self): self.template.add_network('some-network') - self.assertEqual(self.template.resources['some-network']['type'], 'OS::Neutron::Net') + self.assertEqual( + self.template.resources['some-network']['type'], + 'OS::Neutron::Net') def test_add_provider_network(self): self.template.add_network('some-network', 'physnet2', 'sriov') - self.assertEqual(self.template.resources['some-network']['type'], 'OS::Neutron::ProviderNet') - self.assertEqual(self.template.resources['some-network']['properties']['physical_network'], 'physnet2') + self.assertEqual( + self.template.resources['some-network']['type'], + 'OS::Neutron::ProviderNet') + self.assertEqual( + self.template.resources['some-network']['properties']['physical_network'], + 'physnet2') def test_add_subnet(self): - netattrs = {'cidr': '10.0.0.0/24', 'provider': None, 'external_network': 'ext_net'} - self.template.add_subnet('some-subnet', "some-network", netattrs['cidr']) - - self.assertEqual(self.template.resources['some-subnet']['type'], 'OS::Neutron::Subnet') - self.assertEqual(self.template.resources['some-subnet']['properties']['cidr'], '10.0.0.0/24') + netattrs = {'cidr': '10.0.0.0/24', + 'provider': None, 'external_network': 'ext_net'} + self.template.add_subnet( + 'some-subnet', "some-network", netattrs['cidr']) + + self.assertEqual( + self.template.resources['some-subnet']['type'], + 'OS::Neutron::Subnet') + self.assertEqual( + self.template.resources['some-subnet']['properties']['cidr'], + '10.0.0.0/24') def test_add_router(self): self.template.add_router('some-router', 'ext-net', 'some-subnet') - self.assertEqual(self.template.resources['some-router']['type'], 'OS::Neutron::Router') - self.assertIn('some-subnet', self.template.resources['some-router']['depends_on']) + self.assertEqual( + self.template.resources['some-router']['type'], + 'OS::Neutron::Router') + self.assertIn( + 'some-subnet', + self.template.resources['some-router']['depends_on']) def test_add_router_interface(self): - self.template.add_router_interface('some-router-if', 'some-router', 'some-subnet') + self.template.add_router_interface( + 'some-router-if', 'some-router', 'some-subnet') - self.assertEqual(self.template.resources['some-router-if']['type'], 'OS::Neutron::RouterInterface') - self.assertIn('some-subnet', self.template.resources['some-router-if']['depends_on']) + self.assertEqual( + self.template.resources['some-router-if']['type'], + 'OS::Neutron::RouterInterface') + self.assertIn( + 'some-subnet', + self.template.resources['some-router-if']['depends_on']) def test_add_servergroup(self): self.template.add_servergroup('some-server-group', 'anti-affinity') - self.assertEqual(self.template.resources['some-server-group']['type'], 'OS::Nova::ServerGroup') - self.assertEqual(self.template.resources['some-server-group']['properties']['policies'], ['anti-affinity']) + self.assertEqual( + self.template.resources['some-server-group']['type'], + 'OS::Nova::ServerGroup') + self.assertEqual( + self.template.resources['some-server-group']['properties']['policies'], + ['anti-affinity']) def test__add_resources_to_template_raw(self): test_context = node.NodeContext() @@ -136,49 +163,136 @@ class HeatTemplateTestCase(unittest.TestCase): heat_template.add_router("router1", "gw1", "subnet1") heat_template.add_router_interface("router_if1", "router1", "subnet1") heat_template.add_port("port1", "network1", "subnet1", "normal") - heat_template.add_port("port2", "network2", "subnet2", "normal", sec_group_id="sec_group1",provider="not-sriov") - heat_template.add_port("port3", "network2", "subnet2", "normal", sec_group_id="sec_group1",provider="sriov") - heat_template.add_floating_ip("floating_ip1", "network1", "port1", "router_if1") - heat_template.add_floating_ip("floating_ip2", "network2", "port2", "router_if2", "foo-secgroup") - heat_template.add_floating_ip_association("floating_ip1_association", "floating_ip1", "port1") + heat_template.add_port( + "port2", + "network2", + "subnet2", + "normal", + sec_group_id="sec_group1", + provider="not-sriov") + heat_template.add_port( + "port3", + "network2", + "subnet2", + "normal", + sec_group_id="sec_group1", + provider="sriov") + heat_template.add_floating_ip( + "floating_ip1", "network1", "port1", "router_if1") + heat_template.add_floating_ip( + "floating_ip2", "network2", "port2", "router_if2", "foo-secgroup") + heat_template.add_floating_ip_association( + "floating_ip1_association", "floating_ip1", "port1") heat_template.add_servergroup("server_grp2", "affinity") heat_template.add_servergroup("server_grp3", "anti-affinity") heat_template.add_security_group("security_group") - heat_template.add_server(name="server1", image="image1", flavor="flavor1", flavors=[]) - heat_template.add_server_group(name="servergroup", policies=["policy1","policy2"]) + heat_template.add_server( + name="server1", image="image1", flavor="flavor1", flavors=[]) + heat_template.add_server_group( + name="servergroup", policies=["policy1", "policy2"]) heat_template.add_server_group(name="servergroup", policies="policy1") - heat_template.add_server(name="server2", image="image1", flavor="flavor1", flavors=[], ports=["port1", "port2"], - networks=["network1", "network2"], scheduler_hints="hints1", user="user1", - key_name="foo-key", user_data="user", metadata={"cat": 1, "doc": 2}, - additional_properties={"prop1": 1, "prop2": 2}) - heat_template.add_server(name="server2", image="image1", flavor="flavor1", flavors=["flavor1", "flavor2"], - ports=["port1", "port2"], - networks=["network1", "network2"], scheduler_hints="hints1", user="user1", - key_name="foo-key", user_data="user", metadata={"cat": 1, "doc": 2}, - additional_properties={"prop1": 1, "prop2": 2} ) - heat_template.add_server(name="server2", image="image1", flavor="flavor1", flavors=["flavor3", "flavor4"], - ports=["port1", "port2"], - networks=["network1", "network2"], scheduler_hints="hints1", user="user1", - key_name="foo-key", user_data="user", metadata={"cat": 1, "doc": 2}, - additional_properties={"prop1": 1, "prop2": 2}) - heat_template.add_flavor(name="flavor1", vcpus=1, ram=2048, disk=1,extra_specs={"cat": 1, "dog": 2}) + heat_template.add_server( + name="server2", + image="image1", + flavor="flavor1", + flavors=[], + ports=[ + "port1", + "port2"], + networks=[ + "network1", + "network2"], + scheduler_hints="hints1", + user="user1", + key_name="foo-key", + user_data="user", + metadata={ + "cat": 1, + "doc": 2}, + additional_properties={ + "prop1": 1, + "prop2": 2}) + heat_template.add_server( + name="server2", + image="image1", + flavor="flavor1", + flavors=[ + "flavor1", + "flavor2"], + ports=[ + "port1", + "port2"], + networks=[ + "network1", + "network2"], + scheduler_hints="hints1", + user="user1", + key_name="foo-key", + user_data="user", + metadata={ + "cat": 1, + "doc": 2}, + additional_properties={ + "prop1": 1, + "prop2": 2}) + heat_template.add_server( + name="server2", + image="image1", + flavor="flavor1", + flavors=[ + "flavor3", + "flavor4"], + ports=[ + "port1", + "port2"], + networks=[ + "network1", + "network2"], + scheduler_hints="hints1", + user="user1", + key_name="foo-key", + user_data="user", + metadata={ + "cat": 1, + "doc": 2}, + additional_properties={ + "prop1": 1, + "prop2": 2}) + heat_template.add_flavor( + name="flavor1", + vcpus=1, + ram=2048, + disk=1, + extra_specs={ + "cat": 1, + "dog": 2}) heat_template.add_flavor(name=None, vcpus=1, ram=2048) - heat_template.add_server(name="server1", - image="image1", - flavor="flavor1", - flavors=[], - ports=["port1", "port2"], - networks=["network1", "network2"], - scheduler_hints="hints1", - user="user1", - key_name="foo-key", - user_data="user", - metadata={"cat": 1, "doc": 2}, - additional_properties= {"prop1": 1, "prop2": 2} ) + heat_template.add_server( + name="server1", + image="image1", + flavor="flavor1", + flavors=[], + ports=[ + "port1", + "port2"], + networks=[ + "network1", + "network2"], + scheduler_hints="hints1", + user="user1", + key_name="foo-key", + user_data="user", + metadata={ + "cat": 1, + "doc": 2}, + additional_properties={ + "prop1": 1, + "prop2": 2}) heat_template.add_network("network1") heat_template.add_flavor("test") - self.assertEqual(heat_template.resources['test']['type'], 'OS::Nova::Flavor') + self.assertEqual( + heat_template.resources['test']['type'], 'OS::Nova::Flavor') @mock_patch_target_module('op_utils') @mock_patch_target_module('heatclient') @@ -197,18 +311,25 @@ class HeatTemplateTestCase(unittest.TestCase): with mock.patch.object(self.template, 'status', return_value=None) as mock_status: # block with timeout hit timeout = 0 - with self.assertRaises(RuntimeError) as raised, timer() as time_data: + with self.assertRaises(RuntimeError) as raised, timer(): self.template.create(block=True, timeout=timeout) # ensure op_utils was used expected_op_utils_usage += 1 - self.assertEqual(mock_op_utils.get_session.call_count, expected_op_utils_usage) - self.assertEqual(mock_op_utils.get_endpoint.call_count, expected_op_utils_usage) - self.assertEqual(mock_op_utils.get_heat_api_version.call_count, expected_op_utils_usage) + self.assertEqual( + mock_op_utils.get_session.call_count, expected_op_utils_usage) + self.assertEqual( + mock_op_utils.get_endpoint.call_count, expected_op_utils_usage) + self.assertEqual( + mock_op_utils.get_heat_api_version.call_count, + expected_op_utils_usage) # ensure the constructor and instance were used - self.assertEqual(mock_heat_client_class.call_count, expected_constructor_calls) - self.assertEqual(mock_heat_client.stacks.create.call_count, expected_create_calls) + self.assertEqual(mock_heat_client_class.call_count, + expected_constructor_calls) + self.assertEqual( + mock_heat_client.stacks.create.call_count, + expected_create_calls) # ensure that the status was used self.assertGreater(mock_status.call_count, expected_status_calls) @@ -222,22 +343,33 @@ class HeatTemplateTestCase(unittest.TestCase): # block with create failed timeout = 10 mock_status.side_effect = iter([None, None, u'CREATE_FAILED']) - with self.assertRaises(RuntimeError) as raised, timer() as time_data: + with self.assertRaises(RuntimeError) as raised, timer(): self.template.create(block=True, timeout=timeout) - # ensure the existing heat_client was used and op_utils was used again - self.assertEqual(mock_op_utils.get_session.call_count, expected_op_utils_usage) - self.assertEqual(mock_op_utils.get_endpoint.call_count, expected_op_utils_usage) - self.assertEqual(mock_op_utils.get_heat_api_version.call_count, expected_op_utils_usage) + # ensure the existing heat_client was used and op_utils was used + # again + self.assertEqual( + mock_op_utils.get_session.call_count, expected_op_utils_usage) + self.assertEqual( + mock_op_utils.get_endpoint.call_count, expected_op_utils_usage) + self.assertEqual( + mock_op_utils.get_heat_api_version.call_count, + expected_op_utils_usage) # ensure the constructor was not used but the instance was used - self.assertEqual(mock_heat_client_class.call_count, expected_constructor_calls) - self.assertEqual(mock_heat_client.stacks.create.call_count, expected_create_calls) + self.assertEqual(mock_heat_client_class.call_count, + expected_constructor_calls) + self.assertEqual( + mock_heat_client.stacks.create.call_count, + expected_create_calls) # ensure that the status was used three times expected_status_calls += 3 self.assertEqual(mock_status.call_count, expected_status_calls) + # NOTE(elfoley): This needs to be split into multiple tests. + # The lines where the template is reset should serve as a guide for where + # to split. @mock_patch_target_module('op_utils') @mock_patch_target_module('heatclient') def test_create(self, mock_heat_client_class, mock_op_utils): @@ -250,7 +382,7 @@ class HeatTemplateTestCase(unittest.TestCase): {'output_key': 'key2', 'output_value': 'value2'}, {'output_key': 'key3', 'output_value': 'value3'}, ] - expected_outputs = { + expected_outputs = { # pylint: disable=unused-variable 'key1': 'value1', 'key2': 'value2', 'key3': 'value3', @@ -266,17 +398,25 @@ class HeatTemplateTestCase(unittest.TestCase): mock_status.return_value = None # no block - self.assertIsInstance(self.template.create(block=False, timeout=2), heat.HeatStack) + self.assertIsInstance(self.template.create( + block=False, timeout=2), heat.HeatStack) # ensure op_utils was used expected_op_utils_usage += 1 - self.assertEqual(mock_op_utils.get_session.call_count, expected_op_utils_usage) - self.assertEqual(mock_op_utils.get_endpoint.call_count, expected_op_utils_usage) - self.assertEqual(mock_op_utils.get_heat_api_version.call_count, expected_op_utils_usage) + self.assertEqual( + mock_op_utils.get_session.call_count, expected_op_utils_usage) + self.assertEqual( + mock_op_utils.get_endpoint.call_count, expected_op_utils_usage) + self.assertEqual( + mock_op_utils.get_heat_api_version.call_count, + expected_op_utils_usage) # ensure the constructor and instance were used - self.assertEqual(mock_heat_client_class.call_count, expected_constructor_calls) - self.assertEqual(mock_heat_client.stacks.create.call_count, expected_create_calls) + self.assertEqual(mock_heat_client_class.call_count, + expected_constructor_calls) + self.assertEqual( + mock_heat_client.stacks.create.call_count, + expected_create_calls) # ensure that the status was not used self.assertEqual(mock_status.call_count, expected_status_calls) @@ -288,11 +428,15 @@ class HeatTemplateTestCase(unittest.TestCase): self.template.name = 'block, immediate complete test' mock_status.return_value = self.template.HEAT_CREATE_COMPLETE_STATUS - self.assertIsInstance(self.template.create(block=True, timeout=2), heat.HeatStack) + self.assertIsInstance(self.template.create( + block=True, timeout=2), heat.HeatStack) # ensure existing instance was re-used and op_utils was not used - self.assertEqual(mock_heat_client_class.call_count, expected_constructor_calls) - self.assertEqual(mock_heat_client.stacks.create.call_count, expected_create_calls) + self.assertEqual(mock_heat_client_class.call_count, + expected_constructor_calls) + self.assertEqual( + mock_heat_client.stacks.create.call_count, + expected_create_calls) # ensure status was checked once expected_status_calls += 1 @@ -305,13 +449,17 @@ class HeatTemplateTestCase(unittest.TestCase): self.template.name = 'block, delayed complete test' success_index = 2 - mock_status.side_effect = index_value_iter(success_index, - self.template.HEAT_CREATE_COMPLETE_STATUS) - self.assertIsInstance(self.template.create(block=True, timeout=2), heat.HeatStack) + mock_status.side_effect = index_value_iter( + success_index, self.template.HEAT_CREATE_COMPLETE_STATUS) + self.assertIsInstance(self.template.create( + block=True, timeout=2), heat.HeatStack) # ensure existing instance was re-used and op_utils was not used - self.assertEqual(mock_heat_client_class.call_count, expected_constructor_calls) - self.assertEqual(mock_heat_client.stacks.create.call_count, expected_create_calls) + self.assertEqual(mock_heat_client_class.call_count, + expected_constructor_calls) + self.assertEqual( + mock_heat_client.stacks.create.call_count, + expected_create_calls) # ensure status was checked three more times expected_status_calls += 1 + success_index @@ -328,8 +476,7 @@ class HeatStackTestCase(unittest.TestCase): # call once and then call again if uuid is not none self.assertGreater(delete_mock.call_count, 1) - @mock.patch('yardstick.orchestrator.heat.op_utils') - def test_delete_all_calls_delete(self, mock_op): + def test_delete_all_calls_delete(self): # we must patch the object before we create an instance # so we can override delete() in all the instances with mock.patch.object(heat.HeatStack, "delete") as delete_mock: diff --git a/tests/unit/orchestrator/test_kubernetes.py b/yardstick/tests/unit/orchestrator/test_kubernetes.py index 1a3291c89..33fa1dca6 100644 --- a/tests/unit/orchestrator/test_kubernetes.py +++ b/yardstick/tests/unit/orchestrator/test_kubernetes.py @@ -64,7 +64,7 @@ service ssh restart;while true ; do sleep 10000; done" } ], "nodeSelector": { - "kubernetes.io/hostname": "node-01" + "kubernetes.io/hostname": "node-01" } } } @@ -75,7 +75,7 @@ service ssh restart;while true ; do sleep 10000; done" 'args': ['-c', 'chmod 700 ~/.ssh; chmod 600 ~/.ssh/*; \ service ssh restart;while true ; do sleep 10000; done'], 'ssh_key': 'k8s-86096c30-key', - 'nodeSelector': { 'kubernetes.io/hostname': 'node-01'} + 'nodeSelector': {'kubernetes.io/hostname': 'node-01'} } name = 'host-k8s-86096c30' output_r = KubernetesObject(name, **input_s).get_template() diff --git a/tests/unit/test_ssh.py b/yardstick/tests/unit/test_ssh.py index b298c745b..dbaae8c37 100644 --- a/tests/unit/test_ssh.py +++ b/yardstick/tests/unit/test_ssh.py @@ -262,7 +262,7 @@ class SSHTestCase(unittest.TestCase): self.test_client.execute.mock_calls) @mock.patch("yardstick.ssh.paramiko") - def test_send_command(self, mock_paramiko): + def test_send_command(self, _): paramiko_sshclient = self.test_client._get_client() with mock.patch.object(paramiko_sshclient, "exec_command") \ as mock_paramiko_exec_command: @@ -546,6 +546,15 @@ class TestAutoConnectSSH(unittest.TestCase): with mock_scp_client_type() as mock_scp_client: self.assertEqual(mock_scp_client.put.call_count, 1) + @mock.patch('yardstick.ssh.SCPClient') + def test_get(self, mock_scp_client_type): + auto_connect_ssh = AutoConnectSSH('user1', 'host1') + auto_connect_ssh._client = mock.Mock() + + auto_connect_ssh.get('a', 'z') + with mock_scp_client_type() as mock_scp_client: + self.assertEqual(mock_scp_client.get.call_count, 1) + def test_put_file(self): auto_connect_ssh = AutoConnectSSH('user1', 'host1') auto_connect_ssh._client = mock.Mock() |