Changeset 90129 in vbox
- Timestamp:
- Jul 9, 2021 2:33:26 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/audio/tdAudioTest.py
r90099 r90129 166 166 return (False, ""); 167 167 168 def killProcessByName(self, sProcName): 169 """ 170 Kills processes by their name. 171 """ 172 if sys.platform == 'win32': 173 os.system('taskkill /IM "%s.exe" /F' % (sProcName)); 174 else: 175 os.system('killall -9 %s' % (sProcName)); 176 177 def killHstVkat(self): 178 """ 179 Kills VKAT (VBoxAudioTest) on the host side. 180 """ 181 self.killProcessByName("vkat"); 182 self.killProcessByName("VBoxAudioTest"); 183 168 184 def _getVkatResult(self, oTxsSession): 169 185 """ … … 181 197 Starts VKAT on the guest (running in background). 182 198 """ 183 sDesc = 'Starting VKAT on guest';184 185 199 sPathTemp = self.getGuestTempDir(oTestVm); 186 200 sPathAudioOut = oTestVm.pathJoin(sPathTemp, 'vkat-guest-out'); … … 202 216 aArgs.extend(['--daemonize']); 203 217 204 fRc = self.txsRunTest(oTxsSession, sDesc, 15 * 60 * 1000,218 fRc = self.txsRunTest(oTxsSession, 'Starting VKAT on guest', 15 * 60 * 1000, 205 219 sVkatExe, aArgs); 206 220 if not fRc: 207 221 reporter.error('VKAT on guest returned exit code error %d' % (self._getVkatResult(oTxsSession))); 222 else: 223 reporter.error('VKAT on guest not found'); 208 224 209 225 return fRc; … … 245 261 # 246 262 procVkat = subprocess.Popen(sArgs, \ 247 std in=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True);263 stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True); 248 264 if procVkat: 249 while procVkat.poll() is None: 250 sLine = procVkat.stdout.readline().rstrip(); 251 if sLine: 252 reporter.log(sLine); 253 254 if procVkat.returncode != 0: 255 reporter.testFailure('VKAT on the host failed with exit code %d' % (procVkat.returncode)); 265 reporter.log('VKAT on host started'); 266 267 out, err = procVkat.communicate(); 268 rc = procVkat.poll(); 269 270 out = out.decode(sys.stdin.encoding); 271 for line in out.split('\n'): 272 reporter.log(line); 273 274 err = err.decode(sys.stdin.encoding); 275 for line in err.split('\n'): 276 reporter.log(line); 277 278 reporter.log('VKAT on host ended with exit code %d' % rc); 279 if rc != 0: 280 reporter.testFailure('VKAT on the host failed'); 256 281 fRc = False; 257 282 else: … … 267 292 Executes the specified audio tests. 268 293 """ 294 295 # First try to kill any old VKAT / VBoxAudioTest processes lurking around on the host. 296 # Might happen because of former (aborted) runs. 297 self.killHstVkat(); 298 269 299 fRc = self.startVkatOnGuest(oTestVm, oSession, oTxsSession); 270 300 if fRc:
Note:
See TracChangeset
for help on using the changeset viewer.