yardstick.git
7 years agoMerge "Add API(v2) to get all test suite"
Rex Lee [Fri, 21 Jul 2017 01:15:28 +0000 (01:15 +0000)]
Merge "Add API(v2) to get all test suite"

7 years agoMerge "Add API(v2) to create test suite"
Rex Lee [Fri, 21 Jul 2017 01:15:05 +0000 (01:15 +0000)]
Merge "Add API(v2) to create test suite"

7 years agoMerge "Add API to delete certain test case"
Rex Lee [Fri, 21 Jul 2017 01:14:50 +0000 (01:14 +0000)]
Merge "Add API to delete certain test case"

7 years agoMerge "Add API(v2) to get certain test case info"
Rex Lee [Fri, 21 Jul 2017 01:14:35 +0000 (01:14 +0000)]
Merge "Add API(v2) to get certain test case info"

7 years agoMerge "Add API(v2) to get all test case info"
Rex Lee [Fri, 21 Jul 2017 01:14:24 +0000 (01:14 +0000)]
Merge "Add API(v2) to get all test case info"

7 years agoMerge "Add API(v2) to upload test case"
Rex Lee [Fri, 21 Jul 2017 01:14:10 +0000 (01:14 +0000)]
Merge "Add API(v2) to upload test case"

7 years agoMerge "Add API(v2) to add case to task"
Rex Lee [Fri, 21 Jul 2017 01:11:49 +0000 (01:11 +0000)]
Merge "Add API(v2) to add case to task"

7 years agoMerge "Add API(v2) to delete certain task"
Jing Lu [Fri, 21 Jul 2017 01:10:35 +0000 (01:10 +0000)]
Merge "Add API(v2) to delete certain task"

7 years agoMerge "Add API(v2) to get certain task info"
Rex Lee [Fri, 21 Jul 2017 01:07:34 +0000 (01:07 +0000)]
Merge "Add API(v2) to get certain task info"

7 years agoMerge "Add API(v2) to add environment to task"
Rex Lee [Fri, 21 Jul 2017 01:07:18 +0000 (01:07 +0000)]
Merge "Add API(v2) to add environment to task"

7 years agoMerge "Add API(v2) to create task"
Rex Lee [Fri, 21 Jul 2017 01:05:44 +0000 (01:05 +0000)]
Merge "Add API(v2) to create task"

7 years agoMerge "Add API(v2) to delete certain project"
Rex Lee [Fri, 21 Jul 2017 01:04:25 +0000 (01:04 +0000)]
Merge "Add API(v2) to delete certain project"

7 years agoMerge changes from topics 'get_project', 'get_projects'
Rex Lee [Fri, 21 Jul 2017 01:03:42 +0000 (01:03 +0000)]
Merge changes from topics 'get_project', 'get_projects'

* changes:
  Add API(V2) to get certain project info
  Add API(v2) to get all projects info

7 years agoMerge "Add API(v2) to create project"
Rex Lee [Fri, 21 Jul 2017 01:02:08 +0000 (01:02 +0000)]
Merge "Add API(v2) to create project"

7 years agoAdd API(v2) to get all test suite 31/37831/1
chenjiankun [Thu, 20 Jul 2017 04:13:14 +0000 (04:13 +0000)]
Add API(v2) to get all test suite

JIRA: YARDSTICK-747

API: /api/v2/yardstick/testsuites
METHOD: GET

Change-Id: I2375b6d2ea54704f5a2328cc8110058af038e777
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(v2) to create test suite 29/37829/1
chenjiankun [Thu, 20 Jul 2017 04:04:40 +0000 (04:04 +0000)]
Add API(v2) to create test suite

JIRA: YARDSTICK-746

API: /api/v2/yardstick/testsuites/action
METHOD: POST
PARAMS:
{
    'action': 'create_suite',
    'args': {
        'name': 'case_name',
        'testcases': [
            'opnfv_yardstick_tc002'
        ]
    }
}

Change-Id: I7e07c599e64e7eedda274c72344e394f5535f055
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API to delete certain test case 25/37825/1
chenjiankun [Thu, 20 Jul 2017 03:52:34 +0000 (03:52 +0000)]
Add API to delete certain test case

JIRA: YARDSTICK-745

API: /api/v2/yardstick/testcases/<case_name>
METHOD: DELETE

Change-Id: Ic75ee60abfc00d20328ee45b9830dea1fe464482
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(v2) to get certain test case info 23/37823/1
chenjiankun [Thu, 20 Jul 2017 03:46:17 +0000 (03:46 +0000)]
Add API(v2) to get certain test case info

JIRA: YARDSTICK-744

API: /api/v2/yardstick/testcases
METHOD: GET

