VirtualBox

Changeset 103336 in vbox for trunk/src


Ignore:
Timestamp:
Feb 13, 2024 2:05:35 PM (12 months ago)
Author:
vboxsync
Message:

Validation Kit/tdStorageBenchmark: Fail more gracefully if storage volume preparation failed.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/storage/storagecfg.py

    r98103 r103336  
    664664        """
    665665        Creates a new directory on the volume pointed to by the given mount point.
    666         """
    667         return self.oExec.mkDir(sMountPoint + '/' + sDir, fMode);
     666
     667        Returns success status.
     668        """
     669        return self.oExec.mkDir(os.path.join(sMountPoint, sDir), fMode);
    668670
    669671    def cleanupLeftovers(self):
  • trunk/src/VBox/ValidationKit/tests/storage/tdStorageBenchmark1.py

    r101035 r103336  
    837837        """
    838838        Prepares the host storage for disk images or direct testing on the host.
     839
     840        Will return the created mount point path on success, or None on failure.
    839841        """
    840842        # Create a basic pool with the default configuration.
     
    847849                oStorCfg.cleanup();
    848850
     851        if not fRc:
     852            reporter.error('Failed to prepare host storage (fRamDisk=%s, cbPool=%d)' % (fRamDisk, cbPool,));
    849853        return sMountPoint;
    850854
     
    14491453                    reporter.testStart('Create host storage');
    14501454                    sMountPoint = self.prepareStorage(self.oStorCfg);
    1451                     if sMountPoint is None:
    1452                         reporter.testFailure('Failed to prepare host storage');
     1455                    if sMountPoint:
     1456                        fMode = 0o777;
     1457                        sDir  = os.path.join(sMountPoint, 'test');
     1458                        if self.oStorCfg.mkDirOnVolume(sMountPoint, 'test', fMode):
     1459                            sMountPoint = sDir;
     1460                        else:
     1461                            reporter.error('Creating volume directory "%s" (mode %x) failed' % (sDir, fMode,));
     1462                    else:
    14531463                        fRc = False;
    1454                     self.oStorCfg.mkDirOnVolume(sMountPoint, 'test', 0o777);
    1455                     sMountPoint = sMountPoint + '/test';
    14561464                    reporter.testDone();
    14571465
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