- Timestamp:
- Jan 3, 2017 4:14:37 PM (8 years ago)
- Location:
- trunk/src/VBox/ValidationKit/testmanager/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/core/testbox.py
r65040 r65084 339 339 return dErrors; 340 340 341 def formatPythonVersion(self): 342 """ 343 Unbuttons the version number and formats it as a version string. 344 """ 345 if self.iPythonHexVersion is None: 341 @staticmethod 342 def formatPythonVersionEx(iPythonHexVersion): 343 """ Unbuttons the version number and formats it as a version string. """ 344 if iPythonHexVersion is None: 346 345 return 'N/A'; 347 346 return 'v%d.%d.%d.%d' \ 348 % ( self.iPythonHexVersion >> 24, 349 (self.iPythonHexVersion >> 16) & 0xff, 350 (self.iPythonHexVersion >> 8) & 0xff, 351 self.iPythonHexVersion & 0xff); 347 % ( iPythonHexVersion >> 24, 348 (iPythonHexVersion >> 16) & 0xff, 349 (iPythonHexVersion >> 8) & 0xff, 350 iPythonHexVersion & 0xff); 351 352 def formatPythonVersion(self): 353 """ Unbuttons the version number and formats it as a version string. """ 354 return self.formatPythonVersionEx(self.iPythonHexVersion); 355 356 357 @staticmethod 358 def getCpuFamilyEx(lCpuRevision): 359 """ Returns the CPU family for a x86 or amd64 testboxes.""" 360 if lCpuRevision is None: 361 return 0; 362 return (lCpuRevision >> 24 & 0xff); 352 363 353 364 def getCpuFamily(self): 354 365 """ Returns the CPU family for a x86 or amd64 testboxes.""" 355 if self.lCpuRevision is None: 366 return self.getCpuFamilyEx(self.lCpuRevision); 367 368 @staticmethod 369 def getCpuModelEx(lCpuRevision): 370 """ Returns the CPU model for a x86 or amd64 testboxes.""" 371 if lCpuRevision is None: 356 372 return 0; 357 return ( self.lCpuRevision >> 24 & 0xff);373 return (lCpuRevision >> 8 & 0xffff); 358 374 359 375 def getCpuModel(self): 360 376 """ Returns the CPU model for a x86 or amd64 testboxes.""" 361 if self.lCpuRevision is None: 377 return self.getCpuModelEx(self.lCpuRevision); 378 379 @staticmethod 380 def getCpuSteppingEx(lCpuRevision): 381 """ Returns the CPU stepping for a x86 or amd64 testboxes.""" 382 if lCpuRevision is None: 362 383 return 0; 363 return ( self.lCpuRevision >> 8 & 0xffff);384 return (lCpuRevision & 0xff); 364 385 365 386 def getCpuStepping(self): 366 387 """ Returns the CPU stepping for a x86 or amd64 testboxes.""" 367 if self.lCpuRevision is None: 368 return 0; 369 return (self.lCpuRevision & 0xff); 388 return self.getCpuSteppingEx(self.lCpuRevision); 389 370 390 371 391 # The following is a translation of the g_aenmIntelFamily06 array in CPUMR3CpuId.cpp: … … 436 456 }; 437 457 438 def queryCpuMicroarch(self): 458 @staticmethod 459 def queryCpuMicroarchEx(lCpuRevision, sCpuVendor): 439 460 """ Try guess the microarch name for the cpu. Returns None if we cannot. """ 440 if self.lCpuRevision is None or self.sCpuVendor is None:461 if lCpuRevision is None or sCpuVendor is None: 441 462 return None; 442 uFam = self.getCpuFamily();443 uMod = self.getCpuModel();444 if s elf.sCpuVendor == 'GenuineIntel':463 uFam = TestBoxData.getCpuFamilyEx(lCpuRevision); 464 uMod = TestBoxData.getCpuModelEx(lCpuRevision); 465 if sCpuVendor == 'GenuineIntel': 445 466 if uFam == 6: 446 return self.kdIntelFamily06.get(uMod, None);467 return TestBoxData.kdIntelFamily06.get(uMod, None); 447 468 if uFam == 15: 448 return self.kdIntelFamily15.get(uMod, None);449 elif s elf.sCpuVendor == 'AuthenticAMD':469 return TestBoxData.kdIntelFamily15.get(uMod, None); 470 elif sCpuVendor == 'AuthenticAMD': 450 471 if uFam == 0xf: 451 472 if uMod < 0x10: return 'K8_130nm'; … … 464 485 if uFam == 0x16: 465 486 return 'Jaguar'; 466 elif s elf.sCpuVendor == 'CentaurHauls':487 elif sCpuVendor == 'CentaurHauls': 467 488 if uFam == 0x05: 468 489 if uMod == 0x01: return 'Centaur_C6'; … … 473 494 if uMod == 0x05: return 'VIA_C3_M2'; 474 495 if uMod == 0x06: return 'VIA_C3_C5A'; 475 if uMod == 0x07: return 'VIA_C3_C5B' if self.getCpuStepping() < 8 else 'VIA_C3_C5C';496 if uMod == 0x07: return 'VIA_C3_C5B' if TestBoxData.getCpuSteppingEx(lCpuRevision) < 8 else 'VIA_C3_C5C'; 476 497 if uMod == 0x08: return 'VIA_C3_C5N'; 477 if uMod == 0x09: return 'VIA_C3_C5XL' if self.getCpuStepping() < 8 else 'VIA_C3_C5P';498 if uMod == 0x09: return 'VIA_C3_C5XL' if TestBoxData.getCpuSteppingEx(lCpuRevision) < 8 else 'VIA_C3_C5P'; 478 499 if uMod == 0x0a: return 'VIA_C7_C5J'; 479 500 if uMod == 0x0f: return 'VIA_Isaiah'; 480 501 return None; 481 502 503 def queryCpuMicroarch(self): 504 """ Try guess the microarch name for the cpu. Returns None if we cannot. """ 505 return self.queryCpuMicroarchEx(self.lCpuRevision, self.sCpuVendor); 506 507 @staticmethod 508 def getPrettyCpuVersionEx(lCpuRevision, sCpuVendor): 509 """ Pretty formatting of the family/model/stepping with microarch optimizations. """ 510 if lCpuRevision is None or sCpuVendor is None: 511 return u'<none>'; 512 sMarch = TestBoxData.queryCpuMicroarchEx(lCpuRevision, sCpuVendor); 513 if sMarch is not None: 514 return '%s m%02X s%02X' \ 515 % (sMarch, TestBoxData.getCpuModelEx(lCpuRevision), TestBoxData.getCpuSteppingEx(lCpuRevision)); 516 return 'fam%02X m%02X s%02X' \ 517 % ( TestBoxData.getCpuFamilyEx(lCpuRevision), TestBoxData.getCpuModelEx(lCpuRevision), 518 TestBoxData.getCpuSteppingEx(lCpuRevision)); 519 482 520 def getPrettyCpuVersion(self): 483 521 """ Pretty formatting of the family/model/stepping with microarch optimizations. """ 484 if self.lCpuRevision is None or self.sCpuVendor is None: 485 return u'<none>'; 486 sMarch = self.queryCpuMicroarch(); 487 if sMarch is not None: 488 return '%s m%02X s%02X' % (sMarch, self.getCpuModel(), self.getCpuStepping()); 489 return 'fam%02X m%02X s%02X' % (self.getCpuFamily(), self.getCpuModel(), self.getCpuStepping()); 522 return self.getPrettyCpuVersionEx(self.lCpuRevision, self.sCpuVendor); 490 523 491 524 def getArchBitString(self): -
trunk/src/VBox/ValidationKit/testmanager/core/testresults.py
r65077 r65084 646 646 """ 647 647 648 kiTestStatus = 0; 649 kiBranches = 1; 650 kiSchedGroups = 2; 651 kiTestBoxes = 3; 652 kiTestCases = 4; 653 kiTestCaseVars = 5; 654 kiRevisions = 6; 655 kiCpuArches = 7; 656 kiCpuVendors = 8; 657 kiOses = 9; 658 kiOsVersions = 10; 659 kiFailReasons = 11; 648 kiTestStatus = 0; 649 kiBranches = 1; 650 kiSchedGroups = 2; 651 kiTestBoxes = 3; 652 kiTestCases = 4; 653 kiTestCaseVars = 5; 654 kiRevisions = 6; 655 kiCpuArches = 7; 656 kiCpuVendors = 8; 657 kiCpuRevisions = 9; 658 kiCpuCounts = 10; 659 kiMemory = 11; 660 kiMisc = 12; 661 kiOses = 13; 662 kiOsVersions = 14; 663 kiPythonVersions = 15; 664 kiFailReasons = 16; 665 666 kiMisc_NestedPaging = 0; 667 kiMisc_NoNestedPaging = 1; 668 kiMisc_RawMode = 2; 669 kiMisc_NoRawMode = 3; 670 kiMisc_64BitGuest = 4; 671 kiMisc_No64BitGuest = 5; 672 kiMisc_HwVirt = 6; 673 kiMisc_NoHwVirt = 7; 674 kiMisc_IoMmu = 8; 675 kiMisc_NoIoMmu = 9; 660 676 661 677 def __init__(self): … … 699 715 assert self.aCriteria[self.kiCpuVendors] is oCrit; 700 716 717 oCrit = FilterCriterion('CPU revisions', sVarNm = 'cr', sTable = 'TestBoxesWithStrings', sColumn = 'lCpuRevision'); 718 self.aCriteria.append(oCrit); 719 assert self.aCriteria[self.kiCpuRevisions] is oCrit; 720 721 oCrit = FilterCriterion('CPU counts', sVarNm = 'cc', sTable = 'TestBoxesWithStrings', sColumn = 'cCpus'); 722 self.aCriteria.append(oCrit); 723 assert self.aCriteria[self.kiCpuCounts] is oCrit; 724 725 oCrit = FilterCriterion('Memory', sVarNm = 'mb', sTable = 'TestBoxesWithStrings', sColumn = 'cMbMemory'); 726 self.aCriteria.append(oCrit); 727 assert self.aCriteria[self.kiMemory] is oCrit; 728 729 oCrit = FilterCriterion('Misc', sVarNm = 'cf', sTable = 'TestBoxesWithStrings', sColumn = 'it_is_complicated'); 730 oCrit.aoPossible = [ 731 FilterCriterionValueAndDescription(self.kiMisc_NestedPaging, "req nested paging"), 732 FilterCriterionValueAndDescription(self.kiMisc_NoNestedPaging, "w/o nested paging"), 733 #FilterCriterionValueAndDescription(self.kiMisc_RawMode, "req raw-mode"), - not implemented yet. 734 #FilterCriterionValueAndDescription(self.kiMisc_NoRawMode, "w/o raw-mode"), - not implemented yet. 735 FilterCriterionValueAndDescription(self.kiMisc_64BitGuest, "req 64-bit guests"), 736 FilterCriterionValueAndDescription(self.kiMisc_No64BitGuest, "w/o 64-bit guests"), 737 FilterCriterionValueAndDescription(self.kiMisc_HwVirt, "req VT-x / AMD-V"), 738 FilterCriterionValueAndDescription(self.kiMisc_NoHwVirt, "w/o VT-x / AMD-V"), 739 #FilterCriterionValueAndDescription(self.kiMisc_IoMmu, "req I/O MMU"), - not implemented yet. 740 #FilterCriterionValueAndDescription(self.kiMisc_NoIoMmu, "w/o I/O MMU"), - not implemented yet. 741 ]; 742 self.aCriteria.append(oCrit); 743 assert self.aCriteria[self.kiMisc] is oCrit; 744 701 745 oCrit = FilterCriterion('OSes', sVarNm = 'os', sTable = 'TestBoxesWithStrings', sColumn = 'idStrOs'); 702 746 self.aCriteria.append(oCrit); … … 707 751 assert self.aCriteria[self.kiOsVersions] is oCrit; 708 752 753 oCrit = FilterCriterion('Python', sVarNm = 'py', sTable = 'TestBoxesWithStrings', sColumn = 'iPythonHexVersion'); 754 self.aCriteria.append(oCrit); 755 assert self.aCriteria[self.kiPythonVersions] is oCrit; 756 709 757 oCrit = FilterCriterion('Failure reasons', sVarNm = 'fr', sTable = 'TestResultFailures', sColumn = 'idFailureReason'); 710 758 self.aCriteria.append(oCrit); 711 759 assert self.aCriteria[self.kiFailReasons] is oCrit; 712 760 761 kdMiscConditions = { 762 kiMisc_NestedPaging: 'TestBoxesWithStrings.fCpuNestedPaging IS TRUE', 763 kiMisc_NoNestedPaging: 'TestBoxesWithStrings.fCpuNestedPaging IS FALSE', 764 kiMisc_RawMode: 'TestBoxesWithStrings.fRawMode IS TRUE', 765 kiMisc_NoRawMode: 'TestBoxesWithStrings.fRawMode IS NOT TRUE', 766 kiMisc_64BitGuest: 'TestBoxesWithStrings.fCpu64BitGuest IS TRUE', 767 kiMisc_No64BitGuest: 'TestBoxesWithStrings.fCpu64BitGuest IS FALSE', 768 kiMisc_HwVirt: 'TestBoxesWithStrings.fCpuHwVirt IS TRUE', 769 kiMisc_NoHwVirt: 'TestBoxesWithStrings.fCpuHwVirt IS FALSE', 770 kiMisc_IoMmu: 'TestBoxesWithStrings.fChipsetIoMmu IS TRUE', 771 kiMisc_NoIoMmu: 'TestBoxesWithStrings.fChipsetIoMmu IS FALSE', 772 }; 713 773 714 774 def getWhereConditions(self, sExtraIndent = '', iOmit = -1): … … 720 780 for iCrit, oCrit in enumerate(self.aCriteria): 721 781 if oCrit.sState == FilterCriterion.ksState_Selected and iCrit != iOmit: 722 sQuery += '%s AND %s.%s IN (' % (sExtraIndent, oCrit.sTable, oCrit.sColumn,); 723 if oCrit.sType == FilterCriterion.ksType_String: 724 sQuery += ', '.join('\'%s\'' % (sValue,) for sValue in oCrit.aoSelected) + ')\n'; 782 if iCrit == self.kiMisc: 783 for iValue in oCrit.aoSelected: 784 if iValue in self.kdMiscConditions: 785 sQuery += '%s AND %s\n' % (sExtraIndent, self.kdMiscConditions[iValue],); 725 786 else: 726 sQuery += ', '.join(str(iValue) for iValue in oCrit.aoSelected) + ')\n'; 787 if iCrit == self.kiMemory: 788 sQuery += '%s AND (%s.%s / 1024) IN (' % (sExtraIndent, oCrit.sTable, oCrit.sColumn,); 789 else: 790 sQuery += '%s AND %s.%s IN (' % (sExtraIndent, oCrit.sTable, oCrit.sColumn,); 791 if oCrit.sType == FilterCriterion.ksType_String: 792 sQuery += ', '.join('\'%s\'' % (sValue,) for sValue in oCrit.aoSelected) + ')\n'; 793 else: 794 sQuery += ', '.join(str(iValue) for iValue in oCrit.aoSelected) + ')\n'; 727 795 return sQuery; 728 796 … … 1475 1543 if fIdIsName: 1476 1544 for idMissing in dLeft: 1477 oCrit.aoPossible.append(FilterCriterionValueAndDescription(idMissing, idMissing, fIrrelevant = True)); 1545 oCrit.aoPossible.append(FilterCriterionValueAndDescription(idMissing, str(idMissing), 1546 fIrrelevant = True)); 1478 1547 else: 1479 1548 oMissingLogic = oMissingLogicType(self._oDb); … … 1555 1624 'GROUP BY TestBoxesWithStrings.idStrOs, TestBoxesWithStrings.sOs\n' 1556 1625 'ORDER BY TestBoxesWithStrings.sOs\n' ); 1557 workerDoFetch( TestBoxLogic, 'sOs');1626 workerDoFetch(None, fIdIsName = True); 1558 1627 1559 1628 # Testbox OS versions . … … 1575 1644 'GROUP BY TestBoxesWithStrings.idStrOsVersion, TestBoxesWithStrings.sOsVersion\n' 1576 1645 'ORDER BY TestBoxesWithStrings.sOsVersion\n' ); 1577 workerDoFetch( TestBoxLogic, 'sOsVersion');1646 workerDoFetch(None, fIdIsName = True); 1578 1647 1579 1648 # Testbox CPU/OS architectures. … … 1595 1664 'GROUP BY TestBoxesWithStrings.idStrCpuArch, TestBoxesWithStrings.sCpuArch\n' 1596 1665 'ORDER BY TestBoxesWithStrings.sCpuArch\n' ); 1597 workerDoFetch( TestBoxLogic, 'sCpuArch');1666 workerDoFetch(None, fIdIsName = True); 1598 1667 1599 1668 # Testbox CPU vendors. … … 1609 1678 oFilter.getWhereConditions(iOmit = TestResultFilter.kiCpuVendors) + 1610 1679 oReportModel.getExtraSubjectWhereExpr() + 1611 ' GROUP BY TestSets.idG EnTestBox'1680 ' GROUP BY TestSets.idGenTestBox' 1612 1681 ' ) AS TestBoxGenIDs\n' 1613 1682 ' LEFT OUTER JOIN TestBoxesWithStrings\n' … … 1615 1684 'GROUP BY TestBoxesWithStrings.idStrCpuVendor, TestBoxesWithStrings.sCpuVendor\n' 1616 1685 'ORDER BY TestBoxesWithStrings.sCpuVendor\n' ); 1617 workerDoFetch(TestBoxLogic, 'sCpuVendor'); 1686 workerDoFetch(None, fIdIsName = True); 1687 1688 # Testbox CPU revisions. 1689 oCrit = oFilter.aCriteria[TestResultFilter.kiCpuRevisions]; 1690 self._oDb.execute('SELECT TestBoxesWithStrings.lCpuRevision,\n' 1691 ' TestBoxesWithStrings.sCpuVendor,\n' 1692 ' SUM(TestBoxGenIDs.cTimes)\n' 1693 'FROM ( SELECT TestSets.idGenTestBox,\n' 1694 ' COUNT(TestSets.idTestSet) AS cTimes\n' 1695 ' FROM TestSets\n' + oFilter.getTableJoins(iOmit = TestResultFilter.kiCpuRevisions) + 1696 ''.join(' , %s\n' % (sTable,) for sTable in oReportModel.getExtraSubjectTables()) + 1697 ' WHERE ' + self._getTimePeriodQueryPart(tsNow, sPeriod, ' ') + 1698 oFilter.getWhereConditions(iOmit = TestResultFilter.kiCpuRevisions) + 1699 oReportModel.getExtraSubjectWhereExpr() + 1700 ' GROUP BY TestSets.idGenTestBox' 1701 ' ) AS TestBoxGenIDs\n' 1702 ' LEFT OUTER JOIN TestBoxesWithStrings\n' 1703 ' ON TestBoxesWithStrings.idGenTestBox = TestBoxGenIDs.idGenTestBox\n' 1704 'GROUP BY TestBoxesWithStrings.lCpuRevision, TestBoxesWithStrings.sCpuVendor\n' 1705 'ORDER BY TestBoxesWithStrings.sCpuVendor DESC, TestBoxesWithStrings.lCpuRevision DESC\n' ); 1706 workerDoFetch(None, fIdIsName = True); 1707 for oCur in oCrit.aoPossible: 1708 oCur.sDesc = TestBoxData.getPrettyCpuVersionEx(oCur.oValue, oCur.sDesc).replace('_', ' '); 1709 1710 # Testbox CPU core/thread counts. 1711 oCrit = oFilter.aCriteria[TestResultFilter.kiCpuCounts]; 1712 self._oDb.execute('SELECT TestBoxesWithStrings.cCpus,\n' 1713 ' CAST(TestBoxesWithStrings.cCpus AS TEXT),\n' 1714 ' SUM(TestBoxGenIDs.cTimes)\n' 1715 'FROM ( SELECT TestSets.idGenTestBox,\n' 1716 ' COUNT(TestSets.idTestSet) AS cTimes\n' 1717 ' FROM TestSets\n' + oFilter.getTableJoins(iOmit = TestResultFilter.kiCpuCounts) + 1718 ''.join(' , %s\n' % (sTable,) for sTable in oReportModel.getExtraSubjectTables()) + 1719 ' WHERE ' + self._getTimePeriodQueryPart(tsNow, sPeriod, ' ') + 1720 oFilter.getWhereConditions(iOmit = TestResultFilter.kiCpuCounts) + 1721 oReportModel.getExtraSubjectWhereExpr() + 1722 ' GROUP BY TestSets.idGenTestBox' 1723 ' ) AS TestBoxGenIDs\n' 1724 ' LEFT OUTER JOIN TestBoxesWithStrings\n' 1725 ' ON TestBoxesWithStrings.idGenTestBox = TestBoxGenIDs.idGenTestBox\n' 1726 'GROUP BY TestBoxesWithStrings.cCpus\n' 1727 'ORDER BY TestBoxesWithStrings.cCpus\n' ); 1728 workerDoFetch(None, fIdIsName = True); 1729 1730 # Testbox memory. 1731 oCrit = oFilter.aCriteria[TestResultFilter.kiMemory]; 1732 self._oDb.execute('SELECT TestBoxesWithStrings.cMbMemory / 1024,\n' 1733 ' NULL,\n' 1734 ' SUM(TestBoxGenIDs.cTimes)\n' 1735 'FROM ( SELECT TestSets.idGenTestBox,\n' 1736 ' COUNT(TestSets.idTestSet) AS cTimes\n' 1737 ' FROM TestSets\n' + oFilter.getTableJoins(iOmit = TestResultFilter.kiMemory) + 1738 ''.join(' , %s\n' % (sTable,) for sTable in oReportModel.getExtraSubjectTables()) + 1739 ' WHERE ' + self._getTimePeriodQueryPart(tsNow, sPeriod, ' ') + 1740 oFilter.getWhereConditions(iOmit = TestResultFilter.kiMemory) + 1741 oReportModel.getExtraSubjectWhereExpr() + 1742 ' GROUP BY TestSets.idGenTestBox' 1743 ' ) AS TestBoxGenIDs\n' 1744 ' LEFT OUTER JOIN TestBoxesWithStrings\n' 1745 ' ON TestBoxesWithStrings.idGenTestBox = TestBoxGenIDs.idGenTestBox\n' 1746 'GROUP BY TestBoxesWithStrings.cMbMemory / 1024\n' 1747 'ORDER BY 1\n' ); 1748 workerDoFetch(None, fIdIsName = True); 1749 for oCur in oCrit.aoPossible: 1750 oCur.sDesc = '%u GB' % (oCur.oValue,); 1751 1752 # Testbox python versions . 1753 oCrit = oFilter.aCriteria[TestResultFilter.kiPythonVersions]; 1754 self._oDb.execute('SELECT TestBoxesWithStrings.iPythonHexVersion,\n' 1755 ' NULL,\n' 1756 ' SUM(TestBoxGenIDs.cTimes)\n' 1757 'FROM ( SELECT TestSets.idGenTestBox AS idGenTestBox,\n' 1758 ' COUNT(TestSets.idTestSet) AS cTimes\n' 1759 ' FROM TestSets\n' + oFilter.getTableJoins(iOmit = TestResultFilter.kiPythonVersions) + 1760 ''.join(' , %s\n' % (sTable,) for sTable in oReportModel.getExtraSubjectTables()) + 1761 ' WHERE ' + self._getTimePeriodQueryPart(tsNow, sPeriod, ' ') + 1762 oFilter.getWhereConditions(iOmit = TestResultFilter.kiPythonVersions) + 1763 oReportModel.getExtraSubjectWhereExpr() + 1764 ' GROUP BY TestSets.idGenTestBox\n' 1765 ' ) AS TestBoxGenIDs\n' 1766 ' LEFT OUTER JOIN TestBoxesWithStrings\n' 1767 ' ON TestBoxesWithStrings.idGenTestBox = TestBoxGenIDs.idGenTestBox\n' 1768 'GROUP BY TestBoxesWithStrings.iPythonHexVersion\n' 1769 'ORDER BY TestBoxesWithStrings.iPythonHexVersion\n' ); 1770 workerDoFetch(None, fIdIsName = True); 1771 for oCur in oCrit.aoPossible: 1772 oCur.sDesc = TestBoxData.formatPythonVersionEx(oCur.oValue); 1618 1773 1619 1774 # Testcases (see getTestCases).
Note:
See TracChangeset
for help on using the changeset viewer.