VirtualBox

Ignore:
Timestamp:
Feb 8, 2016 5:19:41 PM (9 years ago)
Author:
vboxsync
Message:

Randomly switch between SATA/SCSI controller.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/installation/tdGuestOsInstTest1.py

    r59045 r59605  
    3434import os
    3535import sys
     36import random
    3637
    3738
     
    5455
    5556    ## @name The primary controller, to which the disk will be attached.
     57    ksScsiController = 'SCSI Controller'
    5658    ksSataController = 'SATA Controller'
    5759    ksIdeController  = 'IDE Controller'
     
    137139            oSession = oTestDrv.openSession(oVM);
    138140            if oSession is not None:
    139                 if self.sHddControllerType == self.ksSataController:
    140                     fRc = fRc and oSession.setStorageControllerType(vboxcon.StorageControllerType_IntelAhci,
    141                                                                     self.sHddControllerType)
    142                     fRc = fRc and oSession.setStorageControllerPortCount(self.sHddControllerType, 1)
    143 
     141                if self.sHddControllerType == self.ksIdeController:
     142                    fRc = fRc and oSession.setStorageControllerPortCount(self.sHddControllerType, 1);
     143                else:
     144                    random.seed();
     145                    self.sHddControllerType = random.choice([self.ksSataController, self.ksScsiController]);
     146
     147                    if self.sHddControllerType == self.ksSataController:
     148                        fRc = fRc and oSession.setStorageControllerType(vboxcon.StorageControllerType_IntelAhci,
     149                                                                        self.sHddControllerType);
     150                    elif self.sHddControllerType == self.ksScsiController:
     151                        fRc = fRc and oSession.setStorageControllerType(vboxcon.StorageControllerType_LsiLogic,
     152                                                                        self.sHddControllerType);
    144153                try:
    145154                    sHddPath = os.path.join(os.path.dirname(oVM.settingsFilePath),
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