VirtualBox

Changeset 65729 in vbox


Ignore:
Timestamp:
Feb 10, 2017 1:07:38 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
113443
Message:

ValidationKit: when setting the MAC address: if we can't find out the IP address of the system, it's better to make the method fail, because that makes the VM creation and thus the test fail properly. The previous way of continuing silently (but with an increased error counter) leads to very delayed test failures which can't be easily identified.

File:
1 edited

Legend:

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

    r65683 r65729  
    15171517            except:
    15181518                reporter.errorXcpt('failed to determine the host IP for "%s".' % (sHostName,))
    1519                 abHostIP = array.array('B', (0x80, 0x86, 0x00, 0x00)).tostring()
     1519                return False
    15201520            sDefaultMac = '%02X%02X%02X%02X%02X%02X' \
    15211521                % (0x02, ord(abHostIP[0]), ord(abHostIP[1]), ord(abHostIP[2]), ord(abHostIP[3]), iNic)
     
    15241524        # Get the NIC object and try set it address.
    15251525        try:
    1526             oNic = self.o.machine.getNetworkAdapter(iNic);
    1527         except:
    1528             reporter.errorXcpt('getNetworkAdapter(%s) failed for "%s"' % (iNic, self.sName));
    1529             return False;
    1530 
    1531         try:
    1532             oNic.MACAddress = sMacAddr;
     1526            oNic = self.o.machine.getNetworkAdapter(iNic)
     1527        except:
     1528            reporter.errorXcpt('getNetworkAdapter(%s) failed for "%s"' % (iNic, self.sName))
     1529            return False
     1530
     1531        try:
     1532            oNic.MACAddress = sMacAddr
    15331533        except:
    15341534            reporter.errorXcpt('failed to set the MAC address on slot %s to "%s" for VM "%s"' \
    1535                 % (iNic, sMacAddr, self.sName));
    1536             return False;
    1537 
    1538         reporter.log('set MAC address on slot %s to %s for VM "%s"' % (iNic, sMacAddr, self.sName));
    1539         return True;
     1535                % (iNic, sMacAddr, self.sName))
     1536            return False
     1537
     1538        reporter.log('set MAC address on slot %s to %s for VM "%s"' % (iNic, sMacAddr, self.sName))
     1539        return True
    15401540
    15411541    def setRamSize(self, cMB):
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette