VirtualBox

Changeset 92050 in vbox for trunk/src


Ignore:
Timestamp:
Oct 25, 2021 4:58:55 PM (3 years ago)
Author:
vboxsync
Message:

ValidationKit: bugref:9932 Use host-only networks instead of adapters on Mac OS

Location:
trunk/src/VBox/ValidationKit
Files:
3 edited

Legend:

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

    r90244 r92050  
    22412241                    reporter.log("    hostInterface:  %s" % (oNic.hostInterface,));
    22422242            else:
    2243                 if self.fpApiVer >= 4.1:
     2243                if self.fpApiVer >= 7.0:
     2244                    if oNic.attachmentType == vboxcon.NetworkAttachmentType_HostOnlyNetwork:
     2245                        reporter.log("    attachmentType: HostOnlyNetwork (%s)" % (oNic.attachmentType,));
     2246                        reporter.log("    hostonly-net: %s" % (oNic.hostOnlyNetwork,));
     2247                elif self.fpApiVer >= 4.1:
    22442248                    if oNic.attachmentType == vboxcon.NetworkAttachmentType_Generic:
    22452249                        reporter.log("    attachmentType: Generic (%s)" % (oNic.attachmentType,));
  • trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py

    r91363 r92050  
    14931493                reporter.log("Created host only NIC: '%s'" % (sRetName,));
    14941494
     1495        elif self.fpApiVer >= 7.0 and eAttachmentType == vboxcon.NetworkAttachmentType_HostOnlyNetwork:
     1496            aoHostNetworks = self.oVBoxMgr.getArray(self.oVBox, 'hostOnlyNetworks');
     1497            if aoHostNetworks:
     1498                sRetName = aoHostNetworks[0].networkName;
     1499            else:
     1500                try:
     1501                    oHostOnlyNet = self.oVBox.createHostOnlyNetwork('Host-only Test Network');
     1502                    oHostOnlyNet.lowerIP = '192.168.56.1';
     1503                    oHostOnlyNet.upperIP = '192.168.56.199';
     1504                    oHostOnlyNet.networkMask = '255.255.255.0';
     1505                    sRetName = oHostOnlyNet.networkName;
     1506                except:
     1507                    reporter.errorXcpt();
     1508                    return '';
     1509
    14951510        elif eAttachmentType == vboxcon.NetworkAttachmentType_Internal:
    14961511            sRetName = 'VBoxTest';
     
    15711586                    except:
    15721587                        reporter.errorXcpt('failed to set the internalNetwork property on slot %s to "%s" for VM "%s"'
     1588                                           % (iNic, sName, self.sName,));
     1589                        return False;
     1590                elif self.fpApiVer >= 7.0 and eAttachmentType == vboxcon.NetworkAttachmentType_HostOnlyNetwork:
     1591                    try:
     1592                        oNic.hostOnlyNetwork = sName;
     1593                    except:
     1594                        reporter.errorXcpt('failed to set the hostOnlyNetwork property on slot %s to "%s" for VM "%s"'
    15731595                                           % (iNic, sName, self.sName,));
    15741596                        return False;
  • trunk/src/VBox/ValidationKit/tests/installation/tdGuestOsUnattendedInst1.py

    r82968 r92050  
    242242            if self.sKind in ('WindowsXP','WindowsXP_64',):
    243243                eNic0AttachType = vboxcon.NetworkAttachmentType_HostOnly;
     244
     245        #
     246        # Use host-only networks instead of host-only adapters for trunk builds on Mac OS.
     247        #
     248        if eNic0AttachType == vboxcon.NetworkAttachmentType_HostOnly \
     249            and utils.getHostOs() == 'darwin' \
     250            and oTestDrv.fpApiVer >= 7.0:
     251            eNic0AttachType = vboxcon.NetworkAttachmentType_HostOnlyNetwork;
    244252
    245253        return vboxtestvms.BaseTestVm._createVmDoIt(self, oTestDrv, eNic0AttachType, sDvdImage);
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