Delete part of code under qtip/legacy 15/53615/1
authorzhihui wu <wu.zhihui1@zte.com.cn>
Tue, 13 Mar 2018 01:56:09 +0000 (09:56 +0800)
committerzhihui wu <wu.zhihui1@zte.com.cn>
Tue, 13 Mar 2018 01:56:09 +0000 (09:56 +0800)
These code is obsolete.

Change-Id: I0fc2b12847aaa30f713cf7578a92aae912153dd6
Signed-off-by: zhihui wu <wu.zhihui1@zte.com.cn>
42 files changed:
legacy/api/__init__.py [deleted file]
legacy/api/cmd/__init__.py [deleted file]
legacy/api/cmd/server.py [deleted file]
legacy/api/handler/__init__.py [deleted file]
legacy/api/handler/db.py [deleted file]
legacy/api/handler/job_handler.py [deleted file]
legacy/api/handler/result_handler.py [deleted file]
legacy/api/model/__init__.py [deleted file]
legacy/api/model/job_model.py [deleted file]
legacy/api/router/__init__.py [deleted file]
legacy/api/router/mapper.py [deleted file]
legacy/api/router/mapper.py.orig [deleted file]
legacy/cli/helper.py [deleted file]
legacy/config/SampleHeat.yaml [deleted file]
legacy/docker/README.md [deleted file]
legacy/docker/cleanup_qtip_image.sh [deleted file]
legacy/docker/prepare_qtip_image.sh [deleted file]
legacy/docker/push_db.sh [deleted file]
legacy/docker/run_qtip.sh [deleted file]
legacy/tests/__init__.py [deleted file]
legacy/tests/api/__init__.py [deleted file]
legacy/tests/api/test_server.py [deleted file]
legacy/tests/create_zones_test.py [deleted file]
legacy/tests/functional/__init__.py [deleted file]
legacy/tests/functional/yaml_schema_test.py [deleted file]
legacy/tests/helper/perftest.yaml [deleted file]
legacy/tests/helper/suite.yaml [deleted file]
legacy/tests/helper/version.yaml [deleted file]
legacy/tests/spawn_vm_test.py [deleted file]
legacy/utils/__init__.py [deleted file]
legacy/utils/create_zones.py [deleted file]
legacy/utils/dashboard/__init__.py [deleted file]
legacy/utils/dashboard/pushtoDB.py [deleted file]
legacy/utils/report/__init__.py [deleted file]
legacy/utils/report/get_indices.py [deleted file]
legacy/utils/report/get_results.py [deleted file]
legacy/utils/report/qtip_graph.py [deleted file]
legacy/utils/report/qtip_report.py [deleted file]
legacy/utils/spawn_vm.py [deleted file]
legacy/utils/transform/__init__.py [deleted file]
legacy/utils/transform/fio_transform.py [deleted file]
legacy/utils/transform/iperf_transform.py [deleted file]