Change-Id: I4b1867f713bce2f9f2342ecec8540b08b0bb3456
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(v2) to get all test case info 21/37821/1
chenjiankun [Thu, 20 Jul 2017 03:36:38 +0000 (03:36 +0000)]
Add API(v2) to get all test case info

JIRA: YARDSTICK-743

API: /api/v2/yardstick/testcases
METHOD: GET

Change-Id: Iced97206cb4c5f68ee8a5729af937e8d45ca6e87
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(v2) to upload test case 19/37819/1
chenjiankun [Thu, 20 Jul 2017 03:30:58 +0000 (03:30 +0000)]
Add API(v2) to upload test case

JIRA: YARDSTICK-742

API: /api/v2/yardstick/testcases/action
METHOD: POST
PARAMS:
{
   'action': 'upload_case',
    'args': {
        'file': file
    }
}

Change-Id: Id305e72a24ec28295ac4bae5e5b9ad83eb2c1e34
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(v2) to add case to task 79/37779/2
chenjiankun [Wed, 19 Jul 2017 10:19:13 +0000 (10:19 +0000)]
Add API(v2) to add case to task

JIRA: YARDSTICK-739

API: /api/v2/yardstick/tasks/<task_id>
METHOD: PUT
PARAMS:
{
    'action': 'add_case',
    'args': {
        'case_name': 'opnfv_yardstick_tc002',
        'case_content': case_content
    }
}

Change-Id: I53e71e3d662399b08029ed417b5873a4775ca32d
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(v2) to delete certain task 75/37775/2
chenjiankun [Wed, 19 Jul 2017 10:01:05 +0000 (10:01 +0000)]
Add API(v2) to delete certain task

JIRA: YARDSTICK-738

API: /api/v2/yardstick/tasks/<task_id>
METHOD: DELETE

Change-Id: I28215d2cae63551455abacc4142cff3c4aaed281
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(v2) to get certain task info 71/37771/1
chenjiankun [Wed, 19 Jul 2017 09:44:05 +0000 (09:44 +0000)]
Add API(v2) to get certain task info

JIRA: YARDSTICK-737

API: /api/v2/yardstick/tasks/<task_id>
METHOD: GET

Change-Id: Ia360f4bba05e196e07c9eb339061ccfbf5df8137
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(v2) to add environment to task 67/37767/1
chenjiankun [Wed, 19 Jul 2017 09:33:04 +0000 (09:33 +0000)]
Add API(v2) to add environment to task

JIRA: YARDSTICK-736

API: /api/v2/yardstick/tasks/<task_id>
METHOD: PUT
PARAMS:
{
    'action': 'add_environment',
    'args': {
        'environment_id': environment_id
    }
}

Change-Id: Idc31cb21de882d008202b6395158e9f9aa9244db
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(v2) to create task 59/37759/1
chenjiankun [Wed, 19 Jul 2017 08:47:10 +0000 (08:47 +0000)]
Add API(v2) to create task

JIRA: YARDSTICK-735

API: /api/v2/yardstick/tasks/action
METHOD: POST
PARAMS:
{
    'action': 'create_task',
    'args': {
        'name': 'task1',
        'project_id': project_id
    }
}

Change-Id: I1f9c743f32bbcff999e37cf53ebfa96b41c61e5e
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "Add API(v2) to delete container"
Jing Lu [Wed, 19 Jul 2017 08:18:22 +0000 (08:18 +0000)]
Merge "Add API(v2) to delete container"

7 years agoMerge "Add API(v2) to get container info"
Jing Lu [Wed, 19 Jul 2017 08:18:06 +0000 (08:18 +0000)]
Merge "Add API(v2) to get container info"

7 years agoMerge "Add API(v2) to create grafana"
Jing Lu [Wed, 19 Jul 2017 08:17:49 +0000 (08:17 +0000)]
Merge "Add API(v2) to create grafana"

7 years agoMerge "Add API(v2) to create influxdb"
Jing Lu [Wed, 19 Jul 2017 08:17:38 +0000 (08:17 +0000)]
Merge "Add API(v2) to create influxdb"

7 years agoMerge "Add API(v2) to delete pod"
Jing Lu [Wed, 19 Jul 2017 08:17:25 +0000 (08:17 +0000)]
Merge "Add API(v2) to delete pod"

7 years agoAdd API(v2) to delete certain project 55/37755/1
chenjiankun [Wed, 19 Jul 2017 08:15:31 +0000 (08:15 +0000)]
Add API(v2) to delete certain project

JIRA: YARDSTICK-734

API: /api/v2/yardstick/projects/<project_id>
METHOD: DELETE

Change-Id: I6628ec42aa7c4c6ab073ddc33c119ea1c03b81fe
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(V2) to get certain project info 51/37751/1
chenjiankun [Wed, 19 Jul 2017 08:02:40 +0000 (08:02 +0000)]
Add API(V2) to get certain project info

