VirtualBox

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


Ignore:
Timestamp:
May 2, 2015 1:57:14 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
99964
Message:

Main: Renamed IGuestSession::environment to IGuestSession::environmentChanges, IGuestSession::environmentSet to IGuestSession::environmentScheduleSet, IGuestSession::environmentUnset to IGuestSession::environmentScheduleUnset. Introduced read only IGuestSession::environmentBase attribute and associated IGuestSession::environmentGetBaseVariable and IGuestSession::environmentDoesBaseVariableExist for future exploitations. Changed IGuestProcess::environment back to it's originally documented behavior, though that means it will fail with VBOX_E_NOT_SUPPORTED until the session base environment is implemented.

File:
1 edited

Legend:

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

    r55590 r55591  
    10701070    def testGuestCtrlSessionEnvironment(self, oSession, oTxsSession, oTestVm): # pylint: disable=R0914
    10711071        """
    1072         Tests the guest session environment.
     1072        Tests the guest session environment changes.
    10731073        """
    10741074
     
    11121112        ];
    11131113
     1114        # The IGuestSession::environment attribute changed late in 5.0 development.
     1115        sEnvironmentChangesAttr = 'environmentChanges' if self.oTstDrv.fpApiVer >= 5.0 else 'environment';
     1116
    11141117        # Parameters.
    11151118        fRc = True;
     
    11271130                break;
    11281131            # Make sure environment is empty.
    1129             curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, 'environment');
     1132            curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, sEnvironmentChangesAttr);
    11301133            reporter.log2('Test #%d: Environment initially has %d elements' % (i, len(curEnv)));
    11311134            if len(curEnv) != 0:
     
    11451148                                  % (i, strKey, strValue, len(aElems)));
    11461149                    try:
    1147                         curGuestSession.environmentSet(strKey, strValue); # No return (e.g. boolean) value available thru wrapper.
     1150                        if self.oTstDrv.fpApiVer >= 5.0:
     1151                            curGuestSession.environmentScheduleSet(strKey, strValue);
     1152                        else:
     1153                            curGuestSession.environmentSet(strKey, strValue);
    11481154                    except:
    11491155                        # Setting environment variables might fail (e.g. if empty name specified). Check.
    11501156                        reporter.logXcpt('Test #%d failed: Setting environment variable failed:' % (i,));
    1151                         curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, 'environment');
     1157                        curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, sEnvironmentChangesAttr);
    11521158                        if len(curEnv) is not curRes.cNumVars:
    11531159                            reporter.error('Test #%d failed: Session environment has %d vars, expected %d' \
     
    11581164                            reporter.log('Test #%d: API reported an error (single), good' % (i,));
    11591165                    ## @todo environmentGet() has been removed in 5.0 because it's not up to the task of returning all the
    1160                     ## putenv strings forms and gives the impression that the envrionment is something it isn't. This test
     1166                    ## putenv strings forms and gives the impression that the environment is something it isn't. This test
    11611167                    ## should be rewritten using the attribute.  What's more, there should be an Unset test here, shouldn't
    11621168                    ## there?
     
    11971203                    except:
    11981204                        # Setting environment variables might fail (e.g. if empty name specified). Check.
    1199                         curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, 'environment');
     1205                        curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, sEnvironmentChangesAttr);
    12001206                        if len(curEnv) is not curRes.cNumVars:
    12011207                            reporter.error('Test #%d failed: Session environment has %d vars, expected %d (array)' \
     
    12071213                ## @todo Get current system environment and add it to curRes.cNumVars before comparing!
    12081214                reporter.log('Test #%d: Environment size' % (i,));
    1209                 curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, 'environment');
     1215                curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, sEnvironmentChangesAttr);
    12101216                reporter.log2('Test #%d: Environment (%d) -> %s' % (i, len(curEnv), curEnv));
    12111217                if len(curEnv) != curRes.cNumVars:
     
    12151221                    break;
    12161222
    1217                 self.oTstDrv.oVBoxMgr.setArray(curGuestSession, 'environment', []);
    1218                 curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, 'environment');
     1223                self.oTstDrv.oVBoxMgr.setArray(curGuestSession, sEnvironmentChangesAttr, []);
     1224                curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, sEnvironmentChangesAttr);
    12191225                if len(curEnv) is not 0:
    12201226                    reporter.error('Test #%d failed: Session environment has %d vars, expected 0');
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