11 from __future__
import print_function
12 from future
import standard_library
13 standard_library.install_aliases()
23 from yapsy.PluginManager
import PluginManager
25 from ExecutorMTTTool
import *
37 ExecutorMTTTool.__init__(self)
39 self.
parser = configparser.ConfigParser()
40 self.parser.optionxform = str
49 IPlugin.activate(self)
53 IPlugin.deactivate(self)
57 return "Combinatorial executor"
60 lines = testDef.printOptions(self.
options)
70 tempSpecialSection = {}
72 writeOption = configparser.ConfigParser()
73 writeOption.optionxform = str
75 for section
in self.baseIniFile.sections():
78 if section.startswith(
"SKIP")
or section.startswith(
"skip"):
84 self.parser.add_section(section)
85 for option
in self.baseIniFile.options(section):
86 self.parser.set(section, option, self.baseIniFile.get(section, option))
88 fd, fileName = tempfile.mkstemp(suffix=
".ini", dir = self.
tempDir)
89 with open(fileName,
'w')
as configfile:
90 self.parser.write(configfile)
92 self.parser.remove_section(section)
93 if "MiddlewareGet" in section:
94 self.
runLog[section] = fileName
95 elif "TestRun" in section:
96 tempSpecialSection[section] = fileName
98 self.
iniLog[section] = fileName
101 for section
in self.
runLog:
102 self.parser.read(self.
runLog[section])
103 for id
in tempSpecialSection:
104 self.parser.read(tempSpecialSection[id])
105 fd, fileName = tempfile.mkstemp(suffix =
".ini", dir = self.
tempDir)
106 with open(fileName,
'w')
as configfile:
107 self.parser.write(configfile)
108 self.parser.remove_section(id)
109 tempList[fd] = fileName
110 self.parser.remove_section(section)
115 for section
in self.
iniLog:
116 writeOption.read(self.
iniLog[section])
117 for option
in writeOption.options(section):
118 if ',' in writeOption.get(section, option):
120 if optionsCSV[section]
is not None:
123 optionsCSV[section] = []
124 optionsCSV[section].append(option)
129 self.parser.read(self.
runLog[fd])
130 if not self.parser.has_section(section):
131 self.parser.add_section(section)
132 self.parser.set(section, option, writeOption.get(section, option))
134 with open(self.
runLog[fd],
'w')
as configfile:
135 self.parser.write(configfile)
137 for sect
in self.parser.sections():
138 self.parser.remove_section(sect)
139 writeOption.remove_section(section)
141 for section
in optionsCSV:
142 self.parser.read(self.
iniLog[section])
143 for option
in optionsCSV[section]:
145 rawList = self.parser.get(section, option)
146 splitList = rawList.split(
',')
148 for item
in splitList:
149 optionList.append(item.strip())
152 writeOption.read(self.
runLog[fd])
153 for nextOpt
in optionList:
155 if writeOption.has_section(section):
158 writeOption.add_section(section)
159 writeOption.set(section, option, nextOpt)
160 fd, fileName = tempfile.mkstemp(suffix=
".ini", dir = self.
tempDir)
161 with open(fileName,
'w')
as configfile:
162 writeOption.write(configfile)
163 newList[fd] = fileName
164 for sect
in writeOption.sections():
165 writeOption.remove_section(sect)
169 self.parser.remove_section(section)
172 testDef.logger.verbose_print(
"ExecuteCombinatorial")
177 print(
"Error, empty run log, combinatorial executor failed")
179 for nextFile
in self.
runLog:
180 if not os.path.isfile(self.
runLog[nextFile]):
181 print(
"Test .ini file not found!: " + nextFile)
183 testDef.configNewTest(self.
runLog[nextFile])
184 sequential_status = testDef.executeTest()
185 if sequential_status != 0: