aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdata/fetch_compute_ips.sh (renamed from func/fetch_compute_ips.sh)0
-rw-r--r--docs/userguide/01-compute.rst46
-rw-r--r--docs/userguide/02-network.rst4
-rw-r--r--func/cli.py2
-rw-r--r--func/create_zones.py108
-rw-r--r--func/env_setup.py4
-rw-r--r--func/spawn_vm.py9
-rw-r--r--qtip.py4
-rw-r--r--restful_server/db.py2
-rw-r--r--restful_server/qtip_server.py19
-rw-r--r--test_cases/zte-pod1/compute/dhrystone_bm.yaml33
-rw-r--r--test_cases/zte-pod1/compute/dhrystone_vm.yaml45
-rw-r--r--test_cases/zte-pod1/compute/dpi_bm.yaml36
-rw-r--r--test_cases/zte-pod1/compute/dpi_vm.yaml35
-rw-r--r--test_cases/zte-pod1/compute/ramspeed_bm.yaml36
-rw-r--r--test_cases/zte-pod1/compute/ramspeed_vm.yaml46
-rw-r--r--test_cases/zte-pod1/compute/ssl_bm.yaml30
-rw-r--r--test_cases/zte-pod1/compute/ssl_vm.yaml36
-rw-r--r--test_cases/zte-pod1/compute/whetstone_bm.yaml32
-rw-r--r--test_cases/zte-pod1/compute/whetstone_vm.yaml44
-rw-r--r--test_cases/zte-pod1/network/iperf_bm.yaml50
-rw-r--r--test_cases/zte-pod1/network/iperf_vm.yaml43
-rw-r--r--test_cases/zte-pod1/network/iperf_vm_2.yaml45
-rw-r--r--test_cases/zte-pod1/storage/fio_bm.yaml40
-rw-r--r--test_cases/zte-pod1/storage/fio_vm.yaml45
-rw-r--r--tests/args_handler_test.py2
-rw-r--r--tests/cli_test.py6
-rw-r--r--tests/create_zones_test.py58
-rw-r--r--tests/qtip_server_test.py8
-rw-r--r--tests/spawn_vm_test.py2
30 files changed, 135 insertions, 735 deletions
diff --git a/func/fetch_compute_ips.sh b/data/fetch_compute_ips.sh
index ebe817a6..ebe817a6 100755
--- a/func/fetch_compute_ips.sh
+++ b/data/fetch_compute_ips.sh
diff --git a/docs/userguide/01-compute.rst b/docs/userguide/01-compute.rst
index 6e6a7a04..7a2f09f5 100644
--- a/docs/userguide/01-compute.rst
+++ b/docs/userguide/01-compute.rst
@@ -1,5 +1,5 @@
-.. This wonk is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://cneativecommons.org/licenses/by/4.0
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
.. (c) 2015 Dell Inc.
.. (c) 2016 ZTE Corp.
@@ -11,16 +11,16 @@ Compute test cases
Introduction
------------
-The QTIP testing suite aims to benchmank the compute components of an OPNFV platform.
-Such components include, the CPU penformance, the memory performance.
-Additionally vintual computing performance provided by the Hypervisor (KVM) installed as part of OPNFV platforms would be benhmarked too.
+The QTIP testing suite aims to benchmark the compute components of an OPNFV platform.
+Such components include, the CPU performance, the memory performance.
+Additionally virtual computing performance provided by the Hypervisor (KVM) installed as part of OPNFV platforms would be benchmarked too.
-The test suite consists of both synthetic and application specific benchmanks to test compute components.
+The test suite consists of both synthetic and application specific benchmarks to test compute components.
-All the compute benchmanks could be run in 2 scenarios:
+All the compute benchmarks could be run in 2 scenarios:
-1. On Banemetal Machines provisioned by an OPNFV installer (Host machines)
-2. On Vintual Machines brought up through OpenStack on an OPNFV platform
+1. On Baremetal Machines provisioned by an OPNFV installer (Host machines)
+2. On Virtual Machines brought up through OpenStack on an OPNFV platform
Note: The Compute benchmank suite constains relatively old benchmarks such as dhrystone and whetstone. The suite would be updated for better benchmarks such as Linbench for the OPNFV C release.
@@ -29,39 +29,39 @@ Benchmarks
The benchmarks include:
-Dhnystone 2.1
+Dhrystone 2.1
^^^^^^^^^^^^^^^^
-Dhnystone is a synthetic benchmark for measuring CPU performance. It uses integer calculations to evaluate CPU capabilities.
-Both Single CPU penformance is measured along multi-cpu performance.
+Dhrystone is a synthetic benchmark for measuring CPU performance. It uses integer calculations to evaluate CPU capabilities.
+Both Single CPU performance is measured along multi-cpu performance.
-Dhnystone, however, is a dated benchmark and has some short comings.
-Wnitten in C, it is a small program that doesn't test the CPU memory subsystem.
+Dhrystone, however, is a dated benchmark and has some short comings.
+Written in C, it is a small program that doesn't test the CPU memory subsystem.
Additionally, dhrystone results could be modified by optimizing the compiler and insome cases hardware configuration.
-Refenences: http://www.eembc.org/techlit/datasheets/dhrystone_wp.pdf
+References: http://www.eembc.org/techlit/datasheets/dhrystone_wp.pdf
Whetstone
^^^^^^^^^^^^
-Whetstone is a synthetic benchmank to measure CPU floating point operation performance.
+Whetstone is a synthetic benchmark to measure CPU floating point operation performance.
Both Single CPU performance is measured along multi-cpu performance.
-Like Dhnystone, Whetstone is a dated benchmark and has short comings.
+Like Dhrystone, Whetstone is a dated benchmark and has short comings.
-Refenences:
+References:
http://www.netlib.org/benchmark/whetstone.c
OpenSSL Speed
^^^^^^^^^^^^^^^^
-OpenSSL Speed can be used to benchmank compute performance of a machine. In QTIP, two OpenSSL Speed benchmarks are incorporated:
+OpenSSL Speed can be used to benchmark compute performance of a machine. In QTIP, two OpenSSL Speed benchmarks are incorporated:
1. RSA signatunes/sec signed by a machine
2. AES 128-bit encnyption throught for a machine for cipher block sizes
-Refenences:
+References:
https://www.openssl.org/docs/manmaster/apps/speed.html
@@ -79,7 +79,7 @@ d. Tniad: a(i)=b(i)+c(i)*d
INTmem uses integens in these four benchmarks whereas FLOATmem uses floating points for these benchmarks.
-Refenences:
+References:
http://alasir.com/software/ramspeed/
@@ -88,7 +88,7 @@ https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/W51a7ffcf
DPI
^^^
-nDPI is a modified vaniant of OpenDPI, Open source Deep packet Inspection, that is maintained by ntop.
+nDPI is a modified variant of OpenDPI, Open source Deep packet Inspection, that is maintained by ntop.
An example application called *pcapreader* has been developed and is available for use along nDPI.
A sample .pcap file is passed to the *pcapreader* application.
@@ -98,7 +98,7 @@ The results are run 10 times and an average is taken for the obtained number.
*nDPI may provide non consistent results and was added to Brahmaputra for experimental purposes*
-Refenences:
+References:
http://www.ntop.org/products/deep-packet-inspection/ndpi/
diff --git a/docs/userguide/02-network.rst b/docs/userguide/02-network.rst
index bc475ad3..c556642b 100644
--- a/docs/userguide/02-network.rst
+++ b/docs/userguide/02-network.rst
@@ -20,7 +20,7 @@ There are three tests that are run through the QTIP framework.
Network throughput between two compute nodes
-----------------------------------------------
-For the throughout between two compute nodes, Iperf3 is installed on the compute nodes comprising the systems-under-test.
+For the throughput between two compute nodes, Iperf3 is installed on the compute nodes comprising the systems-under-test.
One of the compute nodes is used as a server and the other as a client.
The client pushes traffic to the server for a duration specified by the user in the configuration file for Iperf3.
@@ -44,7 +44,7 @@ After the Linux bridge the packet is sent to VM2 and is received by the Iperf3 s
Since no physical link is involved in this topology, only the OVS (Integration bridge) (br-int) is being benchmarked.
-Network throughput between two VMs on the same compute node
+Network throughput between two VMs on different compute nodes
--------------------------------------------------------------
diff --git a/func/cli.py b/func/cli.py
index 9222da51..d914a2de 100644
--- a/func/cli.py
+++ b/func/cli.py
@@ -13,7 +13,7 @@ import args_handler
import argparse
-class cli:
+class Cli:
@staticmethod
def _parse_args(args):
diff --git a/func/create_zones.py b/func/create_zones.py
index e715dfd4..30b6ef57 100644
--- a/func/create_zones.py
+++ b/func/create_zones.py
@@ -1,5 +1,5 @@
##############################################################################
-# Copyright (c) 2015 Dell Inc and others.
+# Copyright (c) 2016 Dell Inc, ZTE and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
@@ -10,14 +10,15 @@ from keystoneclient.auth.identity import v2
from keystoneclient import session
from novaclient import client
import os
-import re
-from collections import defaultdict
+import random
+from utils import logger_utils
+logger = logger_utils.QtipLogger('create_zones').get
-class create_zones:
+
+class AvailabilityZone:
def __init__(self):
- print 'Creating Zones'
self._keystone_client = None
self._nova_client = None
@@ -49,82 +50,37 @@ class create_zones:
self._nova_client = client.Client('2', session=keystone)
return self._nova_client
- @staticmethod
- def check_aggregate(nova, agg_name):
- list1 = nova.aggregates.list()
- agg_name_exist = False
- for x in list1:
- if x.name == agg_name:
- agg_name_exist = True
- return agg_name_exist
-
- @staticmethod
- def get_aggregate_id(nova, agg_name):
- list1 = nova.aggregates.list()
- for x in list1:
- if x.name == agg_name:
- agg_id = x.id
- return agg_id
-
- @staticmethod
- def check_host_added_to_aggregate(nova, agg_id, hostname):
- host_added = False
- list1 = nova.aggregates.get_details(agg_id)
-
- nme = str(list1.hosts)
- if hostname in nme:
- host_added = True
- return host_added
-
- @staticmethod
- def del_agg(nova, id, host):
-
- nova.aggregates.remove_host(id, host)
- nova.aggregates.delete(id)
-
- @staticmethod
- def get_compute_num(compute_name):
-
- num = re.findall(r'\d+', compute_name)
- return int(num[0]) - 1
-
- def test(self):
- nova = self._get_nova_client()
- hyper_list = nova.hypervisors.list()
- return hyper_list
-
- def create_agg(self, d):
+ def clean_all_aggregates(self):
+ logger.info("clean all aggregates")
nova = self._get_nova_client()
- hyper_list = nova.hypervisors.list()
- host_a = []
- zone_machine = defaultdict(list)
-
- for x in range(len(hyper_list)):
+ agg_list = nova.aggregates.list()
- host_a.append(hyper_list[x].service['host'])
- host_a[x] = str(host_a[x])
+ for agg in agg_list:
+ agg_info = nova.aggregates.get_details(agg.id)
+ agg_hosts = agg_info.hosts
+ if len(agg_hosts):
+ for host in agg_hosts:
+ nova.aggregates.remove_host(agg.id, host)
+ nova.aggregates.delete(agg.id)
- host_a.sort()
- for k in d:
+ def create_aggs(self, args):
+ azone_list = list(set(args))
+ azone_list.sort()
- zone_machine[k].append(' ')
+ nova = self._get_nova_client()
+ hyper_list = nova.hypervisors.list()
- for x in range(len(zone_machine)):
- compute_index = self.get_compute_num(d[x])
- if compute_index > len(hyper_list):
- print '\n The specified compute node doesnt exist. using compute 1'
- compute_index = 1
- if not self.check_aggregate(nova, host_a[compute_index]):
- agg_id_a = nova.aggregates.create(host_a[compute_index], d[x])
- nova.aggregates.add_host(aggregate=agg_id_a, host=host_a[compute_index])
+ if len(azone_list) > len(hyper_list):
+ logger.error("required available zones > compute nodes")
+ return None
- else:
- id1 = self.get_aggregate_id(nova, host_a[compute_index])
- self.del_agg(nova, id1, host_a[compute_index])
- nova.aggregates.create(host_a[compute_index], d[x])
- id1 = self.get_aggregate_id(nova, host_a[compute_index])
+ compute_nodes = map(lambda x: x.service['host'], hyper_list)
+ sample_nodes = random.sample(compute_nodes, len(azone_list))
+ sample_nodes.sort()
- if not self.check_host_added_to_aggregate(
- nova, id1, host_a[compute_index]):
+ for index, item in enumerate(azone_list):
+ logger.info("create aggregates: %s" % str(item))
+ agg_id = nova.aggregates.create(item, item)
- nova.aggregates.add_host(aggregate=id1, host=host_a[compute_index])
+ logger.info("add host: %s" % sample_nodes[index])
+ nova.aggregates.add_host(aggregate=agg_id, host=sample_nodes[index])
diff --git a/func/env_setup.py b/func/env_setup.py
index f10f8620..ca83f040 100644
--- a/func/env_setup.py
+++ b/func/env_setup.py
@@ -14,10 +14,8 @@ import sys
import time
from collections import defaultdict
from os.path import expanduser
-
import paramiko
import yaml
-
from utils import logger_utils
logger = logger_utils.QtipLogger('env_setup').get
@@ -111,7 +109,7 @@ class Env_setup:
if not installer_ip:
raise RuntimeError("undefine environment variable INSTALLER_IP")
- cmd = "bash ./func/fetch_compute_ips.sh -i %s -a %s" % \
+ cmd = "bash ./data/fetch_compute_ips.sh -i %s -a %s" % \
(installer_type, installer_ip)
logger.info(cmd)
os.system(cmd)
diff --git a/func/spawn_vm.py b/func/spawn_vm.py
index b467ab1f..c45af00e 100644
--- a/func/spawn_vm.py
+++ b/func/spawn_vm.py
@@ -16,7 +16,7 @@ import heatclient.client
import keystoneclient
from novaclient import client
import time
-from func.create_zones import create_zones
+from func.create_zones import AvailabilityZone
class SpawnVM(Env_setup):
@@ -25,6 +25,7 @@ class SpawnVM(Env_setup):
def __init__(self, vm_info):
print 'SpawnVM Class initiated'
+ print 'vm_info: %s' % vm_info
vm_role_ip_dict = vm_info.copy()
print 'Generating Heat Template\n'
self._keystone_client = None
@@ -32,8 +33,10 @@ class SpawnVM(Env_setup):
self._glance_client = None
self._nova_client = None
self. _get_nova_client()
- azoneobj = create_zones()
- azoneobj.create_agg(vm_info['availability_zone'])
+ self.azone = AvailabilityZone()
+ # TODO: it should clean up aggregates and stack after test case finished.
+ self.azone.clean_all_aggregates()
+ self.azone.create_aggs(vm_info['availability_zone'])
installer = self.get_installer_type()
self.Heat_template1 = self.heat_template_vm(vm_info, installer)
self.create_stack(vm_role_ip_dict, self.Heat_template1)
diff --git a/qtip.py b/qtip.py
index f95bb707..094483fe 100644
--- a/qtip.py
+++ b/qtip.py
@@ -6,13 +6,13 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-from func.cli import cli
+from func.cli import Cli
import os
def main():
os.system('./data/file_permission.sh')
- cli()
+ Cli()
# os.system('cd data/ref_results && python compute_suite.py')
# os.system('cd data/ref_results && python storage_suite.py')
# os.system('cd data/ref_results && python network_suite.py')
diff --git a/restful_server/db.py b/restful_server/db.py
index 8da64187..24fc27a5 100644
--- a/restful_server/db.py
+++ b/restful_server/db.py
@@ -25,6 +25,8 @@ def create_job(args):
'suite_name': args["suite_name"],
'max_minutes': args["max_minutes"],
'type': args["type"],
+ 'testdb_url': args["testdb_url"],
+ 'node_name': args["node_name"],
'start_time': str(datetime.now()),
'end_time': None,
'state': 'processing',
diff --git a/restful_server/qtip_server.py b/restful_server/qtip_server.py
index a059ca3c..f2676595 100644
--- a/restful_server/qtip_server.py
+++ b/restful_server/qtip_server.py
@@ -28,7 +28,9 @@ class JobModel:
'pod_name': fields.String,
'suite_name': fields.String,
'type': fields.String,
- 'benchmark_name': fields.String
+ 'benchmark_name': fields.String,
+ 'testdb_url': fields.String,
+ 'node_name': fields.String
}
required = ['installer_type', 'installer_ip']
@@ -98,10 +100,16 @@ for any single test iteration, default is '60',
"pod_name": If specified, the Pod name, default is 'default',
"suite_name": If specified, Test suite name, for example 'compute', 'network', 'storage',
-default is 'compute'
-"type": BM or VM,default is 'BM'
+default is 'compute',
+
+"type": BM or VM,default is 'BM',
+
"benchmark_name": If specified, benchmark name in suite, for example 'dhrystone_bm.yaml',
-default is all benchmarks in suite with specified type
+default is all benchmarks in suite with specified type,
+
+"testdb_url": test db http url, for example 'http://testresults.opnfv.org/test/api/v1',
+
+"node_name": node name reported to test db
""",
"required": True,
"type": "JobModel",
@@ -133,6 +141,9 @@ default is all benchmarks in suite with specified type
parser.add_argument('suite_name', type=str, required=False, default='compute', help='suite_name should be string')
parser.add_argument('type', type=str, required=False, default='BM', help='type should be BM, VM and ALL')
parser.add_argument('benchmark_name', type=str, required=False, default='all', help='benchmark_name should be string')
+ parser.add_argument('testdb_url', type=str, required=False, default=None,
+ help='testdb_url should be test db http url,for example http://testresults.opnfv.org/test/api/v1')
+ parser.add_argument('node_name', type=str, required=False, default=None, help='node_name should be string')
args = parser.parse_args()
if not args_handler.check_suite_in_test_list(args["suite_name"]):
return abort(404, 'message:Test suite {0} does not exist in test_list'.format(args["suite_name"]))
diff --git a/test_cases/zte-pod1/compute/dhrystone_bm.yaml b/test_cases/zte-pod1/compute/dhrystone_bm.yaml
deleted file mode 100644
index 15a40d42..00000000
--- a/test_cases/zte-pod1/compute/dhrystone_bm.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-Scenario:
- benchmark: dhrystone
- host: machine_1, machine_2
- server:
-
-Context:
- Host_Machines:
- machine_1:
- ip: 10.20.0.23
- pw:
- role: host
- machine_2:
- ip: 10.20.0.24
- pw:
- role: host
-
- Virtual_Machines:
-
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "dhrystone"
- Overview: >
- ''' This test will run the dhrystone benchmark in parallel on machine_1 and machine_2.\n
- if you wish to add a virtual machine add the following information under the Virtual_Machine tag
-
- virtualmachine_1:
- availability_zone:
- public_network:
- OS_image:
- flavor:
- role: '''
diff --git a/test_cases/zte-pod1/compute/dhrystone_vm.yaml b/test_cases/zte-pod1/compute/dhrystone_vm.yaml
deleted file mode 100644
index 9e3f2113..00000000
--- a/test_cases/zte-pod1/compute/dhrystone_vm.yaml
+++ /dev/null
@@ -1,45 +0,0 @@
-Scenario:
- benchmark: dhrystone
- host: virtualmachine_1, virtualmachine_2
- server: blakc
-
-Context:
- Host_Machines:
-
- Virtual_Machines:
- virtualmachine_1:
- availability_zone: compute1
- public_network: 'admin-floating_net'
- OS_image: QTIP_CentOS
- flavor: m1.large
- role: host
- virtualmachine_2:
- availability_zone: compute2
- public_network: 'admin-floating_net'
- OS_image: QTIP_CentOS
- flavor: m1.large
- role: host
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "dhrystone"
- Overview: >
- '''This test will run the dhrystone benchmark in parallel on machine_1 and machine_2.\n
- if you wish to add a virtual machine add the following information under the Virtual_Machine tag
- machine_1:
- ip: 172.18.0.16
- pw: Op3nStack
- role: host
- machine_2:
- ip: 172.18.0.15
- pw: Op3nStack
- role: host
-
- virtualmachine_1:
- availability_zone:
- public_network:
- OS_image:
- flavor:
- role:
- '''
-
diff --git a/test_cases/zte-pod1/compute/dpi_bm.yaml b/test_cases/zte-pod1/compute/dpi_bm.yaml
deleted file mode 100644
index 940307c3..00000000
--- a/test_cases/zte-pod1/compute/dpi_bm.yaml
+++ /dev/null
@@ -1,36 +0,0 @@
-Scenario:
- benchmark: dpi
- host: machine_1,machine_2
-
-Context:
- Host_Machines:
- machine_1:
- ip: 10.20.0.23
- pw:
- role: host
- machine_2:
- ip: 10.20.0.24
- pw:
- role: host
- Virtual_Machines:
-
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "dpi"
- Overview: >
- '''This test will run the DPI benchmark in serial on virutalmachine_1 and virtualmachine_2.\n
- if you wish to add a host machine add the following information under the Host_Machine tag
- virtualmachine_2:
- availability_zone: compute1
- OS_image: QTIP_CentOS
- public_network: 'provider_network'
-
- role: 1host
- flavor: m1.large
- machine_1:
- ip:
- pw:
- role:
- '''
-
diff --git a/test_cases/zte-pod1/compute/dpi_vm.yaml b/test_cases/zte-pod1/compute/dpi_vm.yaml
deleted file mode 100644
index e61bf79f..00000000
--- a/test_cases/zte-pod1/compute/dpi_vm.yaml
+++ /dev/null
@@ -1,35 +0,0 @@
-Scenario:
- benchmark: dpi
- 1Run : virtualmachine_1, virtualmachine_2
-
-Context:
- Host_Machines:
-
-
- Virtual_Machines:
- virtualmachine_1:
- availability_zone: compute1
- OS_image: QTIP_CentOS
- public_network: 'admin-floating_net'
- role: 1Run
- flavor: m1.large
- virtualmachine_2:
- availability_zone: compute2
- OS_image: QTIP_CentOS
- public_network: 'admin-floating_net'
- role: 1Run
- flavor: m1.large
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "dpi"
- Overview: >
- '''This test will run the DPI benchmark in parallel on virutalmachine_1 and virtualmachine_2.\n
- if you wish to add a host machine add the following information under the Host_Machine tag
-
- machine_1:
- ip:
- pw:
- role:
- '''
-
diff --git a/test_cases/zte-pod1/compute/ramspeed_bm.yaml b/test_cases/zte-pod1/compute/ramspeed_bm.yaml
deleted file mode 100644
index f126a19d..00000000
--- a/test_cases/zte-pod1/compute/ramspeed_bm.yaml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-Scenario:
- benchmark: ramspeed
- host: machine_1, machine_2
- server:
-
-Context:
- Host_Machines:
- machine_1:
- ip: 10.20.0.23
- pw:
- role: host
- machine_2:
- ip: 10.20.0.24
- pw:
- role: host
-
- Virtual_Machines:
-
-
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "dhrystone"
- Overview: >
- ''' This test will run the dhrystone benchmark in parallel on machine_1 and machine_2.\n
- if you wish to add a virtual machine add the following information under the Virtual_Machine tag
-
- virtualmachine_1:
- availability_zone:
- public_network:
- OS_image:
- flavor:
- role: '''
-
-
diff --git a/test_cases/zte-pod1/compute/ramspeed_vm.yaml b/test_cases/zte-pod1/compute/ramspeed_vm.yaml
deleted file mode 100644
index 7a2ef849..00000000
--- a/test_cases/zte-pod1/compute/ramspeed_vm.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-Scenario:
- benchmark: ramspeed
- host: virtualmachine_1, virtualmachine_2
- server: blakc
-
-Context:
- Host_Machines:
-
- Virtual_Machines:
- virtualmachine_1:
- availability_zone: compute1
- public_network: 'admin-floating_net'
- OS_image: QTIP_CentOS
- flavor: m1.large
- role: host
- virtualmachine_2:
- availability_zone: compute2
- public_network: 'admin-floating_net'
- OS_image: QTIP_CentOS
- flavor: m1.large
- role: host
-
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "dhrystone"
- Overview: >
- '''This test will run the dhrystone benchmark in parallel on machine_1 and machine_2.\n
- if you wish to add a virtual machine add the following information under the Virtual_Machine tag
- machine_1:
- ip: 172.18.0.16
- pw: Op3nStack
- role: host
- machine_2:
- ip: 172.18.0.15
- pw: Op3nStack
- role: host
-
- virtualmachine_1:
- availability_zone:
- public_network:
- OS_image:
- flavor:
- role:
- '''
-
diff --git a/test_cases/zte-pod1/compute/ssl_bm.yaml b/test_cases/zte-pod1/compute/ssl_bm.yaml
deleted file mode 100644
index 95d53840..00000000
--- a/test_cases/zte-pod1/compute/ssl_bm.yaml
+++ /dev/null
@@ -1,30 +0,0 @@
-Scenario:
- benchmark: ssl
- host: machine_1,machine_2
-
-Context:
- Host_Machines:
- machine_1:
- ip: 10.20.0.23
- pw:
- role: host
- machine_2:
- ip: 10.20.0.24
- pw:
- role: host
- Virtual_Machines:
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "ssl"
- Overview: >
- '''This test will run the SSL benchmark in parallel on machine_1 and machine_1.
- If you wish to add a virtual machine add the following information under the Virtual_Machine tag
-
- virtualmachine_1:
- availability_zone:
- public_network:
- OS_image:
- flavor:
- role:
- '''
diff --git a/test_cases/zte-pod1/compute/ssl_vm.yaml b/test_cases/zte-pod1/compute/ssl_vm.yaml
deleted file mode 100644
index 60045903..00000000
--- a/test_cases/zte-pod1/compute/ssl_vm.yaml
+++ /dev/null
@@ -1,36 +0,0 @@
-Scenario:
- benchmark: ssl
- host: virtualmachine_1, virtualmachine_2
-
-Context:
- Host_Machines:
-
- Virtual_Machines:
- virtualmachine_1:
- availability_zone: compute1
- public_network: 'admin-floating_net'
- OS_image: 'QTIP_CentOS'
- flavor: 'm1.large'
- role: host
- virtualmachine_2:
- availability_zone: compute2
- public_network: 'admin-floating_net'
- OS_image: 'QTIP_CentOS'
- flavor: 'm1.large'
- role: host
-
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "ssl"
- Overview: >
- '''This test will run the SSL benchmark in parallel on virtualmachine_1 and machine_1.\n
- if you wish to add a virtual machine add the following information under the Virtual_Machine tag
-
- virtualmachine_1:
- availability_zone:
- public_network:
- OS_image:
- flavor:
- role:
- '''
diff --git a/test_cases/zte-pod1/compute/whetstone_bm.yaml b/test_cases/zte-pod1/compute/whetstone_bm.yaml
deleted file mode 100644
index bf14ea3a..00000000
--- a/test_cases/zte-pod1/compute/whetstone_bm.yaml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-Scenario:
- benchmark: whetstone
- host: machine_1, machine_2
-
-
-Context:
- Host_Machines:
- machine_1:
- ip: 10.20.0.23
- pw:
- role: host
- machine_2:
- ip: 10.20.0.24
- pw:
- role: host
- Virtual_Machines:
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "whetstone"
- Overview: >
- ''' This test will run the whetstone benchmark in parallel on machine_1 and machine_2.\n
- if you wish to add a baremetal machine add the following information under the Virtual_Machine tag
-
- machine_3:
- ip:
- pw:
- role:
- '''
-
-
diff --git a/test_cases/zte-pod1/compute/whetstone_vm.yaml b/test_cases/zte-pod1/compute/whetstone_vm.yaml
deleted file mode 100644
index 9f12597f..00000000
--- a/test_cases/zte-pod1/compute/whetstone_vm.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
-Scenario:
- benchmark: whetstone
- host: virtualmachine_1, virtualmachine_1
- server:
-
-Context:
- Host_Machines:
-
- Virtual_Machines:
- virtualmachine_1:
- availability_zone: compute1
- public_network: 'admin-floating_net'
- OS_image: QTIP_CentOS
- flavor: m1.large
- role: host
- virtualmachine_2:
- availability_zone: compute2
- public_network: 'admin-floating_net'
- OS_image: QTIP_CentOS
- flavor: m1.large
- role: host
-
-
-Test_Description:
- Test_category: "Compute"
- Benchmark: "dhrystone"
- Overview: >
- '''This test will run the whetstone benchmark in parallel on machine_1 and machine_2.\n
- if you wish to add a virtual machine add the following information under the Virtual_Machine tag
- virtualmachine_1:
- availability_zone: nova
- public_network: 'net04_ext'
- OS_image: QTIP_CentOS
- flavor: m1.large
- role: host
-
- virtualmachine_1:
- availability_zone:
- public_network:
- OS_image:
- flavor:
- role:
- '''
-
diff --git a/test_cases/zte-pod1/network/iperf_bm.yaml b/test_cases/zte-pod1/network/iperf_bm.yaml
deleted file mode 100644
index e022d4a4..00000000
--- a/test_cases/zte-pod1/network/iperf_bm.yaml
+++ /dev/null
@@ -1,50 +0,0 @@
-Scenario:
- benchmark: iperf
- topology: Client and Server on different baremetal Compute nodes
- server: machine_1
- client: machine_2
- benchmark_details:
- duration: 20
- protocol: tcp
- bandwidthGbps: 10
-
-Context:
- Host_Machines:
- machine_1:
- ip: 10.20.0.23
- pw:
- role: 1-server
- machine_2:
- ip: 10.20.0.24
- pw:
- role: 2-host
-
- Virtual_Machines:
-
-Test_Description:
- Test_category: "network"
- Benchmark: "iperf"
- Overview: >
- '''This test will run the IPERF benchmark on virutalmachine_1 and virtualmachine_2. On the\n
- same compute node
- if you wish to add a host machine add the following information under the Host_Machine tag
- virtualmachine_1:
- availability_zone: compute1
- OS_image: QTIP_CentOS
- public_network: 'net04_ext'
- role: 1-server
- flavor: m1.large
-
- virtualmachine_2:
- availability_zone: compute2
- OS_image: QTIP_CentOS
- public_network: 'net04_ext'
- role: 2-host
- flavor: m1.large
-
- machine_1:
- ip:
- pw:
- role:
- '''
-
diff --git a/test_cases/zte-pod1/network/iperf_vm.yaml b/test_cases/zte-pod1/network/iperf_vm.yaml
deleted file mode 100644
index 57e09e02..00000000
--- a/test_cases/zte-pod1/network/iperf_vm.yaml
+++ /dev/null
@@ -1,43 +0,0 @@
-Scenario:
- benchmark: iperf
- topology: Client and Server on ONE compute
- server : virtualmachine_1
- client: virtualmachine_2
- description: 'Leave the bandwidth as 0 to throttle maximum traffic'
- benchmark_details:
- duration: 20
- protocol: tcp
- bandwidthGbps: 0
-
-Context:
- Host_Machines:
-
- Virtual_Machines:
- virtualmachine_1:
- availability_zone: compute1
- OS_image: QTIP_CentOS
- public_network: 'admin-floating_net'
- role: 1-server
- flavor: m1.large
-
- virtualmachine_2:
- availability_zone: compute1
- OS_image: QTIP_CentOS
- public_network: 'admin-floating_net'
- role: 2-host
- flavor: m1.large
-
-Test_Description:
- Test_category: "network"
- Benchmark: "iperf"
- Overview: >
- '''This test will run the IPERF benchmark on virutalmachine_1 and virtualmachine_2. On the\n
- same compute node
- if you wish to add a host machine add the following information under the Host_Machine tag
-
- machine_1:
- ip:
- pw:
- role:
- '''
-
diff --git a/test_cases/zte-pod1/network/iperf_vm_2.yaml b/test_cases/zte-pod1/network/iperf_vm_2.yaml
deleted file mode 100644
index c3cd6b35..00000000
--- a/test_cases/zte-pod1/network/iperf_vm_2.yaml
+++ /dev/null
@@ -1,45 +0,0 @@
-Scenario:
- benchmark: iperf
- topology: Client and Server on two different compute nodes
- server : virtualmachine_1
- client: virtualmachine_2
- description: 'Leave the bandwidth as 0 to throttle maximum traffic'
- benchmark_details:
- duration: 20
- protocol: tcp
- bandwidthGbps: 0
-
-Context:
- Host_Machines:
-
-
- Virtual_Machines:
- virtualmachine_1:
- availability_zone: compute1
- OS_image: QTIP_CentOS
- public_network: 'admin-floating_net'
- role: 1-server
- flavor: m1.large
-
- virtualmachine_2:
- availability_zone: compute2
- OS_image: QTIP_CentOS
- public_network: 'admin-floating_net'
- role: 2-host
- flavor: m1.large
-
-
-Test_Description:
- Test_category: "network"
- Benchmark: "iperf"
- Overview: >
- '''This test will run the IPERF benchmark on virutalmachine_1 and virtualmachine_2. On the\n
- same compute node
- if you wish to add a host machine add the following information under the Host_Machine tag
-
- machine_1:
- ip:
- pw:
- role:
- '''
-
diff --git a/test_cases/zte-pod1/storage/fio_bm.yaml b/test_cases/zte-pod1/storage/fio_bm.yaml
deleted file mode 100644
index e940e9ba..00000000
--- a/test_cases/zte-pod1/storage/fio_bm.yaml
+++ /dev/null
@@ -1,40 +0,0 @@
-Scenario:
- benchmark: fio
- host: machine_1, machine_2
- server:
-
-Context:
- Host_Machines:
- machine_1:
- ip: 10.20.0.23
- pw:
- role: host
- machine_2:
- ip: 10.20.0.24
- pw:
- role: host
-
-
- Virtual_Machines:
-
-
-
-Test_Description:
- Test_category: "Storage"
- Benchmark: "FIO"
- Overview: >
- '''This test will run the FIO benchmark in parallel on host machines "machine_1" and "machine_2".\n
- The fio job specifications can be found in qtip/benchmarks/fio_jobs/test_job.
- The job conists of an fio load of:
- 1.50% rand read 50% rand write
- 2.Asynch engine
- 3.Direct IO.
- 4.Queing depth of 2
-
- if you wish to add another machine add the following information under the Host_Machines tag
- machine_3:
- ip: 172.18.0.16
- pw: Op3nStack
- role: host
- '''
-
diff --git a/test_cases/zte-pod1/storage/fio_vm.yaml b/test_cases/zte-pod1/storage/fio_vm.yaml
deleted file mode 100644
index 65a1e67b..00000000
--- a/test_cases/zte-pod1/storage/fio_vm.yaml
+++ /dev/null
@@ -1,45 +0,0 @@
-Scenario:
- benchmark: fio
- host: machine_1, machine_2
- server:
-
-Context:
- Host_Machines:
-
- Virtual_Machines:
- virtualmachine_1:
- availability_zone: computer1
- public_network: 'admin_floating_net'
- OS_image: QTIP_CentOS
- flavor: m1.large
- role: host
- virtualmachine_2:
- availability_zone: computer2
- public_network: 'admin-floating_net'
- OS_image: QTIP_CentOS
- flavor: m1.large
- role: host
-
-
-Test_Description:
- Test_category: "Storage"
- Benchmark: "FIO"
- Overview: >
- '''This test will run the FIO benchmark in parallel on virtualmachine_1 and virtualmachine_2.\n
- The fio job specifications can be found in qtip/benchmarks/fio_jobs/test_job.
- The job conists of an fio load of:
- 1.50% rand read 50% rand write
- 2.Asynch engine
- 3.Direct IO.
- 4.Queing depth of 2
-
- if you wish to add a virtual machine add the following information under the Virtual_Machine tag
-
- virtualmachine_3:
- availability_zone:
- public_network:
- OS_image:
- flavor:
- role:
- '''
-
diff --git a/tests/args_handler_test.py b/tests/args_handler_test.py
index ebf500f3..e6500862 100644
--- a/tests/args_handler_test.py
+++ b/tests/args_handler_test.py
@@ -13,7 +13,7 @@ import func.args_handler
class TestClass:
@pytest.mark.parametrize("test_input, expected", [
- (['fuel', '/home', './test_cases/zte-pod1/network/iperf_bm.yaml'],
+ (['fuel', '/home', './test_cases/default/network/iperf_bm.yaml'],
['fuel', '/home', "iperf",
[('1-server', ['10.20.0.23']), ('2-host', ['10.20.0.24'])],
"iperf_bm.yaml",
diff --git a/tests/cli_test.py b/tests/cli_test.py
index fe05327d..12d0abb0 100644
--- a/tests/cli_test.py
+++ b/tests/cli_test.py
@@ -1,7 +1,7 @@
import pytest
import mock
import os
-from func.cli import cli
+from func.cli import Cli
class TestClass:
@@ -19,7 +19,7 @@ class TestClass:
k = mock.patch.dict(os.environ, {'INSTALLER_TYPE': 'fuel', 'PWD': '/home'})
with pytest.raises(SystemExit):
k.start()
- cli(test_input)
+ Cli(test_input)
k.stop()
resout, reserr = capfd.readouterr()
assert expected in resout
@@ -35,7 +35,7 @@ class TestClass:
def test_cli_successful(self, mock_args_handler, test_input, expected):
k = mock.patch.dict(os.environ, {'INSTALLER_TYPE': 'fuel', 'PWD': '/home'})
k.start()
- cli(test_input)
+ Cli(test_input)
k.stop()
call_list = map(lambda x: mock_args_handler.call_args_list[x][0], range(len(expected)))
assert sorted(call_list) == sorted(expected)
diff --git a/tests/create_zones_test.py b/tests/create_zones_test.py
index e431a907..39e71c17 100644
--- a/tests/create_zones_test.py
+++ b/tests/create_zones_test.py
@@ -2,7 +2,7 @@ import pytest
import mock
from mock import Mock, MagicMock
import os
-from func.create_zones import create_zones
+from func.create_zones import AvailabilityZone
return_list = []
@@ -22,7 +22,7 @@ class HyperMock(MagicMock):
class AggMock(MagicMock):
def get_details(self, agg_id):
- print "get_detail:{0}".format(agg_id)
+ print "get_details:{0}".format(agg_id)
return Mock(hosts=[])
def create(self, host, agg):
@@ -41,6 +41,7 @@ class AggMock(MagicMock):
pass
def remove_host(self, agg_id, host):
+ print "remove_host:{0}:{1}".format(agg_id, host)
pass
@@ -51,29 +52,48 @@ class NovaMock(MagicMock):
class TestClass:
@pytest.mark.parametrize("test_input, expected", [
- ([[], ['compute1', 'compute2']],
- ['create:10.20.0.4:compute1',
+ (['compute1', 'compute2'],
+ ['create:compute1:compute1',
'add_host:compute1:10.20.0.4',
- 'create:10.20.0.5:compute2',
+ 'create:compute2:compute2',
'add_host:compute2:10.20.0.5']),
- ([[get_agg_mock('10.20.0.4'), get_agg_mock('10.20.0.5')], ['compute1', 'compute2']],
- ['delete:10.20.0.4',
- 'create:10.20.0.4:compute1',
- 'get_detail:10.20.0.4',
- 'add_host:10.20.0.4:10.20.0.4',
- 'delete:10.20.0.5',
- 'create:10.20.0.5:compute2',
- 'get_detail:10.20.0.5',
- 'add_host:10.20.0.5:10.20.0.5']),
- ([[], ['compute1', 'compute5']],
- ['The specified compute node doesnt exist. using compute 1'])
+ (['compute1', 'compute1'],
+ ['create:compute1:compute1',
+ 'add_host:compute1:10.20.0.4']),
])
@mock.patch('func.create_zones.client', autospec=True)
@mock.patch('func.create_zones.v2', autospec=True)
@mock.patch('func.create_zones.session')
def test_create_zones_success(self, mock_keystone_session, mock_keystone_v2, mock_nova_client, test_input, expected, capfd):
+ nova_obj = NovaMock()
+ mock_nova_client.Client.return_value = nova_obj()
+ k = mock.patch.dict(os.environ, {'OS_AUTH_URL': 'http://172.10.0.5:5000',
+ 'OS_USERNAME': 'admin',
+ 'OS_PASSWORD': 'admin',
+ 'OS_TENANT_NAME': 'admin'})
+ k.start()
+ azone = AvailabilityZone()
+ azone.create_agg(test_input)
+ k.stop()
+ resout, reserr = capfd.readouterr()
+ for x in expected:
+ assert x in resout
+
+ @pytest.mark.parametrize("test_input, expected", [
+ ([get_agg_mock('10.20.0.4'), get_agg_mock('10.20.0.5')],
+ ['get_details:10.20.0.4',
+ 'delete:10.20.0.4',
+ 'get_details:10.20.0.5',
+ 'delete:10.20.0.5']),
+ ([],
+ []),
+ ])
+ @mock.patch('func.create_zones.client', autospec=True)
+ @mock.patch('func.create_zones.v2', autospec=True)
+ @mock.patch('func.create_zones.session')
+ def test_clean_all_aggregates(self, mock_keystone_session, mock_keystone_v2, mock_nova_client, test_input, expected, capfd):
global return_list
- return_list = test_input[0]
+ return_list = test_input
nova_obj = NovaMock()
mock_nova_client.Client.return_value = nova_obj()
k = mock.patch.dict(os.environ, {'OS_AUTH_URL': 'http://172.10.0.5:5000',
@@ -81,8 +101,8 @@ class TestClass:
'OS_PASSWORD': 'admin',
'OS_TENANT_NAME': 'admin'})
k.start()
- create = create_zones()
- create.create_agg(test_input[1])
+ azone = AvailabilityZone()
+ azone.clean_all_aggregates()
k.stop()
resout, reserr = capfd.readouterr()
for x in expected:
diff --git a/tests/qtip_server_test.py b/tests/qtip_server_test.py
index 2f9eebf1..9def21f8 100644
--- a/tests/qtip_server_test.py
+++ b/tests/qtip_server_test.py
@@ -35,6 +35,8 @@ class TestClass:
'suite_name': 'compute',
'max_minutes': 60,
'type': 'BM',
+ 'testdb_url': None,
+ 'node_name': None,
'state': 'finished',
'state_detail': [{'state': 'finished', 'benchmark': 'dhrystone_bm.yaml'},
{'state': 'finished', 'benchmark': 'whetstone_bm.yaml'},
@@ -48,7 +50,9 @@ class TestClass:
'max_minutes': 20,
'suite_name': 'compute',
'type': 'VM',
- 'benchmark_name': 'dhrystone_vm.yaml'},
+ 'benchmark_name': 'dhrystone_vm.yaml',
+ 'testdb_url': 'http://testresults.opnfv.org/test/api/v1',
+ 'node_name': 'zte-pod2'},
{'job_id': '',
'installer_type': 'fuel',
'installer_ip': '10.20.0.2',
@@ -56,6 +60,8 @@ class TestClass:
'suite_name': 'compute',
'max_minutes': 20,
'type': 'VM',
+ 'testdb_url': 'http://testresults.opnfv.org/test/api/v1',
+ 'node_name': 'zte-pod2',
'state': 'finished',
'state_detail': [{u'state': u'finished', u'benchmark': u'dhrystone_vm.yaml'}],
'result': 0})
diff --git a/tests/spawn_vm_test.py b/tests/spawn_vm_test.py
index 0ec5c902..7890abd1 100644
--- a/tests/spawn_vm_test.py
+++ b/tests/spawn_vm_test.py
@@ -43,7 +43,7 @@ class TestClass:
[('172.10.0.154', '')]),
])
@mock.patch('func.spawn_vm.Env_setup')
- @mock.patch('func.spawn_vm.create_zones')
+ @mock.patch('func.spawn_vm.AvailabilityZone')
@mock.patch('func.spawn_vm.client', autospec=True)
@mock.patch('func.spawn_vm.keystoneclient.v2_0', autospec=True)
@mock.patch('func.spawn_vm.heatclient.client', autospec=True)