VirtualBox

Changeset 99294 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Apr 5, 2023 9:19:25 AM (22 months ago)
Author:
vboxsync
Message:

Validation Kit/vbox.py: Added a couple of functions for Guest Additions / general version handling and comparison. Required for cross host + Guest Additions testing (e.g. old(er) Guest Additions on newer host versions and vice versa) [pylint].

File:
1 edited

Legend:

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

    r99293 r99294  
    17571757
    17581758    @staticmethod
    1759     def versionToTuple(sVer, fIgnoreErrors = False): # pylint: disable=line-too-long
     1759    def versionToTuple(sVer, fIgnoreErrors = False):
    17601760        """
    17611761        Returns a semantic versioning string as a tuple.
     
    17641764            # Regular expression taken from semver.org (recommended regular expression for semantic version strings).
    17651765            # Creative Commons ― CC BY 3.0
    1766             oRegEx = re.compile('^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$');
     1766            oRegEx = re.compile(r'^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'); # pylint: disable=line-too-long
    17671767            oMatch = oRegEx.search(sVer);
    17681768            return oMatch.groups();
     
    18081808        Returns True if version 1 is equal or bigger than version 2, False if not.
    18091809        """
    1810         return False if TestDriver.compareVersion(sVer1, sVer2, fIgnoreErrors) is 1 else True;
     1810        return not TestDriver.compareVersion(sVer1, sVer2, fIgnoreErrors);
    18111811
    18121812    def getGuestAdditionsVersion(self, oSession, fIgnoreErrors = 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