VirtualBox

Ignore:
Timestamp:
Jun 9, 2020 7:11:22 AM (5 years ago)
Author:
vboxsync
Message:

Validation Kit/tdAddGuestCtrl.py: Refined long arguments testing a bit.

File:
1 edited

Legend:

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

    r84713 r84730  
    14311431        # The tests. Must-succeed tests should be first.
    14321432        atTests = [
    1433             ( True,  self.prepareGuestForDebugging,         None,               'Manaul Debugging',),
     1433            ( True,  self.prepareGuestForDebugging,         None,               'Manual Debugging',),
    14341434            ( True,  self.prepareGuestForTesting,           None,               'Preparations',),
    14351435            ( True,  self.testGuestCtrlSession,             'session_basic',    'Session Basics',),
     
    14941494
    14951495        if self.oDebug.sImgPath is None: # If no debugging enabled, bail out.
     1496            reporter.log('Skipping debugging');
    14961497            return True
    14971498
     
    29582959        # Test very long arguments.
    29592960        # Old(er) Windows OSes tend to crash in cmd.exe, so skip this.
     2961        # Regarding paths:
     2962        # - We have RTPATH_BIG_MAX (64K)
     2963        # - MSDN says 32K for CreateFileW()
     2964        # - On Windows, each path component must not be longer than MAX_PATH (260), see
     2965        #   https://docs.microsoft.com/en-us/windows/win32/fileio/filesystem-functionality-comparison#limits
    29602966        if  self.oTstDrv.fpApiVer >= 6.1 \
    29612967        and oTestVm.sKind not in ('WindowsNT4', 'Windows2000', 'WindowsXP', 'Windows2003'):
     2968            sEndMarker = '--end-marker';
     2969            if oTestVm.isWindows() \
     2970            or oTestVm.isOS2():
     2971                sCmd   = sShell;
     2972            else:
     2973                sCmd   = oTestVm.pathJoin(self.oTstDrv.getGuestSystemDir(oTestVm), 'echo');
     2974
    29622975            for _ in xrange(0, 16):
    2963                 sFileName = str(self.oTestFiles.generateFilenameEx(128 * 1024, 2048));
    2964                 reporter.log2('sFileName=%s, type=%s' % (limitString(sFileName), type(sFileName)));
    29652976                if oTestVm.isWindows() \
    29662977                or oTestVm.isOS2():
    2967                     sCmd   = sShell;
    2968                     asArgs = [ sShell, sShellOpt, "echo", sFileName, "--end-marker" ];
     2978                    asArgs = [ sShell, sShellOpt, "echo" ];
    29692979                else:
    2970                     sCmd   = oTestVm.pathJoin(self.oTstDrv.getGuestSystemDir(oTestVm), 'echo');
    2971                     asArgs = [ sCmd, sFileName, "--end-marker" ];
     2980                    asArgs = [ sCmd ];
     2981
     2982                # Append a random number of arguments with random length.
     2983                for _ in xrange(0, self.oTestFiles.oRandom.randrange(1, 16)):
     2984                    asArgs.append(self.oTestFiles.generateFilenameEx((16 * 1024) - len(str(sEndMarker)), 1));
     2985
     2986                asArgs.append(sEndMarker);
     2987
     2988                reporter.log2('asArgs=%s (%d args), type=%s' % (limitString(asArgs), len(asArgs), type(asArgs)));
     2989
    29722990                ## @todo Check limits; on Ubuntu with 256KB IPRT returns VERR_NOT_IMPLEMENTED.
    29732991                # Use a higher timeout (15 min) than usual for these long checks.
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