yardstick.git
7 years agoRecord task status if running via CLI 41/27241/3
chenjiankun [Thu, 19 Jan 2017 20:24:48 +0000 (20:24 +0000)]
Record task status if running via CLI

JIRA: YARDSTICK-542

Currently we do not record task status when using CLI to run task.
So I add this function.
If status=0, task is not done.
if status=1, task is done.
if status=2, there is an error.

Change-Id: Ib9b3c8abd233909c04f792115199250419fa8d7a
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "Bugfix:can not run a test suite if not under yardstick root path"
Jing Lu [Fri, 20 Jan 2017 01:09:36 +0000 (01:09 +0000)]
Merge "Bugfix:can not run a test suite if not under yardstick root path"

7 years agoMerge "Bugfix: task_id parameter from API can not pass to yardstick core"
Jing Lu [Fri, 20 Jan 2017 01:08:39 +0000 (01:08 +0000)]
Merge "Bugfix: task_id parameter from API can not pass to yardstick core"

7 years agoIntroducing the collector to subscribe/publish the KPIs for yardstick plot 13/26613/3
Deepak S [Fri, 30 Dec 2016 17:20:15 +0000 (09:20 -0800)]
Introducing the collector to subscribe/publish the KPIs for yardstick plot

v2: Added unit tests to keep test coverage :)

JIRA: YARDSTICK-482
Change-Id: I9281b00a4b619cc04550cb623c027ee5765c4974
Signed-off-by: Deepak S <deepak.s@linux.intel.com>
7 years agoIntroducing Standalone context for running test in non-managed environment. 11/26611/3
Deepak S [Fri, 30 Dec 2016 17:19:34 +0000 (09:19 -0800)]
Introducing Standalone context for running test in non-managed environment.

This patch introduces standalone virtualization context to
deploy/undeploy NFVi infrastructure to run the VNF

Supported NFVi Type:
  - vswitch
   - ovs
   - ovs-dpdk
   - sr-iov
   - testpmd
   - linuxbridge

This patches inits the function stubs to enable the standalone context.
Actual deploy/undeploy code will be added in later check-in

v2: Added unit tests to keep test coverage :)

JIRA: YARDSTICK-479
Change-Id: I6ab3ac3335f40eabc4efb0af7d5addc20c122d65
Signed-off-by: Deepak S <deepak.s@linux.intel.com>
7 years agoMerge "Verify stdin data before doing encodeutils safe_encode"
Kubi [Thu, 19 Jan 2017 08:27:31 +0000 (08:27 +0000)]
Merge "Verify stdin data before doing encodeutils safe_encode"

7 years agoMerge "Bugfix: command "openstack image list" failed"
Jing Lu [Thu, 19 Jan 2017 07:59:59 +0000 (07:59 +0000)]
Merge "Bugfix: command "openstack image list" failed"

7 years agoBugfix: command "openstack image list" failed 07/27207/1
chenjiankun [Thu, 19 Jan 2017 11:07:12 +0000 (11:07 +0000)]
Bugfix: command "openstack image list" failed

JIRA: YARDSTICK-537

Now the openstackclient version is set to 3.3.0, but it cannot support
osc-lib 1.3.0 whose version is automatic set.
So I set openstackclient version to 3.7.0 and osc-lib version to 1.2.0

Change-Id: If4ccd517f6a572f6c463270596d0e1019ba9a1e6
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "Bugfix: context not found for server ''node1.LF''"
Kubi [Thu, 19 Jan 2017 07:45:17 +0000 (07:45 +0000)]
Merge "Bugfix: context not found for server ''node1.LF''"

7 years agoBugfix: context not found for server ''node1.LF'' 01/27201/1
chenjiankun [Thu, 19 Jan 2017 09:59:58 +0000 (09:59 +0000)]
Bugfix: context not found for server ''node1.LF''

JIRA: YARDSTICK-540

We are adding dynamically generated suffix to server name in the
previous patch.
But in that patch we just change the 'target', 'host' in nodes, but not
'node1', 'node2' ...
This patch will change all this.

Change-Id: Ic7c82c323dea24a40f1fe30871603d30c2689f67
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "Re-factor Node.py to use better python inbuilt functions"
Kubi [Thu, 19 Jan 2017 07:35:55 +0000 (07:35 +0000)]
Merge "Re-factor Node.py to use better python inbuilt functions"

7 years agoMerge "Add unittest framework for Yardstick API"
Jing Lu [Thu, 19 Jan 2017 07:02:38 +0000 (07:02 +0000)]
Merge "Add unittest framework for Yardstick API"

7 years agoVerify stdin data before doing encodeutils safe_encode 09/27109/5
Deepak S [Tue, 17 Jan 2017 00:37:39 +0000 (06:07 +0530)]
Verify stdin data before doing encodeutils safe_encode

Process running via ssh can return "None" or emtpy data from the
application. To avoid encodutils raise NoneType issue. Check the data before
encode.

JIRA: YARDSTICK-539

Change-Id: I7e86e6a17c0adc95d41714f6fec463dfadc2b81b
Signed-off-by: Deepak S <deepak.s@linux.intel.com>
7 years agoRe-factor Node.py to use better python inbuilt functions 11/27211/1
Deepak S [Wed, 18 Jan 2017 09:34:44 +0000 (15:04 +0530)]
Re-factor Node.py to use better python inbuilt functions

