Author: gnichols
Date: 2010-08-12 15:58:43 +0000 (Thu, 12 Aug 2010)
New Revision: 631
Modified:
trunk/tests/audio/audio.py
Log:
608535 - rhel6 audio test failed - sound-sample.wav: No such file or directory
Modified: trunk/tests/audio/audio.py
===================================================================
--- trunk/tests/audio/audio.py 2010-08-12 15:56:09 UTC (rev 630)
+++ trunk/tests/audio/audio.py 2010-08-12 15:58:43 UTC (rev 631)
@@ -40,10 +40,10 @@
def getRequiredRPMs(self):
rpms = ["sox"]
redhat = RedHatRelease()
- if "Fedora" in redhat.getProduct() or ("Red Hat" in
redhat.getProduct() and redhat.getVersion() is 6):
- pass # need to find system-config-soundcard
+ if "Fedora" in redhat.getProduct() or ("Red Hat" in
redhat.getProduct() and redhat.getVersion() >= 6):
+ rpms.append("alsa-utils") # for sound samples in
/usr/share/sounds/alsa
else:
- rpms.append("system-config-soundcard")
+ rpms.append("system-config-soundcard") # for sound samples in
/usr/share/system-config-soundcard
return rpms
def logSoundCardInfo(self):
@@ -80,13 +80,17 @@
self.result = Constants.FAIL
return FAILED
- waveFile="/usr/share/system-config-soundcard/sound-sample.wav";
+ waveFiles=["/usr/share/system-config-soundcard/sound-sample.wav",
+ "/usr/share/sounds/alsa/Front_Right.wav",
+ "/usr/share/sounds/alsa/Front_Left.wav"]
recordedWaveFile="./test.wav"
print "starting recording"
- if not os.system("play %s &" % waveFile) is 0:
- print "Error: play command failed"
- self.result = Constants.FAIL
- return FAILED
+ for waveFile in waveFiles:
+ if os.path.exists(waveFile):
+ if not os.system("play %s &" % waveFile) is 0:
+ print "Error: play command failed"
+ self.result = Constants.FAIL
+ return FAILED
if not os.system("rec -r 44100 %s &" % recordedWaveFile) is 0:
print "Error: record command failed"
self.result = Constants.FAIL
@@ -96,10 +100,7 @@
print "Waiting %d sec" % waitTime
sys.stdout.flush()
time.sleep(waitTime)
- if not os.system("killall -w -9 rec sox") is 0:
- print "Error: kill failed"
- self.result = Constants.FAIL
- return FAILED
+ os.system("killall -w -9 rec sox")
if self.getMode() == Constants.normal and not self.promptConfirm("Did you
hear the sound?"):
self.result = Constants.FAIL
Show replies by date