VirtualBox

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
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