1. don't use sys.exit() to exit when there is an exception, it will hide
the underlying error
2. use the Abstract Base Classes for type checking.
3. don't have to build list, can use next

JIRA: YARDSTICK-541

Change-Id: Id4485acb21e7e02bbc22d3e689cbf0699363098a
Signed-off-by: Deepak S <deepak.s@linux.intel.com>
7 years agoMerge "Use """ to replace ''' in docstring"
Rex Lee [Wed, 18 Jan 2017 10:14:14 +0000 (10:14 +0000)]
Merge "Use """ to replace ''' in docstring"

7 years agoAdd unittest framework for Yardstick API 83/27083/1
chenjiankun [Tue, 17 Jan 2017 15:40:17 +0000 (15:40 +0000)]
Add unittest framework for Yardstick API

JIRA: YARDSTICK-538

Currently it is hard to test API, So I add a base class as flask
document do.
In this framework I will mock a temp sqlite database and a server.

Change-Id: If881233cb22655617c07ad018201b8ee08492d06
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoBugfix: command "openstack image list" failed 71/27071/1
chenjiankun [Tue, 17 Jan 2017 02:54:08 +0000 (02:54 +0000)]
Bugfix: command "openstack image list" failed

JIRA: YARDSTICK-537

Now the openstackclient version is set to 3.3.0, but it cannot support
osc-lib 1.3.0 whose version is automatic set.
So I set openstackclient version to 3.3.0 and osc-lib version to 1.3.0

Change-Id: Ia480feb3621be97a4a97bb027685cc438e01c53e
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "Adding python package requirement for VNF testing."
Jing Lu [Tue, 17 Jan 2017 02:48:34 +0000 (02:48 +0000)]
Merge "Adding python package requirement for VNF testing."

