VirtualBox

Ignore:
Timestamp:
May 29, 2016 7:49:31 PM (9 years ago)
Author:
vboxsync
Message:

virtual test sheriff: Kick-off and the bad-testbox rebooting and disabling. (completely untested)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/core/testset.py

    r61220 r61282  
    229229        return oFile;
    230230
     231
     232
    231233class TestSetLogic(ModelLogicBase):
    232234    """
     
    637639
    638640
     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
    639680#
    640681# Unit testing.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette