VirtualBox

Changeset 94509 in vbox


Ignore:
Timestamp:
Apr 7, 2022 12:07:16 PM (2 years ago)
Author:
vboxsync
Message:

Validation Kit: Added functionality to return expanded strings from TxS to the host.

Location:
trunk/src/VBox/ValidationKit/testdriver
Files:
2 edited

Legend:

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

    r94399 r94509  
    13301330        return rc;
    13311331
     1332    def taskExpandString(self, sString):
     1333        rc = self.sendMsg('EXP STR ', (sString));
     1334        if rc is True:
     1335            rc = False;
     1336            cbMsg, sOpcode, abPayload = self.recvReply();
     1337            if cbMsg is not None:
     1338                sOpcode = sOpcode.strip();
     1339                if sOpcode == "STRING":
     1340                    sStringExp = getSZ(abPayload, 0);
     1341                    if sStringExp is not None:
     1342                        rc = sStringExp;
     1343                else: # Also handles SHORTSTR reply (not enough space to store result).
     1344                    reporter.maybeErr(self.fErr, 'taskExpandString got a bad reply: %s' % (sOpcode,));
     1345            else:
     1346                reporter.maybeErr(self.fErr, 'taskExpandString got 3xNone from recvReply.');
     1347        return rc;
     1348
    13321349    # pylint: enable=missing-docstring
    13331350
     
    18361853        """Synchronous version."""
    18371854        return self.asyncToSync(self.asyncUnpackFile, sRemoteFile, sRemoteDir, cMsTimeout, fIgnoreErrors);
     1855
     1856    def asyncExpandString(self, sString, cMsTimeout = 120000, fIgnoreErrors = False):
     1857        """
     1858        Initiates an expand string task.
     1859
     1860        Returns expanded string on success, False on failure (logged).
     1861
     1862        The task returns True on success, False on failure (logged).
     1863        """
     1864        return self.startTask(cMsTimeout, fIgnoreErrors, "expandString", self.taskExpandString,
     1865                              (sString));
     1866
     1867    def syncExpandString(self, sString, cMsTimeout = 120000, fIgnoreErrors = False):
     1868        """Synchronous version."""
     1869        return self.asyncToSync(self.asyncExpandString, sString, cMsTimeout, fIgnoreErrors);
    18381870
    18391871
  • trunk/src/VBox/ValidationKit/testdriver/vbox.py

    r94187 r94509  
    37373737                              (sRemoteFile, sRemoteDir, self.adjustTimeoutMs(cMsTimeout), fIgnoreErrors));
    37383738
     3739    def txsExpandString(self, oSession, oTxsSession, sString, cMsTimeout = 30000, fIgnoreErrors = False):
     3740        return self.txsDoTask(oSession, oTxsSession, oTxsSession.asyncExpandString, \
     3741                              (sString, self.adjustTimeoutMs(cMsTimeout), fIgnoreErrors));
     3742
    37393743    # pylint: enable=missing-docstring
    37403744
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