VirtualBox

Changeset 78644 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 22, 2019 12:29:14 AM (6 years ago)
Author:
vboxsync
Message:

tdAddSharedFolders1.py: Shared folder testing is halfways working now... bugref:9172

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/additions/Makefile.kmk

    r76553 r78644  
    3434ValidationKitTestsAdditions_EXEC_SOURCES := \
    3535        $(PATH_SUB_CURRENT)/tdAddBasic1.py \
    36         $(PATH_SUB_CURRENT)/tdAddGuestCtrl.py
     36        $(PATH_SUB_CURRENT)/tdAddGuestCtrl.py \
     37        $(PATH_SUB_CURRENT)/tdAddSharedFolders1.py
    3738
    3839
  • trunk/src/VBox/ValidationKit/tests/additions/tdAddBasic1.py

    r78642 r78644  
    3535import os;
    3636import sys;
     37import uuid;
    3738
    3839# Only the main script needs to modify the path.
     
    5152sys.path.append(os.path.dirname(os.path.abspath(__file__))); # For sub-test drivers.
    5253from tdAddGuestCtrl import SubTstDrvAddGuestCtrl;
    53 #from tdAddSharedFolders1 import SubTstDrvAddSharedFolders1;
     54from tdAddSharedFolders1 import SubTstDrvAddSharedFolders1;
    5455
    5556
     
    6566        vbox.TestDriver.__init__(self);
    6667        self.oTestVmSet = self.oTestVmManager.getSmokeVmSet('nat');
    67         self.asTestsDef = ['install', 'guestprops', 'stdguestprops', 'guestcontrol', 'sharedfolders'];
     68        self.asTestsDef = ['install', 'guestprops', 'stdguestprops', 'guestcontrol', ]; #'sharedfolders'];
    6869        self.asTests    = self.asTestsDef;
    6970        self.asRsrcs    = None
    7071
    7172        self.addSubTestDriver(SubTstDrvAddGuestCtrl(self));
    72         #self.addSubTestDriver(SubTstDrvAddSharedFolders1(self));
     73        self.addSubTestDriver(SubTstDrvAddSharedFolders1(self));
    7374
    7475    #
     
    117118        eNic0AttachType = vboxcon.NetworkAttachmentType_NAT;
    118119        sGaIso = self.getGuestAdditionsIso();
     120
     121        # On 6.0 we merge the GAs with the ValidationKit so we can get at FsPerf.
     122        # Note! Not possible to do a dboule import as both images an '/OS2' dir.
     123        #       So, using same dir as with unattended VISOs for the valkit.
     124        if self.fpApiVer >= 6.0 and 'sharedfolders' in self.asTests:
     125            sGaViso = os.path.join(self.sScratchPath, 'AdditionsAndValKit.viso');
     126            ## @todo encode as bash cmd line:
     127            sVisoContent = '--iprt-iso-maker-file-marker-bourne-sh %s ' \
     128                           '--import-iso \'%s\' ' \
     129                           '--push-iso \'%s\' ' \
     130                           '/vboxvalidationkit=/ ' \
     131                           '--pop ' \
     132                          % (uuid.uuid4(), sGaIso, self.sVBoxValidationKitIso);
     133            reporter.log2('Using VISO combining GAs and ValKit "%s": %s' % (sGaViso, sVisoContent));
     134            oGaViso = open(sGaViso, 'w');
     135            oGaViso.write(sVisoContent);
     136            oGaViso.close();
     137            sGaIso = sGaViso;
     138
    119139        return self.oTestVmSet.actionConfig(self, eNic0AttachType = eNic0AttachType, sDvdImage = sGaIso);
    120140
     
    164184            reporter.testDone(fSkip);
    165185
    166             #fSkip = 'sharedfolders' not in self.asTests;
    167             #reporter.testStart('Shared Folders');
    168             #if not fSkip:
    169             #    fRc, oTxsSession = self.aoSubTstDrvs[1].testIt(oTestVm, oSession, oTxsSession);
    170             #reporter.testDone(fSkip or fRc is None);
     186            fSkip = 'sharedfolders' not in self.asTests and self.fpApiVer >= 6.0;
     187            reporter.testStart('Shared Folders');
     188            if not fSkip:
     189                fRc, oTxsSession = self.aoSubTstDrvs[1].testIt(oTestVm, oSession, oTxsSession);
     190            reporter.testDone(fSkip or fRc is None);
    171191
    172192            ## @todo Save and restore test.
  • trunk/src/VBox/ValidationKit/tests/additions/tdAddSharedFolders1.py

    r78642 r78644  
    33
    44"""
    5 VirtualBox Validation Kit - Shared Folders
     5VirtualBox Validation Kit - Shared Folders #1.
    66"""
    77
     
    4343from testdriver import reporter;
    4444from testdriver import base;
    45 from testdriver import vbox;
    46 from testdriver import vboxcon;
    47 from testdriver import vboxwrappers;
    4845from common     import utils;
    49 
    50 # Python 3 hacks:
    51 if sys.version_info[0] >= 3:
    52     long = int      # pylint: disable=W0622,C0103
    5346
    5447
     
    10497        #
    10598        sSharedFolder1 = os.path.join(self.oTstDrv.sScratchPath, 'shfl1');
     99        reporter.log2('Creating shared host folder "%s"...' % (sSharedFolder1,));
    106100        if os.path.exists(sSharedFolder1):
    107101            try:    shutil.rmtree(sSharedFolder1);
     
    125119        reporter.testStart('Automount');
    126120
     121        reporter.log2('Creating shared folder shfl1...');
    127122        try:
    128123            oConsole = oSession.o.console;
     
    137132        while True:
    138133            fRc = oTxsSession.syncIsDir(sMountPoint1 + sGuestSlash + 'candle.dir');
     134            reporter.log2('candle.dir check -> %s' % (fRc,));
    139135            if fRc is not False:
    140136                break;
     
    142138                reporter.error('Shared folder mounting timed out!');
    143139                break;
    144             oTstDrv.sleep(1);
     140            self.oTstDrv.sleep(1);
    145141
    146142        reporter.testDone();
    147         if fRc is not None:
     143        if fRc is not True:
    148144            return (False, oTxsSession); # skip the remainder if we cannot auto mount the folder.
    149145
     
    154150        fSkip = 'fsperf' not in self.asTests;
    155151        if fSkip is False:
    156             cMbFree = utils.getDiskUsage(sSharedFolders1);
    157             if cMbFree < 16:
     152            cMbFree = utils.getDiskUsage(sSharedFolder1);
     153            if cMbFree >= 16:
     154                reporter.log2('Free space: %u MBs' % (cMbFree,));
     155            else:
    158156                reporter.log('Skipping FsPerf because only %u MB free on %s' % (cMbFree, sSharedFolder1,));
    159157                fSkip = True;
    160158        if fSkip is False:
    161             asArgs = ['FsPerf', '-d', sMountPoint1 + sGuestSlash + 'fstestdir-1', ];
    162             if oTestVm.sGuestOsType in []:
    163                 asArgs.append('--no-mmap'); # Fails on older than win7 (CcCoherencyFlushAndPurgeCache).
    164             fRc = oTstDrv.txsRunTest(oTxsSession, 'FsPerf', 10 * 60 * 1000, '${CDROM}/${OS/ARCH}/FsPerf${EXESUFF}', asArgs);
     159            # Common arguments:
     160            asArgs = ['FsPerf', '-d', sMountPoint1 + sGuestSlash + 'fstestdir-1', '-m200'];
     161
     162            # Skip mmap on older windows systems without CcCoherencyFlushAndPurgeCache (>= w7).
     163            reporter.log2('oTestVm.sGuestOsType=%s' % (oTestVm.sGuestOsType,));
     164            if oTestVm.sGuestOsType in [ 'WindowsNT3x', 'WindowsNT4', 'Windows2000', 'WindowsXP', 'WindowsXP_64',
     165                                         'Windows2003', 'Windows2003_64', 'WindowsVista', 'WindowsVista_64',
     166                                         'Windows2008', 'Windows2008_64']:
     167                asArgs.append('--no-mmap');
     168
     169            # Configure I/O block sizes according to guest memory size:
     170            cbMbRam = 128;
     171            try:    cbMbRam = oSession.o.machine.memorySize;
     172            except: reporter.errorXcpt();
     173            reporter.log2('cbMbRam=%s' % (cbMbRam,));
     174            asArgs.append('--set-block-size=1');
     175            asArgs.append('--add-block-size=512');
     176            asArgs.append('--add-block-size=4096');
     177            asArgs.append('--add-block-size=16384');
     178            asArgs.append('--add-block-size=65536');
     179            asArgs.append('--add-block-size=1048576');       #   1 MiB
     180            if cbMbRam >= 512:
     181                asArgs.append('--add-block-size=33554432');  #  32 MiB
     182            if cbMbRam >= 768:
     183                asArgs.append('--add-block-size=134217728'); # 128 MiB
     184
     185            reporter.log2('Starting guest FsPerf (%s)...' % (asArgs,));
     186            fRc = self.oTstDrv.txsRunTest(oTxsSession, 'FsPerf', 10 * 60 * 1000,
     187                                          '${CDROM}/vboxvalidationkit/${OS/ARCH}/FsPerf${EXESUFF}', asArgs);
     188            reporter.log2('FsPerf -> %s' % (fRc,));
    165189
    166190            sTestDir = os.path.join(sSharedFolder1, 'fstestdir-1');
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