VirtualBox

Changeset 92838 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 8, 2021 10:49:27 PM (3 years ago)
Author:
vboxsync
Message:

Validation Kit/testdriver: Move call oSessionWrapper::setNicLocalhostReachable() to the two places where they are needed (and remove from setupPreferredConfig()). bugref:9896

Location:
trunk/src/VBox/ValidationKit/testdriver
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testdriver/vbox.py

    r92683 r92838  
    24622462                    sNic0MacAddr = '%02X' % (iGroup);
    24632463                fRc = oSession.setNicMacAddress(sNic0MacAddr, 0);
     2464            # Needed to reach the host (localhost) from the guest. See xTracker #9896.
     2465            if fRc and self.fpApiVer >= 7.0 and eNic0AttachType == vboxcon.NetworkAttachmentType_NAT:
     2466                fRc = oSession.setNicLocalhostReachable(True, 0);
    24642467            if fRc and fNatForwardingForTxs is True:
    24652468                fRc = oSession.setupNatForwardingForTxs();
     
    25622565                        sNic0MacAddr = '%02X' % (iGroup,);
    25632566                    fRc = oSession.setNicMacAddress(sNic0MacAddr, 0);
     2567                # Needed to reach the host (localhost) from the guest. See xTracker #9896.
     2568                if fRc and self.fpApiVer >= 7.0 and eNic0AttachType == vboxcon.NetworkAttachmentType_NAT:
     2569                    fRc = oSession.setNicLocalhostReachable(True, 0);
    25642570
    25652571                if fRc and fVmmDevTestingPart is not None:
  • trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py

    r92304 r92838  
    16361636            return reporter.errorXcpt('NIC enabled status (%s) failed for "%s"' % (iNic, self.sName,));
    16371637
    1638         try:
    1639             sAdpName = self.oTstDrv.getNetworkAdapterNameFromType(oNic);
    1640             ## @todo Remove this check once we have more attachment types that support this.
    1641             if oNic.attachmentType != vboxcon.NetworkAttachmentType_NAT:
    1642                 # Other attachments will fail if 'LocalhostReachable' extra data override is present
    1643                 ## @todo r=andy Is this still needed, as we now have the API (see above) in place?
    1644                 sKey = 'VBoxInternal/Devices/%s/%d/LUN#0/Config/LocalhostReachable' % (sAdpName, iNic);
    1645                 reporter.log2('Disabling "LocalhostReachable" (NAT) for network adapter "%s" in slot %d (key: %s)' % \
    1646                               (sAdpName, iNic, sKey));
    1647                 self.setExtraData(sKey, '');
    1648                 return True;
    1649         except:
    1650             return reporter.errorXcpt('NIC adapter type (%s) failed for "%s"' % (iNic, self.sName,));
    1651 
    16521638        reporter.log('Setting "LocalhostReachable" for network adapter "%s" in slot %d to %s' % (sAdpName, iNic, fReachable));
    16531639
     
    16581644
    16591645        try:
    1660             oNatEngine.LocalhostReachable = fReachable;
     1646            if hasattr(oNatEngine, "localhostReachable"):
     1647                oNatEngine.localhostReachable = fReachable;
     1648            else
     1649                oNatEngine.LocalhostReachable = fReachable;
    16611650        except:
    16621651            return reporter.errorXcpt('LocalhostReachable (%s) failed for "%s"' % (iNic, self.sName,));
     
    23672356        if self.fpApiVer >= 4.0:
    23682357            if not self.setupAudio(eAudioCtlType):      fRc = False;
    2369 
    2370         if self.fpApiVer >= 7.0:
    2371             # Needed to reach the host (localhost) from the guest. See xTracker #9896.
    2372             for iSlot in range(0, self.oVBox.systemProperties.getMaxNetworkAdapters(self.o.machine.chipsetType)):
    2373                 try:
    2374                     self.setNicLocalhostReachable(True, iSlot);
    2375                 except:
    2376                     reporter.logXcpt();
    23772358
    23782359        return fRc;
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