JIRA: YARDSTICK-733

API: /api/v2/yardstick/projects/<project_id>
METHOD: GET

Change-Id: I20a615af96229aefac6ef86566a7b9c5d42f9633
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(v2) to get all projects info 35/37735/1
chenjiankun [Wed, 19 Jul 2017 07:21:24 +0000 (07:21 +0000)]
Add API(v2) to get all projects info

JIRA: YARDSTICK-732

API: /api/v2/yardstick/projects
METHOD: GET

Change-Id: Ifd67f11f516270d96c0e80b5b8c76a939583d9e5
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(v2) to create project 33/37733/1
chenjiankun [Wed, 19 Jul 2017 06:52:52 +0000 (06:52 +0000)]
Add API(v2) to create project

JIRA: YARDSTICK-731

API: /api/v2/yardstick/projects/action
METHOD: POST
PARAMS:
{
    'action': 'create_project',
    'args': {
        'name': 'project1'
    }
}

Change-Id: I92332dec8dcf3253f0cbf1668332ce5110111d73
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "test_base: speedup unittest, wait for queue not empty"
Ross Brattain [Mon, 17 Jul 2017 16:46:04 +0000 (16:46 +0000)]
Merge "test_base: speedup unittest, wait for queue not empty"

7 years agoAdd API(v2) to delete container 05/37605/1
chenjiankun [Mon, 17 Jul 2017 08:15:57 +0000 (08:15 +0000)]
Add API(v2) to delete container

JIRA: YARDSTICK-729

API: /api/v2/yardstick/containers/<container_id>
METHOD: DELETE

Change-Id: I4cda76329edd7b988a357f1fcb2b5041bf48be64
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(v2) to get container info 03/37603/1
chenjiankun [Mon, 17 Jul 2017 07:54:46 +0000 (07:54 +0000)]
Add API(v2) to get container info

JIRA: YARDSTICK-728

API: /api/v2/yardstick/containers/<container_id>
METHOD: GET

Change-Id: Iba34e6c6dd84573dc9d5914a584d920678c0de36
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(v2) to create grafana 01/37601/1
chenjiankun [Mon, 17 Jul 2017 07:40:09 +0000 (07:40 +0000)]
Add API(v2) to create grafana

JIRA: YARDSTICK-727

API: /api/v2/yardstick/containers/action
METHOD: POST
PARAMS:
{
    'action': 'create_influxdb',
    'args': {
        'environment_id': environment_id
    }
}

Change-Id: I12fc23261ba62df6f923a4d34455ad8b46c4aa8f
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "attacker_process: fix typo s/envrioment/environment/"
Rex Lee [Mon, 17 Jul 2017 06:18:54 +0000 (06:18 +0000)]
Merge "attacker_process: fix typo s/envrioment/environment/"

7 years agoMerge "test_nstat: speedup unittests, sleep for 0 seconds"
Ross Brattain [Mon, 17 Jul 2017 06:14:57 +0000 (06:14 +0000)]
Merge "test_nstat: speedup unittests, sleep for 0 seconds"

7 years agoAdd API(v2) to create influxdb 85/37585/5
chenjiankun [Mon, 17 Jul 2017 02:10:34 +0000 (02:10 +0000)]
Add API(v2) to create influxdb

JIRA: YARDSTICK-726

API: /api/v2/yardstick/containers/action
METHOD: POST
PARAMS:
{
    'action': 'create_influxdb',
    'args': {
        'environment_id': environment_id
    }
}

Change-Id: I20961fc6ae9918c894de7fabd3f81ca966bd24cd
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "pktgen: speedup unittest, mock time.sleep"
Ross Brattain [Mon, 17 Jul 2017 04:40:11 +0000 (04:40 +0000)]
Merge "pktgen: speedup unittest, mock time.sleep"

7 years agoMerge "tg: speedup unittests, mock time.sleep"
Ross Brattain [Mon, 17 Jul 2017 04:21:49 +0000 (04:21 +0000)]
Merge "tg: speedup unittests, mock time.sleep"

7 years agoMerge "test_pktgen_dpdk_throughput: speedup unittest, mock time.sleep()"
Ross Brattain [Mon, 17 Jul 2017 04:20:39 +0000 (04:20 +0000)]
Merge "test_pktgen_dpdk_throughput: speedup unittest, mock time.sleep()"

7 years agotest_nstat: speedup unittests, sleep for 0 seconds 63/37463/3
Ross Brattain [Fri, 14 Jul 2017 05:03:35 +0000 (22:03 -0700)]
test_nstat: speedup unittests, sleep for 0 seconds

