VirtualBox

Ignore:
Timestamp:
Apr 14, 2023 9:47:19 AM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
156848
Message:

Validation Kit/tdAddGuestCtrl.py: Made cross testing (different VBox versions for host / guest) a bit more flexible by querying the installed Guest Additions version on runtime:

  • Use a different coreutils path for old OL6 guests (see comments).
  • Only do process execution CWD testing on guests with installed Guest Additions >= 7.1.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py

    r99285 r99398  
    14771477        self.sPathVBoxServiceExeGst =   oTestVm.pathJoin(self.oTstDrv.getGuestSystemAdminDir(oTestVm), 'VBoxService') \
    14781478                                      + base.exeSuff();
     1479
     1480        # For some tests we need know the Guest Additions version, so fetch it now.
     1481        self.tpAdditionsVer         = self.oTstDrv.getGuestAdditionsVersion(oSession);
    14791482
    14801483        reporter.log("Active tests: %s" % (self.asTests,));
     
    30723075                sVBoxControl = "C:\\Program Files\\Oracle\\VirtualBox Guest Additions\\VBoxControl.exe";
    30733076        else:
    3074             sImageOut = oTestVm.pathJoin(self.oTstDrv.getGuestSystemDir(oTestVm), 'ls');
     3077            # Really old guests (like OL 6) have their coreutils in /bin instead of /usr/bin.
     3078            if self.oTstDrv.txsIsFile(oSession, oTxsSession, "/bin/ls", fIgnoreErrors = True):
     3079                sImageOut = "/bin/ls";
     3080            else:
     3081                sImageOut = oTestVm.pathJoin(self.oTstDrv.getGuestSystemDir(oTestVm), 'ls');
    30753082            if oTestVm.isLinux(): ## @todo check solaris and darwin.
    30763083                sVBoxControl = "/usr/bin/VBoxControl"; # Symlink
     
    31253132                [ tdTestExec(sCmd = sImageOut, asArgs = [ sImageOut, '/C', 'dir', '/S', 'stdouterr-non-existing' ]),
    31263133                  tdTestResultExec(fRc = True, iExitCode = 1) ],
    3127                 # Current working directory set (VBox >= 7.1).
    3128                 [ tdTestExec(sCmd = sImageOut, sCwd = sTempDir, asArgs = [ sImageOut, '/C', 'dir', '/S', sSystemDir ]),
    3129                   tdTestResultExec(fRc = True) ],
    31303134            ];
     3135
     3136            if self.oTstDrv.isVersionEqualOrBigger(self.tpAdditionsVer, "7.1.0"):
     3137                atExec.extend([
     3138                    # Current working directory set (VBox >= 7.1).
     3139                    [ tdTestExec(sCmd = sImageOut, sCwd = sTempDir, asArgs = [ sImageOut, '/C', 'dir', '/S', sSystemDir ]),
     3140                      tdTestResultExec(fRc = True) ]
     3141                ]);
     3142
    31313143            # atExec.extend([
    31323144                # FIXME: Failing tests.
     
    31773189                [ tdTestExec(sCmd = sImageOut, asArgs = [ sImageOut, 'stdouterr-non-existing' ]),
    31783190                  tdTestResultExec(fRc = True, iExitCode = 2) ],
    3179                 # Current working directory set (VBox >= 7.1).
    3180                 [ tdTestExec(sCmd = sImageOut, sCwd = sTempDir, asArgs = [ sImageOut, '-R', sSystemDir ]),
    3181                   tdTestResultExec(fRc = True) ],
    31823191            ];
     3192
     3193            if self.oTstDrv.isVersionEqualOrBigger(self.tpAdditionsVer, "7.1.0"):
     3194                atExec.extend([
     3195                    # Current working directory set (VBox >= 7.1).
     3196                    [ tdTestExec(sCmd = sImageOut, sCwd = sTempDir, asArgs = [ sImageOut, '-R', sSystemDir ]),
     3197                      tdTestResultExec(fRc = True) ]
     3198                ]);
     3199
    31833200            # atExec.extend([
    31843201                # FIXME: Failing tests.
     
    32313248                sCmd   = sShell;
    32323249            else:
    3233                 sCmd   = oTestVm.pathJoin(self.oTstDrv.getGuestSystemDir(oTestVm), 'echo');
     3250                # Really old guests (like OL 6) have their coreutils in /bin instead of /usr/bin.
     3251                if self.oTstDrv.txsIsFile(oSession, oTxsSession, "/bin/echo", fIgnoreErrors = True):
     3252                    sCmd = "/bin/echo";
     3253                else:
     3254                    sCmd = oTestVm.pathJoin(self.oTstDrv.getGuestSystemDir(oTestVm), 'echo');
    32343255
    32353256            for _ in xrange(0, 16):
     
    38993920            fUseDirList = False;
    39003921            cEntriesPerRead = random.randrange(1, 32768);
    3901             if self.oTstDrv.fpApiVer >= 7.1 and self.oTstDrv.uRevision >= 156485:
     3922            if  self.oTstDrv.fpApiVer >= 7.1 and self.oTstDrv.uRevision >= 156485 \
     3923            and self.oTstDrv.isVersionEqualOrBigger(self.tpAdditionsVer, "7.1.0"):
    39023924                 # Listing directories only is available for >= VBox 7.1.
    39033925                fUseDirList = random.choice( [True, False] );
     
    39493971                    fUseDirList = False;
    39503972                    cEntriesPerRead = random.randrange(1, 32768);
    3951                     if self.oTstDrv.fpApiVer >= 7.1 and self.oTstDrv.uRevision >= 156485:
     3973                    if  self.oTstDrv.fpApiVer >= 7.1 and self.oTstDrv.uRevision >= 156485 \
     3974                    and self.oTstDrv.isVersionEqualOrBigger(self.tpAdditionsVer, "7.1.0"):
    39523975                        # Listing directories only is available for >= VBox 7.1.
    39533976                        fUseDirList = random.choice( [True, False] );
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