summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/ci/prepare_env.sh28
-rwxr-xr-xtests/ci/prepare_storperf_admin-rc.sh30
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc042.yaml51
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml2
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml2
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml2
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml2
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml2
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc055.yaml23
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc070.yaml (renamed from tests/opnfv/test_cases/opnfv_yardstick_tc044.yaml)24
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc071.yaml85
-rw-r--r--tests/opnfv/test_suites/opnfv_os-nosdn-kvm-ha_daily.yaml10
-rw-r--r--tests/opnfv/test_suites/opnfv_os-nosdn-kvm_ovs-ha_daily.yaml10
-rw-r--r--tests/opnfv/test_suites/opnfv_os-nosdn-lxd-ha_daily.yaml32
-rw-r--r--tests/opnfv/test_suites/opnfv_os-nosdn-lxd-noha_daily.yaml32
-rw-r--r--tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-ha_daily.yaml31
-rw-r--r--tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-noha_daily.yaml32
-rw-r--r--tests/opnfv/test_suites/opnfv_os-nosdn-ovs-ha_daily.yaml10
-rw-r--r--tests/opnfv/test_suites/opnfv_os-ocl-nofeature-ha_daily.yaml10
-rw-r--r--tests/opnfv/test_suites/opnfv_os-ocl-nofeature-noha_daily.yaml32
-rw-r--r--tests/opnfv/test_suites/opnfv_os-odl_l2-bgpvpn-ha_daily.yaml2
-rw-r--r--tests/opnfv/test_suites/opnfv_os-odl_l2-nofeature-ha_daily.yaml10
-rw-r--r--tests/opnfv/test_suites/opnfv_os-odl_l2-nofeature-noha_daily.yaml32
-rw-r--r--tests/opnfv/test_suites/opnfv_os-odl_l2-sfc-ha_daily.yaml10
-rw-r--r--tests/opnfv/test_suites/opnfv_os-odl_l2-sfc-noha_daily.yaml32
-rw-r--r--tests/opnfv/test_suites/opnfv_os-odl_l3-nofeature-ha_daily.yaml10
-rw-r--r--tests/opnfv/test_suites/opnfv_os-onos-nofeature-ha_daily.yaml10
-rw-r--r--tests/opnfv/test_suites/opnfv_os-onos-nofeature-noha_daily.yaml32
-rw-r--r--tests/opnfv/test_suites/opnfv_os-onos-sfc-ha_daily.yaml10
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_attacker_general.py1
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_monitor_general.py2
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_operation_general.py2
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_result_checker_general.py1
-rw-r--r--tests/unit/benchmark/scenarios/networking/netutilization_sample_output1.txt9
-rw-r--r--tests/unit/benchmark/scenarios/networking/netutilization_sample_output2.txt13
-rw-r--r--tests/unit/benchmark/scenarios/networking/test_netutilization.py225
-rw-r--r--tests/unit/benchmark/scenarios/networking/test_ping.py14
37 files changed, 842 insertions, 23 deletions
diff --git a/tests/ci/prepare_env.sh b/tests/ci/prepare_env.sh
index ed832bc47..35118b12c 100755
--- a/tests/ci/prepare_env.sh
+++ b/tests/ci/prepare_env.sh
@@ -52,3 +52,31 @@ fi
source $OPENRC
export EXTERNAL_NETWORK INSTALLER_TYPE DEPLOY_TYPE NODE_NAME
+
+# Prepare a admin-rc file for StorPerf integration
+$YARDSTICK_REPO_DIR/tests/ci/prepare_storperf_admin-rc.sh
+
+# Fetching id_rsa file from jump_server..."
+verify_connectivity() {
+ local ip=$1
+ echo "Verifying connectivity to $ip..."
+ for i in $(seq 0 10); do
+ if ping -c 1 -W 1 $ip > /dev/null; then
+ echo "$ip is reachable!"
+ return 0
+ fi
+ sleep 1
+ done
+ error "Can not talk to $ip."
+}
+
+ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
+
+if [ "$INSTALLER_TYPE" == "fuel" ]; then
+ #ip_fuel="10.20.0.2"
+ verify_connectivity $INSTALLER_IP
+ echo "Fetching id_rsa file from jump_server $INSTALLER_IP..."
+ sshpass -p r00tme scp 2>/dev/null $ssh_options \
+ root@${INSTALLER_IP}:~/.ssh/id_rsa /root/.ssh/id_rsa &> /dev/null
+fi
+
diff --git a/tests/ci/prepare_storperf_admin-rc.sh b/tests/ci/prepare_storperf_admin-rc.sh
new file mode 100755
index 000000000..0401719ff
--- /dev/null
+++ b/tests/ci/prepare_storperf_admin-rc.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+##############################################################################
+# Copyright (c) 2016 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
+##############################################################################
+
+AUTH_URL=${OS_AUTH_URL}
+USERNAME=${OS_USERNAME:-admin}
+PASSWORD=${OS_PASSWORD:-console}
+TENANT_NAME=${OS_TENANT_NAME:-admin}
+VOLUME_API_VERSION=${OS_VOLUME_API_VERSION:-2}
+PROJECT_NAME=${OS_PROJECT_NAME:-$TENANT_NAME}
+TENANT_ID=`keystone tenant-get admin|grep 'id'|awk -F '|' '{print $3}'|sed -e 's/^[[:space:]]*//'`
+
+
+rm -f ~/storperf_admin-rc
+touch ~/storperf_admin-rc
+
+echo "OS_AUTH_URL="$AUTH_URL >> ~/storperf_admin-rc
+echo "OS_USERNAME="$USERNAME >> ~/storperf_admin-rc
+echo "OS_PASSWORD="$PASSWORD >> ~/storperf_admin-rc
+echo "OS_TENANT_NAME="$TENANT_NAME >> ~/storperf_admin-rc
+echo "OS_VOLUME_API_VERSION="$VOLUME_API_VERSION >> ~/storperf_admin-rc
+echo "OS_PROJECT_NAME="$PROJECT_NAME >> ~/storperf_admin-rc
+echo "OS_TENANT_ID="$TENANT_ID >> ~/storperf_admin-rc
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc042.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc042.yaml
new file mode 100644
index 000000000..a47f71a8b
--- /dev/null
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc042.yaml
@@ -0,0 +1,51 @@
+---
+# Yardstick TC042 config file
+# Measure network latency using testpmd and pktgen-dpdk
+
+schema: "yardstick:task:0.1"
+
+scenarios:
+-
+ type: PktgenDPDKLatency
+ options:
+ packetsize: 64
+ rate: 100
+ duration: 20
+
+ host: demeter.yardstick
+ target: poseidon.yardstick
+
+ runner:
+ type: Iteration
+ iterations: 2
+ interval: 1
+
+ sla:
+ max_rtt: 1000
+ action: monitor
+
+context:
+ name: yardstick
+ image: yardstick-image-pktgen-ready
+ flavor: yardstick-pktgen-dpdk.flavor
+ user: ubuntu
+
+ placement_groups:
+ pgrp1:
+ policy: "availability"
+
+ servers:
+ demeter:
+ floating_ip: true
+ placement: "pgrp1"
+ poseidon:
+ floating_ip: true
+ placement: "pgrp1"
+
+ networks:
+ test:
+ cidr: '10.0.1.0/24'
+ test2:
+ cidr: '10.0.2.0/24'
+ test3:
+ cidr: '10.0.3.0/24'
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml
index 812d53dd8..328b75971 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml
@@ -39,5 +39,5 @@ scenarios:
context:
type: Node
name: LF
- file: /root/yardstick/etc/yardstick/nodes/fuel_virtual/pod.yaml
+ file: etc/yardstick/nodes/fuel_virtual/pod.yaml
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml
index 867553d21..aa39aa82e 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml
@@ -39,4 +39,4 @@ scenarios:
context:
type: Node
name: LF
- file: /root/yardstick/etc/yardstick/nodes/fuel_virtual/pod.yaml
+ file: etc/yardstick/nodes/fuel_virtual/pod.yaml
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml
index 0707dc9e9..1178b4f33 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml
@@ -39,4 +39,4 @@ scenarios:
context:
type: Node
name: LF
- file: /root/yardstick/etc/yardstick/nodes/fuel_virtual/pod.yaml
+ file: etc/yardstick/nodes/fuel_virtual/pod.yaml
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml
index 525c206c3..7b1fbc555 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml
@@ -39,5 +39,5 @@ scenarios:
context:
type: Node
name: LF
- file: /root/yardstick/etc/yardstick/nodes/fuel_virtual/pod.yaml
+ file: etc/yardstick/nodes/fuel_virtual/pod.yaml
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml
index da93a467f..0bdcbd13b 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml
@@ -39,4 +39,4 @@ scenarios:
context:
type: Node
name: LF
- file: /root/yardstick/etc/yardstick/nodes/fuel_virtual/pod.yaml
+ file: etc/yardstick/nodes/fuel_virtual/pod.yaml
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc055.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc055.yaml
new file mode 100644
index 000000000..b43e56665
--- /dev/null
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc055.yaml
@@ -0,0 +1,23 @@
+---
+# Yardstick TC055 config file
+# Collect hardware specification from /proc/cpuinfo
+
+schema: "yardstick:task:0.1"
+{% set host = host or "node5.yardstick-TC055" %}
+{% set pod_info = pod_info or "etc/yardstick/nodes/compass_sclab_virtual/pod.yaml" %}
+scenarios:
+-
+ type: ComputeCapacity
+ options:
+
+ nodes:
+ host: {{host}}
+
+ runner:
+ type: Iteration
+ iterations: 1
+
+context:
+ type: Node
+ name: yardstick-TC055
+ file: {{pod_info}}
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc044.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc070.yaml
index d7406832d..28b28b9ab 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc044.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc070.yaml
@@ -1,13 +1,13 @@
---
-# Yardstick TC044 config file
-# Measure memory usage statistics, network throughput, latency and packet loss.
+# Yardstick TC070 config file
+# Measure network throughput and packet loss using pktgen.
# Different amounts of flows are tested with, from 2 up to 1001000.
# All tests are run 2 times each. First 2 times with the least
# amount of ports, then 2 times with the next amount of ports,
# and so on until all packet sizes have been run with.
#
# During the measurements memory usage statistics and network latency are
-# recorded/measured using sar and ping, respectively.
+# recorded/measured using free and ping, respectively.
schema: "yardstick:task:0.1"
@@ -18,18 +18,18 @@ scenarios:
options:
interval: 1
- count: 1
+ count: 10
- host: demeter.yardstick-TC044
+ host: demeter.yardstick-TC070
-
type: MEMORYload
run_in_background: true
options:
interval: 1
- count: 1
+ count: 10
- host: poseidon.yardstick-TC044
+ host: poseidon.yardstick-TC070
-
type: Ping
run_in_background: true
@@ -37,8 +37,8 @@ scenarios:
options:
packetsize: 100
- host: demeter.yardstick-TC044
- target: poseidon.yardstick-TC044
+ host: demeter.yardstick-TC070
+ target: poseidon.yardstick-TC070
sla:
max_rtt: 10
@@ -51,8 +51,8 @@ scenarios:
number_of_ports: {{num_ports}}
duration: 20
- host: demeter.yardstick-TC044
- target: poseidon.yardstick-TC044
+ host: demeter.yardstick-TC070
+ target: poseidon.yardstick-TC070
runner:
type: Iteration
@@ -65,7 +65,7 @@ scenarios:
{% endfor %}
context:
- name: yardstick-TC044
+ name: yardstick-TC070
image: yardstick-trusty-server
flavor: yardstick-flavor
user: ubuntu
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc071.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc071.yaml
new file mode 100644
index 000000000..644010916
--- /dev/null
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc071.yaml
@@ -0,0 +1,85 @@
+---
+# Yardstick TC071 config file
+# Measure cache hit/miss ratio and usage, network throughput and latency.
+# Different amounts of flows are tested with, from 2 up to 1001000.
+# All tests are run 2 times each. First 2 times with the least
+# amount of ports, then 2 times with the next amount of ports,
+# and so on until all packet sizes have been run with.
+#
+# During the measurements cache hit/miss ration, cache usage statistics and
+# network latency are recorded/measured using cachestat and ping, respectively.
+
+schema: "yardstick:task:0.1"
+
+scenarios:
+-
+ type: CACHEstat
+ run_in_background: true
+
+ options:
+ interval: 1
+
+ host: demeter.yardstick-TC071
+-
+ type: CACHEstat
+ run_in_background: true
+
+ options:
+ interval: 1
+
+ host: poseidon.yardstick-TC071
+-
+ type: Ping
+ run_in_background: true
+
+ options:
+ packetsize: 100
+
+ host: demeter.yardstick-TC071
+ target: poseidon.yardstick-TC071
+
+ sla:
+ max_rtt: 10
+ action: monitor
+{% for num_ports in [1, 10, 50, 100, 300, 500, 750, 1000] %}
+-
+ type: Pktgen
+ options:
+ packetsize: 64
+ number_of_ports: {{num_ports}}
+ duration: 20
+
+ host: demeter.yardstick-TC071
+ target: poseidon.yardstick-TC071
+
+ runner:
+ type: Iteration
+ iterations: 2
+ interval: 1
+
+ sla:
+ max_ppm: 1000
+ action: monitor
+{% endfor %}
+
+context:
+ name: yardstick-TC071
+ image: yardstick-trusty-server
+ flavor: yardstick-flavor
+ user: ubuntu
+
+ placement_groups:
+ pgrp1:
+ policy: "availability"
+
+ servers:
+ demeter:
+ floating_ip: true
+ placement: "pgrp1"
+ poseidon:
+ floating_ip: true
+ placement: "pgrp1"
+
+ networks:
+ test:
+ cidr: '10.0.1.0/24'
diff --git a/tests/opnfv/test_suites/opnfv_os-nosdn-kvm-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-nosdn-kvm-ha_daily.yaml
index 50167b8bf..2840c1755 100644
--- a/tests/opnfv/test_suites/opnfv_os-nosdn-kvm-ha_daily.yaml
+++ b/tests/opnfv/test_suites/opnfv_os-nosdn-kvm-ha_daily.yaml
@@ -20,3 +20,13 @@ test_cases:
file_name: opnfv_yardstick_tc014.yaml
-
file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-nosdn-kvm_ovs-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-nosdn-kvm_ovs-ha_daily.yaml
index 81427ad47..0d139f137 100644
--- a/tests/opnfv/test_suites/opnfv_os-nosdn-kvm_ovs-ha_daily.yaml
+++ b/tests/opnfv/test_suites/opnfv_os-nosdn-kvm_ovs-ha_daily.yaml
@@ -20,3 +20,13 @@ test_cases:
file_name: opnfv_yardstick_tc014.yaml
-
file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-nosdn-lxd-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-nosdn-lxd-ha_daily.yaml
new file mode 100644
index 000000000..08420dbe4
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-nosdn-lxd-ha_daily.yaml
@@ -0,0 +1,32 @@
+---
+# Huawei US bare daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-nosdn-lxd-ha"
+test_cases_dir: "tests/opnfv/test_cases/"
+test_cases:
+-
+ file_name: opnfv_yardstick_tc002.yaml
+-
+ file_name: opnfv_yardstick_tc005.yaml
+-
+ file_name: opnfv_yardstick_tc010.yaml
+-
+ file_name: opnfv_yardstick_tc011.yaml
+-
+ file_name: opnfv_yardstick_tc012.yaml
+-
+ file_name: opnfv_yardstick_tc014.yaml
+-
+ file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-nosdn-lxd-noha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-nosdn-lxd-noha_daily.yaml
new file mode 100644
index 000000000..8d55afb9c
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-nosdn-lxd-noha_daily.yaml
@@ -0,0 +1,32 @@
+---
+# Huawei US bare daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-nosdn-lxd-noha"
+test_cases_dir: "tests/opnfv/test_cases/"
+test_cases:
+-
+ file_name: opnfv_yardstick_tc002.yaml
+-
+ file_name: opnfv_yardstick_tc005.yaml
+-
+ file_name: opnfv_yardstick_tc010.yaml
+-
+ file_name: opnfv_yardstick_tc011.yaml
+-
+ file_name: opnfv_yardstick_tc012.yaml
+-
+ file_name: opnfv_yardstick_tc014.yaml
+-
+ file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-ha_daily.yaml
index c6dadac20..180ad165e 100644
--- a/tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-ha_daily.yaml
+++ b/tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-ha_daily.yaml
@@ -28,4 +28,33 @@ test_cases:
task_args:
huawei_pod1: '{"pod_info": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
"host": "node4.LF","target": "node5.LF"}'
-
+-
+ file_name: opnfv_yardstick_tc045.yaml
+ constraint:
+ installer: fuel
+-
+ file_name: opnfv_yardstick_tc046.yaml
+ constraint:
+ installer: fuel
+-
+ file_name: opnfv_yardstick_tc047.yaml
+ constraint:
+ installer: fuel
+-
+ file_name: opnfv_yardstick_tc048.yaml
+ constraint:
+ installer: fuel
+-
+ file_name: opnfv_yardstick_tc049.yaml
+ constraint:
+ installer: fuel
+-
+ file_name: opnfv_yardstick_tc055.yaml
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-noha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-noha_daily.yaml
new file mode 100644
index 000000000..54c6a25c6
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-nosdn-nofeature-noha_daily.yaml
@@ -0,0 +1,32 @@
+---
+# Huawei US bare daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-nosdn-nofeature-noha"
+test_cases_dir: "tests/opnfv/test_cases/"
+test_cases:
+-
+ file_name: opnfv_yardstick_tc002.yaml
+-
+ file_name: opnfv_yardstick_tc005.yaml
+-
+ file_name: opnfv_yardstick_tc010.yaml
+-
+ file_name: opnfv_yardstick_tc011.yaml
+-
+ file_name: opnfv_yardstick_tc012.yaml
+-
+ file_name: opnfv_yardstick_tc014.yaml
+-
+ file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-nosdn-ovs-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-nosdn-ovs-ha_daily.yaml
index 2eafd279b..e497e1e85 100644
--- a/tests/opnfv/test_suites/opnfv_os-nosdn-ovs-ha_daily.yaml
+++ b/tests/opnfv/test_suites/opnfv_os-nosdn-ovs-ha_daily.yaml
@@ -20,3 +20,13 @@ test_cases:
file_name: opnfv_yardstick_tc014.yaml
-
file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-ocl-nofeature-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-ocl-nofeature-ha_daily.yaml
index 21d2ebf24..2f0e87a1b 100644
--- a/tests/opnfv/test_suites/opnfv_os-ocl-nofeature-ha_daily.yaml
+++ b/tests/opnfv/test_suites/opnfv_os-ocl-nofeature-ha_daily.yaml
@@ -20,3 +20,13 @@ test_cases:
file_name: opnfv_yardstick_tc014.yaml
-
file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-ocl-nofeature-noha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-ocl-nofeature-noha_daily.yaml
new file mode 100644
index 000000000..2d81db80b
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-ocl-nofeature-noha_daily.yaml
@@ -0,0 +1,32 @@
+---
+# Huawei US bare daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-ocl-nofeature-noha"
+test_cases_dir: "tests/opnfv/test_cases/"
+test_cases:
+-
+ file_name: opnfv_yardstick_tc002.yaml
+-
+ file_name: opnfv_yardstick_tc005.yaml
+-
+ file_name: opnfv_yardstick_tc010.yaml
+-
+ file_name: opnfv_yardstick_tc011.yaml
+-
+ file_name: opnfv_yardstick_tc012.yaml
+-
+ file_name: opnfv_yardstick_tc014.yaml
+-
+ file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-odl_l2-bgpvpn-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-odl_l2-bgpvpn-ha_daily.yaml
index 80389062a..ab34f67d5 100644
--- a/tests/opnfv/test_suites/opnfv_os-odl_l2-bgpvpn-ha_daily.yaml
+++ b/tests/opnfv/test_suites/opnfv_os-odl_l2-bgpvpn-ha_daily.yaml
@@ -20,3 +20,5 @@ test_cases:
file_name: opnfv_yardstick_tc014.yaml
-
file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-odl_l2-nofeature-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-odl_l2-nofeature-ha_daily.yaml
index c80b394b4..ed831ef82 100644
--- a/tests/opnfv/test_suites/opnfv_os-odl_l2-nofeature-ha_daily.yaml
+++ b/tests/opnfv/test_suites/opnfv_os-odl_l2-nofeature-ha_daily.yaml
@@ -20,3 +20,13 @@ test_cases:
file_name: opnfv_yardstick_tc014.yaml
-
file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-odl_l2-nofeature-noha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-odl_l2-nofeature-noha_daily.yaml
new file mode 100644
index 000000000..a9c55626f
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-odl_l2-nofeature-noha_daily.yaml
@@ -0,0 +1,32 @@
+---
+# Huawei US bare daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-odl_l2-nofeature-noha"
+test_cases_dir: "tests/opnfv/test_cases/"
+test_cases:
+-
+ file_name: opnfv_yardstick_tc002.yaml
+-
+ file_name: opnfv_yardstick_tc005.yaml
+-
+ file_name: opnfv_yardstick_tc010.yaml
+-
+ file_name: opnfv_yardstick_tc011.yaml
+-
+ file_name: opnfv_yardstick_tc012.yaml
+-
+ file_name: opnfv_yardstick_tc014.yaml
+-
+ file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-odl_l2-sfc-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-odl_l2-sfc-ha_daily.yaml
index 9799a2dff..5d0d6d1fa 100644
--- a/tests/opnfv/test_suites/opnfv_os-odl_l2-sfc-ha_daily.yaml
+++ b/tests/opnfv/test_suites/opnfv_os-odl_l2-sfc-ha_daily.yaml
@@ -20,3 +20,13 @@ test_cases:
file_name: opnfv_yardstick_tc014.yaml
-
file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-odl_l2-sfc-noha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-odl_l2-sfc-noha_daily.yaml
new file mode 100644
index 000000000..69177b2ec
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-odl_l2-sfc-noha_daily.yaml
@@ -0,0 +1,32 @@
+---
+# Huawei US bare daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-odl_l2-sfc-noha"
+test_cases_dir: "tests/opnfv/test_cases/"
+test_cases:
+-
+ file_name: opnfv_yardstick_tc002.yaml
+-
+ file_name: opnfv_yardstick_tc005.yaml
+-
+ file_name: opnfv_yardstick_tc010.yaml
+-
+ file_name: opnfv_yardstick_tc011.yaml
+-
+ file_name: opnfv_yardstick_tc012.yaml
+-
+ file_name: opnfv_yardstick_tc014.yaml
+-
+ file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-odl_l3-nofeature-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-odl_l3-nofeature-ha_daily.yaml
index 112b70c03..db49b6ab5 100644
--- a/tests/opnfv/test_suites/opnfv_os-odl_l3-nofeature-ha_daily.yaml
+++ b/tests/opnfv/test_suites/opnfv_os-odl_l3-nofeature-ha_daily.yaml
@@ -20,3 +20,13 @@ test_cases:
file_name: opnfv_yardstick_tc014.yaml
-
file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-onos-nofeature-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-onos-nofeature-ha_daily.yaml
index e2d348c65..503ff1033 100644
--- a/tests/opnfv/test_suites/opnfv_os-onos-nofeature-ha_daily.yaml
+++ b/tests/opnfv/test_suites/opnfv_os-onos-nofeature-ha_daily.yaml
@@ -20,3 +20,13 @@ test_cases:
file_name: opnfv_yardstick_tc014.yaml
-
file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-onos-nofeature-noha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-onos-nofeature-noha_daily.yaml
new file mode 100644
index 000000000..62ff86668
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-onos-nofeature-noha_daily.yaml
@@ -0,0 +1,32 @@
+---
+# Huawei US bare daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-onos-nofeature-noha"
+test_cases_dir: "tests/opnfv/test_cases/"
+test_cases:
+-
+ file_name: opnfv_yardstick_tc002.yaml
+-
+ file_name: opnfv_yardstick_tc005.yaml
+-
+ file_name: opnfv_yardstick_tc010.yaml
+-
+ file_name: opnfv_yardstick_tc011.yaml
+-
+ file_name: opnfv_yardstick_tc012.yaml
+-
+ file_name: opnfv_yardstick_tc014.yaml
+-
+ file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
diff --git a/tests/opnfv/test_suites/opnfv_os-onos-sfc-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-onos-sfc-ha_daily.yaml
index 9ea5f1314..5af223723 100644
--- a/tests/opnfv/test_suites/opnfv_os-onos-sfc-ha_daily.yaml
+++ b/tests/opnfv/test_suites/opnfv_os-onos-sfc-ha_daily.yaml
@@ -20,3 +20,13 @@ test_cases:
file_name: opnfv_yardstick_tc014.yaml
-
file_name: opnfv_yardstick_tc037.yaml
+-
+ file_name: opnfv_yardstick_tc055.yaml
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
diff --git a/tests/unit/benchmark/scenarios/availability/test_attacker_general.py b/tests/unit/benchmark/scenarios/availability/test_attacker_general.py
index 643c1e7ac..aa2e0cc4d 100644
--- a/tests/unit/benchmark/scenarios/availability/test_attacker_general.py
+++ b/tests/unit/benchmark/scenarios/availability/test_attacker_general.py
@@ -33,6 +33,7 @@ class GeneralAttackerServiceTestCase(unittest.TestCase):
'action_parameter':{'process_name':'nova_api'},
'rollback_parameter':{'process_name':'nova_api'},
'key':'stop-service',
+ 'attack_key':'stop-service',
'host': 'node1',
}
diff --git a/tests/unit/benchmark/scenarios/availability/test_monitor_general.py b/tests/unit/benchmark/scenarios/availability/test_monitor_general.py
index b48434c99..de7d26cbf 100644
--- a/tests/unit/benchmark/scenarios/availability/test_monitor_general.py
+++ b/tests/unit/benchmark/scenarios/availability/test_monitor_general.py
@@ -32,6 +32,7 @@ class GeneralMonitorServiceTestCase(unittest.TestCase):
self.monitor_cfg = {
'monitor_type': 'general-monitor',
'key': 'service-status',
+ 'monitor_key': 'service-status',
'host': 'node1',
'monitor_time': 3,
'parameter': {'serviceName': 'haproxy'},
@@ -40,6 +41,7 @@ class GeneralMonitorServiceTestCase(unittest.TestCase):
self.monitor_cfg_noparam = {
'monitor_type': 'general-monitor',
'key': 'service-status',
+ 'monitor_key': 'service-status',
'host': 'node1',
'monitor_time': 3,
'sla': {'max_outage_time': 1}
diff --git a/tests/unit/benchmark/scenarios/availability/test_operation_general.py b/tests/unit/benchmark/scenarios/availability/test_operation_general.py
index 6713733a8..26cd3f7c4 100644
--- a/tests/unit/benchmark/scenarios/availability/test_operation_general.py
+++ b/tests/unit/benchmark/scenarios/availability/test_operation_general.py
@@ -34,11 +34,13 @@ class GeneralOperaionTestCase(unittest.TestCase):
'action_parameter': {'ins_cup': 2},
'rollback_parameter': {'ins_id': 'id123456'},
'key': 'nova-create-instance',
+ 'operation_key': 'nova-create-instance',
'host': 'node1',
}
self.operation_cfg_noparam = {
'operation_type': 'general-operation',
'key': 'nova-create-instance',
+ 'operation_key': 'nova-create-instance',
'host': 'node1',
}
diff --git a/tests/unit/benchmark/scenarios/availability/test_result_checker_general.py b/tests/unit/benchmark/scenarios/availability/test_result_checker_general.py
index 88a9b9d20..bbadf0ac3 100644
--- a/tests/unit/benchmark/scenarios/availability/test_result_checker_general.py
+++ b/tests/unit/benchmark/scenarios/availability/test_result_checker_general.py
@@ -38,6 +38,7 @@ class GeneralResultCheckerTestCase(unittest.TestCase):
'condition' : 'eq',
'expectedValue' : 1,
'key' : 'process-checker',
+ 'checker_key' : 'process-checker',
'host': 'node1'
}
diff --git a/tests/unit/benchmark/scenarios/networking/netutilization_sample_output1.txt b/tests/unit/benchmark/scenarios/networking/netutilization_sample_output1.txt
new file mode 100644
index 000000000..f90457cb3
--- /dev/null
+++ b/tests/unit/benchmark/scenarios/networking/netutilization_sample_output1.txt
@@ -0,0 +1,9 @@
+Linux 3.19.0-25-generic (huawei-pod4) 07/19/2016 _x86_64_ (1 CPU)
+
+02:01:50 PM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil
+02:01:51 PM eth0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
+02:01:51 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
+
+Average: IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil
+Average: eth0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
+Average: lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
diff --git a/tests/unit/benchmark/scenarios/networking/netutilization_sample_output2.txt b/tests/unit/benchmark/scenarios/networking/netutilization_sample_output2.txt
new file mode 100644
index 000000000..417613ec1
--- /dev/null
+++ b/tests/unit/benchmark/scenarios/networking/netutilization_sample_output2.txt
@@ -0,0 +1,13 @@
+Linux 3.19.0-25-generic (huawei-pod4) 07/19/2016 _x86_64_ (1 CPU)
+
+02:01:50 PM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil
+02:01:51 PM eth0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
+02:01:51 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
+
+02:01:52 PM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil
+02:01:53 PM eth0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
+02:01:53 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
+
+Average: IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil
+Average: eth0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
+Average: lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
diff --git a/tests/unit/benchmark/scenarios/networking/test_netutilization.py b/tests/unit/benchmark/scenarios/networking/test_netutilization.py
new file mode 100644
index 000000000..eb6626fea
--- /dev/null
+++ b/tests/unit/benchmark/scenarios/networking/test_netutilization.py
@@ -0,0 +1,225 @@
+#!/usr/bin/env python
+
+##############################################################################
+# Copyright (c) 2016 Huawei Technologies Co.,Ltd and other.
+#
+# 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.networking.netutilization.NetUtilization
+
+import mock
+import unittest
+import os
+
+from yardstick.benchmark.scenarios.networking import netutilization
+
+
+@mock.patch('yardstick.benchmark.scenarios.networking.netutilization.ssh')
+class NetUtilizationTestCase(unittest.TestCase):
+
+ def setUp(self):
+ self.ctx = {
+ 'host': {
+ 'ip': '172.16.0.137',
+ 'user': 'cirros',
+ 'key_filename': "mykey.key"
+ }
+ }
+
+ self.result = {}
+
+ def test_setup_success(self, mock_ssh):
+ options = {
+ "interval": 1,
+ "count": 1
+ }
+ args = {'options': options}
+
+ n = netutilization.NetUtilization(args, self.ctx)
+ mock_ssh.SSH().execute.return_value = (0, '', '')
+
+ n.setup()
+ self.assertIsNotNone(n.client)
+ self.assertTrue(n.setup_done)
+
+ def test_execute_command_success(self, mock_ssh):
+ options = {
+ "interval": 1,
+ "count": 1
+ }
+ args = {'options': options}
+
+ n = netutilization.NetUtilization(args, self.ctx)
+ mock_ssh.SSH().execute.return_value = (0, '', '')
+ n.setup()
+
+ expected_result = 'abcdefg'
+ mock_ssh.SSH().execute.return_value = (0, expected_result, '')
+ result = n._execute_command("foo")
+ self.assertEqual(result, expected_result)
+
+ def test_execute_command_failed(self, mock_ssh):
+ options = {
+ "interval": 1,
+ "count": 1
+ }
+ args = {'options': options}
+
+ n = netutilization.NetUtilization(args, self.ctx)
+ mock_ssh.SSH().execute.return_value = (0, '', '')
+ n.setup()
+
+ mock_ssh.SSH().execute.return_value = (127, '', 'abcdefg')
+ self.assertRaises(RuntimeError, n._execute_command,
+ "failed")
+
+ def test_get_network_utilization_success(self, mock_ssh):
+ options = {
+ "interval": 1,
+ "count": 1
+ }
+ args = {'options': options}
+
+ n = netutilization.NetUtilization(args, self.ctx)
+ mock_ssh.SSH().execute.return_value = (0, '', '')
+ n.setup()
+
+ mpstat_output = self._read_file("netutilization_sample_output1.txt")
+ mock_ssh.SSH().execute.return_value = (0, mpstat_output, '')
+ result = n._get_network_utilization()
+
+ expected_result = \
+ {"network_utilization_maximun": {
+ "lo": {"rxcmp/s": "0.00",
+ "%ifutil": "0.00",
+ "txcmp/s": "0.00",
+ "txkB/s": "0.00",
+ "rxkB/s": "0.00",
+ "rxpck/s": "0.00",
+ "txpck/s": "0.00",
+ "rxmcst/s": "0.00"},
+ "eth0": {"rxcmp/s": "0.00",
+ "%ifutil": "0.00",
+ "txcmp/s": "0.00",
+ "txkB/s": "0.00",
+ "rxkB/s": "0.00",
+ "rxpck/s": "0.00",
+ "txpck/s": "0.00",
+ "rxmcst/s": "0.00"}},
+ "network_utilization_average": {
+ "lo": {"rxcmp/s": "0.00",
+ "%ifutil": "0.00",
+ "txcmp/s": "0.00",
+ "txkB/s": "0.00",
+ "rxkB/s": "0.00",
+ "rxpck/s": "0.00",
+ "txpck/s": "0.00",
+ "rxmcst/s": "0.00"},
+ "eth0": {"rxcmp/s": "0.00",
+ "%ifutil": "0.00",
+ "txcmp/s": "0.00",
+ "txkB/s": "0.00",
+ "rxkB/s": "0.00",
+ "rxpck/s": "0.00",
+ "txpck/s": "0.00",
+ "rxmcst/s": "0.00"}},
+ "network_utilization_minimum": {
+ "lo": {"rxcmp/s": "0.00",
+ "%ifutil": "0.00",
+ "txcmp/s": "0.00",
+ "txkB/s": "0.00",
+ "rxkB/s": "0.00",
+ "rxpck/s": "0.00",
+ "txpck/s": "0.00",
+ "rxmcst/s": "0.00"},
+ "eth0": {"rxcmp/s": "0.00",
+ "%ifutil": "0.00",
+ "txcmp/s": "0.00",
+ "txkB/s": "0.00",
+ "rxkB/s": "0.00",
+ "rxpck/s": "0.00",
+ "txpck/s": "0.00",
+ "rxmcst/s": "0.00"}}}
+
+ self.assertDictEqual(result, expected_result)
+
+ def test_get_network_utilization_2_success(self, mock_ssh):
+ options = {
+ "interval": 1,
+ "count": 2
+ }
+ args = {'options': options}
+
+ n = netutilization.NetUtilization(args, self.ctx)
+ mock_ssh.SSH().execute.return_value = (0, '', '')
+ n.setup()
+
+ mpstat_output = self._read_file("netutilization_sample_output2.txt")
+ mock_ssh.SSH().execute.return_value = (0, mpstat_output, '')
+ result = n._get_network_utilization()
+
+ expected_result = \
+ {"network_utilization_maximun": {
+ "lo": {"rxcmp/s": "0.00",
+ "%ifutil": "0.00",
+ "txcmp/s": "0.00",
+ "txkB/s": "0.00",
+ "rxkB/s": "0.00",
+ "rxpck/s": "0.00",
+ "txpck/s": "0.00",
+ "rxmcst/s": "0.00"},
+ "eth0": {"rxcmp/s": "0.00",
+ "%ifutil": "0.00",
+ "txcmp/s": "0.00",
+ "txkB/s": "0.00",
+ "rxkB/s": "0.00",
+ "rxpck/s": "0.00",
+ "txpck/s": "0.00",
+ "rxmcst/s": "0.00"}},
+ "network_utilization_average": {
+ "lo": {"rxcmp/s": "0.00",
+ "%ifutil": "0.00",
+ "txcmp/s": "0.00",
+ "txkB/s": "0.00",
+ "rxkB/s": "0.00",
+ "rxpck/s": "0.00",
+ "txpck/s": "0.00",
+ "rxmcst/s": "0.00"},
+ "eth0": {"rxcmp/s": "0.00",
+ "%ifutil": "0.00",
+ "txcmp/s": "0.00",
+ "txkB/s": "0.00",
+ "rxkB/s": "0.00",
+ "rxpck/s": "0.00",
+ "txpck/s": "0.00",
+ "rxmcst/s": "0.00"}},
+ "network_utilization_minimum": {
+ "lo": {"rxcmp/s": "0.00",
+ "%ifutil": "0.00",
+ "txcmp/s": "0.00",
+ "txkB/s": "0.00",
+ "rxkB/s": "0.00",
+ "rxpck/s": "0.00",
+ "txpck/s": "0.00",
+ "rxmcst/s": "0.00"},
+ "eth0": {"rxcmp/s": "0.00",
+ "%ifutil": "0.00",
+ "txcmp/s": "0.00",
+ "txkB/s": "0.00",
+ "rxkB/s": "0.00",
+ "rxpck/s": "0.00",
+ "txpck/s": "0.00",
+ "rxmcst/s": "0.00"}}}
+
+ self.assertDictEqual(result, expected_result)
+
+ def _read_file(self, filename):
+ curr_path = os.path.dirname(os.path.abspath(__file__))
+ output = os.path.join(curr_path, filename)
+ with open(output) as f:
+ sample_output = f.read()
+ return sample_output
diff --git a/tests/unit/benchmark/scenarios/networking/test_ping.py b/tests/unit/benchmark/scenarios/networking/test_ping.py
index 600974510..8d35b8490 100644
--- a/tests/unit/benchmark/scenarios/networking/test_ping.py
+++ b/tests/unit/benchmark/scenarios/networking/test_ping.py
@@ -36,6 +36,7 @@ class PingTestCase(unittest.TestCase):
args = {
'options': {'packetsize': 200},
+ 'target': 'ares.demo'
}
result = {}
@@ -43,14 +44,15 @@ class PingTestCase(unittest.TestCase):
mock_ssh.SSH().execute.return_value = (0, '100', '')
p.run(result)
- self.assertEqual(result, {'rtt': {'10.229.17.105': 100.0}})
+ self.assertEqual(result, {'rtt': {'ares': 100.0}})
@mock.patch('yardstick.benchmark.scenarios.networking.ping.ssh')
def test_ping_successful_sla(self, mock_ssh):
args = {
'options': {'packetsize': 200},
- 'sla': {'max_rtt': 150}
+ 'sla': {'max_rtt': 150},
+ 'target': 'ares.demo'
}
result = {}
@@ -58,14 +60,15 @@ class PingTestCase(unittest.TestCase):
mock_ssh.SSH().execute.return_value = (0, '100', '')
p.run(result)
- self.assertEqual(result, {'rtt': {'10.229.17.105': 100.0}})
+ self.assertEqual(result, {'rtt': {'ares': 100.0}})
@mock.patch('yardstick.benchmark.scenarios.networking.ping.ssh')
def test_ping_unsuccessful_sla(self, mock_ssh):
args = {
'options': {'packetsize': 200},
- 'sla': {'max_rtt': 50}
+ 'sla': {'max_rtt': 50},
+ 'target': 'ares.demo'
}
result = {}
@@ -79,7 +82,8 @@ class PingTestCase(unittest.TestCase):
args = {
'options': {'packetsize': 200},
- 'sla': {'max_rtt': 50}
+ 'sla': {'max_rtt': 50},
+ 'target': 'ares.demo'
}
result = {}