VirtualBox

Ignore:
Timestamp:
Jan 16, 2017 11:37:48 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
112891
Message:

vsheriff: Extended the bad-testbox handling to include failure reason 'Host/Driver not unloading'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/batch/virtual_test_sheriff.py

    r65306 r65317  
    328328        return 0;
    329329
     330    def getFailureReason(self, tReason):
     331        """ Gets the failure reason object for tReason. """
     332        return self.oFailureReasonLogic.cachedLookupByNameAndCategory(tReason[1], tReason[0]);
    330333
    331334    def selfCheck(self):
     
    335338            if sAttr.startswith('ktReason_'):
    336339                tReason = getattr(self.__class__, sAttr);
    337                 oFailureReason = self.oFailureReasonLogic.cachedLookupByNameAndCategory(tReason[1], tReason[0]);
     340                oFailureReason = self.getFailureReason(tReason);
    338341                if oFailureReason is None:
    339342                    rcExit = self.eprint(u'Failed to find failure reason "%s" in category "%s" in the database!'
     
    366369
    367370        #
     371        # Generate a list of failures reasons we consider bad-testbox behavior.
     372        #
     373        aidFailureReasons = [
     374            self.getFailureReason(self.ktReason_Host_DriverNotUnloading).idFailureReason,
     375        ];
     376
     377        #
    368378        # Get list of bad test boxes for given period and check them out individually.
    369379        #
    370         aidBadTestBoxes = self.oTestSetLogic.fetchBadTestBoxIds(cHoursBack = cHoursBack, tsNow = tsNow);
     380        aidBadTestBoxes = self.oTestSetLogic.fetchBadTestBoxIds(cHoursBack = cHoursBack, tsNow = tsNow,
     381                                                                aidFailureReasons = aidFailureReasons);
    371382        for idTestBox in aidBadTestBoxes:
    372383            # Skip if the testbox is already disabled or has a pending reboot command.
     
    394405                    cBad += 1;
    395406                else:
    396                     ## @todo maybe check the elapsed time here, it could still be a bad run.
    397                     cOkay += 1;
    398                     if iFirstOkay > iSet:
    399                         iFirstOkay = iSet;
     407                    # Check for bad failure reasons.
     408                    oFailure = None;
     409                    if oSet.enmStatus in TestSetData.kasBadTestStatuses:
     410                        oFailure = self.oTestResultFailureLogic.getById(oSet.idTestResult);
     411                    if oFailure is not None and oFailure.idFailureReason in aidFailureReasons:
     412                        cBad += 1;
     413                    else:
     414                        # This is an okay test result then.
     415                        ## @todo maybe check the elapsed time here, it could still be a bad run?
     416                        cOkay += 1;
     417                        if iFirstOkay > iSet:
     418                            iFirstOkay = iSet;
    400419                if iSet > 10:
    401420                    break;
     
    522541        #
    523542        for idTestResult, tReason in dReasonForResultId.items():
    524             oFailureReason = self.oFailureReasonLogic.cachedLookupByNameAndCategory(tReason[1], tReason[0]);
     543            oFailureReason = self.getFailureReason(tReason);
    525544            if oFailureReason is not None:
    526545                sComment = 'Set by $Revision$' # Handy for reverting later.
     
    641660        an uninstall first and will be seeing similar issues to the uninstall.
    642661        """
     662        _ = fInstall;
     663
    643664        atSimple = self.katSimpleInstallUninstallMainLogReasons;
    644665        if oCaseFile.oTestBox.sOs in self.kdatSimpleInstallUninstallMainLogReasonsPerOs:
     
    11381159                self.uidSelf = self.oLogin.uid;
    11391160
     1161        #
    11401162        # Do the stuff.
     1163        #
    11411164        if rcExit == 0:
    11421165            rcExit  = self.selfCheck();
     
    11461169            if rcExit == 0:
    11471170                rcExit = rcExit2;
     1171            # Redo the bad testbox management after failure reasons have been assigned (got timing issues).
     1172            if rcExit == 0:
     1173                rcExit = self.badTestBoxManagement();
    11481174
    11491175        # Cleanup.
Note: See TracChangeset for help on using the changeset viewer.

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