Change-Id: I3f961e26fb045ea7501dc3a5b630b3ef94fec3ee
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agotest_heat: ipaddress expects unicode inputs 99/37599/2
Ross Brattain [Mon, 17 Jul 2017 03:46:27 +0000 (20:46 -0700)]
test_heat: ipaddress expects unicode inputs

weird error

E           AddressValueError: '10.20.0.0/15' does not appear to be an IPv4 or IPv6 network. Did you pass in a bytes (str in Python 2) instead of a unicode object?

I guess we need to convert the stack.outputs mock to unicode

FAILED
tests/unit/benchmark/contexts/test_heat.py:137 (HeatContextTestCase.test_add_server_port)
self = <tests.unit.benchmark.contexts.test_heat.HeatContextTestCase testMethod=test_add_server_port>

    def test_add_server_port(self):
        network1 = mock.MagicMock()
        network1.vld_id = 'vld111'
        network2 = mock.MagicMock()
        network2.vld_id = 'vld777'
        self.test_context.name = 'foo'
        self.test_context.stack = mock.MagicMock()
        self.test_context.networks = {
            'a': network1,
            'c': network2,
        }
        self.test_context.stack.outputs = {
            'b': '10.20.30.45',
            'b-subnet_id': 1,
            'foo-a-subnet-cidr': '10.20.0.0/15',
            'foo-a-subnet-gateway_ip': '10.20.30.1',
            'b-mac_address': '00:01',
            'b-device_id': 'dev21',
            'b-network_id': 'net789',
            'd': '40.30.20.15',
            'd-subnet_id': 2,
            'foo-c-subnet-cidr': '40.30.0.0/18',
            'foo-c-subnet-gateway_ip': '40.30.20.254',
            'd-mac_address': '00:10',
            'd-device_id': 'dev43',
            'd-network_id': 'net987',
        }
        server = mock.MagicMock()
        server.ports = OrderedDict([
            ('a', {'stack_name': 'b'}),
            ('c', {'stack_name': 'd'}),
        ])

        expected = {
            "private_ip": '10.20.30.45',
            "subnet_id": 1,
            "subnet_cidr": '10.20.0.0/15',
            "network": '10.20.0.0',
            "netmask": '255.254.0.0',
            "gateway_ip": '10.20.30.1',
            "mac_address": '00:01',
            "device_id": 'dev21',
            "network_id": 'net789',
            "network_name": 'a',
            "local_mac": '00:01',
            "local_ip": '10.20.30.45',
            "vld_id": 'vld111',
        }
>       self.test_context.add_server_port(server)

tests/unit/benchmark/contexts/test_heat.py:186:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
yardstick/benchmark/contexts/heat.py:307: in add_server_port
    network_name, port['stack_name'], self.stack.outputs)
yardstick/benchmark/contexts/heat.py:315: in make_interface_dict
    subnet_ip = ipaddress.ip_network(subnet_cidr)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

address = '10.20.0.0/15', strict = True

    def ip_network(address, strict=True):
        """Take an IP string/int and return an object of the correct type.

        Args:
            address: A string or integer, the IP network.  Either IPv4 or
              IPv6 networks may be supplied; integers less than 2**32 will
              be considered to be IPv4 by default.

        Returns:
            An IPv4Network or IPv6Network object.

        Raises:
            ValueError: if the string passed isn't either a v4 or a v6
              address. Or if the network has host bits set.

        """
        try:
            return IPv4Network(address, strict)
        except (AddressValueError, NetmaskValueError):
            pass

        try:
            return IPv6Network(address, strict)
        except (AddressValueError, NetmaskValueError):
            pass

        if isinstance(address, bytes):
            raise AddressValueError(
                '%r does not appear to be an IPv4 or IPv6 network. '
                'Did you pass in a bytes (str in Python 2) instead of'
>               ' a unicode object?' % address)
E           AddressValueError: '10.20.0.0/15' does not appear to be an IPv4 or IPv6 network. Did you pass in a bytes (str in Python 2) instead of a unicode object?

../../yardstick/yardstick_venv/lib/python2.7/site-packages/ipaddress.py:199: AddressValueError

Change-Id: Ie3b087a26a054203573eaa9b13c3e90152bba6a9
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agoMerge "test_tg_rfc2544_trex: speedup unittest, set time.sleep(0)"
Ross Brattain [Mon, 17 Jul 2017 03:56:09 +0000 (03:56 +0000)]
Merge "test_tg_rfc2544_trex: speedup unittest, set time.sleep(0)"

7 years agotest_tg_rfc2544_trex: speedup unittest, set time.sleep(0) 31/37331/4
Ross Brattain [Thu, 13 Jul 2017 04:05:22 +0000 (21:05 -0700)]
test_tg_rfc2544_trex: speedup unittest, set time.sleep(0)

