diff options
Diffstat (limited to 'contrib/nettest')
-rw-r--r-- | contrib/nettest/nettest/rest_server.py | 10 | ||||
-rw-r--r-- | contrib/nettest/nettest/rfc2544test.py | 10 | ||||
-rw-r--r-- | contrib/nettest/nettest/stcv_stack.py | 9 |
3 files changed, 14 insertions, 15 deletions
diff --git a/contrib/nettest/nettest/rest_server.py b/contrib/nettest/nettest/rest_server.py index ee13c91b..3558b9ac 100644 --- a/contrib/nettest/nettest/rest_server.py +++ b/contrib/nettest/nettest/rest_server.py @@ -7,9 +7,10 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +import os import logging -from flask import Flask, abort, jsonify, request +from flask import Flask, abort, jsonify, request, send_from_directory from flask_cors import CORS from flask_restful import Api, Resource, fields from flask_restful_swagger import swagger @@ -23,6 +24,13 @@ api = swagger.docs(Api(app), apiVersion="1.0") stcv_master = NetTestMaster() +@app.route("/tc_results/<tc_id>", methods=["GET"]) +def download_result_file(tc_id): + directory = os.getcwd() + "/tc_results/rfc2544/" + tc_id + files = os.listdir(directory) + return send_from_directory(directory, files[0], as_attachment=True) + + @swagger.model class StackRequestModel: resource_fields = { diff --git a/contrib/nettest/nettest/rfc2544test.py b/contrib/nettest/nettest/rfc2544test.py index 688b4d12..3764b357 100644 --- a/contrib/nettest/nettest/rfc2544test.py +++ b/contrib/nettest/nettest/rfc2544test.py @@ -200,14 +200,14 @@ class StcRfc2544Test: default_additional_params = { "AcceptableFrameLoss": 0.0, - "Duration": 60, + "Duration": 30, "FrameSizeList": 64, "LearningMode": 'AUTO', "NumOfTrials": 1, - "RateInitial": 99.0, - "RateLowerLimit": 99.0, - "RateStep": 10.0, - "RateUpperLimit": 99.0, + # "RateInitial": 99.0, + # "RateLowerLimit": 99.0, + # "RateStep": 10.0, + # "RateUpperLimit": 99.0, "Resolution": 1.0, "SearchMode": 'BINARY', "TrafficPattern": 'PAIR' diff --git a/contrib/nettest/nettest/stcv_stack.py b/contrib/nettest/nettest/stcv_stack.py index 6e69f479..7c1d4336 100644 --- a/contrib/nettest/nettest/stcv_stack.py +++ b/contrib/nettest/nettest/stcv_stack.py @@ -20,9 +20,6 @@ from keystoneauth1 import session class StcvStack(object): STCV_CONFIG_FILE = 'stcv_config_file' STCV_HEAT_FILE = './heat_2stcv.yaml' - STCV_USER_DATA = '''#cloud-config - spirent: - ntp: ''' def __init__(self, name, **kwargs): self.logger = logging.getLogger(__name__) @@ -63,12 +60,6 @@ class StcvStack(object): self._heat_client = heatclient.Client("1", session=sess) def _make_parameters(self): - user_data = self.STCV_USER_DATA + self.ntp_server_ip - file_path = os.getcwd() + '/' + self.STCV_CONFIG_FILE - fd = open(file_path, 'w') - fd.writelines(user_data) - fd.close() - return { 'public_net_name': self.pub_net_name, 'stcv_image': self.stcv_image, |