diff options
author | Jerry Flood <jf9860@att.com> | 2017-04-12 09:46:44 -0400 |
---|---|---|
committer | Jerry Flood <jf9860@att.com> | 2017-04-12 10:36:32 -0400 |
commit | b88fc2d930537a47b12115a899322fb9cebbc0c1 (patch) | |
tree | b6bfa126823c1937159e0a6cb0fbcac6621d551d /loadtest/TestConfig.py | |
parent | 26151066fb0c53c62cc5ecbe1637482be59c497c (diff) |
TEST-2 load/soak test utility
Command line load/soak test utility to run multple ETE
tests at once.
Change-Id: I4b0224d4fbdf82964acaf7704a5e6d9802d8a0e1
Signed-off-by: Jerry Flood <jf9860@att.com>
Diffstat (limited to 'loadtest/TestConfig.py')
-rw-r--r-- | loadtest/TestConfig.py | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/loadtest/TestConfig.py b/loadtest/TestConfig.py new file mode 100644 index 0000000..c22e875 --- /dev/null +++ b/loadtest/TestConfig.py @@ -0,0 +1,51 @@ +''' +Created on Apr 7, 2017 + +@author: jf9860 +''' +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"]], + [5, ["instantiate", "distribute"]], + [300, ["distribute"]], + [300, ["distribute"]], + [300, ["distribute"]], + [300, ["distribute"]], + [300, ["distribute"]], + ] + + duration=10 + cyclelength=60 + + def __init__(self, duration=10, cyclelength=1800, json=None): + ''' + Constructor + ''' + self.duration = duration + self.cyclelength = cyclelength + running_time = 0 + for p in self.profile: + secs = p[0] + running_time = running_time + secs + if (running_time < cyclelength): + last = cyclelength - running_time + self.profile.append([last, []]) + + 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 + + |