Changeset 91119 in vbox
- Timestamp:
- Sep 6, 2021 9:35:26 AM (3 years ago)
- Location:
- trunk/src/VBox/ValidationKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/audio/tdAudioTest.py
r91118 r91119 34 34 35 35 # Standard Python imports. 36 from datetime import datetime 36 37 import os 37 38 import sys 38 39 import signal 39 40 import subprocess 40 import uuid41 41 42 42 # Only the main script needs to modify the path. … … 397 397 return iRc; 398 398 399 def startVkatOnGuest(self, oTestVm, oSession, oTxsSession ):399 def startVkatOnGuest(self, oTestVm, oSession, oTxsSession, sTag): 400 400 """ 401 401 Starts VKAT on the guest (running in background). … … 407 407 reporter.log('Guest audio test temp path is \"%s\"' % (sPathAudioOut)); 408 408 reporter.log('Guest audio test output path is \"%s\"' % (sPathAudioTemp)); 409 reporter.log('Guest audio test tag is \"%s\"' % (sTag)); 409 410 410 411 fRc, sVkatExe = self.locateGstVkat(oSession, oTxsSession); … … 415 416 416 417 asArgsVkat = [ sVkatExe, 'test', '--mode', 'guest', '--probe-backends', \ 417 '--tempdir', sPathAudioTemp, '--outdir', sPathAudioOut ]; 418 '--tempdir', sPathAudioTemp, '--outdir', sPathAudioOut, \ 419 '--tag', sTag ]; 418 420 419 421 asArgs.extend(asArgsVkat); … … 467 469 return fRc; 468 470 469 def runTests(self, oTestVm, oSession, oTxsSession, sDesc, asTests):471 def runTests(self, oTestVm, oSession, oTxsSession, sDesc, sTag, asTests): 470 472 """ 471 473 Runs one or more tests using VKAT on the host, which in turn will … … 474 476 """ 475 477 _ = oSession, oTxsSession; 476 sTag = uuid.uuid4();477 478 478 479 sPathTemp = self.sScratchPath; … … 492 493 # Build the base command line, exclude all tests by default. 493 494 asArgs = [ sVkatExe, 'test', '--mode', 'host', '--probe-backends', \ 494 '--tempdir', sPathAudioTemp, '--outdir', sPathAudioOut, '-a' ]; 495 '--tempdir', sPathAudioTemp, '--outdir', sPathAudioOut, '-a', \ 496 '--tag', sTag, \ 497 '--no-verify' ]; # We do the verification separately in the step below. 495 498 496 499 for _ in range(1, reporter.getVerbosity()): # Verbosity always is initialized at 1. … … 507 510 reporter.testDone(); 508 511 512 if fRc: 513 # 514 # When running the test(s) above were successful, do the verification step next. 515 # This gives us a bit more fine-grained test results in the test manager. 516 # 517 reporter.testStart('Verifying audio data'); 518 519 sNameSetHst = '%s-host.tar.gz' % (sTag); 520 sPathSetHst = oTestVm.pathJoin(sPathAudioOut, sNameSetHst); 521 sNameSetGst = '%s-guest.tar.gz' % (sTag); 522 sPathSetGst = oTestVm.pathJoin(sPathAudioOut, sNameSetGst); 523 524 asArgs = [ sVkatExe, 'verify', sPathSetHst, sPathSetGst ]; 525 526 for _ in range(1, reporter.getVerbosity()): # Verbosity always is initialized at 1. 527 asArgs.extend([ '-v' ]); 528 529 fRc = self.executeHst("VKAT Host Verify", asArgs); 530 if fRc: 531 reporter.error("Verification audio data successful"); 532 else: 533 # 534 # Add the test sets to the test manager for later (manual) diagnosis. 535 # 536 reporter.addLogFile(sPathSetGst, 'misc/other', 'Guest audio test set'); 537 reporter.addLogFile(sPathSetHst, 'misc/other', 'Host audio test set'); 538 539 reporter.error("Verification of audio data failed"); 540 541 reporter.testDone(); 542 509 543 return fRc; 510 544 … … 527 561 reporter.log("Active tests: %s" % (self.asTests,)); 528 562 529 fRc = self.startVkatOnGuest(oTestVm, oSession, oTxsSession); 563 # Define a tag for the whole run. 564 sTag = oTestVm.sVmName + "_" + datetime.now().strftime("%Y%m%d_%H%M%S"); 565 566 fRc = self.startVkatOnGuest(oTestVm, oSession, oTxsSession, sTag); 530 567 if fRc: 531 568 # … … 533 570 # 534 571 if "guest_tone_playback" in self.asTests: 535 fRc = self.runTests(oTestVm, oSession, oTxsSession, 'Guest audio playback', asTests = [ '-i0' ]); 572 fRc = self.runTests(oTestVm, oSession, oTxsSession, \ 573 'Guest audio playback', sTag + "_test_playback", \ 574 asTests = [ '-i0' ]); 536 575 if "guest_tone_recording" in self.asTests: 537 fRc = fRc and self.runTests(oTestVm, oSession, oTxsSession, 'Guest audio recording', asTests = [ '-i1' ]); 576 fRc = fRc and self.runTests(oTestVm, oSession, oTxsSession, \ 577 'Guest audio recording', sTag + "_test_recording", \ 578 asTests = [ '-i1' ]); 538 579 539 580 # Cancel guest VKAT execution task summoned by startVkatOnGuest(). -
trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp
r91088 r91119 670 670 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Verification skipped\n"); 671 671 672 RTFileDelete(pTstEnv->u.Host.szPathTestSetGuest); 673 RTFileDelete(pTstEnv->u.Host.szPathTestSetValKit); 672 if (!pTstEnv->fSkipVerify) 673 { 674 RTFileDelete(pTstEnv->u.Host.szPathTestSetGuest); 675 RTFileDelete(pTstEnv->u.Host.szPathTestSetValKit); 676 } 677 else 678 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Leaving test set files behind\n"); 674 679 } 675 680 } … … 750 755 int rc; 751 756 752 const char *pszTag = NULL; /* Custom tag to use. Can be NULL if not being used. */753 757 PCPDMDRVREG pDrvReg = AudioTestGetDefaultBackend(); 754 758 bool fWithDrvAudio = false; … … 862 866 863 867 case VKAT_TEST_OPT_TAG: 864 pszTag = ValueUnion.psz; 868 rc = RTStrCopy(TstEnv.szTag, sizeof(TstEnv.szTag), ValueUnion.psz); 869 if (RT_FAILURE(rc)) 870 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Tag invalid, rc=%Rrc", rc); 865 871 break; 866 872 … … 978 984 979 985 const bool fPacked = AudioTestSetIsPacked(pszPathSet); 986 980 987 if (fPacked) 981 988 { 982 989 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test set is an archive and needs to be unpacked\n"); 983 990 984 char szPathTemp[RTPATH_MAX]; 985 rc = RTPathTemp(szPathTemp, sizeof(szPathTemp)); 991 if (!RTFileExists(pszPathSet)) 992 { 993 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test set '%s' does not exist\n", pszPathSet); 994 rc = VERR_FILE_NOT_FOUND; 995 } 996 else 997 rc = VINF_SUCCESS; 998 986 999 if (RT_SUCCESS(rc)) 987 1000 { 988 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Using temporary directory '%s'\n", szPathTemp); 989 990 rc = RTPathJoin(szPathExtracted, sizeof(szPathExtracted), szPathTemp, "vkat-testset-XXXX"); 1001 char szPathTemp[RTPATH_MAX]; 1002 rc = RTPathTemp(szPathTemp, sizeof(szPathTemp)); 991 1003 if (RT_SUCCESS(rc)) 992 1004 { 993 rc = RTDirCreateTemp(szPathExtracted, 0755); 1005 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Using temporary directory '%s'\n", szPathTemp); 1006 1007 rc = RTPathJoin(szPathExtracted, sizeof(szPathExtracted), szPathTemp, "vkat-testset-XXXX"); 994 1008 if (RT_SUCCESS(rc)) 995 1009 { 996 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Unpacking archive to '%s'\n", szPathExtracted); 997 rc = AudioTestSetUnpack(pszPathSet, szPathExtracted); 1010 rc = RTDirCreateTemp(szPathExtracted, 0755); 998 1011 if (RT_SUCCESS(rc)) 999 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Archive successfully unpacked\n"); 1012 { 1013 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Unpacking archive to '%s'\n", szPathExtracted); 1014 rc = AudioTestSetUnpack(pszPathSet, szPathExtracted); 1015 if (RT_SUCCESS(rc)) 1016 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Archive successfully unpacked\n"); 1017 } 1000 1018 } 1001 1019 }
Note:
See TracChangeset
for help on using the changeset viewer.