Change-Id: I6fdae629bdbd45cba715a838c41613b914a3abcb
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agotest_delete_all_calls_delete: fix delete mock 93/37593/2
Ross Brattain [Mon, 17 Jul 2017 03:31:38 +0000 (20:31 -0700)]
test_delete_all_calls_delete: fix delete mock

we need to mock HeatStack.delete() before
we instantiate otherwise we can't
reach the instantiated objects delete() method

we need to patch the class so we patch all instances

Change-Id: I36f9476dcfb83e2d583c5a9f72dc27fce57258eb
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agotest_heat: don't waste 2 seconds in unittest 95/37595/1
Ross Brattain [Fri, 14 Jul 2017 06:05:45 +0000 (23:05 -0700)]
test_heat: don't waste 2 seconds in unittest

remove duration checks and test with sleep 0

Change-Id: I22516cde56ac3a02358ca9c3e652cead10580d76
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agoMerge "Bugfix: kubernetes context do not implement _get_network"
Jing Lu [Mon, 17 Jul 2017 03:15:13 +0000 (03:15 +0000)]
Merge "Bugfix: kubernetes context do not implement _get_network"

7 years agoBugfix: kubernetes context do not implement _get_network 87/37587/2
chenjiankun [Mon, 17 Jul 2017 02:32:47 +0000 (02:32 +0000)]
Bugfix: kubernetes context do not implement _get_network

Since kubernetes context do not implement _get_network,
so when run unit test case, we will get a error:

    TypeError: Can't instantiate abstract class KubernetesContext with
    abstract methods _get_network

Change-Id: Ib56abe7c580ef8a6fc9f52f3fcd566d0fa70e1cc
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "apexlake: speed unittest, mock time.sleep"
Ross Brattain [Mon, 17 Jul 2017 03:09:35 +0000 (03:09 +0000)]
Merge "apexlake: speed unittest, mock time.sleep"

7 years agoMerge "test_attacker_baremetal: don't run local commands"
Ross Brattain [Mon, 17 Jul 2017 03:08:47 +0000 (03:08 +0000)]
Merge "test_attacker_baremetal: don't run local commands"

7 years agoMerge "Kubernetes (k8s) support"
Jing Lu [Mon, 17 Jul 2017 01:58:00 +0000 (01:58 +0000)]
Merge "Kubernetes (k8s) support"

7 years agoMerge "add network info to topology"
Rex Lee [Mon, 17 Jul 2017 01:15:07 +0000 (01:15 +0000)]
Merge "add network info to topology"

7 years agoKubernetes (k8s) support 37/36537/16
chenjiankun [Tue, 27 Jun 2017 03:20:08 +0000 (03:20 +0000)]
Kubernetes (k8s) support

JIRA: YARDSTICK-682

We decide to support k8s in E release.
We need to discuss with openretriver team and then rewrite the ping
test case under k8s as the first step.

Change-Id: I3f81ebca8de5c1f3a8b7d42581cd7342dc320239
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoadd release date 57/37557/1
Ross Brattain [Sat, 15 Jul 2017 04:59:21 +0000 (21:59 -0700)]
add release date

Change-Id: Icf12b7a59144754f65f67ed54a5c455a64c5042f
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agoDanube 3.1 release notes 51/36451/4
Ross Brattain [Sun, 25 Jun 2017 22:36:21 +0000 (15:36 -0700)]
Danube 3.1 release notes

Change-Id: I7032dd2348dd7212484a4a3cbd40e1d7698c8668
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agoAdd API(v2) to delete pod 85/37485/1
chenjiankun [Fri, 14 Jul 2017 03:54:06 +0000 (03:54 +0000)]
Add API(v2) to delete pod

JIRA: YARDSTICK-725

API: /api/v2/yardstick/pods/<pod_id>
METHOD: DELETE

Change-Id: Ib9e9f9ced455c4ee3b6e1f63d773ea2e3ee906a6
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "Initial all url of api v2"
Jing Lu [Fri, 14 Jul 2017 08:38:41 +0000 (08:38 +0000)]
Merge "Initial all url of api v2"

7 years agoattacker_process: fix typo s/envrioment/environment/ 81/37481/1
Ross Brattain [Fri, 14 Jul 2017 08:24:25 +0000 (01:24 -0700)]
attacker_process: fix typo s/envrioment/environment/

Change-Id: I1e5db657eb88c73b5d9223c47e2d97dc79eec1f1
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agoMerge "test_monitor_command: mock LOG so we don't output error"
Ross Brattain [Fri, 14 Jul 2017 08:09:50 +0000 (08:09 +0000)]
Merge "test_monitor_command: mock LOG so we don't output error"

