def _populateForm(self, oForm, oData): oForm.addIntRO(TestCaseData.ksParam_idTestCase, oData.idTestCase, "Test Case ID") oForm.addTimestampRO(TestCaseData.ksParam_tsEffective, oData.tsEffective, "Last changed") oForm.addTimestampRO(TestCaseData.ksParam_tsExpire, oData.tsExpire, "Expires (excl)") oForm.addIntRO(TestCaseData.ksParam_uidAuthor, oData.uidAuthor, "Changed by UID") oForm.addIntRO(TestCaseData.ksParam_idGenTestCase, oData.idGenTestCase, "Test Case generation ID") oForm.addText(TestCaseData.ksParam_sName, oData.sName, "Name") oForm.addText(TestCaseData.ksParam_sDescription, oData.sDescription, "Description") oForm.addCheckBox(TestCaseData.ksParam_fEnabled, oData.fEnabled, "Enabled") oForm.addLong( TestCaseData.ksParam_cSecTimeout, utils.formatIntervalSeconds2(oData.cSecTimeout), "Default timeout" ) oForm.addWideText(TestCaseData.ksParam_sTestBoxReqExpr, oData.sTestBoxReqExpr, "TestBox requirements (python)") oForm.addWideText(TestCaseData.ksParam_sBuildReqExpr, oData.sBuildReqExpr, "Build requirement (python)") oForm.addWideText(TestCaseData.ksParam_sBaseCmd, oData.sBaseCmd, "Base command") oForm.addText(TestCaseData.ksParam_sValidationKitZips, oData.sValidationKitZips, "Test suite files") oForm.addListOfTestCaseArgs(TestCaseDataEx.ksParam_aoTestCaseArgs, oData.aoTestCaseArgs, "Argument variations") aoTestCaseDeps = [] for oTestCase in self._aoAllTestCases: if oTestCase.idTestCase == oData.idTestCase: continue fSelected = False for oDep in oData.aoDepTestCases: if oDep.idTestCase == oTestCase.idTestCase: fSelected = True break aoTestCaseDeps.append([oTestCase.idTestCase, fSelected, oTestCase.sName]) oForm.addListOfTestCases(TestCaseDataEx.ksParam_aoDepTestCases, aoTestCaseDeps, "Depends on test cases") aoGlobalResrcDeps = [] for oGlobalRsrc in self._aoAllGlobalRsrcs: fSelected = False for oDep in oData.aoDepGlobalResources: if oDep.idGlobalRsrc == oGlobalRsrc.idGlobalRsrc: fSelected = True break aoGlobalResrcDeps.append([oGlobalRsrc.idGlobalRsrc, fSelected, oGlobalRsrc.sName]) oForm.addListOfResources(TestCaseDataEx.ksParam_aoDepGlobalResources, aoGlobalResrcDeps, "Depends on resources") oForm.addMultilineText(TestCaseDataEx.ksParam_sComment, oData.sComment, "Comment") oForm.addSubmit() return True
def _formatListEntry(self, iEntry): """ Format *show all* table entry """ from testmanager.webui.wuiadmin import WuiAdmin oEntry = self._aoEntries[iEntry] aoActions = [ WuiTmLink('Details', WuiAdmin.ksScriptName, { WuiAdmin.ksParamAction: WuiAdmin.ksActionBuildSrcDetails, BuildSourceData.ksParam_idBuildSrc: oEntry.idBuildSrc, WuiAdmin.ksParamEffectiveDate: self._tsEffectiveDate, }), ]; if self._oDisp is None or not self._oDisp.isReadOnlyUser(): aoActions += [ WuiTmLink('Clone', WuiAdmin.ksScriptName, { WuiAdmin.ksParamAction: WuiAdmin.ksActionBuildSrcClone, BuildSourceData.ksParam_idBuildSrc: oEntry.idBuildSrc, WuiAdmin.ksParamEffectiveDate: self._tsEffectiveDate, }), ]; if isDbTimestampInfinity(oEntry.tsExpire): aoActions += [ WuiTmLink('Modify', WuiAdmin.ksScriptName, { WuiAdmin.ksParamAction: WuiAdmin.ksActionBuildSrcEdit, BuildSourceData.ksParam_idBuildSrc: oEntry.idBuildSrc } ), WuiTmLink('Remove', WuiAdmin.ksScriptName, { WuiAdmin.ksParamAction: WuiAdmin.ksActionBuildSrcDoRemove, BuildSourceData.ksParam_idBuildSrc: oEntry.idBuildSrc }, sConfirm = 'Are you sure you want to remove build source #%d?' % (oEntry.idBuildSrc,) ) ]; return [ oEntry.idBuildSrc, oEntry.sName, oEntry.sDescription, oEntry.sProduct, oEntry.sBranch, self._getSubList(oEntry.asTypes), self._getSubList(oEntry.asOsArches), oEntry.iFirstRevision, oEntry.iLastRevision, utils.formatIntervalSeconds2(oEntry.cSecMaxAge) if oEntry.cSecMaxAge is not None else None, aoActions, ]
def _populateForm(self, oForm, oData): oForm.addIntRO (TestCaseData.ksParam_idTestCase, oData.idTestCase, 'Test Case ID') oForm.addTimestampRO(TestCaseData.ksParam_tsEffective, oData.tsEffective, 'Last changed') oForm.addTimestampRO(TestCaseData.ksParam_tsExpire, oData.tsExpire, 'Expires (excl)') oForm.addIntRO (TestCaseData.ksParam_uidAuthor, oData.uidAuthor, 'Changed by UID') oForm.addIntRO (TestCaseData.ksParam_idGenTestCase, oData.idGenTestCase, 'Test Case generation ID') oForm.addText (TestCaseData.ksParam_sName, oData.sName, 'Name') oForm.addText (TestCaseData.ksParam_sDescription, oData.sDescription, 'Description') oForm.addCheckBox (TestCaseData.ksParam_fEnabled, oData.fEnabled, 'Enabled') oForm.addLong (TestCaseData.ksParam_cSecTimeout, utils.formatIntervalSeconds2(oData.cSecTimeout), 'Default timeout') oForm.addWideText (TestCaseData.ksParam_sTestBoxReqExpr, oData.sTestBoxReqExpr, 'TestBox requirements (python)'); oForm.addWideText (TestCaseData.ksParam_sBuildReqExpr, oData.sBuildReqExpr, 'Build requirement (python)'); oForm.addWideText (TestCaseData.ksParam_sBaseCmd, oData.sBaseCmd, 'Base command') oForm.addText (TestCaseData.ksParam_sValidationKitZips, oData.sValidationKitZips, 'Test suite files') oForm.addListOfTestCaseArgs(TestCaseDataEx.ksParam_aoTestCaseArgs, oData.aoTestCaseArgs, 'Argument variations') aoTestCaseDeps = []; for oTestCase in self._aoAllTestCases: if oTestCase.idTestCase == oData.idTestCase: continue; fSelected = False; for oDep in oData.aoDepTestCases: if oDep.idTestCase == oTestCase.idTestCase: fSelected = True; break; aoTestCaseDeps.append([oTestCase.idTestCase, fSelected, oTestCase.sName]); oForm.addListOfTestCases(TestCaseDataEx.ksParam_aoDepTestCases, aoTestCaseDeps, 'Depends on test cases') aoGlobalResrcDeps = []; for oGlobalRsrc in self._aoAllGlobalRsrcs: fSelected = False; for oDep in oData.aoDepGlobalResources: if oDep.idGlobalRsrc == oGlobalRsrc.idGlobalRsrc: fSelected = True; break; aoGlobalResrcDeps.append([oGlobalRsrc.idGlobalRsrc, fSelected, oGlobalRsrc.sName]); oForm.addListOfResources(TestCaseDataEx.ksParam_aoDepGlobalResources, aoGlobalResrcDeps, 'Depends on resources') oForm.addSubmit(); return True;
def _populateForm(self, oForm, oData): oForm.addIntRO (BuildSourceData.ksParam_idBuildSrc, oData.idBuildSrc, 'Build Source item ID') oForm.addTimestampRO(BuildSourceData.ksParam_tsEffective, oData.tsEffective, 'Last changed') oForm.addTimestampRO(BuildSourceData.ksParam_tsExpire, oData.tsExpire, 'Expires (excl)') oForm.addIntRO (BuildSourceData.ksParam_uidAuthor, oData.uidAuthor, 'Changed by UID') oForm.addText (BuildSourceData.ksParam_sName, oData.sName, 'Name') oForm.addText (BuildSourceData.ksParam_sDescription, oData.sDescription, 'Description') oForm.addText (BuildSourceData.ksParam_sProduct, oData.sProduct, 'Product') oForm.addText (BuildSourceData.ksParam_sBranch, oData.sBranch, 'Branch') asTypes = self.getListOfItems(coreconsts.g_kasBuildTypesAll, oData.asTypes); oForm.addListOfTypes(BuildSourceData.ksParam_asTypes, asTypes, 'Build types') asOsArches = self.getListOfItems(coreconsts.g_kasOsDotCpusAll, oData.asOsArches); oForm.addListOfOsArches(BuildSourceData.ksParam_asOsArches, asOsArches, 'Target architectures') oForm.addInt (BuildSourceData.ksParam_iFirstRevision, oData.iFirstRevision, 'Starting from revision') oForm.addInt (BuildSourceData.ksParam_iLastRevision, oData.iLastRevision, 'Ending by revision') oForm.addLong (BuildSourceData.ksParam_cSecMaxAge, utils.formatIntervalSeconds2(oData.cSecMaxAge) if oData.cSecMaxAge not in [-1, '', None] else '', 'Max age in seconds'); oForm.addSubmit(); return True;
def addListOfTestCaseArgs(self, sName, aoVariations, sLabel): # pylint: disable=R0915 """ Adds a list of test case argument variations to the form. @param sName Name of HTML form element @param aoVariations List of TestCaseArgsData instances. @param sLabel Label of HTML form element """ self._addLabel(sName, sLabel); sTableId = 'TestArgsExtendingListRoot'; fReadOnly = self._fReadOnly; ## @todo argument? sReadOnlyAttr = ' readonly class="tmform-input-readonly"' if fReadOnly else ''; sHtml = '<li>\n' # # Define javascript function for extending the list of test case # variations. Doing it here so we can use the python constants. This # also permits multiple argument lists on one page should that ever be # required... # if not fReadOnly: sHtml += '<script type="text/javascript">\n' sHtml += '\n'; sHtml += 'g_%s_aItems = { %s };\n' % (sName, ', '.join(('%s: 1' % (i,)) for i in range(len(aoVariations))),); sHtml += 'g_%s_cItems = %s;\n' % (sName, len(aoVariations),); sHtml += 'g_%s_iIdMod = %s;\n' % (sName, len(aoVariations) + 32); sHtml += '\n'; sHtml += 'function %s_removeEntry(sId)\n' % (sName,); sHtml += '{\n'; sHtml += ' if (g_%s_cItems > 1)\n' % (sName,); sHtml += ' {\n'; sHtml += ' g_%s_cItems--;\n' % (sName,); sHtml += ' delete g_%s_aItems[sId];\n' % (sName,); sHtml += ' setElementValueToKeyList(\'%s\', g_%s_aItems);\n' % (sName, sName); sHtml += '\n'; for iInput in range(8): sHtml += ' removeHtmlNode(\'%s[\' + sId + \'][%s]\');\n' % (sName, iInput,); sHtml += ' }\n'; sHtml += '}\n'; sHtml += '\n'; sHtml += 'function %s_extendListEx(cGangMembers, cSecTimeout, sArgs, sTestBoxReqExpr, sBuildReqExpr)\n' % (sName,); sHtml += '{\n'; sHtml += ' var oElement = document.getElementById(\'%s\');\n' % (sTableId,); sHtml += ' var oTBody = document.createElement(\'tbody\');\n'; sHtml += ' var sHtml = \'\';\n'; sHtml += ' var sId;\n'; sHtml += '\n'; sHtml += ' g_%s_iIdMod += 1;\n' % (sName,); sHtml += ' sId = g_%s_iIdMod.toString();\n' % (sName,); oVarDefaults = TestCaseArgsData(); oVarDefaults.convertToParamNull(); sHtml += '\n'; sHtml += ' sHtml += \'<tr class="tmform-testcasevars-first-row">\';\n'; sHtml += ' sHtml += \' <td>Gang Members:</td>\';\n'; sHtml += ' sHtml += \' <td class="tmform-field-tiny-int">' \ '<input name="%s[\' + sId + \'][%s]" id="%s[\' + sId + \'][0]" value="\' + cGangMembers + \'"></td>\';\n' \ % (sName, TestCaseArgsData.ksParam_cGangMembers, sName,); sHtml += ' sHtml += \' <td>Timeout:</td>\';\n'; sHtml += ' sHtml += \' <td class="tmform-field-int">' \ '<input name="%s[\' + sId + \'][%s]" id="%s[\' + sId + \'][1]" value="\'+ cSecTimeout + \'"></td>\';\n' \ % (sName, TestCaseArgsData.ksParam_cSecTimeout, sName,); sHtml += ' sHtml += \' <td><a href="#" onclick="%s_removeEntry(\\\'\' + sId + \'\\\');"> Remove</a></td>\';\n' \ % (sName, ); sHtml += ' sHtml += \' <td></td>\';\n'; sHtml += ' sHtml += \'</tr>\';\n' sHtml += '\n'; sHtml += ' sHtml += \'<tr class="tmform-testcasevars-inner-row">\';\n'; sHtml += ' sHtml += \' <td>Arguments:</td>\';\n'; sHtml += ' sHtml += \' <td class="tmform-field-wide100" colspan="4">' \ '<input name="%s[\' + sId + \'][%s]" id="%s[\' + sId + \'][2]" value="\' + sArgs + \'"></td>\';\n' \ % (sName, TestCaseArgsData.ksParam_sArgs, sName,); sHtml += ' sHtml += \' <td></td>\';\n'; sHtml += ' sHtml += \'</tr>\';\n' sHtml += '\n'; sHtml += ' sHtml += \'<tr class="tmform-testcasevars-inner-row">\';\n'; sHtml += ' sHtml += \' <td>TestBox Reqs:</td>\';\n'; sHtml += ' sHtml += \' <td class="tmform-field-wide100" colspan="4">' \ '<input name="%s[\' + sId + \'][%s]" id="%s[\' + sId + \'][2]" value="\' + sTestBoxReqExpr' \ ' + \'"></td>\';\n' \ % (sName, TestCaseArgsData.ksParam_sTestBoxReqExpr, sName,); sHtml += ' sHtml += \' <td></td>\';\n'; sHtml += ' sHtml += \'</tr>\';\n' sHtml += '\n'; sHtml += ' sHtml += \'<tr class="tmform-testcasevars-final-row">\';\n'; sHtml += ' sHtml += \' <td>Build Reqs:</td>\';\n'; sHtml += ' sHtml += \' <td class="tmform-field-wide100" colspan="4">' \ '<input name="%s[\' + sId + \'][%s]" id="%s[\' + sId + \'][2]" value="\' + sBuildReqExpr + \'"></td>\';\n' \ % (sName, TestCaseArgsData.ksParam_sBuildReqExpr, sName,); sHtml += ' sHtml += \' <td></td>\';\n'; sHtml += ' sHtml += \'</tr>\';\n' sHtml += '\n'; sHtml += ' oTBody.id = \'%s[\' + sId + \'][6]\';\n' % (sName,); sHtml += ' oTBody.innerHTML = sHtml;\n'; sHtml += '\n'; sHtml += ' oElement.appendChild(oTBody);\n'; sHtml += '\n'; sHtml += ' g_%s_aItems[sId] = 1;\n' % (sName,); sHtml += ' g_%s_cItems++;\n' % (sName,); sHtml += ' setElementValueToKeyList(\'%s\', g_%s_aItems);\n' % (sName, sName); sHtml += '}\n'; sHtml += 'function %s_extendList()\n' % (sName,); sHtml += '{\n'; sHtml += ' %s_extendListEx("%s", "%s", "%s", "%s", "%s");\n' % (sName, escapeAttr(str(oVarDefaults.cGangMembers)), escapeAttr(str(oVarDefaults.cSecTimeout)), escapeAttr(oVarDefaults.sArgs), escapeAttr(oVarDefaults.sTestBoxReqExpr), escapeAttr(oVarDefaults.sBuildReqExpr), ); sHtml += '}\n'; if config.g_kfVBoxSpecific: sSecTimeoutDef = escapeAttr(str(oVarDefaults.cSecTimeout)); sHtml += 'function vbox_%s_add_uni()\n' % (sName,); sHtml += '{\n'; sHtml += ' %s_extendListEx("1", "%s", "--cpu-counts 1 --virt-modes raw", ' \ ' "", "");\n' % (sName, sSecTimeoutDef); sHtml += ' %s_extendListEx("1", "%s", "--cpu-counts 1 --virt-modes hwvirt", ' \ ' "fCpuHwVirt is True", "");\n' % (sName, sSecTimeoutDef); sHtml += ' %s_extendListEx("1", "%s", "--cpu-counts 1 --virt-modes hwvirt-np", ' \ ' "fCpuNestedPaging is True", "");\n' % (sName, sSecTimeoutDef); sHtml += '}\n'; sHtml += 'function vbox_%s_add_uni_amd64()\n' % (sName,); sHtml += '{\n'; sHtml += ' %s_extendListEx("1", "%s", "--cpu-counts 1 --virt-modes hwvirt", ' \ ' "fCpuHwVirt is True", "");\n' % (sName, sSecTimeoutDef); sHtml += ' %s_extendListEx("1", "%s", "--cpu-counts 1 --virt-modes hwvirt-np", ' \ ' "fCpuNestedPaging is True", "");\n' % (sName, sSecTimeoutDef); sHtml += '}\n'; sHtml += 'function vbox_%s_add_smp()\n' % (sName,); sHtml += '{\n'; sHtml += ' %s_extendListEx("1", "%s", "--cpu-counts 2 --virt-modes hwvirt",' \ ' "fCpuHwVirt is True and cCpus >= 2", "");\n' % (sName, sSecTimeoutDef); sHtml += ' %s_extendListEx("1", "%s", "--cpu-counts 2 --virt-modes hwvirt-np",' \ ' "fCpuNestedPaging is True and cCpus >= 2", "");\n' % (sName, sSecTimeoutDef); sHtml += ' %s_extendListEx("1", "%s", "--cpu-counts 3 --virt-modes hwvirt",' \ ' "fCpuHwVirt is True and cCpus >= 3", "");\n' % (sName, sSecTimeoutDef); sHtml += ' %s_extendListEx("1", "%s", "--cpu-counts 4 --virt-modes hwvirt-np ",' \ ' "fCpuNestedPaging is True and cCpus >= 4", "");\n' % (sName, sSecTimeoutDef); #sHtml += ' %s_extendListEx("1", "%s", "--cpu-counts 6 --virt-modes hwvirt",' \ # ' "fCpuHwVirt is True and cCpus >= 6", "");\n' % (sName, sSecTimeoutDef); #sHtml += ' %s_extendListEx("1", "%s", "--cpu-counts 8 --virt-modes hwvirt-np",' \ # ' "fCpuNestedPaging is True and cCpus >= 8", "");\n' % (sName, sSecTimeoutDef); sHtml += '}\n'; sHtml += '</script>\n'; # # List current entries. # sHtml += '<input type="hidden" name="%s" id="%s" value="%s">\n' \ % (sName, sName, ','.join(str(i) for i in range(len(aoVariations))), ); sHtml += ' <table id="%s" class="tmform-testcasevars">\n' % (sTableId,) if not fReadOnly: sHtml += ' <caption>\n' \ ' <a href="#" onClick="%s_extendList()">Add</a>\n' % (sName,); if config.g_kfVBoxSpecific: sHtml += ' [<a href="#" onClick="vbox_%s_add_uni()">Single CPU Variations</a>\n' % (sName,); sHtml += ' <a href="#" onClick="vbox_%s_add_uni_amd64()">amd64</a>]\n' % (sName,); sHtml += ' [<a href="#" onClick="vbox_%s_add_smp()">SMP Variations</a>]\n' % (sName,); sHtml += ' </caption>\n'; dSubErrors = {}; if sName in self._dErrors and isinstance(self._dErrors[sName], dict): dSubErrors = self._dErrors[sName]; for iVar in range(len(aoVariations)): oVar = copy.copy(aoVariations[iVar]); oVar.convertToParamNull(); sHtml += '<tbody id="%s[%s][6]">\n' % (sName, iVar,) sHtml += ' <tr class="tmform-testcasevars-first-row">\n' \ ' <td>Gang Members:</td>' \ ' <td class="tmform-field-tiny-int"><input name="%s[%s][%s]" id="%s[%s][1]" value="%s"%s></td>\n' \ ' <td>Timeout:</td>' \ ' <td class="tmform-field-int"><input name="%s[%s][%s]" id="%s[%s][2]" value="%s"%s></td>\n' \ % ( sName, iVar, TestCaseArgsData.ksParam_cGangMembers, sName, iVar, oVar.cGangMembers, sReadOnlyAttr, sName, iVar, TestCaseArgsData.ksParam_cSecTimeout, sName, iVar, utils.formatIntervalSeconds2(oVar.cSecTimeout), sReadOnlyAttr, ); if not fReadOnly: sHtml += ' <td><a href="#" onclick="%s_removeEntry(\'%s\');">Remove</a></td>\n' \ % (sName, iVar); else: sHtml += ' <td></td>\n'; sHtml += ' <td class="tmform-testcasevars-stupid-border-column"></td>\n' \ ' </tr>\n'; sHtml += ' <tr class="tmform-testcasevars-inner-row">\n' \ ' <td>Arguments:</td>' \ ' <td class="tmform-field-wide100" colspan="4">' \ '<input name="%s[%s][%s]" id="%s[%s][3]" value="%s"%s></td>\n' \ ' <td></td>\n' \ ' </tr>\n' \ % ( sName, iVar, TestCaseArgsData.ksParam_sArgs, sName, iVar, escapeAttr(oVar.sArgs), sReadOnlyAttr) sHtml += ' <tr class="tmform-testcasevars-inner-row">\n' \ ' <td>TestBox Reqs:</td>' \ ' <td class="tmform-field-wide100" colspan="4">' \ '<input name="%s[%s][%s]" id="%s[%s][4]" value="%s"%s></td>\n' \ ' <td></td>\n' \ ' </tr>\n' \ % ( sName, iVar, TestCaseArgsData.ksParam_sTestBoxReqExpr, sName, iVar, escapeAttr(oVar.sTestBoxReqExpr), sReadOnlyAttr) sHtml += ' <tr class="tmform-testcasevars-final-row">\n' \ ' <td>Build Reqs:</td>' \ ' <td class="tmform-field-wide100" colspan="4">' \ '<input name="%s[%s][%s]" id="%s[%s][5]" value="%s"%s></td>\n' \ ' <td></td>\n' \ ' </tr>\n' \ % ( sName, iVar, TestCaseArgsData.ksParam_sBuildReqExpr, sName, iVar, escapeAttr(oVar.sBuildReqExpr), sReadOnlyAttr) if iVar in dSubErrors: sHtml += ' <tr><td colspan="4"><p align="left" class="tmform-error-desc">%s</p></td></tr>\n' \ % (self._escapeErrorText(dSubErrors[iVar]),); sHtml += '</tbody>\n'; sHtml += ' </table>\n' sHtml += '</li>\n' return self._add(sHtml)
def _populateForm(self, oForm, oData): oForm.addIntRO(TestCaseData.ksParam_idTestCase, oData.idTestCase, 'Test Case ID') oForm.addTimestampRO(TestCaseData.ksParam_tsEffective, oData.tsEffective, 'Last changed') oForm.addTimestampRO(TestCaseData.ksParam_tsExpire, oData.tsExpire, 'Expires (excl)') oForm.addIntRO(TestCaseData.ksParam_uidAuthor, oData.uidAuthor, 'Changed by UID') oForm.addIntRO(TestCaseData.ksParam_idGenTestCase, oData.idGenTestCase, 'Test Case generation ID') oForm.addText(TestCaseData.ksParam_sName, oData.sName, 'Name') oForm.addText(TestCaseData.ksParam_sDescription, oData.sDescription, 'Description') oForm.addCheckBox(TestCaseData.ksParam_fEnabled, oData.fEnabled, 'Enabled') oForm.addLong(TestCaseData.ksParam_cSecTimeout, utils.formatIntervalSeconds2(oData.cSecTimeout), 'Default timeout') oForm.addWideText(TestCaseData.ksParam_sTestBoxReqExpr, oData.sTestBoxReqExpr, 'TestBox requirements (python)') oForm.addWideText(TestCaseData.ksParam_sBuildReqExpr, oData.sBuildReqExpr, 'Build requirement (python)') oForm.addWideText(TestCaseData.ksParam_sBaseCmd, oData.sBaseCmd, 'Base command') oForm.addText(TestCaseData.ksParam_sValidationKitZips, oData.sValidationKitZips, 'Test suite files') oForm.addListOfTestCaseArgs(TestCaseDataEx.ksParam_aoTestCaseArgs, oData.aoTestCaseArgs, 'Argument variations') aoTestCaseDeps = [] for oTestCase in self._aoAllTestCases: if oTestCase.idTestCase == oData.idTestCase: continue fSelected = False for oDep in oData.aoDepTestCases: if oDep.idTestCase == oTestCase.idTestCase: fSelected = True break aoTestCaseDeps.append( [oTestCase.idTestCase, fSelected, oTestCase.sName]) oForm.addListOfTestCases(TestCaseDataEx.ksParam_aoDepTestCases, aoTestCaseDeps, 'Depends on test cases') aoGlobalResrcDeps = [] for oGlobalRsrc in self._aoAllGlobalRsrcs: fSelected = False for oDep in oData.aoDepGlobalResources: if oDep.idGlobalRsrc == oGlobalRsrc.idGlobalRsrc: fSelected = True break aoGlobalResrcDeps.append( [oGlobalRsrc.idGlobalRsrc, fSelected, oGlobalRsrc.sName]) oForm.addListOfResources(TestCaseDataEx.ksParam_aoDepGlobalResources, aoGlobalResrcDeps, 'Depends on resources') oForm.addSubmit() return True
def _formatListEntry(self, iEntry): """ Format *show all* table entry """ from testmanager.webui.wuiadmin import WuiAdmin oEntry = self._aoEntries[iEntry] aoActions = [ WuiTmLink( 'Details', WuiAdmin.ksScriptName, { WuiAdmin.ksParamAction: WuiAdmin.ksActionBuildSrcDetails, BuildSourceData.ksParam_idBuildSrc: oEntry.idBuildSrc, WuiAdmin.ksParamEffectiveDate: self._tsEffectiveDate, }), ] if self._oDisp is None or not self._oDisp.isReadOnlyUser(): aoActions += [ WuiTmLink( 'Clone', WuiAdmin.ksScriptName, { WuiAdmin.ksParamAction: WuiAdmin.ksActionBuildSrcClone, BuildSourceData.ksParam_idBuildSrc: oEntry.idBuildSrc, WuiAdmin.ksParamEffectiveDate: self._tsEffectiveDate, }), ] if isDbTimestampInfinity(oEntry.tsExpire): aoActions += [ WuiTmLink( 'Modify', WuiAdmin.ksScriptName, { WuiAdmin.ksParamAction: WuiAdmin.ksActionBuildSrcEdit, BuildSourceData.ksParam_idBuildSrc: oEntry.idBuildSrc }), WuiTmLink( 'Remove', WuiAdmin.ksScriptName, { WuiAdmin.ksParamAction: WuiAdmin.ksActionBuildSrcDoRemove, BuildSourceData.ksParam_idBuildSrc: oEntry.idBuildSrc }, sConfirm= 'Are you sure you want to remove build source #%d?' % (oEntry.idBuildSrc, )) ] return [ oEntry.idBuildSrc, oEntry.sName, oEntry.sDescription, oEntry.sProduct, oEntry.sBranch, self._getSubList(oEntry.asTypes), self._getSubList(oEntry.asOsArches), oEntry.iFirstRevision, oEntry.iLastRevision, utils.formatIntervalSeconds2(oEntry.cSecMaxAge) if oEntry.cSecMaxAge is not None else None, aoActions, ]