7 years agoUse """ to replace ''' in docstring 07/27007/1
chenjiankun [Mon, 16 Jan 2017 09:17:48 +0000 (09:17 +0000)]
Use """ to replace ''' in docstring

JIRA: YARDSTICK-525

For consistency, we always use """triple double quotes""" around
docstrings.

Change-Id: I47a20bbd8b55bc544b4841ea4006929af0a044ac
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "remove failing influx testcases"
Kubi [Mon, 16 Jan 2017 02:38:50 +0000 (02:38 +0000)]
Merge "remove failing influx testcases"

7 years agoBugfix:can not run a test suite if not under yardstick root path 15/26815/3
chenjiankun [Tue, 10 Jan 2017 08:01:41 +0000 (08:01 +0000)]
Bugfix:can not run a test suite if not under yardstick root path

JIRA: YARDSTICK-530

Currently we can not run a test suite if we are not in yardstick root
path.
The reason is that the file in test suite config file use relative path.
So I change it to absolute path when run.

Change-Id: I62758bc67f466ac794d339b597562b3be05574fb
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd support for Python 3 39/25539/18
Ross Brattain [Mon, 5 Dec 2016 21:11:54 +0000 (16:11 -0500)]
Add support for Python 3

Porting to Python3 using Openstack guidelines:
https://wiki.openstack.org/wiki/Python3

This passes unittests on Python 3.5 and passes opnfv_smoke suite

Updates:
   use six for urlparse and urlopen
   fix exception.message attribute removal
   run unittests on python3
   use unitest.mock on python 3
   fix open mock for vsperf
   fix float division by using delta/eplison comparison
   use unicode in StringIO
   use plugin/sample_config.yaml relative path from test case
   fixed apexlake unittests
   upgraded to mock 2.0.0 to match python3 unittest.mock features
   fixed flake8 issues
   implement safe JSON decode with oslo_serialization.jsonutils.dump_as_bytes()
   implement safe unicode encode/decode with oslo_utils.encodeutils

heat: convert pub key file from bytes to unicode
    pkg_resources returns raw bytes, in python3
    we have to decode this to utf-8 unicode
    so JSON can encode it for heat template

JIRA: YARDSTICK-452

Change-Id: Ib80dd1d0c0eb0592acd832b82f6a7f8f7c20bfda
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agoheat: fix key_uuid format 09/26909/2
Ross Brattain [Thu, 12 Jan 2017 05:59:18 +0000 (21:59 -0800)]
heat: fix key_uuid format

The .format() won't work, since it can't slice the uuid

We have to convert the uuid to string before we slice it.
I thought .format() would implicitly call __str__() before
applying width, but that is not the case.

'files/yardstick_key-{:.{width}}'.format(self.key_uuid, width=8))

We also need to define a constant short uuid lenght, we can't
hardcode the length to 8 everywhere.

Create a helper function to standardize the generation
of the short key uuid and use that helper function everywhere

Change-Id: I59e051bfe697587e967f93f5b8f209e0e7daa5c7
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agoremove failing influx testcases 15/26915/1
Ross Brattain [Thu, 12 Jan 2017 06:32:26 +0000 (22:32 -0800)]
remove failing influx testcases

when influx was refactored these test cases must not
have been removed

>       influx._write_data(measurement, field, timestamp, tags)
E       AttributeError: 'module' object has no attribute '_write_data'

Change-Id: I78814266fae04bd3b0bc06fe1fe41317ba8aced4
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agoBugfix: task_id parameter from API can not pass to yardstick core 63/26863/1
chenjiankun [Wed, 11 Jan 2017 10:42:32 +0000 (10:42 +0000)]
Bugfix: task_id parameter from API can not pass to yardstick core

JIRA: YARDSTICK-531

Now in API entry the task_id parameter will not pass to yardstick core.
I fix it by pass task_id to yardstick.benchmark.core.task.start() method.

Change-Id: I66439660ff116d83104e5ba4f040106ca73142e6
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "Create API to run test suite"
Rex Lee [Wed, 11 Jan 2017 03:03:10 +0000 (03:03 +0000)]
Merge "Create API to run test suite"

7 years agoMerge "associate an uuid to yardstick_key and yardstick_key.pub"
Rex Lee [Wed, 11 Jan 2017 03:01:14 +0000 (03:01 +0000)]
Merge "associate an uuid to yardstick_key and yardstick_key.pub"

7 years agoCreate API to run test suite 07/26407/4
JingLu5 [Thu, 22 Dec 2016 04:07:55 +0000 (12:07 +0800)]
Create API to run test suite

JIRA: YARDSTICK-475

This API will be used to run test suite files in the test/opnfv/test_suites directory

Change-Id: I208edf9abed62fd6436de988ac85bfe99c4d01bd
Signed-off-by: JingLu5 <lvjing5@huawei.com>
7 years agoassociate an uuid to yardstick_key and yardstick_key.pub 05/26705/3
JingLu5 [Mon, 9 Jan 2017 11:35:47 +0000 (11:35 +0000)]
associate an uuid to yardstick_key and yardstick_key.pub

JIRA: YARDSTICK-527

This work is to support yardstick parallel tasks in the future.
Currently, the RSA key we generated and used to access the VM is named
'yardstick_key'.
If more than two tasks are running paralleled, the later 'yardstick_key' will
cover the former.
We want associate an uuid to identify differnets for each tasks. So the key
files won't conflict.
The first 8 digits will be used, as there is no need to used a full-length uuid.

Change-Id: If8eaf47ae527cf9b3bd50f37ab3051fbdccf5f03
Signed-off-by: JingLu5 <lvjing5@huawei.com>
7 years agoMerge "Yardstick framework concurrent support"
Jing Lu [Tue, 10 Jan 2017 09:13:06 +0000 (09:13 +0000)]
Merge "Yardstick framework concurrent support"

7 years agoMerge "Add API to get the status of async task"
Jing Lu [Tue, 10 Jan 2017 09:11:54 +0000 (09:11 +0000)]
Merge "Add API to get the status of async task"

7 years agoAdd API to get the status of async task 79/26679/9
chenjiankun [Wed, 4 Jan 2017 17:41:18 +0000 (17:41 +0000)]
Add API to get the status of async task

JIRA: YARDSTICK-526

Currently there are many API run a task using sub thread.
But we don't know the status of this task.
So we need to offer a API to query the status of this task.

Change-Id: I8d2cc558750bf9270aed4a7abb8bf35d17894d83
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "Record test case names when run a task using API"
Rex Lee [Tue, 10 Jan 2017 08:54:16 +0000 (08:54 +0000)]
Merge "Record test case names when run a task using API"

7 years agoMerge "subprocess.call para stdout=PIPE is risky"
Rex Lee [Tue, 10 Jan 2017 08:48:55 +0000 (08:48 +0000)]
Merge "subprocess.call para stdout=PIPE is risky"

7 years agoYardstick framework concurrent support 63/26763/3
chenjiankun [Fri, 6 Jan 2017 08:01:53 +0000 (08:01 +0000)]
Yardstick framework concurrent support

JIRA: YARDSTICK-528

Currently yardstick framework can not support run the same test case at
the same time.
But actually we need to support it.
The reason why framework can't support it is that openstack do not allow
to create stack with the same name.
So I use the task_id to make the stack different.

Change-Id: I9e853793650066dfc56606464f7826f330a1401c
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdding python package requirement for VNF testing. 09/26609/1
Deepak S [Fri, 30 Dec 2016 17:18:43 +0000 (09:18 -0800)]
Adding python package requirement for VNF testing.

List of packages:
zmq - Py lib helps to publish/subscribe for ZeroMQ for data exchange
pika - Py lib helps setup amqp for data exchange with collectd

JIRA: YARDSTICK-453
Change-Id: Ic537d677622167fdb3aef81fb0c313553fcf087a
Signed-off-by: Deepak S <deepak.s@linux.intel.com>
7 years agoSplit Yardstick CLI with Yardstick core logic 77/26577/4
chenjiankun [Thu, 29 Dec 2016 11:45:12 +0000 (11:45 +0000)]
Split Yardstick CLI with Yardstick core logic

JIRA: YARDSTICK-511

We need to unify yardstick entry. Now the solution is using CLI call API
as nova do.
This is the first step: coupling the yardstick core logic from CLI.
Moving the core logic to yardstick/benchmark/core and the CLI using a
object to call yardstick core logic.

Change-Id: I84f10d2134635880c281cc63212a8533f2dd7d4e
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "Yardstick Plugin: add support for ssh login using key"
Jing Lu [Fri, 30 Dec 2016 07:02:06 +0000 (07:02 +0000)]
Merge "Yardstick Plugin: add support for ssh login using key"

7 years agoMerge "BugFix: correct Copyright info in openstack_utils.py"
Jing Lu [Fri, 30 Dec 2016 06:22:18 +0000 (06:22 +0000)]
Merge "BugFix: correct Copyright info in openstack_utils.py"

7 years agoMerge "Create ping_load sample configuration yaml file"
Rex Lee [Fri, 30 Dec 2016 03:32:00 +0000 (03:32 +0000)]
Merge "Create ping_load sample configuration yaml file"

7 years agoMerge "Fix installation dependency and authentication issue for fuel plugin"
Jing Lu [Thu, 29 Dec 2016 02:16:41 +0000 (02:16 +0000)]
Merge "Fix installation dependency and authentication issue for fuel plugin"

7 years agoRecord test case names when run a task using API 47/26547/2
chenjiankun [Wed, 28 Dec 2016 10:27:14 +0000 (10:27 +0000)]
Record test case names when run a task using API

JIRA: YARDSTICK-509

Currently we use influxdb as database and will not record test case name
when run a test case.
So if we must offer test case name if we want to get result from API.

Regarding future requirement, I create sqlite database and alchemy orm
framework. And record test case name when run a test case. So we needn't
offer test case any more when call for get result API.

Change-Id: I7d7dc24543a33918546267591f7bdcd0742928cb
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoYardstick Plugin: add support for ssh login using key 79/25379/3
JingLu5 [Wed, 28 Dec 2016 02:07:20 +0000 (10:07 +0800)]
Yardstick Plugin: add support for ssh login using key

JIRA: YARDSTICK-442

Change-Id: I4736e8cb8331d7a74c8c9946e21edd791b0c8ba9
Signed-off-by: JingLu5 <lvjing5@huawei.com>
7 years agoMerge "enhance test cases description and provide more info(in progress)"
Jing Lu [Wed, 28 Dec 2016 01:23:09 +0000 (01:23 +0000)]
Merge "enhance test cases description and provide more info(in progress)"

7 years agoMerge "Use ConfigParser to write yardstick.conf"
Jing Lu [Wed, 28 Dec 2016 01:07:48 +0000 (01:07 +0000)]
Merge "Use ConfigParser to write yardstick.conf"

7 years agoFix installation dependency and authentication issue for fuel plugin 43/26543/2
Edwin Zhai [Mon, 26 Dec 2016 00:00:06 +0000 (16:00 -0800)]
Fix installation dependency and authentication issue for fuel plugin

JIRA: YARDSTICK-516

Change-Id: I348959c2ea3b6ed586f487cde88a173eb593be4f
Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
7 years agoCreate ping_load sample configuration yaml file 13/26513/3
JingLu5 [Tue, 27 Dec 2016 09:11:09 +0000 (17:11 +0800)]
Create ping_load sample configuration yaml file

JIRA: YARDSTICK-514

The ping_load task uses multiple(3 in this case) host VMs to ping one target
VM in parallel. The multiple hosts configuration will be rendered using jinja
syntax. "contexts" is used to specify the target and muiltip host VMs.

Change-Id: I3e36b86d16d0386b4d446a2e252a094926cd97a3
Signed-off-by: JingLu5 <lvjing5@huawei.com>
7 years agoBugFix: correct Copyright info in openstack_utils.py 11/26511/1
JingLu5 [Tue, 27 Dec 2016 09:01:06 +0000 (17:01 +0800)]
BugFix: correct Copyright info in openstack_utils.py

JIRA:YARDSTICK-513

the copyright info in openstack_utils.py is not accurate.
(yardstick: this file is copied from rally and slightly modified)
this line should be deleted.

Change-Id: I6cf8205ee6b142ae87b268829e5ac7454239dd0d
Signed-off-by: JingLu5 <lvjing5@huawei.com>
7 years agoUse ConfigParser to write yardstick.conf 03/26003/6
chenjiankun [Thu, 15 Dec 2016 02:31:43 +0000 (02:31 +0000)]
Use ConfigParser to write yardstick.conf

JIRA: YARDSTICK-474

Currently, I use file.write() method to write config in yardstick.conf.
But it is not recommended.
So I change to use ConfigParser to write config in yardstick.conf

Change-Id: Ia789cf09296afd5d1507bcf99f165378bf87c591
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd sqlite and SQLAlchemy support for API 95/26395/4
chenjiankun [Thu, 22 Dec 2016 08:41:08 +0000 (08:41 +0000)]
Add sqlite and SQLAlchemy support for API

JIRA: YARDSTICK-505

Now yardstick API need a database to store API data.
And for future the yardstick GUI also need a self database.
So I choose a light-weight database sqlite.
And use SQLAlchemy to do ORM.

Change-Id: I1edc350ec6f57ad67785de549c2135c86ea60a4a
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "Bugfix: the load_image.sh script will load a image with the same name"
Jing Lu [Sat, 24 Dec 2016 01:21:36 +0000 (01:21 +0000)]
Merge "Bugfix: the load_image.sh script will load a image with the same name"

7 years agoMerge "Move uwsgi.log and yardstick.sock to proper location"
Jing Lu [Sat, 24 Dec 2016 01:12:49 +0000 (01:12 +0000)]
Merge "Move uwsgi.log and yardstick.sock to proper location"

7 years agoBugfix: the load_image.sh script will load a image with the same name 09/26009/5
chenjiankun [Thu, 15 Dec 2016 06:02:50 +0000 (06:02 +0000)]
Bugfix: the load_image.sh script will load a image with the same name

JIRA: YARDSTICK-471

Currently, if we execute the load_image.sh and the openstack already
have this image in the cloud,this script will load another image with
the same name.
This will make yardstick run error.
So I clean this related images before loading.

Change-Id: If5b985ef9b2e890aa10453810fac36867d320a06
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoYardstick API refactor 21/26321/2
chenjiankun [Wed, 21 Dec 2016 01:07:26 +0000 (01:07 +0000)]
Yardstick API refactor

JIRA: YARDSTICK-503

Now in api/views.py there are many redundant code.
So I do some refactoring and make it to be a lightweight framework.

Change-Id: Id7cecc95e60f5403b2d26239a3ef41d01bbb542a
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "ssh: don't quote ~ in remotepaths"
Jing Lu [Thu, 22 Dec 2016 04:33:32 +0000 (04:33 +0000)]
Merge "ssh: don't quote ~ in remotepaths"

7 years agoMerge "Add smoke, components, features and performance test suite for Yatdstick"
Rex Lee [Thu, 22 Dec 2016 03:41:47 +0000 (03:41 +0000)]
Merge "Add smoke, components, features and performance test suite for Yatdstick"

7 years agoMerge "Replace heat, keystone and nova command with openstack command"
Rex Lee [Thu, 22 Dec 2016 02:52:16 +0000 (02:52 +0000)]
Merge "Replace heat, keystone and nova command with openstack command"

7 years agoMerge "Use openstack command instead keystone command in prepare_storperf_admin-rc.sh"
Jing Lu [Thu, 22 Dec 2016 02:13:09 +0000 (02:13 +0000)]
Merge "Use openstack command instead keystone command in prepare_storperf_admin-rc.sh"

7 years agoMove uwsgi.log and yardstick.sock to proper location 31/26331/1
chenjiankun [Wed, 21 Dec 2016 11:14:02 +0000 (11:14 +0000)]
Move uwsgi.log and yardstick.sock to proper location

JIRA: YARDSTICK-504

Now yardstick.sock and uwsgi.log is in yardstick/api directory.
But it is not standard for they should not be put in the code path.
So I move yardstick.sock to /var/run/yardstick.sock
and move uwsgi.log to /var/log/yardstick/uwsgi.log

Change-Id: I526ab011c0222255dfbae037f494edb5d8a88add
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agorestore the yardstick-img-modify cleanup() func 57/26357/2
Ryan.RCS [Wed, 21 Dec 2016 07:44:21 +0000 (07:44 +0000)]
restore the yardstick-img-modify cleanup() func

There is a result failed again after last update.
So i restore the clean() function to its original codes and avoid CI failed.
But i'm not sure something about the clean() function,
and I will check this failed clearly in future.

Change-Id: I8f49533788c7ccb2016e7a484368a72028579fa8
JIRA: YARDSTICK-502
Signed-off-by: Ryan.RCS <lihainong@huawei.com>
7 years agossh: don't quote ~ in remotepaths 33/26333/2
Ross Brattain [Wed, 21 Dec 2016 05:40:52 +0000 (21:40 -0800)]
ssh: don't quote ~ in remotepaths

~ is not expanded in double quotes, so we have a dilemma.

We need to quote in order to preserve filenames with spaces,
but we have to make sure we don't quote the ~ so it can be expanded.

To resolve this we use a regex to search for tidle-prefixes
and excluded them from quotes.

Added unittests for the cases:
path with tilde
path with space
path with tilde and space

see bash man page for details of tidle expansion

Tilde Expansion

    If  a word begins with an unquoted tilde character (`~'), all of the
characters preceding the first unquoted slash (or all characters, if there is
no unquoted slash) are considered a tilde-prefix.  If none of the characters in
the tilde-prefix are quoted, the characters in the tilde-prefix following the
tilde are treated as a possible login name.  If this login name is the null
string, the tilde is replaced with the value of the shell parameter HOME.  If
HOME is unset, the home directory of the user executing the shell is
substituted instead.  Otherwise, the  tilde-prefix  is  replaced  with  the
home directory associated with the specified login name.

JIRA: YARDSTICK-501

Change-Id: I324be20aba0dbd50434fbd8081685c598ebd8a84
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agoMerge "fixed issue in yardstick-img-modify cleanup() fun"
Jing Lu [Wed, 21 Dec 2016 04:28:51 +0000 (04:28 +0000)]
Merge "fixed issue in yardstick-img-modify cleanup() fun"

7 years agofixed issue in yardstick-img-modify cleanup() fun 27/26327/1
Ryan.RCS [Wed, 21 Dec 2016 02:29:41 +0000 (02:29 +0000)]
fixed issue in yardstick-img-modify cleanup() fun

1. when run yardstick-img-modify script, sometimes it show below error.
 + '[' -f /tmp/workspace/yardstick/yardstick-xenial-server.raw ']'
 + kpartx -dv /tmp/workspace/yardstick/yardstick-xenial-server.raw
 ioctl: LOOP_CLR_FD: No such device or address
 del devmap : loop0p1
 can't del loop : /dev/loop0
 + test 1 -eq 1 -o 1 -eq 2
 2. so i added a expression to check if the .raw file map deleted or not
 3. if the devmap not deleted, then we delete it, otherwise, we do nothing

JIRA: YARDSTICK-502

Change-Id: Ia050121ed6bf837bab05e38f2e9e9628ca31627a
Signed-off-by: Ryan.RCS <lihainong@huawei.com>
7 years agosubprocess.call para stdout=PIPE is risky 11/26111/4
Ryan.RCS [Tue, 20 Dec 2016 08:36:24 +0000 (08:36 +0000)]
subprocess.call para stdout=PIPE is risky

1.In 'def run' function of parser.py file,
  subprocess.call parameter stdout=
  subprocess.PIPE is risky, so I changed
  the function from 'call' to 'popen'
2.updated sample/tosca.ymal because the version of
  that file is old.

JIRA: YARDSTICK-473

Change-Id: Ie242e77eed6fdc2849394a3f170e40a0dd2be632
Signed-off-by: Ryan.RCS <lihainong@huawei.com>
7 years agoReplace heat, keystone and nova command with openstack command 97/26197/5
JingLu5 [Tue, 20 Dec 2016 03:17:45 +0000 (11:17 +0800)]
Replace heat, keystone and nova command with openstack command

JIRA: YARDSTICK-486

In future Openstack release, 'heat', 'keystone', 'nova' command will be
deprecated. So we need to use 'openstack' command instead.

Change-Id: I7070f8aaf0d235705b65e0760c845f843ad79719
Signed-off-by: JingLu5 <lvjing5@huawei.com>
7 years agoBugFix: remotepath cannot be found 71/26271/2
JingLu5 [Tue, 20 Dec 2016 02:46:26 +0000 (10:46 +0800)]
BugFix: remotepath cannot be found

JIRA: YARDSTICK-501

An redundant pair of quotation in ssh.py causes remotepath cannot be found.

Change-Id: I2df8ab59830fd28d8ad8882a93a8efbd4d1f7cb7
Signed-off-by: JingLu5 <lvjing5@huawei.com>
7 years agoMerge "change m1.* flavor to "yardstick-flavor""
Rex Lee [Tue, 20 Dec 2016 01:28:57 +0000 (01:28 +0000)]
Merge "change m1.* flavor to "yardstick-flavor""

7 years agoMerge "Update Yardstick README file"
Rex Lee [Mon, 19 Dec 2016 06:16:14 +0000 (06:16 +0000)]
Merge "Update Yardstick README file"

7 years agochange m1.* flavor to "yardstick-flavor" 67/26167/1
JingLu5 [Mon, 19 Dec 2016 00:59:34 +0000 (08:59 +0800)]
change m1.* flavor to "yardstick-flavor"

JIRA: YARDSTICK-485

In OpenStack Newton, the 'm1.tiny', 'm1.small', 'm1.medium' and 'm1.large' will
not be automatic created. This may cause errors as some Yardstick testcases are
using one of these flavor. Therefore, it's better change all the flavor option
in task configuration file to 'yardstick-flavor'.

Change-Id: Ibb29a77ef331bbf728dec9894a2e9f17c19d5ebd
Signed-off-by: JingLu5 <lvjing5@huawei.com>
7 years agoUse openstack command instead keystone command in prepare_storperf_admin-rc.sh 81/26081/3
JingLu5 [Fri, 16 Dec 2016 06:38:16 +0000 (14:38 +0800)]
Use openstack command instead keystone command in prepare_storperf_admin-rc.sh

JIRA: YARDSTICK-476

In Openstack Newton, the ”tenant“ is deprecated and "project" is used.
The prepare_storperf_admin-rc.sh uses keystone command to get "tenant id".
So for newton, we need to use openstack command to get "project id".

This patch also add a copy right header in tests/ci/scp_storperf_admin-rc.sh.

Change-Id: Ic69cb07f684ccb557866a4141e9d2724fc054f29
Signed-off-by: JingLu5 <lvjing5@huawei.com>
7 years agoAdd smoke, components, features and performance test suite for Yatdstick 53/24953/4
JingLu5 [Mon, 28 Nov 2016 03:03:08 +0000 (11:03 +0800)]
Add smoke, components, features and performance test suite for Yatdstick

JIRA: YARDSTICK-417

This patch adds a smoke test suite for Yardstick. The smoke test suite consists
of 3 test cases: TC002 Ping, TC005 Fio, TC012 LMbench.

3 test suites for components, features and performance tiers are also provided.

Change-Id: Ic5223c1401270d126aabb4bf062e40da9464e18f
Signed-off-by: JingLu5 <lvjing5@huawei.com>
7 years agoMerge "Add support for OpenSrack Newton"
Rex Lee [Thu, 15 Dec 2016 09:01:21 +0000 (09:01 +0000)]
Merge "Add support for OpenSrack Newton"

7 years agoMerge "Bugfixed:run command: "yardstick-img-modify" fail!"
Rex Lee [Thu, 15 Dec 2016 09:00:33 +0000 (09:00 +0000)]
Merge "Bugfixed:run command: "yardstick-img-modify" fail!"

7 years agoUpdate Yardstick README file 85/25385/8
JingLu5 [Fri, 2 Dec 2016 02:00:35 +0000 (10:00 +0800)]
Update Yardstick README file

JIRA: YARDSTICK-443

Change-Id: Iecd56e257513ca2d1217fd44aaaf377a3c04104d
Signed-off-by: JingLu5 <lvjing5@huawei.com>
7 years agoBugfixed:run command: "yardstick-img-modify" fail! 01/25701/3
Ryan.RCS [Fri, 9 Dec 2016 03:06:41 +0000 (03:06 +0000)]
Bugfixed:run command: "yardstick-img-modify" fail!

Avoid incorrect deletion of $raw_imgfile when the command:
"kpartx -dv $raw_imgfile" execute failed.

JIRA: YARDSTICK-424

Change-Id: I34dac60bda6c028c4b0f0bfd9ad077e2d5dbb0ff
Signed-off-by: Ryan.RCS <lihainong@huawei.com>
7 years agoMerge "BugFix: Upgrade python-novaclient and other dependencies"
Rex Lee [Wed, 14 Dec 2016 01:13:48 +0000 (01:13 +0000)]
Merge "BugFix: Upgrade python-novaclient and other dependencies"

7 years agoAdd support for OpenSrack Newton 23/25823/5
JingLu5 [Tue, 13 Dec 2016 05:42:41 +0000 (05:42 +0000)]
Add support for OpenSrack Newton

JIRA: YARDSTICK-410

This patch uses keystoneauth1.session to initialize the client for Heat
The keystoneauth1.session.Session class was introduced into keystoneauth1
as an attempt to bring a unified interface to the various OpenStack clients
that share common authentication and request parameters between a variety of
services.

Change-Id: Ie6287b50a36cf03950fa1174791df826e9bdafd3
Signed-off-by: JingLu5 <lvjing5@huawei.com>
7 years agoMerge "ssh.py: add flag to request for a pseudo terminal (pty) for ssh connection"
Rex Lee [Tue, 13 Dec 2016 07:38:03 +0000 (07:38 +0000)]
Merge "ssh.py: add flag to request for a pseudo terminal (pty) for ssh connection"

7 years agoMerge "env: convert file open to context manager"
Jing Lu [Tue, 13 Dec 2016 06:27:55 +0000 (06:27 +0000)]
Merge "env: convert file open to context manager"

7 years agoMerge "Increase Ping scenario ssh timeout limit to 600 seconds"
Rex Lee [Mon, 12 Dec 2016 07:43:15 +0000 (07:43 +0000)]
Merge "Increase Ping scenario ssh timeout limit to 600 seconds"

7 years agoMerge "Bugfix: update Yardstick custom VM image name in user guide"
Rex Lee [Mon, 12 Dec 2016 07:42:37 +0000 (07:42 +0000)]
Merge "Bugfix: update Yardstick custom VM image name in user guide"

7 years agoMerge "use context manager for stdin files and use _put_file_shell"
Rex Lee [Mon, 12 Dec 2016 07:13:30 +0000 (07:13 +0000)]
Merge "use context manager for stdin files and use _put_file_shell"

7 years agoMerge "Add support for Storperf job status"
Rex Lee [Mon, 12 Dec 2016 07:06:59 +0000 (07:06 +0000)]
Merge "Add support for Storperf job status"

7 years agossh.py: add flag to request for a pseudo terminal (pty) for ssh connection 83/25683/2
Deepak S [Thu, 8 Dec 2016 08:27:13 +0000 (13:57 +0530)]
ssh.py: add flag to request for a pseudo terminal (pty) for ssh connection

For some VNFs we may want to send periodic commands, for example to
print statistics etc.

When you open a SSH connection, request a pseudo terminal (pty) which
allows passing of control characters to the connection.

JIRA: YARDSTICK-453

Change-Id: Ibfd4164e745f005d0e29f6efdc63076e1e220b60
Signed-off-by: Deepak S <deepak.s@linux.intel.com>
7 years agoBugFix: Upgrade python-novaclient and other dependencies 73/25673/3
JingLu5 [Thu, 8 Dec 2016 11:49:46 +0000 (19:49 +0800)]
BugFix: Upgrade python-novaclient and other dependencies

JIRA: YARDSTICK-454

The python-novalient need to upgraded to fix the error in jenkin CI joid environment.
Related dependencies also need to be updated.

Change-Id: I63ce57aadbd46f159df2b5371caf3725e311ab34
Signed-off-by: JingLu5 <lvjing5@huawei.com>
7 years agoenv: convert file open to context manager 89/25589/1
Ross Brattain [Wed, 7 Dec 2016 05:26:16 +0000 (00:26 -0500)]
env: convert file open to context manager

always use context managers to open file

Change-Id: I2c894ea87a94789edbed4a4da1fa906b28556664
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agoBugfix: update Yardstick custom VM image name in user guide 79/25579/1
JingLu5 [Wed, 7 Dec 2016 03:26:07 +0000 (11:26 +0800)]
Bugfix: update Yardstick custom VM image name in user guide

JIRA: YARDSTICK-451

Change-Id: Ie6e4a0b924f4ee047756b954e88c50621e0b596f
Signed-off-by: JingLu5 <lvjing5@huawei.com>
7 years agoMerge "update grafana dashboard opnfv_yardstick_tc002"
Rex Lee [Tue, 6 Dec 2016 10:36:30 +0000 (10:36 +0000)]
Merge "update grafana dashboard opnfv_yardstick_tc002"

7 years agoupdate grafana dashboard opnfv_yardstick_tc002 29/25529/3
rexlee8776 [Tue, 6 Dec 2016 09:30:57 +0000 (17:30 +0800)]
update grafana dashboard opnfv_yardstick_tc002

JIRA: YARDSTICK-447

Change-Id: Iba97948eb9db2d8f22b31fdfc6e09570ed6b11b9
Signed-off-by: rexlee8776 <limingjiang@huawei.com>
7 years agoBugfix: create stack failed due to not export EXTERNAL_NETWORK environment viarable 21/25521/1
chenjiankun [Tue, 6 Dec 2016 09:15:33 +0000 (09:15 +0000)]
Bugfix: create stack failed due to not export EXTERNAL_NETWORK environment viarable

JIRA: YARDSTICK-449

Now if we run prepare env, we will not source the EXTERNAL_NETWORK.
I will source the EXTERNAL_NETWORK after I get it.

Change-Id: I917fcecae2cac13b7511667c0687d10eccfac751
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoChange grafana default dashboard from ping to opnfv_yardstick_tc002 97/25497/1
chenjiankun [Mon, 5 Dec 2016 14:31:46 +0000 (14:31 +0000)]
Change grafana default dashboard from ping to opnfv_yardstick_tc002

JIRA: YARDSTICK-447

Now the grafana default dashboard use the sample/ping.yaml test case.
I will change it to opnfv_yardstick_tc002 because it is the release test
case.

Change-Id: If20ca123d0407ad92b49f7d2dac98faa2a01e195
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agouse context manager for stdin files and use _put_file_shell 57/24957/11
Ross Brattain [Thu, 1 Dec 2016 03:56:38 +0000 (19:56 -0800)]
use context manager for stdin files and use _put_file_shell

requires https://gerrit.opnfv.org/gerrit/#/c/25183/

use new ssh method _put_file_shell to upload files.
We have to use _put_file_shell because we rely on ~/ path
expansions.  Eventually we should move to remote absolute
paths so we can use sftp upload.

For ssh.execute() replace open() with context manager

context managers were invented partly to control
freeing resources.  Opening files without closing
them will leak file descriptors.

The old standard method for closing files:

f = open('data.txt')
try:
    data = f.read()
finally:
    f.close()

was replaced with a context manager

with open('data.txt') as f:
    data = f.read()

Reference:  Raymond Hettinger's Pycon 2013 presentation:
https://speakerdeck.com/pyconslides/transforming-code-into-beautiful-idiomatic-python-by-raymond-hettinger-1

Video: https://youtu.be/OSGv2VnC0go?t=2522

Always use context managers for files

Update:
   rebased now that _put_file_shell was merged

Change-Id: Iabfc0e43aa3b7766d7c658115e13d21c31efb2a9
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agoBugfix: create yardstick.conf file failed due to wrong config file path 81/25481/1
chenjiankun [Mon, 5 Dec 2016 10:48:35 +0000 (10:48 +0000)]
Bugfix: create yardstick.conf file failed due to wrong config file path

JIRA: YARDSTICK-446

now the yardstick dispatcher config path is set to
/etc/yardstick/config.yaml which is wrong.
I will change it to /etc/yardstick/yardstick.conf

Change-Id: I4cd5436bf64f3b764f6bb102eff3443e765fffe9
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoBugfix: easy_install -U setuptools go wrong due to the setuptools version 73/25473/1
chenjiankun [Mon, 5 Dec 2016 08:53:25 +0000 (08:53 +0000)]
Bugfix: easy_install -U setuptools go wrong due to the setuptools version

JIRA: YARDSTICK-445

Currently we do not set the setuptools version.
Now the setuptools version update to the 30.2.0, but when run
easy_install -U setuptools, it goes wrong.
So I set the setuptools version to 30.0.0

Change-Id: Id7ae232cce6d088355f71a7124688cb625d18457
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "argsAlreadyParsedError: arguments already parsed: cannot register CLI option"
Rex Lee [Mon, 5 Dec 2016 06:40:58 +0000 (06:40 +0000)]
Merge "argsAlreadyParsedError: arguments already parsed: cannot register CLI option"

7 years agoMerge "fix SSH object examples to use correct context manager form"
Rex Lee [Mon, 5 Dec 2016 06:38:48 +0000 (06:38 +0000)]
Merge "fix SSH object examples to use correct context manager form"

7 years agoMerge "import new _put_file_shell method from upstream rally"
Rex Lee [Mon, 5 Dec 2016 06:37:08 +0000 (06:37 +0000)]
Merge "import new _put_file_shell method from upstream rally"

7 years agoMerge "Making nginx and uwsgi service start when run docker by using supervisor"
Rex Lee [Mon, 5 Dec 2016 06:33:43 +0000 (06:33 +0000)]
Merge "Making nginx and uwsgi service start when run docker by using supervisor"

7 years agoMerge "Bugfix: debug should be default off"
Jing Lu [Mon, 5 Dec 2016 06:29:44 +0000 (06:29 +0000)]
Merge "Bugfix: debug should be default off"

7 years agoenhance test cases description and provide more info(in progress) 39/24339/16
JingLu5 [Tue, 15 Nov 2016 03:42:10 +0000 (11:42 +0800)]
enhance test cases description and provide more info(in progress)

JIRA: YARDSTICK-389

This work is about to improve test case.rst to provide more info

Change-Id: If27fe462a43f6344a06e61944b72e912d2a516b7
Signed-off-by: JingLu5 <lvjing5@huawei.com>