Changeset 61282 in vbox for trunk/src/VBox/ValidationKit/testmanager/core/testset.py
- Timestamp:
- May 29, 2016 7:49:31 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/core/testset.py
r61220 r61282 229 229 return oFile; 230 230 231 232 231 233 class TestSetLogic(ModelLogicBase): 232 234 """ … … 637 639 638 640 641 # 642 # The virtual test sheriff interface. 643 # 644 645 def fetchBadTestBoxIds(self, cHoursBack = 2, tsNow = None): 646 """ 647 Fetches a list of test box IDs which returned bad-testbox statuses in the 648 given period (tsDone). 649 """ 650 if tsNow is None: 651 tsNow = self._oDb.getCurrentTimestamp(); 652 self._oDb.execute('SELECT DISTINCT idTestBox\n' 653 'FROM TestSets\n' 654 'WHERE TestSets.enmStatus = \'bad-testbox\'\n' 655 ' AND tsDone <= %s\n' 656 ' AND tsDone > (%s - interval \'%s hours\')\n' 657 , ( tsNow, tsNow, cHoursBack,)); 658 return [aoRow[0] for aoRow in self._oDb.fetchAll()]; 659 660 def fetchResultForTestBox(self, idTestBox, cHoursBack = 2, tsNow = None): 661 """ 662 Fetches the TestSet rows for idTestBox for the given period (tsDone), w/o running ones. 663 664 Returns list of TestSetData sorted by tsDone in descending order. 665 """ 666 if tsNow is None: 667 tsNow = self._oDb.getCurrentTimestamp(); 668 self._oDb.execute('SELECT *\n' 669 'FROM TestSets\n' 670 'WHERE TestSets.idTestBox = %s\n' 671 ' AND tsDone IS NOT NULL\n' 672 ' AND tsDone <= %s\n' 673 ' AND tsDone > (%s - interval \'%s hours\')\n' 674 'ORDER by tsDone DESC\n' 675 , ( idTestBox, tsNow, tsNow, cHoursBack,)); 676 return self._dbRowsToModelDataList(TestSetData); 677 678 679 639 680 # 640 681 # Unit testing.
Note:
See TracChangeset
for help on using the changeset viewer.