VirtualBox

Changeset 56735 in vbox


Ignore:
Timestamp:
Jul 1, 2015 2:32:06 PM (10 years ago)
Author:
vboxsync
Message:

tdAddGuestCtrl.py: Try fix 4.3 runs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py

    r56731 r56735  
    452452        for (i, oStep) in enumerate(self.aoSteps):
    453453            fRc2 = oStep.execute(oTstDrv, oGstCtrlSession, sMsgPrefix + ', step #%d' % i);
    454             if fRc2 is False:
     454            if fRc2 is True:
     455                pass;
     456            elif fRc2 is None:
     457                reporter.log('skipping remaining %d steps' % (len(self.aoSteps) - i - 1,));
     458                break;
     459            else:
    455460                fRc = False;
    456461        return fRc;
     
    474479
    475480
     481class tdSessionStepBase(object):
     482    """
     483    Base class for the guest control session test steps.
     484    """
     485
     486    def execute(self, oTstDrv, oGstCtrlSession, sMsgPrefix):
     487        """
     488        Executes the test step.
     489
     490        Returns True on success.
     491        Returns False on failure (must be reported as error).
     492        Returns None if to skip the remaining steps.
     493        """
     494        reporter.error('%s: Missing execute implementation: %s' % (sMsgPrefix, self,));
     495        _ = oTstDrv;
     496        _ = oGstCtrlSession;
     497        return False;
     498
     499
     500class tdStepRequireMinimumApiVer(tdSessionStepBase):
     501    """
     502    Special test step which will cause executeSteps to skip the remaining step
     503    if the VBox API is too old:
     504    """
     505    def __init__(self, fpMinApiVer):
     506        self.fpMinApiVer = fpMinApiVer;
     507
     508    def execute(self, oTstDrv, oGstCtrlSession, sMsgPrefix):
     509        """ Returns None if API version is too old, otherwise True. """
     510        if oTstDrv.fpApiVer >= self.fpMinApiVer:
     511            return True;
     512        _ = oGstCtrlSession;
     513        _ = sMsgPrefix;
     514        return None; # Special return value. Don't use elsewhere.
     515
    476516
    477517#
     
    479519#
    480520
    481 class tdStepSessionSetEnv(object):
     521class tdStepSessionSetEnv(tdSessionStepBase):
    482522    """
    483523    Guest session environment: schedule putenv
     
    521561        return True;
    522562
    523 class tdStepSessionUnsetEnv(object):
     563class tdStepSessionUnsetEnv(tdSessionStepBase):
    524564    """
    525565    Guest session environment: schedule unset.
     
    562602        return True;
    563603
    564 class tdStepSessionBulkEnv(object):
     604class tdStepSessionBulkEnv(tdSessionStepBase):
    565605    """
    566606    Guest session environment: Bulk environment changes.
     
    605645
    606646
    607 class tdStepSessionCheckEnv(object):
     647class tdStepSessionCheckEnv(tdSessionStepBase):
    608648    """
    609649    Check the currently scheduled environment changes of a guest control session.
     
    651691        return fRc;
    652692
     693
    653694#
    654695# File system object statistics (i.e. stat()).
    655696#
    656697
    657 class tdStepStat(object):
     698class tdStepStat(tdSessionStepBase):
    658699    """
    659700    Stats a file system object.
     
    14771518                              tdStepSessionSetEnv('FOO', 'BAR'),
    14781519                              tdStepSessionCheckEnv(['FOO=BAR',]),
     1520                              tdStepRequireMinimumApiVer(5.0), # 4.3 can't cope with the remainder.
    14791521                              tdStepSessionClearEnv(),
    14801522                              tdStepSessionCheckEnv(),
     
    15001542                              tdStepSessionSetEnv('FOO','BAR3'),
    15011543                              tdStepSessionCheckEnv([ 'FOO=BAR3',]),
     1544                              tdStepRequireMinimumApiVer(5.0), # 4.3 can't cope with the remainder.
    15021545                              # Add a little unsetting to the mix.
    15031546                              tdStepSessionSetEnv('BAR', 'BEAR'),
     
    15161559                              tdStepSessionBulkEnv(['FOO=bar', 'foo=bar', 'FOO=doofus', 'TMPDIR=/tmp', 'foo=bar2']),
    15171560                              tdStepSessionCheckEnv(['FOO=doofus', 'TMPDIR=/tmp', 'foo=bar2']),
     1561                              tdStepRequireMinimumApiVer(5.0), # 4.3 is buggy!
     1562                              tdStepSessionBulkEnv(['2=1+1', 'FOO=doofus2', ]),
     1563                              tdStepSessionCheckEnv(['2=1+1', 'FOO=doofus2', 'TMPDIR=/tmp', 'foo=bar2']),
    15181564                              ]),
    15191565            # Invalid variable names.
     
    15261572                              tdStepSessionSetEnv('=FOO', 'BAR', vbox.ComError.E_INVALIDARG),
    15271573                              tdStepSessionCheckEnv(),
     1574                              tdStepRequireMinimumApiVer(5.0), # 4.3 is buggy!
    15281575                              tdStepSessionBulkEnv(['=', 'foo=bar'], vbox.ComError.E_INVALIDARG),
    15291576                              tdStepSessionCheckEnv(),
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