summaryrefslogtreecommitdiff
path: root/test-cli/test/tests
diff options
context:
space:
mode:
Diffstat (limited to 'test-cli/test/tests')
-rw-r--r--test-cli/test/tests/qaudio.py7
-rw-r--r--test-cli/test/tests/qusbdual.py2
2 files changed, 6 insertions, 3 deletions
diff --git a/test-cli/test/tests/qaudio.py b/test-cli/test/tests/qaudio.py
index acad4a9..f7ae33c 100644
--- a/test-cli/test/tests/qaudio.py
+++ b/test-cli/test/tests/qaudio.py
@@ -2,6 +2,7 @@ import unittest
import sh
import wave
import contextlib
+import time
def calc_audio_duration(fname):
@@ -27,6 +28,8 @@ class Qaudio(unittest.TestCase):
def execute(self):
# analize audio file
recordtime = calc_audio_duration("/var/lib/hwtest-files/dtmf-13579.wav") + 0.15
+ # wait time before playing
+ time.sleep(1)
# play and record
p1 = sh.aplay("/var/lib/hwtest-files/dtmf-13579.wav", _bg=True)
p2 = sh.arecord("-r", 8000, "-d", recordtime, "/tmp/station/recorded.wav", _bg=True)
@@ -42,8 +45,8 @@ class Qaudio(unittest.TestCase):
self.__dtmf_secuence_result.append(li.split(" ")[1])
# compare original and processed dtmf sequence
if len(self.__dtmf_secuence) == len(self.__dtmf_secuence_result):
- for i in range(len(self.__dtmf_secuence)):
- if self.__dtmf_secuence[i] != self.__dtmf_secuence_result[i]:
+ for a, b in zip(self.__dtmf_secuence, self.__dtmf_secuence_result):
+ if a != b:
self.fail("failed: sent and received DTMF sequence don't match.")
else:
self.fail("failed: received DTMF sequence is shorter than expected.")
diff --git a/test-cli/test/tests/qusbdual.py b/test-cli/test/tests/qusbdual.py
index ad95b84..842d514 100644
--- a/test-cli/test/tests/qusbdual.py
+++ b/test-cli/test/tests/qusbdual.py
@@ -60,7 +60,7 @@ class Qusbdual(unittest.TestCase):
self.fail("failed: Unable to calculate MD5 of the copied file.")
newmd5 = p.stdout.decode().split(" ")[0]
with open('/tmp/station/hdd_gadget/usb-test.bin.md5', 'r') as outfile:
- oldmd5 = outfile.read()
+ oldmd5 = outfile.read().rstrip("\n")
outfile.close()
if newmd5 != oldmd5:
sh.umount("/tmp/station/hdd_gadget")