VirtualBox

Changeset 72728 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Jun 28, 2018 4:24:31 PM (6 years ago)
Author:
vboxsync
Message:

validationkit/tests/additions: fix plumbing of resources, and use a file from the resources for the copy testing instead of some unpredictable iso (keeping the cruft in place, hopefully never reached - for later removal)

Location:
trunk/src/VBox/ValidationKit/tests/additions
Files:
2 edited

Legend:

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

    r69111 r72728  
    6262    def __init__(self):
    6363        vbox.TestDriver.__init__(self);
    64         self.oTestVmSet = self.oTestVmManager.getStandardVmSet('nat');
     64        self.oTestVmSet = self.oTestVmManager.getSmokeVmSet('nat');
    6565        self.asTestsDef = ['guestprops', 'stdguestprops', 'guestcontrol'];
    6666        self.asTests    = self.asTestsDef;
     67        self.asRsrcs    = None
    6768
    6869        self.addSubTestDriver(SubTstDrvAddGuestCtrl(self));
     
    9899            return vbox.TestDriver.parseOption(self, asArgs, iArg);
    99100        return iArg + 1;
     101
     102    def getResourceSet(self):
     103        if self.asRsrcs is None:
     104            self.asRsrcs = []
     105            for oSubTstDrv in self.aoSubTstDrvs:
     106                self.asRsrcs.extend(oSubTstDrv.asRsrcs)
     107            self.asRsrcs.extend(self.oTestVmSet.getResourceSet())
     108        return self.asRsrcs
    100109
    101110    def actionConfig(self):
  • trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py

    r72192 r72728  
    932932        ];
    933933        self.asTests    = self.asTestsDef;
     934
     935        self.asRsrcs    = []
     936        self.asRsrcs.append('5.3/guestctrl/50mb_rnd.dat')
    934937
    935938    def parseOption(self, asArgs, iArg):                                        # pylint: disable=R0912,R0915
     
    31343137            return (False, oTxsSession);
    31353138
    3136         # Some stupid trickery to guess the location of the iso.
    3137         sVBoxValidationKitISO = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../VBoxValidationKit.iso'));
    3138         if not os.path.isfile(sVBoxValidationKitISO):
    3139             sVBoxValidationKitISO = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../VBoxTestSuite.iso'));
    3140         if not os.path.isfile(sVBoxValidationKitISO):
    3141             sCur = os.getcwd();
    3142             for i in range(0, 10):
    3143                 sVBoxValidationKitISO = os.path.join(sCur, 'validationkit/VBoxValidationKit.iso');
    3144                 if os.path.isfile(sVBoxValidationKitISO):
    3145                     break;
    3146                 sVBoxValidationKitISO = os.path.join(sCur, 'testsuite/VBoxTestSuite.iso');
    3147                 if os.path.isfile(sVBoxValidationKitISO):
    3148                     break;
    3149                 sCur = os.path.abspath(os.path.join(sCur, '..'));
    3150                 if i is None: pass; # shut up pychecker/pylint.
    3151         if os.path.isfile(sVBoxValidationKitISO):
    3152             reporter.log('Validation Kit .ISO found at: %s' % (sVBoxValidationKitISO,));
     3139        ## @todo r=klaus It's not good to use files with unpredictable size
     3140        # for testing. Causes all sorts of weird failures as things grow,
     3141        # exceeding the free space of the test VMs. Especially as this used
     3142        # the very big (and quickly growing) validation kit ISO originally.
     3143
     3144        sTestFileBig = self.oTstDrv.getFullResourceName('5.3/guestctrl/50mb_rnd.dat')
     3145        if not os.path.isfile(sTestFileBig):
     3146            sTestFileBig = self.oTstDrv.getGuestAdditionsIso()
     3147        if sTestFileBig == '' or not os.path.isfile(sTestFileBig):
     3148            # Some stupid trickery to guess the location of the validation kit iso.
     3149            sTestFileBig = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../VBoxValidationKit.iso'));
     3150            if not os.path.isfile(sTestFileBig):
     3151                sTestFileBig = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../VBoxTestSuite.iso'));
     3152            if not os.path.isfile(sTestFileBig):
     3153                sCur = os.getcwd();
     3154                for i in range(0, 10):
     3155                    sTestFileBig = os.path.join(sCur, 'validationkit/VBoxValidationKit.iso');
     3156                    if os.path.isfile(sTestFileBig):
     3157                        break;
     3158                    sTestFileBig = os.path.join(sCur, 'testsuite/VBoxTestSuite.iso');
     3159                    if os.path.isfile(sTestFileBig):
     3160                        break;
     3161                    sCur = os.path.abspath(os.path.join(sCur, '..'));
     3162                    if i is None: pass; # shut up pychecker/pylint.
     3163
     3164        if os.path.isfile(sTestFileBig):
     3165            reporter.log('Test file for big copy found at: %s' % (sTestFileBig,));
    31533166        else:
    3154             reporter.log('Warning: Validation Kit .ISO not found -- some tests might fail');
     3167            reporter.log('Warning: Test file for big copy not found -- some tests might fail');
    31553168
    31563169        aaTests = [];
     
    31703183                  tdTestResult(fRc = False) ],
    31713184                # Testing DirectoryCopyFlag flags.
    3172                 [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sVBoxValidationKitISO,
     3185                [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    31733186                               sDst = sScratchGstInvalid, aFlags = [ 80 ] ),
    31743187                  tdTestResult(fRc = False) ],
    31753188                # Testing FileCopyFlag flags.
    3176                 [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sVBoxValidationKitISO,
     3189                [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    31773190                               sDst = sScratchGstInvalid, aFlags = [ 80 ] ),
    31783191                  tdTestResult(fRc = False) ],
     
    31923205            if self.oTstDrv.fpApiVer > 5.2:
    31933206                aaTests.extend([
    3194                     [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sVBoxValidationKitISO,
     3207                    [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    31953208                                   sDst = sScratchGstInvalid),
    31963209                      tdTestResult(fRc = False) ],
    3197                     [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sVBoxValidationKitISO,
     3210                    [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    31983211                                   sDst = sScratchGstNotExist),
    31993212                      tdTestResult(fRc = False) ],
    3200                     [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sVBoxValidationKitISO,
     3213                    [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    32013214                                   sDst = sScratchGstNotExist),
    32023215                      tdTestResult(fRc = False) ],
    3203                     [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sVBoxValidationKitISO,
     3216                    [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    32043217                                   sDst = os.path.join(sScratchGstNotExist, 'renamedfile.dll')),
    32053218                      tdTestResult(fRc = False) ],
    3206                     [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sVBoxValidationKitISO,
    3207                                    sDst = os.path.join(sScratchGst, 'HostGuestAdditions.iso')),
     3219                    [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
     3220                                   sDst = os.path.join(sScratchGst, 'HostGABig.dat')),
    32083221                      tdTestResult(fRc = True) ],
    3209                     [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sVBoxValidationKitISO,
    3210                                    sDst = os.path.join(sScratchGst, 'HostGuestAdditions.iso')),
     3222                    [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
     3223                                   sDst = os.path.join(sScratchGst, 'HostGABig.dat')),
    32113224                      tdTestResult(fRc = True) ],
    32123225                    # Note: Copying files into directories via Main is supported only in versions > 5.2.
    32133226                    # Destination is a directory.
    3214                     [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sVBoxValidationKitISO,
     3227                    [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    32153228                                   sDst = sScratchGst),
    32163229                      tdTestResult(fRc = True) ],
    32173230                    # Copy over file again into same directory (overwrite).
    3218                     [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sVBoxValidationKitISO,
     3231                    [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
    32193232                                   sDst = sScratchGst),
    32203233                      tdTestResult(fRc = True) ]
     
    32243237                    # Copy the same file over to the guest, but this time store the file into the former
    32253238                    # file's ADS (Alternate Data Stream). Only works on Windows, of course.
    3226                     [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sVBoxValidationKitISO,
    3227                                    sDst = os.path.join(sScratchGst, 'HostGuestAdditions.iso:ADS-Test')),
     3239                    [ tdTestCopyTo(sUser = sUser, sPassword = sPassword, sSrc = sTestFileBig,
     3240                                   sDst = os.path.join(sScratchGst, 'HostGABig.dat:ADS-Test')),
    32283241                      tdTestResult(fRc = True) ]
    32293242                ]);
     
    36153628    def __init__(self):
    36163629        vbox.TestDriver.__init__(self);
    3617         self.oTestVmSet = self.oTestVmManager.getStandardVmSet('nat');
     3630        self.oTestVmSet = self.oTestVmManager.getSmokeVmSet('nat');
     3631        self.asRsrcs    = None
    36183632        self.fQuick     = False; # Don't skip lengthly tests by default.
    36193633        self.addSubTestDriver(SubTstDrvAddGuestCtrl(self));
     
    36453659        return iArg + 1;
    36463660
     3661    def getResourceSet(self):
     3662        if self.asRsrcs is None:
     3663            self.asRsrcs = []
     3664            for oSubTstDrv in self.aoSubTstDrvs:
     3665                self.asRsrcs.extend(oSubTstDrv.asRsrcs)
     3666            self.asRsrcs.extend(self.oTestVmSet.getResourceSet())
     3667        return self.asRsrcs
     3668
    36473669    def actionConfig(self):
    36483670        if not self.importVBoxApi(): # So we can use the constant below.
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