summaryrefslogtreecommitdiffstats
path: root/robotframework-onap/loadtest/TestConfig.py
diff options
context:
space:
mode:
authorDR695H <dr695h@att.com>2019-08-28 10:52:51 -0400
committerDR695H <dr695h@att.com>2019-08-28 11:21:56 -0400
commitf2b75da8dd38077c60cc2c852f73092980c1f906 (patch)
treef58fc4de4f54eec45e10717fabcb62d7cbe64182 /robotframework-onap/loadtest/TestConfig.py
parent566c583bbfe0b5a4e46af7ac53765a1340d11fc0 (diff)
fix linter errors and copyright
Change-Id: Idf7384307623c70a9f7714a5d276f404873c5974 Issue-ID: TEST-198 Signed-off-by: DR695H <dr695h@att.com>
Diffstat (limited to 'robotframework-onap/loadtest/TestConfig.py')
-rw-r--r--robotframework-onap/loadtest/TestConfig.py59
1 files changed, 0 insertions, 59 deletions
diff --git a/robotframework-onap/loadtest/TestConfig.py b/robotframework-onap/loadtest/TestConfig.py
deleted file mode 100644
index b9b8112..0000000
--- a/robotframework-onap/loadtest/TestConfig.py
+++ /dev/null
@@ -1,59 +0,0 @@
-'''
-Created on Apr 7, 2017
-
-@author: jf9860
-'''
-import json
-
-class TestConfig(object):
- '''
- The profile defines a cycle of tests. Each entry is defined as
- [<seconds to wait>, [<list of ete tags to run after the wait]],
- '''
- profile = [
- [0, ["health"]],
- ]
-
- duration=10
- cyclelength=60
-
- def __init__(self, duration=None, cyclelength=None, json=None):
- '''
- Constructor
- '''
- if (json != None):
- self.parseConfig(json)
- if (duration != None):
- self.duration = duration
- if (cyclelength != None):
- self.cyclelength = cyclelength
- running_time = 0
- for p in self.profile:
- secs = p[0]
- running_time = running_time + secs
- if (running_time < self.cyclelength):
- last = self.cyclelength - running_time
- self.profile.append([last, []])
-
- def parseConfig(self, fileName):
- with open(fileName) as data_file:
- config = json.load(data_file)
- self.profile = config["profile"]
- self.cyclelength = config["cyclelength"]
- self.duration = config["duration"]
-
-
- def to_string(self):
- pstring = 'Cycle length is {} seconds'.format(self.cyclelength)
- pstring = '{}\nDuration is {} seconds'.format(pstring, self.duration)
- running_time = 0
- for p in self.profile:
- secs = p[0]
- running_time = running_time + secs
- for ete in p[1]:
- pstring = "{0}\n{1:08d} : {2:08d} : {3}".format(pstring, secs, running_time, ete)
- if (len(p[1]) == 0):
- pstring = "{0}\n{1:08d} : {2:08d} : {3}".format(pstring, secs, running_time, "")
- return pstring
-
-