aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/nettest/nettest/rfc2544test.py28
-rw-r--r--contrib/nettest_client/nettest_client.py8
2 files changed, 28 insertions, 8 deletions
diff --git a/contrib/nettest/nettest/rfc2544test.py b/contrib/nettest/nettest/rfc2544test.py
index 3764b357..e8c9cd64 100644
--- a/contrib/nettest/nettest/rfc2544test.py
+++ b/contrib/nettest/nettest/rfc2544test.py
@@ -198,7 +198,7 @@ class StcRfc2544Test:
TC_STATUS_FINISHED = 'finished'
TC_STATUS_ERROR = 'error'
- default_additional_params = {
+ throughput_additional_params = {
"AcceptableFrameLoss": 0.0,
"Duration": 30,
"FrameSizeList": 64,
@@ -213,6 +213,21 @@ class StcRfc2544Test:
"TrafficPattern": 'PAIR'
}
+ latency_additional_params = {
+ "Duration": 30,
+ "ExecuteSynchronous": True,
+ "FrameSizeList": 64,
+ "LearningMode": 'AUTO',
+ # "LoadType": 'STEP',
+ # "LoadStart": 10.0,
+ # "LoadEnd": 100.0,
+ # "LoadStep": 10.0,
+ "LoadList": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
+ "LoadUnits": "PERCENT_LINE_RATE",
+ "NumOfTrials": 1,
+ "TrafficPattern": 'PAIR'
+ }
+
def __init__(self, name, lab_server_ip, license_server_ip,
west_stcv_admin_ip, west_stcv_tst_ip,
east_stcv_admin_ip, east_stcv_tst_ip,
@@ -228,7 +243,12 @@ class StcRfc2544Test:
self.east_stcv_tst_ip = east_stcv_tst_ip
self.stack_id = stack_id
self.metric = kwargs.get('metric')
- self.additional_params = copy.copy(self.default_additional_params)
+ if self.metric == 'throughput':
+ self.additional_params = copy.copy(self.throughput_additional_params)
+ elif self.metric == 'latency':
+ self.additional_params = copy.copy(self.latency_additional_params)
+ else:
+ raise Exception('invalid metric, metric = ' + self.metric)
self.additional_params['FrameSizeList'] = kwargs.get('framesizes')
self.tc_id = str(uuid.uuid4())
@@ -372,12 +392,12 @@ class StcRfc2544Test:
resultsdict = self.stc.perform("QueryResult",
params={
"DatabaseConnectionString": lab_server_resultsdb,
- "ResultPath": "RFC2544LatencyTestResultDetailedSummaryView"})
+ "ResultPath": "RFC2544FrameLossTestResultDetailedSummaryView"})
elif self.metric == "latency":
resultsdict = self.stc.perform("QueryResult",
params={
"DatabaseConnectionString": lab_server_resultsdb,
- "ResultPath": "RFC2544FrameLossTestResultDetailedSummaryView"})
+ "ResultPath": "RFC2544LatencyTestResultDetailedSummaryView"})
else:
raise Exception("invalid rfc2544 test metric.")
diff --git a/contrib/nettest_client/nettest_client.py b/contrib/nettest_client/nettest_client.py
index 5215fa56..ec16caf0 100644
--- a/contrib/nettest_client/nettest_client.py
+++ b/contrib/nettest_client/nettest_client.py
@@ -129,7 +129,7 @@ class NettestClient(object):
response = requests.get(url)
if requests.codes.ok == response.status_code:
self.write_log("get tc result success")
- with open(os.getcwd() + "/" + tc_id, "w") as fd:
+ with open(os.getcwd() + "/" + tc_id + ".csv", "w") as fd:
fd.write(response.content)
break
ret = True
@@ -148,10 +148,10 @@ class NettestClient(object):
if __name__ == "__main__":
- nc = NettestClient(rest_server_ip="127.0.0.1", port=5001, version="1.0")
+ nc = NettestClient(rest_server_ip="127.0.0.1", port=5000, version="1.0")
stack_params = {
- "name": 's1',
+ "name": 's2',
"stack_type": "stcv",
"public_network_name": "public",
"stcv_affinity": True,
@@ -173,7 +173,7 @@ if __name__ == "__main__":
"stack_id": stack_id,
"tc_name": "tc1",
"metric_type": "throughput",
- "framesizes": [64, 128, 256, 512, 1024]
+ "framesizes": [64]
}
tc_id = nc.run_rfc2544_testcase(**tc_params)
if tc_id is None: