Changeset 55591 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- May 2, 2015 1:57:14 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 99964
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
r55590 r55591 1070 1070 def testGuestCtrlSessionEnvironment(self, oSession, oTxsSession, oTestVm): # pylint: disable=R0914 1071 1071 """ 1072 Tests the guest session environment .1072 Tests the guest session environment changes. 1073 1073 """ 1074 1074 … … 1112 1112 ]; 1113 1113 1114 # The IGuestSession::environment attribute changed late in 5.0 development. 1115 sEnvironmentChangesAttr = 'environmentChanges' if self.oTstDrv.fpApiVer >= 5.0 else 'environment'; 1116 1114 1117 # Parameters. 1115 1118 fRc = True; … … 1127 1130 break; 1128 1131 # Make sure environment is empty. 1129 curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, 'environment');1132 curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, sEnvironmentChangesAttr); 1130 1133 reporter.log2('Test #%d: Environment initially has %d elements' % (i, len(curEnv))); 1131 1134 if len(curEnv) != 0: … … 1145 1148 % (i, strKey, strValue, len(aElems))); 1146 1149 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); 1148 1154 except: 1149 1155 # Setting environment variables might fail (e.g. if empty name specified). Check. 1150 1156 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); 1152 1158 if len(curEnv) is not curRes.cNumVars: 1153 1159 reporter.error('Test #%d failed: Session environment has %d vars, expected %d' \ … … 1158 1164 reporter.log('Test #%d: API reported an error (single), good' % (i,)); 1159 1165 ## @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 env rionment is something it isn't. This test1166 ## putenv strings forms and gives the impression that the environment is something it isn't. This test 1161 1167 ## should be rewritten using the attribute. What's more, there should be an Unset test here, shouldn't 1162 1168 ## there? … … 1197 1203 except: 1198 1204 # 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); 1200 1206 if len(curEnv) is not curRes.cNumVars: 1201 1207 reporter.error('Test #%d failed: Session environment has %d vars, expected %d (array)' \ … … 1207 1213 ## @todo Get current system environment and add it to curRes.cNumVars before comparing! 1208 1214 reporter.log('Test #%d: Environment size' % (i,)); 1209 curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, 'environment');1215 curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, sEnvironmentChangesAttr); 1210 1216 reporter.log2('Test #%d: Environment (%d) -> %s' % (i, len(curEnv), curEnv)); 1211 1217 if len(curEnv) != curRes.cNumVars: … … 1215 1221 break; 1216 1222 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); 1219 1225 if len(curEnv) is not 0: 1220 1226 reporter.error('Test #%d failed: Session environment has %d vars, expected 0');
Note:
See TracChangeset
for help on using the changeset viewer.