8 class TestConfig(object):
10 The profile defines a cycle of tests. Each entry is defined as
11 [<seconds to wait>, [<list of ete tags to run after the wait]],
20 def __init__(self, duration=None, cyclelength=None, json=None):
25 self.parseConfig(json)
26 if (duration != None):
27 self.duration = duration
28 if (cyclelength != None):
29 self.cyclelength = cyclelength
31 for p in self.profile:
33 running_time = running_time + secs
34 if (running_time < self.cyclelength):
35 last = self.cyclelength - running_time
36 self.profile.append([last, []])
38 def parseConfig(self, fileName):
39 with open(fileName) as data_file:
40 config = json.load(data_file)
41 self.profile = config["profile"]
42 self.cyclelength = config["cyclelength"]
43 self.duration = config["duration"]
47 pstring = 'Cycle length is {} seconds'.format(self.cyclelength)
48 pstring = '{}\nDuration is {} seconds'.format(pstring, self.duration)
50 for p in self.profile:
52 running_time = running_time + secs
54 pstring = "{0}\n{1:08d} : {2:08d} : {3}".format(pstring, secs, running_time, ete)
56 pstring = "{0}\n{1:08d} : {2:08d} : {3}".format(pstring, secs, running_time, "")