7 years agoInitial all url of api v2 77/37477/1
chenjiankun [Fri, 14 Jul 2017 07:12:03 +0000 (07:12 +0000)]
Initial all url of api v2

JIRA: YARDSTICK-648

Change-Id: I915889a974da9c49188c25fe2443ece481987ecb
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(v2) to get pod info 57/37457/2
chenjiankun [Fri, 14 Jul 2017 03:39:06 +0000 (03:39 +0000)]
Add API(v2) to get pod info

JIRA: YARDSTICK-724

API: /api/v2/yardstick/pods/<pod_id>
METHOD: GET

Change-Id: I49608eab1f1625cd4358732da052ce3745e28c24
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agotest_attacker_baremetal: don't run local commands 69/37469/4
Ross Brattain [Fri, 14 Jul 2017 06:03:46 +0000 (23:03 -0700)]
test_attacker_baremetal: don't run local commands

these tests were failing to mock subprocess.check_output
and thus were trying to run sudo commands on the local
system.

This is dangerous.  Add the subprocess mock.

Also mock the LOG object so we don't print
bogus Runtime error tracebacks in the unittest logs
when we test assertRaises()

Change-Id: I01535f9952fbd95ce2f5972b641c51ff836e7e8c
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agotest_monitor_command: mock LOG so we don't output error 71/37471/2
Ross Brattain [Fri, 14 Jul 2017 06:14:07 +0000 (23:14 -0700)]
test_monitor_command: mock LOG so we don't output error

Don't print fake tracebacks to the unittest logs

Change-Id: I8a468b8c6566f02be88a9dd222567c14c66b0956
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agoMerge "Add API(v2) to delete openrc"
Rex Lee [Fri, 14 Jul 2017 06:15:25 +0000 (06:15 +0000)]
Merge "Add API(v2) to delete openrc"

7 years agoAdd API(v2) to upload pod file 55/37455/2
chenjiankun [Fri, 14 Jul 2017 03:27:43 +0000 (03:27 +0000)]
Add API(v2) to upload pod file

JIRA: YARDSTICK-723

API: /api/v2/yardstick/pods/action
METHOD: POST
PARAMS:
{
    'action': 'upload_pod_file',
    'args': {
        'file': file,
        'environment_id': environment_id
    }
}

Change-Id: I5eb065d8b46080a94c989ec9b8217dc54900bd06
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(v2) to delete openrc 47/37447/2
chenjiankun [Fri, 14 Jul 2017 01:49:52 +0000 (01:49 +0000)]
Add API(v2) to delete openrc

JIRA: YARDSTICK-722

API: /api/v2/yardstick/environments/openrcs/<openrc_id>
METHOD: DELETE

Change-Id: Ia0989fe74681654750af80ddb935bb3e63485f43
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(v2) to get openrc info 45/37445/2
chenjiankun [Fri, 14 Jul 2017 01:38:47 +0000 (01:38 +0000)]
Add API(v2) to get openrc info

JIRA: YARDSTICK-721

API: /api/v2/yardstick/environments/openrcs/<openrc_id>
METHOD: GET

Change-Id: I57241381cf50fef0dc4eec3281c01ba106262a5a
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(v2) to update openrc 43/37443/2
chenjiankun [Fri, 14 Jul 2017 01:01:19 +0000 (01:01 +0000)]
Add API(v2)  to update openrc

JIRA: YARDSTICK-720

API: /api/v2/yardstick/environments/openrcs/action
METHOD: POST
PARAMS:
{
    'action': 'update_openrc',
        'args': {
            'openrc': {
                "EXTERNAL_NETWORK": "ext-net",
                "OS_AUTH_URL": "http://192.168.23.51:5000/v3",
                "OS_IDENTITY_API_VERSION": "3",
                "OS_IMAGE_API_VERSION": "2",
                "OS_PASSWORD": "console",
                "OS_PROJECT_DOMAIN_NAME": "default",
                "OS_PROJECT_NAME": "admin",
                "OS_TENANT_NAME": "admin",
                "OS_USERNAME": "admin",
                "OS_USER_DOMAIN_NAME": "default"
            },
            'environment_id': environment_id
        }
}

Change-Id: Ie9a1614190a01456fd0896f0bdfd05f9d0724fc6
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API(v2) to upload openrc 55/37355/3
chenjiankun [Thu, 13 Jul 2017 09:39:20 +0000 (09:39 +0000)]
Add API(v2) to upload openrc

JIRA: YARDSTICK-719

API: /api/v2/yardstick/environments/openrcs/action
METHOD: POST
PARAMS:
{
    'action': 'upload_openrc',
    'args': {
        'file': file,
        'environment_id': environment_id
    }
}

