VirtualBox

Ignore:
Timestamp:
Sep 2, 2021 12:17:58 PM (3 years ago)
Author:
vboxsync
Message:

Audio/Validation Kit: Implemented host audio probing for the test driver to detect host OSes which don't have audio (configured / enabled / whatever). ​bugref:10008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/audio/tdAudioTest.py

    r91064 r91090  
    243243            for line in iter(oProcess.stdout.readline, b''):
    244244                reporter.log('[' + sWhat + '] ' + line.decode('utf-8'));
    245             iExitCode = oProcess.poll();
    246             if iExitCode:
    247                 if iExitCode == 0:
    248                     fRc = True;
    249                 else:
    250                     reporter.error('Executing \"%s\" on host returned exit code error %d' % (sWhat, iExitCode));
     245            oProcess.communicate();
     246            if oProcess.returncode == 0:
     247                fRc = True;
     248            else:
     249                reporter.log2('Executing \"%s\" on host returned exit code error %d' % (sWhat, oProcess.returncode));
    251250
    252251        return fRc;
     
    267266        fRc = self.executeHstLoop(sWhat, asArgs, asEnv);
    268267        if fRc:
    269             reporter.error('Executing \"%s\" on host done' % (sWhat,));
     268            reporter.log('Executing \"%s\" on host done' % (sWhat,));
    270269        else:
    271             reporter.error('Executing \"%s\" on host failed' % (sWhat,));
     270            reporter.log('Executing \"%s\" on host failed' % (sWhat,));
    272271
    273272        reporter.testDone();
     
    541540        self.logVmInfo(oVM);
    542541
     542        reporter.testStart("Audio Testing");
     543
     544        fSkip = False;
     545
    543546        if  oTestVm.isWindows() \
    544547        and oTestVm.sKind in ('WindowsNT4', 'Windows2000'): # Too old for DirectSound and WASAPI backends.
    545548            reporter.log('Audio testing skipped, not implemented/available for that OS yet.');
     549            fSkip = True;
     550
     551        if  not fSkip \
     552        and self.fpApiVer < 7.0:
     553            reporter.log('Audio testing for non-trunk builds skipped.');
     554            fSkip = True;
     555
     556        sVkatExe = self.getBinTool('vkat');
     557        asArgs   = [ sVkatExe, 'enum', '--probe-backends' ];
     558        fRc      = self.executeHst("VKAT Host Audio Probing", asArgs);
     559        if  not fSkip \
     560        and not fRc:
     561            reporter.log('Audio not available on host, skipping audio tests.');
     562            fSkip = True;
     563
     564        if fSkip:
     565            reporter.testDone(fSkipped = True);
    546566            return True;
    547 
    548         if self.fpApiVer < 7.0:
    549             reporter.log('Audio testing for non-trunk builds skipped.');
    550             return True;
    551 
    552         fRc = False;
    553567
    554568        # Reconfigure the VM.
     
    588602            self.terminateVmBySession(oSession);
    589603
     604        reporter.testDone();
    590605        return fRc;
    591606
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