summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/ci/yardstick-verify4
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc006.yaml8
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc011.yaml4
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml7
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml8
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml7
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml7
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml7
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml7
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml7
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc050.yaml11
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc051.yaml5
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc052.yaml5
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml7
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc055.yaml4
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc063.yaml4
-rwxr-xr-xtests/opnfv/test_cases/opnfv_yardstick_tc073.yaml8
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc075.yaml4
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc078.yaml3
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc080.yaml5
-rw-r--r--tests/opnfv/test_cases/opnfv_yardstick_tc081.yaml6
-rw-r--r--tests/opnfv/test_suites/opnfv_os-nosdn-openbaton-ha_daily.yaml62
-rw-r--r--tests/opnfv/test_suites/opnfv_os-nosdn-ovs_dpdk-ha_daily.yaml62
-rw-r--r--tests/opnfv/test_suites/opnfv_os-nosdn-ovs_dpdk-noha_daily.yaml62
-rw-r--r--tests/opnfv/test_suites/opnfv_os-odl_l2-moon-noha_daily.yaml62
-rw-r--r--tests/unit/benchmark/contexts/standalone/test_model.py20
-rw-r--r--tests/unit/benchmark/scenarios/networking/test_iperf3.py22
-rw-r--r--tests/unit/network_services/helpers/test_iniparser.py (renamed from tests/unit/network_services/vnf_generic/vnf/test_iniparser.py)14
-rw-r--r--tests/unit/network_services/helpers/test_samplevnf_helper.py8
-rw-r--r--tests/unit/network_services/nfvi/test_resource.py13
-rw-r--r--tests/unit/network_services/vnf_generic/vnf/test_cgnapt_vnf.py7
-rw-r--r--tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py2
-rw-r--r--tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py10
33 files changed, 373 insertions, 99 deletions
diff --git a/tests/ci/yardstick-verify b/tests/ci/yardstick-verify
index f3e7a49e3..d1174825f 100755
--- a/tests/ci/yardstick-verify
+++ b/tests/ci/yardstick-verify
@@ -209,10 +209,10 @@ EOF
- local scenario_status="SUCCESS"
+ local scenario_status="PASS"
if [ $failed -gt 0 ]; then
- scenario_status="FAILED"
+ scenario_status="FAIL"
fi
report "${scenario_status}" "${start_date}" "${stop_date}"
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc006.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc006.yaml
index 81b42dc4d..fe244e81c 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc006.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc006.yaml
@@ -13,7 +13,8 @@ description: >
Yardstick TC006 config file;
Measure volume storage IOPS, throughput and latency using fio with job file.
-{% set directory = directory or "/FIO_Test" %}
+{% set job_file_config = job_file_config or '["[random-writers]", ioengine=libaio, rw=randwrite, size=128m, bs=32k, direct=0, size=64m, numjobs=4]' %}
+{% set directory = directory or '/FIO_Test' %}
{% set volume_size = volume_size or 200 %}
{% set provider = provider or none %}
{% set physical_network = physical_network or 'physnet1' %}
@@ -25,7 +26,10 @@ scenarios:
-
type: Fio
options:
- job_file: "job_file.ini"
+ # input the content of a fio job file directly
+ job_file_config: {{ job_file_config }}
+ # or input the job file name
+ #job_file: "job_file.ini"
directory: {{ directory }}
host: fio.yardstick-TC006
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc011.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc011.yaml
index b2077d59e..ee36c6c82 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc011.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc011.yaml
@@ -13,7 +13,7 @@ description: >
Yardstick TC011 config file;
Measure packet delay variation (jitter) using iperf3.
-{% set udp = udp or "udp" %}
+{% set protocol = protocol or "udp" %}
{% set bandwidth = bandwidth or "20m" %}
{% set length = length or "8K" %}
{% set window = window or 29200 %}
@@ -25,7 +25,7 @@ scenarios:
-
type: Iperf3
options:
- udp: {{udp}}
+ protocol: {{protocol}}
bandwidth: {{bandwidth}}
length: {{length}}
window: {{window}}
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml
index 046d51731..852424d8e 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc019.yaml
@@ -13,6 +13,7 @@ description: >
Sample test case for the HA of controller node Openstack service.
{% set file = file or '/etc/yardstick/pod.yaml' %}
+{% set attack_host = attack_host or "node1" %}
scenarios:
-
@@ -21,7 +22,7 @@ scenarios:
attackers:
- fault_type: "kill-process"
process_name: "nova-api"
- host: node1
+ host: {{attack_host}}
wait_time: 10
monitors:
@@ -33,14 +34,14 @@ scenarios:
max_outage_time: 5
- monitor_type: "process"
process_name: "nova-api"
- host: node1
+ host: {{attack_host}}
monitor_time: 30
monitor_number: 3
sla:
max_recover_time: 30
nodes:
- node1: node1.LF
+ {{attack_host}}: {{attack_host}}.LF
runner:
type: Iteration
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml
index b14fc4554..ea4fc3b24 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc043.yaml
@@ -13,16 +13,16 @@ description: >
Yardstick TC043 config file;
Measure latency between NFVI nodes using ping.
-{% set host = host or "node1.LF" %}
-{% set target = target or "node2.LF" %}
+{% set host = host or "node1" %}
+{% set target = target or "node2" %}
{% set file = file or '/etc/yardstick/pod.yaml' %}
scenarios:
-
type: Ping
options:
packetsize: 100
- host: {{host}}
- target: {{target}}
+ host: {{host}}.LF
+ target: {{target}}.LF
runner:
type: Duration
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml
index dfe44ed12..f9d9dde48 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc045.yaml
@@ -13,6 +13,7 @@ description: >
Test case for TC045 :Control node Openstack service down - neutron server.
{% set file = file or '/etc/yardstick/pod.yaml' %}
+{% set attack_host = attack_host or "node1" %}
scenarios:
-
@@ -21,7 +22,7 @@ scenarios:
attackers:
- fault_type: "kill-process"
process_name: "neutron-server"
- host: node1
+ host: {{attack_host}}
monitors:
- monitor_type: "openstack-cmd"
@@ -32,14 +33,14 @@ scenarios:
max_outage_time: 5
- monitor_type: "process"
process_name: "neutron-server"
- host: node1
+ host: {{attack_host}}
monitor_time: 30
monitor_number: 3
sla:
max_recover_time: 30
nodes:
- node1: node1.LF
+ {{attack_host}}: {{attack_host}}.LF
runner:
type: Duration
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml
index 1d553268c..129489968 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc046.yaml
@@ -13,6 +13,7 @@ description: >
Test case for TC046 :Control node Openstack service down - keystone.
{% set file = file or '/etc/yardstick/pod.yaml' %}
+{% set attack_host = attack_host or "node1" %}
scenarios:
-
@@ -21,7 +22,7 @@ scenarios:
attackers:
- fault_type: "kill-process"
process_name: "keystone"
- host: node1
+ host: {{attack_host}}
monitors:
- monitor_type: "openstack-cmd"
@@ -32,14 +33,14 @@ scenarios:
max_outage_time: 5
- monitor_type: "process"
process_name: "keystone"
- host: node1
+ host: {{attack_host}}
monitor_time: 30
monitor_number: 3
sla:
max_recover_time: 30
nodes:
- node1: node1.LF
+ {{attack_host}}: {{attack_host}}.LF
runner:
type: Duration
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml
index 33bc5cd5f..4a0b65b8d 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc047.yaml
@@ -13,6 +13,7 @@ description: >
Test case for TC047 :Control node Openstack service down - glance api.
{% set file = file or '/etc/yardstick/pod.yaml' %}
+{% set attack_host = attack_host or "node1" %}
scenarios:
-
@@ -21,7 +22,7 @@ scenarios:
attackers:
- fault_type: "kill-process"
process_name: "glance-api"
- host: node1
+ host: {{attack_host}}
monitors:
- monitor_type: "openstack-cmd"
@@ -32,14 +33,14 @@ scenarios:
max_outage_time: 5
- monitor_type: "process"
process_name: "glance-api"
- host: node1
+ host: {{attack_host}}
monitor_time: 30
monitor_number: 3
sla:
max_recover_time: 30
nodes:
- node1: node1.LF
+ {{attack_host}}: {{attack_host}}.LF
runner:
type: Duration
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml
index a13afe3bf..a1629c6d0 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc048.yaml
@@ -13,6 +13,7 @@ description: >
Test case for TC048 :Control node Openstack service down - cinder api.
{% set file = file or '/etc/yardstick/pod.yaml' %}
+{% set attack_host = attack_host or "node1" %}
scenarios:
-
@@ -21,7 +22,7 @@ scenarios:
attackers:
- fault_type: "kill-process"
process_name: "cinder-api"
- host: node1
+ host: {{attack_host}}
monitors:
- monitor_type: "openstack-cmd"
@@ -32,14 +33,14 @@ scenarios:
max_outage_time: 5
- monitor_type: "process"
process_name: "cinder-api"
- host: node1
+ host: {{attack_host}}
monitor_time: 30
monitor_number: 3
sla:
max_recover_time: 30
nodes:
- node1: node1.LF
+ {{attack_host}}: {{attack_host}}.LF
runner:
type: Duration
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml
index 394b98721..7b8383e4e 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc049.yaml
@@ -13,6 +13,7 @@ description: >
Test case for TC049 :Control node Openstack service down - swift proxy.
{% set file = file or '/etc/yardstick/pod.yaml' %}
+{% set attack_host = attack_host or "node1" %}
scenarios:
-
@@ -21,7 +22,7 @@ scenarios:
attackers:
- fault_type: "kill-process"
process_name: "swift-proxy"
- host: node1
+ host: {{attack_host}}
monitors:
- monitor_type: "openstack-cmd"
@@ -32,14 +33,14 @@ scenarios:
max_outage_time: 5
- monitor_type: "process"
process_name: "swift-proxy"
- host: node1
+ host: {{attack_host}}
monitor_time: 30
monitor_number: 3
sla:
max_recover_time: 30
nodes:
- node1: node1.LF
+ {{attack_host}}: {{attack_host}}.LF
runner:
type: Duration
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc050.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc050.yaml
index 303dd4216..b765feb68 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc050.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc050.yaml
@@ -14,6 +14,7 @@ description: >
This test case is written by new scenario-based HA testing framework.
{% set file = file or '/etc/yardstick/pod.yaml' %}
+{% set attack_host = attack_host or "node1" %}
{% set external_net = external_net or 'br-ex' %}
{% set management_net = management_net or 'br-mgmt' %}
{% set storage_net = storage_net or 'br-storage' %}
@@ -26,7 +27,7 @@ scenarios:
attackers:
-
fault_type: "general-attacker"
- host: node1
+ host: {{attack_host}}
key: "close-br-public"
attack_key: "close-interface"
action_parameter:
@@ -36,7 +37,7 @@ scenarios:
-
fault_type: "general-attacker"
- host: node1
+ host: {{attack_host}}
key: "close-br-mgmt"
attack_key: "close-interface"
action_parameter:
@@ -46,7 +47,7 @@ scenarios:
-
fault_type: "general-attacker"
- host: node1
+ host: {{attack_host}}
key: "close-br-storage"
attack_key: "close-interface"
action_parameter:
@@ -56,7 +57,7 @@ scenarios:
-
fault_type: "general-attacker"
- host: node1
+ host: {{attack_host}}
key: "close-br-private"
attack_key: "close-interface"
action_parameter:
@@ -145,7 +146,7 @@ scenarios:
nodes:
- node1: node1.LF
+ {{attack_host}}: {{attack_host}}.LF
runner:
type: Duration
duration: 1
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc051.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc051.yaml
index 98a08b7ca..aade1aed2 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc051.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc051.yaml
@@ -14,6 +14,7 @@ description: >
This test case is written by new scenario-based HA testing framework.
{% set file = file or '/etc/yardstick/pod.yaml' %}
+{% set attack_host = attack_host or "node1" %}
scenarios:
-
@@ -22,7 +23,7 @@ scenarios:
attackers:
-
fault_type: "general-attacker"
- host: node1
+ host: {{attack_host}}
key: "stress-cpu"
attack_key: "stress-cpu"
@@ -92,7 +93,7 @@ scenarios:
nodes:
- node1: node1.LF
+ {{attack_host}}: {{attack_host}}.LF
runner:
type: Duration
duration: 1
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc052.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc052.yaml
index 75835ebf5..62cabd1a2 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc052.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc052.yaml
@@ -14,6 +14,7 @@ description: >
This test case is written by new scenario-based HA testing framework.
{% set file = file or '/etc/yardstick/pod.yaml' %}
+{% set attack_host = attack_host or "node1" %}
scenarios:
-
@@ -22,7 +23,7 @@ scenarios:
attackers:
-
fault_type: "general-attacker"
- host: node1
+ host: {{attack_host}}
key: "block-io"
attack_key: "block-io"
@@ -76,7 +77,7 @@ scenarios:
index: 4
nodes:
- node1: node1.LF
+ {{attack_host}}: {{attack_host}}.LF
runner:
type: Duration
duration: 1
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml
index f987e2b45..64c67c0b3 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc053.yaml
@@ -14,6 +14,7 @@ description: >
This test case is written by new scenario-based HA testing framework.
{% set file = file or '/etc/yardstick/pod.yaml' %}
+{% set attack_host = attack_host or "node1" %}
scenarios:
-
@@ -22,7 +23,7 @@ scenarios:
attackers:
-
fault_type: "kill-process"
- host: node1
+ host: {{attack_host}}
key: "kill-process"
process_name: "haproxy"
@@ -31,7 +32,7 @@ scenarios:
monitor_type: "process"
key: "service-status"
process_name: "haproxy"
- host: node1
+ host: {{attack_host}}
monitor_time: 30
monitor_number: 3
sla:
@@ -61,7 +62,7 @@ scenarios:
index: 3
nodes:
- node1: node1.LF
+ {{attack_host}}: {{attack_host}}.LF
runner:
type: Duration
duration: 1
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc055.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc055.yaml
index 10a7a7108..8905b9cdd 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc055.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc055.yaml
@@ -19,14 +19,14 @@ description: >
cache size per CPU, total cache size;
HT (Hyper-Thread) support status, 1 for open, 0 for close.
-{% set host = host or "node5.yardstick-TC055" %}
{% set file = file or '/etc/yardstick/pod.yaml' %}
+{% set host = host or "node5" %}
scenarios:
-
type: ComputeCapacity
nodes:
- host: {{host}}
+ host: {{host}}.yardstick-TC055
runner:
type: Iteration
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc063.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc063.yaml
index 254c214d2..50d0c40e1 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc063.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc063.yaml
@@ -14,7 +14,7 @@ description: >
Measure disk size, block size and disk utilization using fdisk and iostat.
{% set file = file or '/etc/yardstick/pod.yaml' %}
-{% set node = node or "node5" %}
+{% set host = host or "node5" %}
scenarios:
-
@@ -22,7 +22,7 @@ scenarios:
options:
test_type: "disk_size"
- host: {{node}}.yardstick-TC063
+ host: {{host}}.yardstick-TC063
runner:
type: Iteration
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc073.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc073.yaml
index fb40257f3..54282cbb1 100755
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc073.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc073.yaml
@@ -18,8 +18,8 @@ description: >
In req/rsp test, TCP_RR TCP_CRR UDP_RR can be used;
req_rsp_size is option of req/rsp test;
-{% set host = host or "node1.LF" %}
-{% set target = target or "node2.LF" %}
+{% set host = host or "node1" %}
+{% set target = target or "node2" %}
{% set file = file or '/etc/yardstick/pod.yaml' %}
scenarios:
-
@@ -29,8 +29,8 @@ scenarios:
send_msg_size: 1024
duration: 20
- host: {{host}}
- target: {{target}}
+ host: {{host}}.LF
+ target: {{target}}.LF
runner:
type: Iteration
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc075.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc075.yaml
index d19b3c4e7..4954249b3 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc075.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc075.yaml
@@ -14,13 +14,13 @@ description: >
Measure network capacity and scale.
Measure number of connections, number of frames received;
-{% set host = host or "node1.LF" %}
+{% set host = host or "node1" %}
{% set file = file or '/etc/yardstick/pod.yaml' %}
scenarios:
-
type: NetworkCapacity
- host: {{host}}
+ host: {{host}}.LF
runner:
type: Iteration
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc078.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc078.yaml
index 94256125f..d20045b25 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc078.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc078.yaml
@@ -14,6 +14,7 @@ description: >
Measure CPU performance using SPEC CPU2006;
{% set file = file or "/etc/yardstick/pod.yaml" %}
+{% set host = host or 'node1' %}
scenarios:
-
@@ -26,7 +27,7 @@ scenarios:
runspec_size: ref
runspec_rate: 1
- host: node1.yardstick-TC078
+ host: {{host}}.yardstick-TC078
runner:
type: Iteration
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc080.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc080.yaml
index 503fe6a45..0da296297 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc080.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc080.yaml
@@ -8,10 +8,11 @@
##############################################################################
---
-# Sample benchmark task config file
-# measure network latency using ping in container
schema: "yardstick:task:0.1"
+description: >
+ Yardstick TC080 config file;
+ measure network latency between containers in k8s using ping;
scenarios:
-
diff --git a/tests/opnfv/test_cases/opnfv_yardstick_tc081.yaml b/tests/opnfv/test_cases/opnfv_yardstick_tc081.yaml
index d99757e47..0d79a41ed 100644
--- a/tests/opnfv/test_cases/opnfv_yardstick_tc081.yaml
+++ b/tests/opnfv/test_cases/opnfv_yardstick_tc081.yaml
@@ -8,10 +8,12 @@
##############################################################################
---
-# Sample benchmark task config file
-# measure network latency using ping betwwen container and VM
schema: "yardstick:task:0.1"
+description: >
+ Yardstick TC081 config file;
+ measure network latency between container and VM using ping;
+
scenarios:
-
diff --git a/tests/opnfv/test_suites/opnfv_os-nosdn-openbaton-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-nosdn-openbaton-ha_daily.yaml
new file mode 100644
index 000000000..d1b4cce1a
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-nosdn-openbaton-ha_daily.yaml
@@ -0,0 +1,62 @@
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+# os-nosdn-openbaton-ha daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-nosdn-openbaton-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
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node5.yardstick-TC055"}'
+-
+ file_name: opnfv_yardstick_tc063.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node5.yardstick-TC063"}'
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
+-
+ file_name: opnfv_yardstick_tc075.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node1.LF"}'
diff --git a/tests/opnfv/test_suites/opnfv_os-nosdn-ovs_dpdk-ha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-nosdn-ovs_dpdk-ha_daily.yaml
new file mode 100644
index 000000000..10772e0cc
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-nosdn-ovs_dpdk-ha_daily.yaml
@@ -0,0 +1,62 @@
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+# os-nosdn-ovs_dpdk-ha daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-nosdn-ovs_dpdk-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
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node5.yardstick-TC055"}'
+-
+ file_name: opnfv_yardstick_tc063.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node5.yardstick-TC063"}'
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
+-
+ file_name: opnfv_yardstick_tc075.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node1.LF"}'
diff --git a/tests/opnfv/test_suites/opnfv_os-nosdn-ovs_dpdk-noha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-nosdn-ovs_dpdk-noha_daily.yaml
new file mode 100644
index 000000000..9b2be3710
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-nosdn-ovs_dpdk-noha_daily.yaml
@@ -0,0 +1,62 @@
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+# os-nosdn-ovs_dpdk-noha daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-nosdn-ovs_dpdk-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
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node5.yardstick-TC055"}'
+-
+ file_name: opnfv_yardstick_tc063.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node5.yardstick-TC063"}'
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
+-
+ file_name: opnfv_yardstick_tc075.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node1.LF"}'
diff --git a/tests/opnfv/test_suites/opnfv_os-odl_l2-moon-noha_daily.yaml b/tests/opnfv/test_suites/opnfv_os-odl_l2-moon-noha_daily.yaml
new file mode 100644
index 000000000..cff147720
--- /dev/null
+++ b/tests/opnfv/test_suites/opnfv_os-odl_l2-moon-noha_daily.yaml
@@ -0,0 +1,62 @@
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+# os-odl_l2-moon-noha daily task suite
+
+schema: "yardstick:suite:0.1"
+
+name: "os-odl_l2-moon-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
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node5.yardstick-TC055"}'
+-
+ file_name: opnfv_yardstick_tc063.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node5.yardstick-TC063"}'
+-
+ file_name: opnfv_yardstick_tc069.yaml
+-
+ file_name: opnfv_yardstick_tc070.yaml
+-
+ file_name: opnfv_yardstick_tc071.yaml
+-
+ file_name: opnfv_yardstick_tc072.yaml
+-
+ file_name: opnfv_yardstick_tc075.yaml
+ constraint:
+ installer: compass
+ pod: huawei-pod1
+ task_args:
+ huawei-pod1: '{"file": "etc/yardstick/nodes/compass_sclab_physical/pod.yaml",
+ "host": "node1.LF"}'
diff --git a/tests/unit/benchmark/contexts/standalone/test_model.py b/tests/unit/benchmark/contexts/standalone/test_model.py
index ddbc1a4bb..6899a0af6 100644
--- a/tests/unit/benchmark/contexts/standalone/test_model.py
+++ b/tests/unit/benchmark/contexts/standalone/test_model.py
@@ -91,10 +91,12 @@ class ModelLibvirtTestCase(unittest.TestCase):
image = Libvirt.create_snapshot_qemu(ssh_mock, "0", "ubuntu.img")
self.assertEqual(image, result)
+ @mock.patch("yardstick.benchmark.contexts.standalone.model.Libvirt.pin_vcpu_for_perf")
@mock.patch("yardstick.benchmark.contexts.standalone.model.Libvirt.create_snapshot_qemu")
@mock.patch('yardstick.benchmark.contexts.standalone.model.open')
@mock.patch('yardstick.benchmark.contexts.standalone.model.write_file')
- def test_build_vm_xml(self, mock_open, mock_write_file, mock_create_snapshot_qemu):
+ def test_build_vm_xml(self, mock_open, mock_write_file, mock_create_snapshot_qemu,
+ mock_pin_vcpu_for_perf):
result = [4]
with mock.patch("yardstick.ssh.SSH") as ssh:
ssh_mock = mock.Mock(autospec=ssh.SSH)
@@ -102,17 +104,10 @@ class ModelLibvirtTestCase(unittest.TestCase):
mock.Mock(return_value=(0, "a", ""))
ssh.return_value = ssh_mock
mock_create_snapshot_qemu.return_value = "0.img"
+
status = Libvirt.build_vm_xml(ssh_mock, {}, "test", "vm_0", 0)
self.assertEqual(status[0], result[0])
- def test_split_cpu_list(self):
- result = Libvirt.split_cpu_list("1,2,3")
- self.assertEqual(result, [1, 2, 3])
-
- def test_get_numa_nodes(self):
- result = Libvirt.get_numa_nodes()
- self.assertIsNotNone(result)
-
def test_update_interrupts_hugepages_perf(self):
with mock.patch("yardstick.ssh.SSH") as ssh:
ssh_mock = mock.Mock(autospec=ssh.SSH)
@@ -122,17 +117,16 @@ class ModelLibvirtTestCase(unittest.TestCase):
status = Libvirt.update_interrupts_hugepages_perf(ssh_mock)
self.assertIsNone(status)
- @mock.patch("yardstick.benchmark.contexts.standalone.model.Libvirt.get_numa_nodes")
+ @mock.patch("yardstick.benchmark.contexts.standalone.model.CpuSysCores")
@mock.patch("yardstick.benchmark.contexts.standalone.model.Libvirt.update_interrupts_hugepages_perf")
- def test_pin_vcpu_for_perf(self, mock_update_interrupts_hugepages_perf, mock_get_numa_nodes):
+ def test_pin_vcpu_for_perf(self, mock_update_interrupts_hugepages_perf, mock_CpuSysCores):
with mock.patch("yardstick.ssh.SSH") as ssh:
ssh_mock = mock.Mock(autospec=ssh.SSH)
ssh_mock.execute = \
mock.Mock(return_value=(0, "a", ""))
ssh.return_value = ssh_mock
- mock_get_numa_nodes.return_value = {'1': [18, 19, 20, 21], '0': [0, 1, 2, 3]}
status = Libvirt.pin_vcpu_for_perf(ssh_mock, "vm_0", 4)
- self.assertIsNone(status)
+ self.assertIsNotNone(status)
class StandaloneContextHelperTestCase(unittest.TestCase):
diff --git a/tests/unit/benchmark/scenarios/networking/test_iperf3.py b/tests/unit/benchmark/scenarios/networking/test_iperf3.py
index 331245357..4d3745230 100644
--- a/tests/unit/benchmark/scenarios/networking/test_iperf3.py
+++ b/tests/unit/benchmark/scenarios/networking/test_iperf3.py
@@ -123,7 +123,7 @@ class IperfTestCase(unittest.TestCase):
self.assertRaises(AssertionError, p.run, result)
def test_iperf_successful_sla_jitter(self, mock_ssh):
- options = {"udp": "udp", "bandwidth": "20m"}
+ options = {"protocol": "udp", "bandwidth": "20m"}
args = {
'options': options,
'sla': {'jitter': 10}
@@ -141,7 +141,7 @@ class IperfTestCase(unittest.TestCase):
self.assertEqual(result, expected_result)
def test_iperf_unsuccessful_sla_jitter(self, mock_ssh):
- options = {"udp": "udp", "bandwidth": "20m"}
+ options = {"protocol": "udp", "bandwidth": "20m"}
args = {
'options': options,
'sla': {'jitter': 0.0001}
@@ -156,6 +156,24 @@ class IperfTestCase(unittest.TestCase):
mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
self.assertRaises(AssertionError, p.run, result)
+ def test_iperf_successful_tcp_protocal(self, mock_ssh):
+ options = {"protocol": "tcp", "nodelay": "yes"}
+ args = {
+ 'options': options,
+ 'sla': {'bytes_per_second': 15000000}
+ }
+ result = {}
+
+ p = iperf3.Iperf(args, self.ctx)
+ mock_ssh.SSH.from_node().execute.return_value = (0, '', '')
+ p.host = mock_ssh.SSH.from_node()
+
+ sample_output = self._read_sample_output(self.output_name_tcp)
+ mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
+ expected_result = utils.flatten_dict_key(jsonutils.loads(sample_output))
+ p.run(result)
+ self.assertEqual(result, expected_result)
+
def test_iperf_unsuccessful_script_error(self, mock_ssh):
options = {}
diff --git a/tests/unit/network_services/vnf_generic/vnf/test_iniparser.py b/tests/unit/network_services/helpers/test_iniparser.py
index 1ad8df9c6..bd27b497e 100644
--- a/tests/unit/network_services/vnf_generic/vnf/test_iniparser.py
+++ b/tests/unit/network_services/helpers/test_iniparser.py
@@ -27,10 +27,10 @@ stl_patch = mock.patch.dict("sys.modules", STL_MOCKS)
stl_patch.start()
if stl_patch:
- from yardstick.network_services.vnf_generic.vnf.iniparser import ParseError
- from yardstick.network_services.vnf_generic.vnf.iniparser import LineParser
- from yardstick.network_services.vnf_generic.vnf.iniparser import BaseParser
- from yardstick.network_services.vnf_generic.vnf.iniparser import ConfigParser
+ from yardstick.network_services.helpers.iniparser import ParseError
+ from yardstick.network_services.helpers.iniparser import LineParser
+ from yardstick.network_services.helpers.iniparser import BaseParser
+ from yardstick.network_services.helpers.iniparser import ConfigParser
PARSE_TEXT_1 = """\
@@ -141,7 +141,7 @@ class TestConfigParser(unittest.TestCase):
return internal_open
- @mock.patch('yardstick.network_services.vnf_generic.vnf.iniparser.open')
+ @mock.patch('yardstick.network_services.helpers.iniparser.open')
def test_parse(self, mock_open):
mock_open.side_effect = self.make_open(PARSE_TEXT_1)
@@ -182,7 +182,7 @@ class TestConfigParser(unittest.TestCase):
self.assertEqual(config_parser.find_section_index('section1'), 1)
self.assertEqual(config_parser.find_section_index('section3'), -1)
- @mock.patch('yardstick.network_services.vnf_generic.vnf.iniparser.open')
+ @mock.patch('yardstick.network_services.helpers.iniparser.open')
def test_parse_2(self, mock_open):
mock_open.side_effect = self.make_open(PARSE_TEXT_2)
@@ -200,7 +200,7 @@ class TestConfigParser(unittest.TestCase):
self.assertEqual(config_parser.sections, expected)
- @mock.patch('yardstick.network_services.vnf_generic.vnf.iniparser.open')
+ @mock.patch('yardstick.network_services.helpers.iniparser.open')
def test_parse_negative(self, mock_open):
bad_text_dict = {
'no section': PARSE_TEXT_BAD_1,
diff --git a/tests/unit/network_services/helpers/test_samplevnf_helper.py b/tests/unit/network_services/helpers/test_samplevnf_helper.py
index 0ac363f28..05acdfaa9 100644
--- a/tests/unit/network_services/helpers/test_samplevnf_helper.py
+++ b/tests/unit/network_services/helpers/test_samplevnf_helper.py
@@ -211,6 +211,7 @@ class TestMultiPortConfig(unittest.TestCase):
opnfv_vnf.generate_script_data = \
mock.Mock(return_value={'link_config': 0, 'arp_config': '',
'arp_config6': '', 'actions': '',
+ 'arp_route_tbl': '', 'arp_route_tbl6': '',
'rules': ''})
opnfv_vnf.port_pair_list = [("xe0", "xe1")]
self.assertIsNotNone(opnfv_vnf.generate_script(self.VNFD))
@@ -796,7 +797,7 @@ class TestMultiPortConfig(unittest.TestCase):
def test_generate_arp_route_tbl(self, *_):
topology_file = mock.Mock()
config_tpl = mock.Mock()
- tmp_file = mock.Mock()
+ tmp_file = ""
vnfd_mock = mock.MagicMock()
vnfd_mock.port_num.side_effect = ['32', '1', '987']
vnfd_mock.find_interface.side_effect = [
@@ -823,8 +824,9 @@ class TestMultiPortConfig(unittest.TestCase):
opnfv_vnf = MultiPortConfig(topology_file, config_tpl, tmp_file, vnfd_mock)
opnfv_vnf.all_ports = [3, 2, 5]
- expected = '(0a141000,fffff000,32,0a141e28) (0ac81e00,ffffff00,1,0ac81e28) ' \
- '(0a000000,ff000000,987,0a140328)'
+ expected = 'routeadd net 32 10.20.30.40 0xfffff000\n' \
+ 'routeadd net 1 10.200.30.40 0xffffff00\n' \
+ 'routeadd net 987 10.20.3.40 0xff000000'
result = opnfv_vnf.generate_arp_route_tbl()
self.assertEqual(result, expected)
diff --git a/tests/unit/network_services/nfvi/test_resource.py b/tests/unit/network_services/nfvi/test_resource.py
index 799cc202b..f3244fdbd 100644
--- a/tests/unit/network_services/nfvi/test_resource.py
+++ b/tests/unit/network_services/nfvi/test_resource.py
@@ -134,6 +134,14 @@ class TestResourceProfile(unittest.TestCase):
self.assertIsNone(
self.resource_profile._prepare_collectd_conf("/opt/nsb_bin"))
+ def test__setup_intel_pmu(self):
+ self.assertIsNone(
+ self.resource_profile._setup_intel_pmu(self.ssh_mock, "/opt/nsb_bin"))
+
+ def test__setup_ovs_stats(self):
+ self.assertIsNone(
+ 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):
@@ -187,7 +195,6 @@ class TestResourceProfile(unittest.TestCase):
res = self.resource_profile.parse_collectd_result({})
expected_result = {'cpu': {}, 'dpdkstat': {}, 'hugepages': {},
'memory': {}, 'ovs_stats': {}, 'timestamp': '',
- 'intel_pmu': {},
'virt': {}}
self.assertDictEqual(res, expected_result)
@@ -200,7 +207,6 @@ class TestResourceProfile(unittest.TestCase):
res = self.resource_profile.parse_collectd_result(metric)
expected_result = {'cpu': {1: {'ipc': '1234'}}, 'dpdkstat': {}, 'hugepages': {},
'memory': {}, 'ovs_stats': {}, 'timestamp': '',
- 'intel_pmu': {},
'virt': {}}
self.assertDictEqual(res, expected_result)
@@ -209,7 +215,6 @@ class TestResourceProfile(unittest.TestCase):
res = self.resource_profile.parse_collectd_result(metric)
expected_result = {'cpu': {}, 'dpdkstat': {}, 'hugepages': {},
'memory': {'bw': '101'}, 'ovs_stats': {}, 'timestamp': '',
- 'intel_pmu': {},
'virt': {}}
self.assertDictEqual(res, expected_result)
@@ -220,7 +225,6 @@ class TestResourceProfile(unittest.TestCase):
res = self.resource_profile.parse_collectd_result(metric)
expected_result = {'cpu': {}, 'dpdkstat': {}, 'hugepages': {'free': '101'},
'memory': {}, 'ovs_stats': {}, 'timestamp': '',
- 'intel_pmu': {},
'virt': {}}
self.assertDictEqual(res, expected_result)
@@ -237,7 +241,6 @@ class TestResourceProfile(unittest.TestCase):
res = self.resource_profile.parse_collectd_result(metric)
expected_result = {'cpu': {}, 'dpdkstat': {'tx': '101'}, 'hugepages': {},
'memory': {}, 'ovs_stats': {'tx': '101'}, 'timestamp': '',
- 'intel_pmu': {},
'virt': {'memory': '101'}}
self.assertDictEqual(res, expected_result)
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 b0ef1da91..832509ea7 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
@@ -72,13 +72,12 @@ link 1 up
self.assertNotIn("This is a header", out)
def test__get_cgnapt_config(self):
- vnfd_helper = mock.Mock()
+ vnfd_helper = mock.MagicMock()
vnfd_helper.port_pairs.uplink_ports = [{"name": 'a'}, {"name": "b"}, {"name": "c"}]
helper = CgnaptApproxSetupEnvHelper(vnfd_helper, mock.Mock(), mock.Mock())
- helper._get_ports_gateway = mock.Mock(side_effect=[3, 5, 2])
- result = helper._get_cgnapt_config([{"name": 'a'}, {}, {"name": "b"}, {}, {"name": "c"}])
- self.assertEqual(result, [3, 5, 2])
+ result = helper._get_cgnapt_config()
+ self.assertIsNotNone(result)
def test_scale(self):
helper = CgnaptApproxSetupEnvHelper(mock.Mock(), mock.Mock(), mock.Mock())
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 09060ff57..a6d40877d 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
@@ -376,7 +376,7 @@ class TestProxApproxVnf(unittest.TestCase):
return file_path
@mock.patch('yardstick.benchmark.scenarios.networking.vnf_generic.open', create=True)
- @mock.patch('yardstick.network_services.vnf_generic.vnf.iniparser.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)
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 1e6bc1a13..6c102ed59 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
@@ -360,15 +360,6 @@ class TestSetupEnvHelper(unittest.TestCase):
with self.assertRaises(NotImplementedError):
setup_env_helper.build_config()
- def test__get_ports_gateway(self):
- vnfd_helper = VnfdHelper(self.VNFD_0)
- setup_env_helper = SetupEnvHelper(vnfd_helper, mock.Mock(), mock.Mock())
- result = setup_env_helper._get_ports_gateway("xe0")
- self.assertEqual(result, "152.16.100.20")
-
- result = setup_env_helper._get_ports_gateway("xe123")
- self.assertIsNone(result)
-
def test_setup_vnf_environment(self):
setup_env_helper = SetupEnvHelper(mock.Mock(), mock.Mock(), mock.Mock())
self.assertIsNone(setup_env_helper.setup_vnf_environment())
@@ -1886,6 +1877,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.WAIT_TIME_FOR_SCRIPT = 0
sample_vnf._start_server = mock.Mock(return_value=0)
sample_vnf._vnf_process = mock.MagicMock()
sample_vnf._vnf_process.exitcode = 0