Change-Id: If367904a2d0c2d4a192fdc87a8da21ac6549269e
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "Add API to delete single environment"
Rex Lee [Fri, 14 Jul 2017 04:01:24 +0000 (04:01 +0000)]
Merge "Add API to delete single environment"

7 years agoMerge "Add API to get single environment info"
Rex Lee [Fri, 14 Jul 2017 03:59:18 +0000 (03:59 +0000)]
Merge "Add API to get single environment info"

7 years agoMerge "Add API to get environments"
Rex Lee [Fri, 14 Jul 2017 03:56:16 +0000 (03:56 +0000)]
Merge "Add API to get environments"

7 years agoMerge "test_monitor_multi: speedup unittests, sleep less"
Ross Brattain [Fri, 14 Jul 2017 03:55:31 +0000 (03:55 +0000)]
Merge "test_monitor_multi: speedup unittests, sleep less"

7 years agoMerge "test_storperf: speedup unittest, use time.sleep(0)"
Ross Brattain [Fri, 14 Jul 2017 03:55:27 +0000 (03:55 +0000)]
Merge "test_storperf: speedup unittest, use time.sleep(0)"

7 years agoMerge "Add API to create environment"
Rex Lee [Fri, 14 Jul 2017 03:53:12 +0000 (03:53 +0000)]
Merge "Add API to create environment"

7 years agoadd network info to topology 45/36745/17
Ross Brattain [Mon, 22 May 2017 04:07:50 +0000 (21:07 -0700)]
add network info to topology

we need to know which network each port is connected to
so we can find VLAN or VXLAN ID.

To do this we implement a new method for Contexts,
Context.get_network().  This method is similar to
Context.get_server(), it searches for a given
network name in all the contexts.

From this we generate a context_cfg["networks"]
dict that stores all the network info for the nodes
in the scenario.

Then when we generate the topology for VNFD, we can
lookup a given network by the vld_id and get the
network_type, segmentation_id, etc.

Then if we need to for example generated
traffic on a given VLAN or VXLAN, we have this
info available.

Define default nd_route_tbl for ACL VNF
we need default empty nd_route_tbl for IPv6 route.

Change-Id: I9f9cfbd6acabeb4ae4675ca7354390efa57b29e7
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com>
7 years agotest_monitor_multi: speedup unittests, sleep less 41/37441/1
Ross Brattain [Thu, 13 Jul 2017 21:38:23 +0000 (14:38 -0700)]
test_monitor_multi: speedup unittests, sleep less

Change-Id: I306e8e5525c3722179a5321988cad76190b93951
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agotest_storperf: speedup unittest, use time.sleep(0) 35/37435/1
Ross Brattain [Thu, 13 Jul 2017 04:04:29 +0000 (21:04 -0700)]
test_storperf: speedup unittest, use time.sleep(0)

Change-Id: I3923d75c1ae7974c7803b0ad6997a5ad0fece11d
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agotest_pktgen_dpdk_throughput: speedup unittest, mock time.sleep() 29/37329/2
Ross Brattain [Thu, 13 Jul 2017 04:05:56 +0000 (21:05 -0700)]
test_pktgen_dpdk_throughput: speedup unittest, mock time.sleep()

Change-Id: I74bbdee1a503ef9bad32db7d4444921f6730f465
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agotest_vpe_vnf: speedup unittest, mock time 27/37327/2
Ross Brattain [Thu, 13 Jul 2017 04:09:55 +0000 (21:09 -0700)]
test_vpe_vnf: speedup unittest, mock time

Change-Id: I046fae81c23555573df7d9e2e80995499062cf38
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agoapexlake: speed unittest, mock time.sleep 33/37433/1
Ross Brattain [Thu, 13 Jul 2017 18:20:08 +0000 (11:20 -0700)]
apexlake: speed unittest, mock time.sleep

Change-Id: I40cbcd1963bbb2481282c34b2360c77a5bef109b
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agotg: speedup unittests, mock time.sleep 31/37431/1
Ross Brattain [Thu, 13 Jul 2017 18:20:42 +0000 (11:20 -0700)]
tg: speedup unittests, mock time.sleep

Change-Id: Ia6207c898653c3ba21b22e9c309e7abb25d5cd32
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agopktgen: speedup unittest, mock time.sleep 29/37429/1
Ross Brattain [Thu, 13 Jul 2017 18:21:01 +0000 (11:21 -0700)]
pktgen: speedup unittest, mock time.sleep

Change-Id: I0c6f6b68b30ae72887666a3b9e994dabf7c6a71d
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agotest_base: speedup unittest, wait for queue not empty 27/37427/1
Ross Brattain [Thu, 13 Jul 2017 18:21:27 +0000 (11:21 -0700)]
test_base: speedup unittest, wait for queue not empty