diff --git a/legacy/api/__init__.py b/legacy/api/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/legacy/api/cmd/__init__.py b/legacy/api/cmd/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/legacy/api/cmd/server.py b/legacy/api/cmd/server.py
deleted file mode 100644 (file)
index eea45ad..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-##############################################################################
-# Copyright (c) 2016 ZTE Corp and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-from flask import Flask
-from flask_restful import Api
-from flask_restful_swagger import swagger
-
-import legacy.api.router.mapper as mapper
-
-app = Flask(__name__)
-api = swagger.docs(Api(app), apiVersion='0.1', description='QTIP API specs')
-
-
-def add_routers():
-    for (handler, url) in mapper.mappers:
-        api.add_resource(handler, url)
-
-
-def main():
-    add_routers()
-    app.run(host='0.0.0.0')
-
-
-if __name__ == "__main__":
-    main()
diff --git a/legacy/api/handler/__init__.py b/legacy/api/handler/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/legacy/api/handler/db.py b/legacy/api/handler/db.py
deleted file mode 100644 (file)
index 24fc27a..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-##############################################################################
-# Copyright (c) 2016 ZTE Corp and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-from datetime import datetime
-from operator import add
-import uuid
-
-jobs = {}
-threads = {}
-
-
-def create_job(args):
-    if len(filter(lambda x: jobs[x]['state'] == 'processing', jobs.keys())) > 0:
-        return None
-    else:
-        job = {'job_id': str(uuid.uuid4()),
-               'installer_type': args["installer_type"],
-               'installer_ip': args["installer_ip"],
-               'pod_name': args["pod_name"],
-               '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',
-               'state_detail': [],
-               'result': None,
-               'result_detail': []}
-        jobs[job['job_id']] = job
-        return job['job_id']
-
-
-def delete_job(job_id):
-    if job_id in threads:
-        stop_thread(job_id)
-    if job_id in jobs:
-        jobs[job_id]['end_time'] = str(datetime.now())
-        jobs[job_id]['state'] = 'terminated'
-        return True
-    else:
-        return False
-
-
-def get_job_info(job_id):
-    if job_id in jobs:
-        return jobs[job_id]
-    else:
-        return None
-
-
-def finish_job(job_id):
-    jobs[job_id]['end_time'] = str(datetime.now())
-    jobs[job_id]['state'] = 'finished'
-    jobs[job_id]['result'] = reduce(add, map(lambda x: x['result'],
-                                             jobs[job_id]['result_detail']))
-    del threads[job_id]
-
-
-def update_job_state_detail(job_id, state_detail):
-    jobs[job_id]['state_detail'] = state_detail
-
-
-def update_job_result_detail(job_id, benchmark, result):
-    result['benchmark'] = benchmark
-    jobs[job_id]['result_detail'].append(result)
-
-
-def is_job_timeout(job_id):
-    period = datetime.now() - datetime.strptime(jobs[job_id]['start_time'],
-                                                "%Y-%m-%d %H:%M:%S.%f")
-    return True if jobs[job_id]['max_minutes'] * 60 < period.total_seconds()\
-        else False
-
-
-def start_thread(job_id, thread, thread_stop):
-    threads[job_id] = {'thread': thread,
-                       'thread_stop': thread_stop}
-    thread.start()
-
-
-def stop_thread(job_id):
-    if threads[job_id]['thread'].isAlive():
-        threads[job_id]['thread_stop'].set()
-        threads[job_id]['thread'].join()
-    if job_id in threads:
-        del threads[job_id]
-
-
-def update_benchmark_state(job_id, benchmark, benchmark_state):
-    filter(lambda x: x["benchmark"] == benchmark,
-           get_job_info(job_id)["state_detail"])[0]['state'] = benchmark_state
diff --git a/legacy/api/handler/job_handler.py b/legacy/api/handler/job_handler.py
deleted file mode 100644 (file)
index 4ecc1ce..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import threading
-from copy import copy
-
-from flask_restful import Resource, reqparse
-from flask_restful_swagger import swagger
-from qtip.api.model.job_model import JobResponseModel
-from qtip.utils import args_handler as args_handler
-from werkzeug.exceptions import abort
-
-from legacy.api.handler import db, result_handler
-
-
-class Job(Resource):
-    @swagger.operation(
-        notes='get a job by ID',
-        nickname='get',
-        parameters=[],
-        responseMessages=[
-            {
-                "code": 200,
-                "message": "Job detail info."
-            },
-            {
-                "code": 404,
-                "message": "Can't not find the job id XXXXXXX"
-            }
-        ]
-    )
-    def get(self, id):
-        ret = db.get_job_info(id)
-        return ret if ret else abort(404, " Can't not find the job id %s" % id)
-
-    @swagger.operation(
-        notes='delete a job by ID',
-        nickname='delete',
-        parameters=[],
-        responseMessages=[
-            {
-                "code": 200,
-                "message": "Delete successfully"
-            },
-            {
-                "code": 404,
-                "message": "Can not find job_id XXXXXXXXX"
-            }
-        ]
-    )
-    def delete(self, id):
-        ret = db.delete_job(id)
-        return {'result': "Delete successfully"} if ret else abort(404, "Can not find job_id %s" % id)
-
-
-class JobList(Resource):
-    @swagger.operation(
-        note='create a job with parameters',
-        nickname='create',
-        parameters=[
-            {
-                "name": "body",
-                "description": """
-"installer_type": The installer type, for example fuel, compass..,
-
-"installer_ip": The installer ip of the pod,
-
-"max_minutes": If specified, the maximum duration in minutes
-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',
-
-"benchmark_name": If specified, benchmark name in suite, for example 'dhrystone_bm.yaml',
-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",
-                "paramType": "body"
-            }
-        ],
-        type=JobResponseModel.__name__,
-        responseMessages=[
-            {
-                "code": 200,
-                "message": "Job submitted"
-            },
-            {
-                "code": 400,
-                "message": "Missing configuration data"
-            },
-            {
-                "code": 409,
-                "message": "It already has one job running now!"
-            }
-        ]
-    )
-    def post(self):
-        parser = reqparse.RequestParser()
-        parser.add_argument('installer_type', type=str, required=True, help='installer_type is required')
-        parser.add_argument('installer_ip', type=str, required=True, help='installer_ip is required')
-        parser.add_argument('max_minutes', type=int, required=False, default=60, help='max_minutes should be integer')
-        parser.add_argument('pod_name', type=str, required=False, default='default', help='pod_name should be string')
-        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(args["suite_name"]):
-            return abort(404, 'message:Test suite {0} does not exist under benchmarks/suite'.format(args["suite_name"]))
-        if not args_handler.check_lab_name(args["pod_name"]):
-            return abort(404, 'message: You have specified a lab {0}\
-                               that is not present in test_cases'.format(args['pod_name']))
-
-        job_id = db.create_job(args)
-        if not job_id:
-            return abort(409, 'message:It already has one job running now!')
-
-        benchmarks = args_handler.get_files_in_suite(args["suite_name"],
-                                                     args["type"].lower())
-        test_cases = args_handler.get_files_in_test_plan(args["pod_name"],
-                                                         args["suite_name"],
-                                                         args["type"].lower())
-        benchmarks_list = filter(lambda x: x in test_cases, benchmarks)
-        if args["benchmark_name"] in benchmarks_list:
-            benchmarks_list = [args["benchmark_name"]]
-        if (args["benchmark_name"] is not 'all') and args["benchmark_name"] not in benchmarks_list:
-            return abort(404, 'message: Benchmark name {0} does not exist in suit {1}'.format(args["benchmark_name"],
-                                                                                              args["suite_name"]))
-        state_detail = map(lambda x: {'benchmark': x, 'state': 'idle'}, benchmarks_list)
-        db.update_job_state_detail(job_id, copy(state_detail))
-        thread_stop = threading.Event()
-        post_thread = threading.Thread(target=self.thread_post, args=(args["installer_type"],
-                                                                      benchmarks_list,
-                                                                      args["pod_name"],
-                                                                      args["suite_name"],
-                                                                      job_id,
-                                                                      args["testdb_url"],
-                                                                      args["node_name"],
-                                                                      thread_stop))
-        db.start_thread(job_id, post_thread, thread_stop)
-        return {'job_id': str(job_id)}
-
-    def thread_post(self, installer_type, benchmarks_list, pod_name, suite_name,
-                    job_id, testdb_url, node_name, stop_event):
-        for benchmark in benchmarks_list:
-            if db.is_job_timeout(job_id) or stop_event.is_set():
-                break
-            db.update_benchmark_state(job_id, benchmark, 'processing')
-            result = args_handler.prepare_and_run_benchmark(installer_type,
-                                                            '/home',
-                                                            args_handler.get_benchmark_path(pod_name,
-                                                                                            suite_name,
-                                                                                            benchmark))
-            db.update_job_result_detail(job_id, benchmark, copy(result))
-            db.update_benchmark_state(job_id, benchmark, 'finished')
-        if (result_handler.dump_suite_result(suite_name) and testdb_url):
-            result_handler.push_suite_result_to_db(suite_name, testdb_url, installer_type, node_name)
-        db.finish_job(job_id)
diff --git a/legacy/api/handler/result_handler.py b/legacy/api/handler/result_handler.py
deleted file mode 100644 (file)
index 3d1d592..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-##############################################################################
-# Copyright (c) 2016 ZTE Corp and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import importlib
-import json
-from os.path import expanduser
-
-import qtip.utils.dashboard.pushtoDB as push_to_db
-from qtip.utils import logger_utils
-
-logger = logger_utils.QtipLogger('suite_result').get
-
-
-def get_benchmark_result(benchmark_name, suite_name):
-    benchmark_indices = importlib.import_module('scripts.ref_results'
-                                                '.{0}_benchmarks_indices'.format(suite_name))
-    methodToCall = getattr(benchmark_indices, '{0}_index'.format(benchmark_name))
-    return methodToCall()
-
-
-def dump_suite_result(suite_name):
-    suite_dict = {}
-    suite_bench_list = {'compute': ['DPI', 'Dhrystone', 'Whetstone', 'SSL', 'RamSpeed'],
-                        'storage': ['FIO'],
-                        'network': ['IPERF']}
-    temp = 0
-    l = len(suite_bench_list[suite_name])
-    for benchmark in suite_bench_list[suite_name]:
-        try:
-            suite_dict[benchmark] = get_benchmark_result(benchmark.lower(), suite_name)
-            temp = temp + float(suite_dict[benchmark]['index'])
-        except OSError:
-            l = l - 1
-            pass
-
-    if l == 0:
-        logger.info("No {0} suite results found".format(suite_name))
-        return False
-    else:
-        suite_index = temp / l
-        suite_dict_f = {'index': suite_index,
-                        'suite_results': suite_dict}
-        result_path = expanduser('~') + '/qtip/results'
-        with open('{0}/{1}_result.json'.format(result_path, suite_name), 'w+') as result_json:
-            json.dump(suite_dict_f, result_json, indent=4, sort_keys=True)
-        return True
-
-
-def push_suite_result_to_db(suite_name, test_db_url, installer_type, node_name):
-    with open('results/{0}_result.json'.format(suite_name), 'r') as result_file:
-        j = json.load(result_file)
-        push_to_db.push_results_to_db(test_db_url, '{0}_test_suite'.format(suite_name),
-                                      j, installer_type, node_name)
diff --git a/legacy/api/model/__init__.py b/legacy/api/model/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/legacy/api/model/job_model.py b/legacy/api/model/job_model.py
deleted file mode 100644 (file)
index 73baf66..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-from flask_restful import fields
-from flask_restful_swagger import swagger
-
-
-@swagger.model
-class JobModel:
-    resource_fields = {
-        'installer_type': fields.String,
-        'installer_ip': fields.String,
-        'max_minutes': fields.Integer,
-        'pod_name': fields.String,
-        'suite_name': fields.String,
-        'type': fields.String,
-        'benchmark_name': fields.String,
-        'testdb_url': fields.String,
-        'node_name': fields.String
-    }
-    required = ['installer_type', 'installer_ip']
-
-
-@swagger.model
-class JobResponseModel:
-    resource_fields = {
-        'job_id': fields.String
-    }
diff --git a/legacy/api/router/__init__.py b/legacy/api/router/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/legacy/api/router/mapper.py b/legacy/api/router/mapper.py
deleted file mode 100644 (file)
index 470d18e..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-from legacy.api.handler.job_handler import Job, JobList
-
-
-mappers = [
-    (JobList, '/api/v1.0/jobs'),
-    (Job, '/api/v1.0/jobs/<string:id>'),
-]
diff --git a/legacy/api/router/mapper.py.orig b/legacy/api/router/mapper.py.orig
deleted file mode 100644 (file)
index 1acb40b..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<<<<<<< HEAD
-from legacy.api.handler.job_handler import Job, JobList
-=======
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-from legacy.api.handler import Job, JobList
->>>>>>> 615b529... Add licence header according to OPNFV contribution guidelines[1] by script[2]
-
-
-mappers = [
-    (JobList, '/api/v1.0/jobs'),
-    (Job, '/api/v1.0/jobs/<string:id>'),
-]
diff --git a/legacy/cli/helper.py b/legacy/cli/helper.py
deleted file mode 100644 (file)
index acfecf8..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-##############################################################################
-# Copyright (c) 2016 ZTE Corp and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-import os
-
-
-def fetch_root():
-    return os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, 'benchmarks/')
diff --git a/legacy/config/SampleHeat.yaml b/legacy/config/SampleHeat.yaml
deleted file mode 100644 (file)
index 650c6a0..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-heat_template_version: 2015-04-30
-
-description: >
-  Used to run VMs for QTIP
-
-parameters:
-  image:
-    type: string
-    description: Name of the image
-    default: QTIP_CentOS
-
-  external_net_name:
-    type: string
-    description: Name of the external network which management network will connect to
-    default: admin_floating_net
-
-resources:
-  flavor:
-    type: OS::Nova::Flavor
-    properties:
-      ram: 8192
-      vcpus: 8
-      disk: 80
-
-  network:
-    type: OS::Neutron::Net
-    properties:
-      name: qtip_net
-
-  subnet:
-    type: OS::Neutron::Subnet
-    properties:
-      name: qtip_subnet
-      ip_version: 4
-      cidr: 192.168.0.0/24
-      network: { get_resource: network }
-      dns_nameservers: [8.8.8.8]
-
-  management_router:
-    type: OS::Neutron::Router
-    properties:
-      name: qtip_router
-      external_gateway_info:
-        network: { get_param: external_net_name }
-
-  management_router_interface:
-    type: OS::Neutron::RouterInterface
-    properties:
-      router: { get_resource: management_router }
-      subnet: { get_resource: subnet }
-
-  security_group:
-    type: OS::Neutron::SecurityGroup
-    properties:
-      name: qtip_security_group
-      rules:
-          - port_range_min: 22
-            port_range_max: 5201
-            protocol: tcp
-          - port_range_min: 22
-            port_range_max: 5201
-            protocol: udp
-          - protocol: icmp
-
-outputs:
-  description: 'none'
diff --git a/legacy/docker/README.md b/legacy/docker/README.md
deleted file mode 100644 (file)
index 35ac093..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-# QTIP The Indices for Performance
-
-[QTIP] is an [OPNFV] project.
-
-It aims to build a platform for creating and sharing indices of [NFVI] performance.
-
-See the [project vision](https://wiki.opnfv.org/display/qtip/Vision) for more details.
-
-[QTIP]: https://wiki.opnfv.org/display/qtip
-[OPNFV]: https://www.opnfv.org
-[NFVI]: https://en.wikipedia.org/wiki/Network_function_virtualization
diff --git a/legacy/docker/cleanup_qtip_image.sh b/legacy/docker/cleanup_qtip_image.sh
deleted file mode 100644 (file)
index 9c2b59d..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-if [[ ! -f ${QTIP_DIR}/openrc ]];then
-    source ${REPOS_DIR}/releng/utils/fetch_os_creds.sh \
-    -d ${QTIP_DIR}/openrc \
-    -i ${INSTALLER_TYPE} \
-    -a ${INSTALLER_IP}
-fi
-
-source ${QTIP_DIR}/openrc
-
-cleanup_image()
-{
-    echo
-    if ! glance image-list; then
-        return
-    fi
-
-    echo "Deleting image QTIP_CentOS..."
-    glance image-delete $(glance image-list | grep -e QTIP_CentOS | awk '{print $2}')
-
-}
-
-cleanup_image
diff --git a/legacy/docker/prepare_qtip_image.sh b/legacy/docker/prepare_qtip_image.sh
deleted file mode 100644 (file)
index 4095c80..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-IMGNAME='QTIP_CentOS.qcow2'
-IMGPATH='/home/opnfv/imgstore'
-IMGURL='http://build.opnfv.org/artifacts.opnfv.org/qtip/QTIP_CentOS.qcow2'
-
-load_image()
-{
-    if [[ -n $( glance image-list | grep -e QTIP_CentOS) ]]; then
-        return
-    fi
-
-    test -d $IMGPATH || mkdir -p $IMGPATH
-    if [[ ! -f "$IMGPATH/$IMGNAME" ]];then
-        echo
-        echo "========== Downloading QTIP_CentOS image =========="
-        cd $IMGPATH
-        wget -c --progress=dot:giga $IMGURL
-    fi
-
-    echo
-    echo "========== Loading QTIP_CentOS image =========="
-    output=$(glance image-create \
-        --name QTIP_CentOS \
-        --visibility public \
-        --disk-format qcow2 \
-        --container-format bare \
-        --file $IMGPATH/$IMGNAME )
-    echo "$output"
-
-    IMAGE_ID=$(echo "$output" | grep " id " | awk '{print $(NF-1)}')
-
-    if [ -z "$IMAGE_ID" ]; then
-        echo 'Failed uploading QTIP_CentOS image to cloud'.
-        exit 1
-    fi
-
-    echo "QTIP_CentOS image id: $IMAGE_ID"
-}
-
-rm -rf ${QTIP_DIR}/openrc
-
-${REPOS_DIR}/releng/utils/fetch_os_creds.sh \
--d ${QTIP_DIR}/openrc \
--i ${INSTALLER_TYPE} \
--a ${INSTALLER_IP}
-
-source ${QTIP_DIR}/openrc
-
-load_image
diff --git a/legacy/docker/push_db.sh b/legacy/docker/push_db.sh
deleted file mode 100755 (executable)
index 50341ea..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-cd ${QTIP_DIR} && python qtip/utils/dashboard/pushtoDB.py
diff --git a/legacy/docker/run_qtip.sh b/legacy/docker/run_qtip.sh
deleted file mode 100755 (executable)
index 98abf13..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#! /bin/bash
-
-QTIP=qtip/run.py
-
-run_test_suite()
-{
-    if [ "$TEST_CASE" == "compute" ]; then
-        cd ${QTIP_DIR}  && python ${QTIP} -l default -f compute
-        cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py compute
-    elif [ "$TEST_CASE" == "storage" ]; then
-        cd ${QTIP_DIR}  && python ${QTIP} -l default -f storage
-        cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py storage
-    elif [ "$TEST_CASE" == "network" ]; then
-        cd ${QTIP_DIR}  && python ${QTIP} -l default -f network
-        cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py network
-    elif [ "$TEST_CASE" == "all" ]; then
-        cd ${QTIP_DIR}  && python ${QTIP} -l default -f compute
-        cd ${QTIP_DIR}  && python ${QTIP} -l default -f storage
-        cd ${QTIP_DIR}  && python ${QTIP} -l default -f network
-
-        cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py compute
-        cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py storage
-        cd ${QTIP_DIR} && python scripts/ref_results/suite_result.py network
-    fi
-}
-
-rm -f ${QTIP_DIR}/config/QtipKey*
-
-echo "Generating ssh keypair"
-ssh-keygen -t rsa -N "" -f ${QTIP_DIR}/config/QtipKey -q
-
-source ${QTIP_DIR}/docker/prepare_qtip_image.sh
-
-run_test_suite
-
-source ${QTIP_DIR}/docker/cleanup_qtip_image.sh
-
-echo "Remove ssh keypair"
-rm -f ${QTIP_DIR}/config/QtipKey*
diff --git a/legacy/tests/__init__.py b/legacy/tests/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/legacy/tests/api/__init__.py b/legacy/tests/api/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/legacy/tests/api/test_server.py b/legacy/tests/api/test_server.py
deleted file mode 100644 (file)
index bf316f5..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import json
-import time
-
-import mock
-import pytest
-
-import qtip.api.cmd.server as server
-
-
-def setup_module():
-    server.add_routers()
-
-
-@pytest.fixture
-def app():
-    return server.app
-
-
-@pytest.fixture
-def app_client(app):
-    client = app.test_client()
-    return client
-
-
-def side_effect_sleep(sleep_time):
-    time.sleep(sleep_time)
-
-
-def side_effect_pass():
-    pass
-
-
-class TestClass:
-    @pytest.mark.parametrize("body, expected", [
-        ({'installer_type': 'fuel',
-          'installer_ip': '10.20.0.2'},
-         {'job_id': '',
-          'installer_type': 'fuel',
-          'installer_ip': '10.20.0.2',
-          'pod_name': 'default',
-          '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'},
-                           {'state': 'finished', 'benchmark': 'ramspeed_bm.yaml'},
-                           {'state': 'finished', 'benchmark': 'dpi_bm.yaml'},
-                           {'state': 'finished', 'benchmark': 'ssl_bm.yaml'}],
-          'result': 0}),
-        ({'installer_type': 'fuel',
-          'installer_ip': '10.20.0.2',
-          'pod_name': 'default',
-          'max_minutes': 20,
-          'suite_name': 'compute',
-          'type': 'VM',
-          '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',
-          'pod_name': 'default',
-          '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})
-    ])
-    @mock.patch('qtip.utils.args_handler.prepare_and_run_benchmark')
-    def test_post_get_delete_job_successful(self, mock_args_handler, app_client, body, expected):
-        mock_args_handler.return_value = {'result': 0,
-                                          'detail': {'host': [(u'10.20.6.14', {'unreachable': 0,
-                                                                               'skipped': 13,
-                                                                               'ok': 27,
-                                                                               'changed': 26,
-                                                                               'failures': 0}),
-                                                              ('localhost', {'unreachable': 0,
-                                                                             'skipped': 0,
-                                                                             'ok': 6,
-                                                                             'changed': 6,
-                                                                             'failures': 0}),
-                                                              (u'10.20.6.13', {'unreachable': 0,
-                                                                               'skipped': 13,
-                                                                               'ok': 27,
-                                                                               'changed': 26,
-                                                                               'failures': 0})]}}
-
-        reply = app_client.post("/api/v1.0/jobs", data=body)
-        print(reply.data)
-        id = json.loads(reply.data)['job_id']
-        expected['job_id'] = id
-        post_process = ''
-        while post_process != 'finished':
-            get_reply = app_client.get("/api/v1.0/jobs/%s" % id)
-            reply_data = json.loads(get_reply.data)
-            post_process = reply_data['state']
-            print(reply_data)
-        assert len(filter(lambda x: reply_data[x] == expected[x], expected.keys())) == len(expected)
-        delete_reply = app_client.delete("/api/v1.0/jobs/%s" % id)
-        assert "successful" in delete_reply.data
-
-    @pytest.mark.parametrize("body, expected", [
-        ([{'installer_type': 'fuel',
-           'installer_ip': '10.20.0.2'},
-          {'installer_type': 'compass',
-           'installer_ip': '192.168.20.50'}],
-         ['job_id',
-          'It already has one job running now!'])
-    ])
-    @mock.patch('qtip.utils.args_handler.prepare_and_run_benchmark',
-                side_effect=[side_effect_sleep(0.5), side_effect_pass])
-    def test_post_two_jobs_unsuccessful(self, mock_args_hanler, app_client, body, expected):
-        reply_1 = app_client.post("/api/v1.0/jobs", data=body[0])
-        reply_2 = app_client.post("/api/v1.0/jobs", data=body[1])
-        assert expected[0] in json.loads(reply_1.data).keys()
-        app_client.delete("/api/v1.0/jobs/%s" % json.loads(reply_1.data)['job_id'])
-        assert expected[1] in json.dumps(reply_2.data)
diff --git a/legacy/tests/create_zones_test.py b/legacy/tests/create_zones_test.py
deleted file mode 100644 (file)
index 1aa3747..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import pytest
-import mock
-from mock import Mock, MagicMock
-import os
-from qtip.utils.create_zones import AvailabilityZone
-
-return_list = []
-
-
-def get_agg_mock(host):
-    agg = Mock()
-    agg.name = host
-    agg.id = host
-    return agg
-
-
-class HyperMock(MagicMock):
-    def list(self):
-        mock_hypervisor = [Mock(service={'host': '10.20.0.4'}), Mock(service={'host': '10.20.0.5'})]
-        return mock_hypervisor
-
-
-class AggMock(MagicMock):
-    def get_details(self, agg_id):
-        print "get_details:{0}".format(agg_id)
-        return Mock(hosts=[])
-
-    def create(self, host, agg):
-        print "create:{0}:{1}".format(host, agg)
-        return agg
-
-    def list(self):
-        return return_list
-
-    def delete(self, agg_id):
-        print "delete:{0}".format(agg_id)
-        pass
-
-    def add_host(self, aggregate, host):
-        print "add_host:{0}:{1}".format(aggregate, host)
-        pass
-
-    def remove_host(self, agg_id, host):
-        print "remove_host:{0}:{1}".format(agg_id, host)
-        pass
-
-
-class NovaMock(MagicMock):
-    hypervisors = HyperMock()
-    aggregates = AggMock()
-
-
-@pytest.mark.xfail(reason="unstable result")
-class TestClass:
-    @pytest.mark.parametrize("test_input, expected", [
-        (['compute1', 'compute2'],
-         ['create:compute1:compute1',
-          'add_host:compute1:10.20.0.4',
-          'create:compute2:compute2',
-          'add_host:compute2:10.20.0.5']),
-        (['compute1'],
-         ['create:compute1:compute1',
-          'add_host:compute1:10.20.0.4']),
-    ])
-    @mock.patch('qtip.utils.create_zones.client', autospec=True)
-    @mock.patch('qtip.utils.create_zones.v2', autospec=True)
-    @mock.patch('qtip.utils.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_aggs(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('qtip.utils.create_zones.client', autospec=True)
-    @mock.patch('qtip.utils.create_zones.v2', autospec=True)
-    @mock.patch('qtip.utils.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
-        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.clean_all_aggregates()
-        k.stop()
-        resout, reserr = capfd.readouterr()
-        for x in expected:
-            assert x in resout
diff --git a/legacy/tests/functional/__init__.py b/legacy/tests/functional/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/legacy/tests/functional/yaml_schema_test.py b/legacy/tests/functional/yaml_schema_test.py
deleted file mode 100644 (file)
index 3c7994a..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import os
-import os.path
-from pykwalify.core import Core
-
-
-class TestClass:
-    def test_schema_success(self):
-        for root, dirs, files in os.walk("test_cases"):
-            for name in files:
-                print root + "/" + name
-                if "_bm" in name:
-                    schema = "tests/schema/test_bm_schema.yaml"
-                if "_vm" in name:
-                    schema = "tests/schema/test_vm_schema.yaml"
-                c = Core(source_file=root + "/" + name, schema_files=[schema])
-                c.validate(raise_exception=True)
diff --git a/legacy/tests/helper/perftest.yaml b/legacy/tests/helper/perftest.yaml
deleted file mode 100644 (file)
index 57948b6..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 taseer94@gmail.com and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
----
-
-  tests:
-    - command: ['perftest', 'run']
-      output: "Run a perftest\n"
diff --git a/legacy/tests/helper/suite.yaml b/legacy/tests/helper/suite.yaml
deleted file mode 100644 (file)
index 84bf923..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 taseer94@gmail.com and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
----
-
-  tests:
-    - command: ['suite', 'run']
-      output: "Run a suite\n"
-
diff --git a/legacy/tests/helper/version.yaml b/legacy/tests/helper/version.yaml
deleted file mode 100644 (file)
index 59be425..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 taseer94@gmail.com and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
----
-
-  tests:
-    - command: ['version', 'list']
-      output: "Lists all the different versions\n"
-
-    - command: ['version', 'install', 'Colorado']
-      output: "Install: Colorado\n"
-
-    - command: ['version', 'uninstall', 'Arno']
-      output: "Uninstall: Arno\n"
-
diff --git a/legacy/tests/spawn_vm_test.py b/legacy/tests/spawn_vm_test.py
deleted file mode 100644 (file)
index ac58db2..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import pytest
-import mock
-from mock import Mock, MagicMock
-import os
-from qtip.utils.spawn_vm import SpawnVM
-
-
-class KeystoneMock(MagicMock):
-    auth_token = Mock()
-    v2_0 = Mock()
-
-
-class StackMock(MagicMock):
-    status = 'COMPLETE'
-    outputs = [{'output_key': 'availability_instance_1',
-                'output_value': 'output_value_1'},
-               {'output_key': 'instance_ip_1',
-                "output_value": "172.10.0.154"},
-               {"output_key": "instance_PIP_1",
-                "output_value": "10.10.17.5"}]
-
-
-class HeatMock(MagicMock):
-    def list(self):
-        return []
-
-    def get(self, stackname):
-        return StackMock()
-
-    def create(self, stack_name, template):
-        pass
-
-
-class TestClass:
-    @pytest.mark.parametrize("test_input, expected", [
-        ({'availability_zone': ['compute1', 'compute1'],
-          'OS_image': ['QTIP_CentOS', 'QTIP_CentOS'],
-          'public_network': ['admin-floating_net', 'admin-floating_net'],
-          'flavor': ['m1.large', 'm1.large'],
-          'role': ['1-server', '2-host']},
-         [('172.10.0.154', '')]),
-    ])
-    @mock.patch('qtip.utils.spawn_vm.Env_setup')
-    @mock.patch('qtip.utils.spawn_vm.AvailabilityZone')
-    @mock.patch('qtip.utils.spawn_vm.keystoneclient.v2_0', autospec=True)
-    @mock.patch('qtip.utils.spawn_vm.heatclient.client', autospec=True)
-    def test_create_zones_success(self, mock_heat, mock_keystone,
-                                  mock_zone, mock_setup, test_input, expected):
-        open('./config/QtipKey.pub', 'a').close()
-        mock_heat.Client.return_value = Mock(stacks=HeatMock())
-        k = mock.patch.dict(os.environ, {'INSTALLER_TYPE': 'fuel'})
-        k.start()
-        SpawnVM(test_input)
-        k.stop()
-        os.remove('./config/QtipKey.pub')
-        mock_setup.ip_pw_list.append.assert_called_with(expected[0])
diff --git a/legacy/utils/__init__.py b/legacy/utils/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/legacy/utils/create_zones.py b/legacy/utils/create_zones.py
deleted file mode 100644 (file)
index 5e378c8..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-##############################################################################\r
-# Copyright (c) 2016 Dell Inc, ZTE and others.\r
-#\r
-# All rights reserved. This program and the accompanying materials\r
-# are made available under the terms of the Apache License, Version 2.0\r
-# which accompanies this distribution, and is available at\r
-# http://www.apache.org/licenses/LICENSE-2.0\r
-##############################################################################\r
-from keystoneclient.auth.identity import v2\r
-from keystoneclient import session\r
-from novaclient import client\r
-import os\r
-import random\r
-import logger_utils\r
-\r
-logger = logger_utils.QtipLogger('create_zones').get\r
-\r
-\r
-class AvailabilityZone:\r
-\r
-    def __init__(self):\r
-        self._keystone_client = None\r
-        self._nova_client = None\r
-\r
-    def _get_keystone_client(self):\r
-        """returns a keystone client instance"""\r
-\r
-        if self._keystone_client is None:\r
-            '''\r
-            self._keystone_client = keystoneclient.v2_0.client.Client(\r
-            auth_url=os.environ.get('OS_AUTH_URL'),\r
-            username=os.environ.get('OS_USERNAME'),\r
-            password=os.environ.get('OS_PASSWORD'),\r
-            tenant_name=os.environ.get('OS_TENANT_NAME'))\r
-            '''\r
-            auth = v2.Password(auth_url=os.environ.get('OS_AUTH_URL'),\r
-                               username=os.environ.get('OS_USERNAME'),\r
-                               password=os.environ.get('OS_PASSWORD'),\r
-                               tenant_name=os.environ.get('OS_TENANT_NAME'))\r
-\r
-            sess = session.Session(auth=auth)\r
-        else:\r
-            return self._keystone_client\r
-\r
-        return sess\r
-\r
-    def _get_nova_client(self):\r
-        if self._nova_client is None:\r
-            keystone = self._get_keystone_client()\r
-            self._nova_client = client.Client('2', session=keystone)\r
-        return self._nova_client\r
-\r
-    def clean_all_aggregates(self):\r
-        logger.info("clean all aggregates")\r
-        nova = self._get_nova_client()\r
-        agg_list = nova.aggregates.list()\r
-\r
-        for agg in agg_list:\r
-            agg_info = nova.aggregates.get_details(agg.id)\r
-            agg_hosts = agg_info.hosts\r
-            if len(agg_hosts):\r
-                for host in agg_hosts:\r
-                    nova.aggregates.remove_host(agg.id, host)\r
-            nova.aggregates.delete(agg.id)\r
-\r
-    def create_aggs(self, args):\r
-        azone_list = list(set(args))\r
-        azone_list.sort()\r
-\r
-        nova = self._get_nova_client()\r
-        hyper_list = nova.hypervisors.list()\r
-\r
-        if len(azone_list) > len(hyper_list):\r
-            logger.error("required available zones > compute nodes")\r
-            return None\r
-\r
-        compute_nodes = map(lambda x: x.service['host'], hyper_list)\r
-        sample_nodes = random.sample(compute_nodes, len(azone_list))\r
-        sample_nodes.sort()\r
-\r
-        for index, item in enumerate(azone_list):\r
-            logger.info("create aggregates: %s" % str(item))\r
-            agg_id = nova.aggregates.create(item, item)\r
-\r
-            logger.info("add host: %s" % sample_nodes[index])\r
-            nova.aggregates.add_host(aggregate=agg_id, host=sample_nodes[index])\r
diff --git a/legacy/utils/dashboard/__init__.py b/legacy/utils/dashboard/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/legacy/utils/dashboard/pushtoDB.py b/legacy/utils/dashboard/pushtoDB.py
deleted file mode 100644 (file)
index ce54aeb..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import requests
-import json
-import datetime
-import os
-import sys
-from qtip.utils import logger_utils
-
-logger = logger_utils.QtipLogger('push_db').get
-
-TEST_DB = 'http://testresults.opnfv.org/test/api/v1'
-
-suite_list = [('compute_result.json', 'compute_test_suite'),
-              ('network_result.json', 'network_test_suite'),
-              ('storage_result.json', 'storage_test_suite')]
-payload_list = {}
-
-
-def push_results_to_db(db_url, case_name, payload, installer, pod_name):
-
-    url = db_url + "/results"
-    creation_date = str(datetime.datetime.utcnow().isoformat())
-
-    params = {"project_name": "qtip", "case_name": case_name,
-              "pod_name": pod_name, "installer": installer, "start_date": creation_date,
-              "version": "test", "details": payload}
-
-    headers = {'Content-Type': 'application/json'}
-    logger.info('pod_name:{0},installer:{1},creation_data:{2}'.format(pod_name,
-                                                                      installer,
-                                                                      creation_date))
-    # temporary code, will be deleted after Bigergia dashboard is ready
-    try:
-        qtip_testapi_url = "http://testapi.qtip.openzero.net/results"
-        qtip_testapi_r = requests.post(qtip_testapi_url, data=json.dumps(params), headers=headers)
-        logger.info('Pushing Results to qtip_testapi: %s'.format(qtip_testapi_r))
-    except:
-        logger.info("Pushing Results to qtip_testapi Error:{0}".format(sys.exc_info()[0]))
-
-    try:
-        r = requests.post(url, data=json.dumps(params), headers=headers)
-        logger.info(r)
-        return True
-    except:
-        logger.info("Error:{0}".format(sys.exc_info()[0]))
-        return False
-
-
-def populate_payload(suite_list):
-
-    global payload_list
-    for k, v in suite_list:
-
-        if os.path.isfile('results/' + str(k)):
-            payload_list[k] = v
-
-
-def main():
-
-    global payload_list
-    populate_payload(suite_list)
-    if payload_list:
-        logger.info(payload_list)
-        for suite, case in payload_list.items():
-            with open('results/' + suite, 'r') as result_file:
-                j = json.load(result_file)
-            push_results_to_db(TEST_DB, case, j,
-                               os.environ['INSTALLER_TYPE'],
-                               os.environ['NODE_NAME'])
-    elif not payload_list:
-        logger.info('Results not found')
-
-
-if __name__ == "__main__":
-    main()
diff --git a/legacy/utils/report/__init__.py b/legacy/utils/report/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/legacy/utils/report/get_indices.py b/legacy/utils/report/get_indices.py
deleted file mode 100644 (file)
index 42db658..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import json
-
-
-def get_index(suite):
-    with open('../../results/' + suite + '.json') as result_file:
-        result_djson = json.load(result_file)
-        index = result_djson['index']
-    return index
diff --git a/legacy/utils/report/get_results.py b/legacy/utils/report/get_results.py
deleted file mode 100644 (file)
index 6df8823..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import os
-import json
-
-
-def report_concat(targ_dir, testcase):
-    machine_temp = []
-    machines = []
-
-    for file in os.listdir(targ_dir):
-        if file.endswith(".json"):
-            machine_temp.append(file)
-
-    l = len(machine_temp)
-
-    for x in range(0, l):
-        file_t = machine_temp[x]
-        with open(targ_dir + file_t) as result_file:
-            result_djson = json.load(result_file)
-            if result_djson['1  Testcase Name'] == str(testcase):
-                machines.append(result_djson)
-    return machines
-
-
-def space_count(l):
-    spc = ''
-    for x in range(l):
-        spc = spc + ' '
-    return spc
-
-
-def custom_dict(list1, list2, k):
-    string_1 = ''
-    for num_1 in range(0, len(list1)):
-        string_1 = string_1 + space_count(k) + str(list1[num_1][0]) + "=" + str(list2[num_1]) + "\n"
-    return string_1
-
-
-def generate_result(dict_a, k):
-    list_1 = []
-    list_2 = []
-    count = 0
-    for i, j in sorted(dict_a.iteritems()):
-        list_1.append([])
-        list_1[count].append(i)
-        if (str(type(dict_a.get(i)))) == "<type 'dict'>":
-            list_2.append(str("\n" + generate_result(dict_a.get(i), int(k + 1))))
-        else:
-            list_2.append(dict_a.get(i))
-        count = count + 1
-    return custom_dict(list_1, list_2, k)
diff --git a/legacy/utils/report/qtip_graph.py b/legacy/utils/report/qtip_graph.py
deleted file mode 100644 (file)
index 68ed660..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import matplotlib
-import matplotlib.pyplot as plt
-import numpy as np
-
-matplotlib.use('Agg')
-
-
-def plot_indices(a, b, c):
-    N = 3
-    ind = np.arange(N)
-    y_axis = (a, b, c)
-    width = 0.35
-    f = plt.figure()
-    ax = f.gca()
-    ax.set_autoscale_on(True)
-    my_bars = ax.bar(ind, y_axis, width, color='b')
-    ax.set_ylabel('Index Score*')
-    ax.set_xlabel('Suite')
-    ax.set_title(' QTIP benchmark scores')
-    ax.axis('on')
-    my_bars = ax.bar(ind, y_axis, width)
-    ax.set_xticks(ind + width / 2)
-    ax.set_xticklabels(['Compute', 'Storage', 'Network'])
-    ax.axis([0, 3, 0, 1.25])
-    f.text(0.7, 0.01, '* With Comparison to Refernece POD', fontsize=9)
-
-    for rect in my_bars:
-        height = rect.get_height()
-        ax.text(rect.get_x() + rect.get_width() / 2., 1.05 * height, height, ha='center', va='bottom')
-    f.savefig('qtip_graph.jpeg')
diff --git a/legacy/utils/report/qtip_report.py b/legacy/utils/report/qtip_report.py
deleted file mode 100644 (file)
index 1097df5..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image
-from reportlab.lib.styles import getSampleStyleSheet
-from reportlab.lib.units import inch
-from reportlab.lib.pagesizes import letter
-import qtip_graph as graph
-import get_indices as results
-from get_results import report_concat
-from get_results import generate_result
-
-
-def dump_result(Stor, directory, testcase):
-    try:
-        lower_s = testcase.lower()
-        Stor.append(Paragraph(testcase, Style['h3']))
-        l1 = report_concat(directory, lower_s)
-        l = 1
-        for a in l1:
-            Stor.append(Paragraph(testcase + " result_" + str(l), Style['h5']))
-            raw_string = generate_result(a, 0)
-            replaced_string = raw_string.replace('\n', '<br/> ').replace(' ', '&nbsp;')
-            Stor.append(Paragraph(replaced_string, Style['BodyText']))
-            l = l + 1
-    except OSError:
-        print "Results for {0} not found".format(testcase)
-
-
-doc = SimpleDocTemplate("../../results/QTIP_results.pdf", pagesize=letter,
-                        rightMargin=72, leftMargin=72,
-                        topMargin=72, bottomMargin=18)
-Stor = []
-Style = getSampleStyleSheet()
-Title = "QTIP Benchmark Suite"
-Stor.append(Paragraph(Title, Style['Title']))
-H1 = "Results"
-Stor.append(Spacer(0, 36))
-Stor.append(Paragraph(H1, Style['h2']))
-compute = 0
-storage = 0
-network = 0
-try:
-    compute = results.get_index('compute_result')
-except IOError:
-    pass
-
-try:
-    storage = results.get_index('storage_result')
-except IOError:
-    pass
-try:
-    network = results.get_index('network_result')
-except IOError:
-    pass
-
-Stor.append(Paragraph("Compute Suite:   %f" % compute, Style['h5']))
-Stor.append(Paragraph("Storage Suite:   %f" % storage, Style['h5']))
-Stor.append(Paragraph("Network Suite:   %f" % network, Style['h5']))
-graph.plot_indices(compute, storage, network)
-qtip_graph = ('qtip_graph.jpeg')
-im = Image(qtip_graph, 5 * inch, 4 * inch)
-Stor.append(im)
-Stor.append(Spacer(0, 12))
-Stor.append(Paragraph("Reference POD", Style['h5']))
-ptext = "The Dell OPNFV Lab POD3  has been taken as the reference POD against which the reference results have been collected. The POD consists of 6 identical servers. The details of such a server are:"
-Stor.append(Paragraph(ptext, Style['Normal']))
-ptext = "<bullet>&bull;</bullet>Server Type: Dell PowerEdge R630 Server"
-Stor.append(Paragraph(ptext, Style['Bullet']))
-ptext = "<bullet>&bull;</bullet>CPU: Intel  Xeon E5-2698 @ 2300 MHz"
-Stor.append(Paragraph(ptext, Style["Bullet"]))
-ptext = "<bullet>&bull;</bullet>RAM: 128GB"
-Stor.append(Paragraph(ptext, Style["Bullet"]))
-ptext = "<bullet>&bull;</bullet>Storage SSD: 420GB"
-Stor.append(Paragraph(ptext, Style["Bullet"]))
-ptext = "<bullet>&bull;</bullet>Network Card: Intel 2P X520/2P I350 rNDC"
-Stor.append(Paragraph(ptext, Style["Bullet"]))
-ptext = "Servers interconnected through a DELL S4810 switch using a 10Gbps physical link"
-Stor.append(Paragraph(ptext, Style["Bullet"]))
-Stor.append(Spacer(0, 12))
-ptext = "For Further  Details of the Reference POD hardware, please visit: https://wiki.opnfv.org/reference_pod_hardware_details"
-Stor.append(Paragraph(ptext, Style['Normal']))
-Stor.append(Spacer(0, 12))
-ptext = "For Details of the Reference POD Results,  please visit: https://wiki.opnfv.org/reference_pod_qtip_results"
-Stor.append(Spacer(0, 12))
-Stor.append(Paragraph(ptext, Style['Normal']))
-Stor.append(Paragraph("RAW Results", Style['h1']))
-Stor.append(Paragraph("Compute Results", Style['h2']))
-
-dump_result(Stor, "../../results/dhrystone/", "Dhrystone_bm")
-dump_result(Stor, "../../results/dhrystone/", "Dhrystone_vm")
-
-dump_result(Stor, "../../results/whetstone/", "Whetstone_bm")
-dump_result(Stor, "../../results/whetstone/", "Whetstone_vm")
-
-dump_result(Stor, "../../results/ramspeed/", "Ramspeed_bm")
-dump_result(Stor, "../../results/ramspeed/", "Ramspeed_vm")
-
-dump_result(Stor, "../../results/ssl/", "SSL_bm")
-dump_result(Stor, "../../results/ssl/", "SSL_vm")
-
-Stor.append(Paragraph("Network Results", Style['h2']))
-dump_result(Stor, "../../results/iperf/", "IPERF_bm")
-dump_result(Stor, "../../results/iperf/", "IPERF_vm")
-dump_result(Stor, "../../results/iperf/", "IPERF_vm_2")
-
-Stor.append(Paragraph("Storage Results", Style['h2']))
-dump_result(Stor, "../../results/fio/", "fio_bm")
-dump_result(Stor, "../../results/fio/", "fio_vm")
-
-
-doc.build(Stor)
diff --git a/legacy/utils/spawn_vm.py b/legacy/utils/spawn_vm.py
deleted file mode 100644 (file)
index f38c9a3..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-##############################################################################\r
-# Copyright (c) 2016 Dell Inc, ZTE and others.\r
-#\r
-# All rights reserved. This program and the accompanying materials\r
-# are made available under the terms of the Apache License, Version 2.0\r
-# which accompanies this distribution, and is available at\r
-# http://www.apache.org/licenses/LICENSE-2.0\r
-##############################################################################\r
-import os\r
-import sys\r
-import yaml\r
-import heatclient.client\r
-import keystoneclient\r
-import time\r
-from env_setup import Env_setup\r
-from create_zones import AvailabilityZone\r
-import logger_utils\r
-\r
-logger = logger_utils.QtipLogger('spawn_vm').get\r
-\r
-\r
-class SpawnVM(Env_setup):\r
-\r
-    def __init__(self, vm_info):\r
-        logger.info('vm_info: %s' % vm_info)\r
-        vm_role_ip_dict = vm_info.copy()\r
-        self._keystone_client = None\r
-        self._heat_client = None\r
-        self._glance_client = None\r
-        self._nova_client = None\r
-        self.azone = AvailabilityZone()\r
-        # TODO: it should clean up aggregates and stack after test case finished.\r
-        self.azone.clean_all_aggregates()\r
-        self.azone.create_aggs(vm_info['availability_zone'])\r
-        self.heat_template = self.generate_heat_template(vm_info)\r
-        self.create_stack(vm_role_ip_dict)\r
-\r
-    @staticmethod\r
-    def get_public_network():\r
-\r
-        """\r
-        TODO: GET THE NAMES OF THE PUBLIC NETWORKS for OTHER PROJECTS\r
-        """\r
-        installer = os.environ['INSTALLER_TYPE']\r
-\r
-        if installer.lower() == 'fuel':\r
-            return 'admin_floating_net'\r
-        if installer.lower() == 'apex':\r
-            return 'external'\r
-        if installer.lower() == 'compass':\r
-            return 'ext-net'\r
-        if installer.lower() == 'joid':\r
-            return 'ext-net'\r
-\r
-    def generate_heat_template(self, vm_params):\r
-        logger.info('Generating Heat Template')\r
-        heat_dict = {}\r
-        try:\r
-            with open('./config/SampleHeat.yaml', 'r+') as H_temp:\r
-                heat_dict = yaml.safe_load(H_temp)\r
-        except yaml.YAMLError as exc:\r
-            if hasattr(exc, 'problem_mark'):\r
-                mark = exc.problem_mark\r
-                logger.error(\r
-                    'Error in qtip/config/SampleHeat.yaml at: (%s,%s)' % (mark.line + 1,\r
-                                                                          mark.column + 1))\r
-                logger.error('EXITING PROGRAM. Correct File and restart')\r
-                sys.exit(1)\r
-\r
-        fopen = open('./config/QtipKey.pub', 'r')\r
-        fopenstr = fopen.read()\r
-        fopenstr = fopenstr.rstrip()\r
-        scriptcmd = '#!/bin/bash \n echo {0} >>  foo.txt \n echo {1} >> /root/.ssh/authorized_keys'.format(\r
-            fopenstr, fopenstr)\r
-\r
-        netName = self.get_public_network()\r
-        heat_dict['heat_template_version'] = '2015-04-30'\r
-\r
-        heat_dict['parameters']['public_network'] = {\r
-            'type': 'string',\r
-            'default': netName\r
-        }\r
-\r
-        for x in range(1, len(vm_params['availability_zone']) + 1):\r
-            avail_zone = vm_params['availability_zone'][x - 1]\r
-\r
-            heat_dict['parameters']['availability_zone_' + str(x)] = \\r
-                {'description': 'Availability Zone of the instance',\r
-                 'default': avail_zone,\r
-                 'type': 'string'}\r
-\r
-            heat_dict['resources']['public_port_' + str(x)] = \\r
-                {'type': 'OS::Neutron::Port',\r
-                 'properties': {'network': {'get_resource': 'network'},\r
-                                'security_groups': [{'get_resource': 'security_group'}],\r
-                                'fixed_ips': [{'subnet_id': {'get_resource': 'subnet'}}]}}\r
-\r
-            heat_dict['resources']['floating_ip_' + str(x)] = {\r
-                'type': 'OS::Neutron::FloatingIP',\r
-                'properties': {'floating_network': {'get_param': 'external_net_name'}}}\r
-\r
-            heat_dict['resources']['floating_ip_assoc_' + str(x)] = {\r
-                'type': 'OS::Neutron::FloatingIPAssociation',\r
-                'properties': {\r
-                    'floatingip_id': {'get_resource': 'floating_ip_' + str(x)},\r
-                    'port_id': {'get_resource': 'public_port_' + str(x)}}}\r
-\r
-            heat_dict['resources']['my_instance_' + str(x)] = \\r
-                {'type': 'OS::Nova::Server',\r
-                 'properties': {'image': {'get_param': 'image'},\r
-                                'networks':\r
-                                    [{'port': {'get_resource': 'public_port_' + str(x)}}],\r
-                                'flavor': {'get_resource': 'flavor'},\r
-                                'availability_zone': avail_zone,\r
-                                'security_groups': [{'get_resource': 'security_group'}],\r
-                                'name': 'instance' + str(x),\r
-                                'user_data_format': 'RAW',\r
-                                'user_data': scriptcmd}}\r
-\r
-            heat_dict['outputs']['instance_PIP_' + str(x)] = {\r
-                'description': 'IP address of the instance',\r
-                'value': {'get_attr': ['my_instance_' + str(x), 'first_address']}}\r
-\r
-            heat_dict['outputs']['instance_ip_' + str(x)] = {\r
-                'description': 'IP address of the instance',\r
-                'value': {'get_attr': ['floating_ip_' + str(x), 'floating_ip_address']}}\r
-\r
-            heat_dict['outputs']['availability_instance_' + str(x)] = {\r
-                'description': 'Availability Zone of the Instance',\r
-                'value': {'get_param': 'availability_zone_' + str(x)}}\r
-\r
-        del heat_dict['outputs']['description']\r
-        logger.info(heat_dict)\r
-\r
-        return heat_dict\r
-\r
-    def _get_keystone_client(self):\r
-        """returns a keystone client instance"""\r
-\r
-        if self._keystone_client is None:\r
-            self._keystone_client = keystoneclient.v2_0.client.Client(\r
-                auth_url=os.environ.get('OS_AUTH_URL'),\r
-                username=os.environ.get('OS_USERNAME'),\r
-                password=os.environ.get('OS_PASSWORD'),\r
-                tenant_name=os.environ.get('OS_TENANT_NAME'))\r
-        return self._keystone_client\r
-\r
-    def _get_heat_client(self):\r
-        """returns a heat client instance"""\r
-        if self._heat_client is None:\r
-            keystone = self._get_keystone_client()\r
-            heat_endpoint = keystone.service_catalog.url_for(\r
-                service_type='orchestration')\r
-            self._heat_client = heatclient.client.Client(\r
-                '1', endpoint=heat_endpoint, token=keystone.auth_token)\r
-        return self._heat_client\r
-\r
-    def create_stack(self, vm_role_ip_dict):\r
-        stackname = 'QTIP'\r
-        heat = self._get_heat_client()\r
-\r
-        self.delete_stack(stackname)\r
-\r
-        logger.info('Start to create stack %s' % stackname)\r
-        heat.stacks.create(stack_name=stackname, template=self.heat_template)\r
-\r
-        stack_status = "IN_PROGRESS"\r
-        while stack_status != 'COMPLETE':\r
-            if stack_status == 'IN_PROGRESS':\r
-                logger.debug('Create in Progress')\r
-            if stack_status == 'CREATE_FAILED':\r
-                raise RuntimeError("Stack %s created failed!" % stackname)\r
-            stack_status = heat.stacks.get(stackname).status\r
-            time.sleep(15)\r
-        logger.info('Stack %s Created Complete!' % stackname)\r
-\r
-        stack_outputs = heat.stacks.get(stackname).outputs\r
-\r
-        for vm in range(len(vm_role_ip_dict['OS_image'])):\r
-            for i in stack_outputs:\r
-                instanceKey = "instance_ip_" + str(vm + 1)\r
-                privateIPkey = 'instance_PIP_' + str(vm + 1)\r
-                if i['output_key'] == instanceKey:\r
-                    Env_setup.roles_dict[vm_role_ip_dict['role'][vm]] \\r
-                        .append(str(i['output_value']))\r
-                    Env_setup.ip_pw_list.append((str(i['output_value']), ''))\r
-\r
-                if i['output_key'] == privateIPkey:\r
-                    Env_setup.ip_pw_dict[vm_role_ip_dict['role'][vm]] = str(i['output_value'])\r
-\r
-        logger.info('Getting Public IP(s): %s' % Env_setup.ip_pw_list)\r
-\r
-    def delete_stack(self, stack_name):\r
-        heat = self._get_heat_client()\r
-\r
-        stacks = heat.stacks.list()\r
-        exists = map(lambda x: x.stack_name, stacks)\r
-        if stack_name in exists:\r
-            logger.info("Delete stack %s" % stack_name)\r
-            heat.stacks.delete(stack_name)\r
-            while stack_name in exists:\r
-                time.sleep(10)\r
-                stacks = heat.stacks.list()\r
-                exists = map(lambda x: x.stack_name, stacks)\r
-                logger.debug("exists_stacks: %s" % exists)\r
-        logger.info("%s doesn't exist" % stack_name)\r
diff --git a/legacy/utils/transform/__init__.py b/legacy/utils/transform/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/legacy/utils/transform/fio_transform.py b/legacy/utils/transform/fio_transform.py
deleted file mode 100644 (file)
index e8de2f9..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import json
-import pickle
-import os
-import datetime
-
-
-def get_fio_job_result(fio_job_data):
-    return {'read': {'io_bytes': fio_job_data["read"]["io_bytes"],
-                     'io_ps': fio_job_data["read"]["iops"],
-                     'io_runtime_millisec': fio_job_data["read"]["runtime"],
-                     'mean_io_latenchy_microsec': fio_job_data["read"]["lat"]["mean"]},
-            'write': {'io_bytes': fio_job_data["write"]["io_bytes"],
-                      'io_ps': fio_job_data["write"]["iops"],
-                      'io_runtime_millisec': fio_job_data["write"]["runtime"],
-                      'mean_io_latenchy_microsec': fio_job_data["write"]["lat"]["mean"]}}
-
-
-with open("fio_result.json") as fio_raw:
-    fio_data = json.load(fio_raw)
-
-fio_result_dict = {}
-for x, result in enumerate(map(get_fio_job_result, fio_data["jobs"])):
-    fio_result_dict['job_{0}'.format(x)] = result
-
-host_name = (os.popen("hostname").read().rstrip())
-report_time = str(datetime.datetime.utcnow().isoformat())
-os.system("mv fio_result.json " + str(host_name) + "-" + report_time + ".log")
-with open('./result_temp', 'w + ')as out_fio_result:
-    pickle.dump(fio_result_dict, out_fio_result)
diff --git a/legacy/utils/transform/iperf_transform.py b/legacy/utils/transform/iperf_transform.py
deleted file mode 100644 (file)
index c5eef6f..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-import json\r
-import datetime\r
-import pickle\r
-with open('iperf_raw.json', 'r') as ifile:\r
-    raw_iperf_data = json.loads(ifile.read().rstrip())\r
-\r
-bits_sent = raw_iperf_data['end']['sum_sent']['bits_per_second']\r
-bits_received = raw_iperf_data['end']['sum_received']['bits_per_second']\r
-total_byte_sent = raw_iperf_data['end']['sum_sent']['bytes']\r
-total_byte_received = raw_iperf_data['end']['sum_received']['bytes']\r
-cpu_host_total_percent = raw_iperf_data['end']['cpu_utilization_percent']['host_total']\r
-cpu_remote_total_percent = raw_iperf_data['end']['cpu_utilization_percent']['remote_total']\r
-\r
-time_stamp = str(datetime.datetime.utcnow().isoformat())\r
-\r
-result = {'version': raw_iperf_data['start']['version'],\r
-          'bandwidth': {'sender_throughput': bits_sent,\r
-                        'received_throughput': bits_received},\r
-          'cpu': {'cpu_host': cpu_host_total_percent,\r
-                  'cpu_remote': cpu_remote_total_percent}\r
-          }\r
-\r
-with open('iperf_raw-' + time_stamp + '.log', 'w+') as ofile:\r
-    ofile.write(json.dumps(raw_iperf_data))\r
-\r
-with open('./result_temp', 'w+') as result_file:\r
-    pickle.dump(result, result_file)\r