summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test-cli/.idea/workspace.xml5
-rw-r--r--test-cli/test/tests/qaudio.py1
-rw-r--r--test-cli/test/tests/qethernet.py19
-rw-r--r--test-cli/test/tests/qwifi.py19
4 files changed, 26 insertions, 18 deletions
diff --git a/test-cli/.idea/workspace.xml b/test-cli/.idea/workspace.xml
index 5d804c5..3d15030 100644
--- a/test-cli/.idea/workspace.xml
+++ b/test-cli/.idea/workspace.xml
@@ -3,13 +3,8 @@
<component name="ChangeListManager">
<list default="true" id="4991a6e0-1b9d-4824-9b6e-5ac031eb4816" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/test/tests/qamper.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/tests/qamper.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test/tests/qaudio.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/tests/qaudio.py" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/test/tests/qdmesg.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/tests/qdmesg.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test/tests/qethernet.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/tests/qethernet.py" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/test/tests/qnand.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/tests/qnand.py" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/test/tests/qusb.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/tests/qusb.py" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/test/tests/qusbdual.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/tests/qusbdual.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test/tests/qwifi.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/tests/qwifi.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
diff --git a/test-cli/test/tests/qaudio.py b/test-cli/test/tests/qaudio.py
index bfbb051..364d8b2 100644
--- a/test-cli/test/tests/qaudio.py
+++ b/test-cli/test/tests/qaudio.py
@@ -48,7 +48,6 @@ class Qaudio(unittest.TestCase):
if a != b:
self.fail("failed: sent and received DTMF sequence don't match.")
else:
- print(self.__dtmf_secuence_result)
self.fail("failed: received DTMF sequence is shorter than expected.")
else:
self.fail("failed: unable to use multimon command.")
diff --git a/test-cli/test/tests/qethernet.py b/test-cli/test/tests/qethernet.py
index d38de34..81acef1 100644
--- a/test-cli/test/tests/qethernet.py
+++ b/test-cli/test/tests/qethernet.py
@@ -1,6 +1,7 @@
import unittest
import sh
import json
+import time
class Qethernet(unittest.TestCase):
@@ -11,6 +12,7 @@ class Qethernet(unittest.TestCase):
params = None
__bwreal = None
__resultlist = None # resultlist is a python list of python dictionaries
+ timebetweenattempts = 5
# varlist content: serverip, bwexpected, port
def __init__(self, testname, testfunc, varlist):
@@ -37,12 +39,17 @@ class Qethernet(unittest.TestCase):
self.__resultlist = []
def execute(self):
- # execute iperf command against the server
- try:
- p = sh.iperf3("-c", self.__serverip, "-n", self.__numbytestx, "-f", "m", "-p", self.__port, "-J",
- _timeout=20)
- except sh.TimeoutException:
- self.fail("failed: iperf timeout reached")
+ # execute iperf command against the server, but it implements attempts in case the server is busy
+ iperfdone = False
+ while not iperfdone:
+ try:
+ p = sh.iperf3("-c", self.__serverip, "-n", self.__numbytestx, "-f", "m", "-p", self.__port, "-J",
+ _timeout=20)
+ iperfdone = True
+ except sh.TimeoutException:
+ self.fail("failed: iperf timeout reached")
+ except sh.ErrorReturnCode:
+ time.sleep(self.timebetweenattempts)
# check if it was executed succesfully
if p.exit_code == 0:
diff --git a/test-cli/test/tests/qwifi.py b/test-cli/test/tests/qwifi.py
index 4522057..3dd9e38 100644
--- a/test-cli/test/tests/qwifi.py
+++ b/test-cli/test/tests/qwifi.py
@@ -2,6 +2,7 @@ import unittest
import sh
import re
import json
+import time
class Qwifi(unittest.TestCase):
@@ -12,6 +13,7 @@ class Qwifi(unittest.TestCase):
params = None
__bwreal = None
__resultlist = None # resultlist is a python list of python dictionaries
+ timebetweenattempts = 5
# varlist content: serverip, bwexpected, port
def __init__(self, testname, testfunc, varlist):
@@ -48,12 +50,17 @@ class Qwifi(unittest.TestCase):
'inet addr:(?!127\.0{1,3}\.0{1,3}\.0{0,2}1$)((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)',
p.stdout.decode('ascii'))
if result:
- # execute iperf command against the server
- try:
- p = sh.iperf3("-c", self.__serverip, "-n", self.__numbytestx, "-f", "m", "-p", self.__port,
- "-J", _timeout=30)
- except sh.TimeoutException:
- self.fail("failed: iperf timeout reached")
+ # execute iperf command against the server, but it implements attempts in case the server is busy
+ iperfdone = False
+ while not iperfdone:
+ try:
+ p = sh.iperf3("-c", self.__serverip, "-n", self.__numbytestx, "-f", "m", "-p", self.__port,
+ "-J", _timeout=20)
+ iperfdone = True
+ except sh.TimeoutException:
+ self.fail("failed: iperf timeout reached")
+ except sh.ErrorReturnCode:
+ time.sleep(self.timebetweenattempts)
# check if it was executed succesfully
if p.exit_code == 0: