aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/vnf/ims/ixia
diff options
context:
space:
mode:
Diffstat (limited to 'functest/opnfv_tests/vnf/ims/ixia')
-rw-r--r--functest/opnfv_tests/vnf/ims/ixia/utils/IxLoadUtils.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/functest/opnfv_tests/vnf/ims/ixia/utils/IxLoadUtils.py b/functest/opnfv_tests/vnf/ims/ixia/utils/IxLoadUtils.py
index d8003e46..50dfbc66 100644
--- a/functest/opnfv_tests/vnf/ims/ixia/utils/IxLoadUtils.py
+++ b/functest/opnfv_tests/vnf/ims/ixia/utils/IxLoadUtils.py
@@ -11,7 +11,9 @@ import requests
import sys
import time
import logging
-from IxRestUtils import formatDictToJSONPayload
+
+from functest.opnfv_tests.vnf.ims.ixia.utils import IxRestUtils
+
kActionStateFinished = 'finished'
kActionStatusSuccessful = 'Successful'
@@ -80,7 +82,7 @@ def performGenericOperation(connection, url, payloadDict):
it will wait for it to finish.
"""
- data = formatDictToJSONPayload(payloadDict)
+ data = IxRestUtils.formatDictToJSONPayload(payloadDict)
reply = connection.httpPost(url=url, data=data)
waitForActionToFinish(connection, reply, url)
@@ -93,7 +95,7 @@ def performGenericPost(connection, listUrl, payloadDict):
This will perform a generic POST method on a given url
"""
- data = formatDictToJSONPayload(payloadDict)
+ data = IxRestUtils.formatDictToJSONPayload(payloadDict)
reply = connection.httpPost(url=listUrl, data=data)
try:
@@ -111,7 +113,7 @@ def performGenericDelete(connection, listUrl, payloadDict):
This will perform a generic DELETE method on a given url
"""
- data = formatDictToJSONPayload(payloadDict)
+ data = IxRestUtils.formatDictToJSONPayload(payloadDict)
reply = connection.httpDelete(url=listUrl, data=data)
return reply
@@ -122,7 +124,7 @@ def performGenericPatch(connection, url, payloadDict):
This will perform a generic PATCH method on a given url
"""
- data = formatDictToJSONPayload(payloadDict)
+ data = IxRestUtils.formatDictToJSONPayload(payloadDict)
reply = connection.httpPatch(url=url, data=data)
return reply
@@ -307,12 +309,11 @@ def pollStats(connection, sessionUrl, watchedStatsDict, pollingInterval=4):
for timestamp in newTimestamps:
timeStampStr = str(timestamp)
- collectedTimestamps.setdefault(statSource, []).append(
- timeStampStr)
+ collectedTimestamps.setdefault(
+ statSource, []).append(timeStampStr)
- timestampDict = statsDict.setdefault(statSource,
- {}).setdefault(
- timestamp, {})
+ timestampDict = statsDict.setdefault(
+ statSource, {}).setdefault(timestamp, {})
# save the values for the current timestamp,
# and later print them