VirtualBox

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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