Change-Id: I41a72b1fd7099e404a1cf832de39f15bbc7b46e0
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agoAdd API to delete single environment 49/37349/1
chenjiankun [Thu, 13 Jul 2017 08:20:10 +0000 (08:20 +0000)]
Add API to delete single environment

JIRA: YARDSTICK-718

API: /api/v2/yardstick/environments/<environment_id>
METHOD: DELETE

Change-Id: I2e96b0f786440dea46f6b851d3f10f6cc5a0ab40
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API to get single environment info 43/37343/1
chenjiankun [Thu, 13 Jul 2017 07:24:35 +0000 (07:24 +0000)]
Add API to get single environment info

JIRA: YARDSTICK-717

API: /api/v2/yardstick/environments/<environment_id>
METHOD: GET

Change-Id: I9fe42a48520cc17d0f5416080b3595bd6c269761
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoAdd API to get environments 33/37333/2
chenjiankun [Thu, 13 Jul 2017 06:14:43 +0000 (06:14 +0000)]
Add API to get environments

JIRA: YARDSTICK-716

API: /api/v2/yardstick/environments
METHOD: GET

Change-Id: I46b7fb2b143fe76b6a0edbf1ecc8281187b85918
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoupdate gitignore to exclude *.DS_Store *.log 21/37321/1
rexlee8776 [Thu, 13 Jul 2017 04:02:54 +0000 (12:02 +0800)]
update gitignore to exclude *.DS_Store *.log

Change-Id: Ibd05768eb08336ecfa3f2454ec5548b48944126f
Signed-off-by: rexlee8776 <limingjiang@huawei.com>
7 years agoAdd API to create environment 13/37313/3
chenjiankun [Thu, 13 Jul 2017 02:26:19 +0000 (02:26 +0000)]
Add API to create environment

JIRA: YARDSTICK-715

API: /api/v2/yardstick/environments/action
METHOD: POST
PARAM:
{
    'action': 'create_environment'
}

Change-Id: I58086be3c70cdc3c4c93516bcfd53ba725486600
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoMerge "NSBperf: fix bad sigint handler"
Ross Brattain [Thu, 13 Jul 2017 03:19:54 +0000 (03:19 +0000)]
Merge "NSBperf: fix bad sigint handler"

7 years agoMerge "test_nstat: decrease sleep time for unittest"
Ross Brattain [Thu, 13 Jul 2017 01:20:03 +0000 (01:20 +0000)]
Merge "test_nstat: decrease sleep time for unittest"

7 years agoNSBperf: fix bad sigint handler 03/37303/2
Ross Brattain [Thu, 13 Jul 2017 01:04:03 +0000 (18:04 -0700)]
NSBperf: fix bad sigint handler

This is why we don't do things at module
import time.

when we import this module it makes a bad
sigint handler.  Only load signal handlers
at runtime.

Also fix handler to take *args, **kwargs.

Unittest failures:

>     time.sleep(0.01)
E     TypeError: handler() takes 0 positional arguments but 2 were given

Change-Id: I4296a4bdef0e5f4d58b0503dcbc834f3bef0feeb
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agotest_nstat: decrease sleep time for unittest 01/37301/1
Ross Brattain [Thu, 13 Jul 2017 00:53:17 +0000 (17:53 -0700)]
test_nstat: decrease sleep time for unittest

there is no reason to sleep for a whole
minute during unittest

Change-Id: I206229bcaa7a50af1859f7b04e521955bb6217d4
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agoChange endpoint to url in API 55/37255/4
chenjiankun [Wed, 12 Jul 2017 10:45:17 +0000 (10:45 +0000)]
Change endpoint to url in API

There are come conflict with new architecture.
Also it is more proper to use url as endpoint.

Change-Id: Idce331e36d85d0720bbf3255dca29ba6022e18b2
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
7 years agoconstants: default SERVER_IP to 127.0.0.1 87/33287/7
Ross Brattain [Wed, 12 Apr 2017 04:56:15 +0000 (21:56 -0700)]
constants: default SERVER_IP to 127.0.0.1

When running unittest while connected to P2P VPN,
their is no default route, so we get None.

Instead of using None, default to 127.0.0.1

Not sure why this was renamed to SERVER_IP either,
what do we use this value for?

Still getting py.test unittest failures all the time.

The problem is we lookup influxdb.ip but SERVER_IP is None,
so the lookup fails.

  INFLUXDB_IP = get_param('influxdb.ip', SERVER_IP)

SERVER_IP can't ever be None

Change-Id: Iedb09dc541137f7cdc6ef8d26dd312807985bfa8
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
7 years agoMerge "Yardstick api database v2 model"
Jing Lu [Wed, 12 Jul 2017 02:54:02 +0000 (02:54 +0000)]
Merge "Yardstick api database v2 model"