summaryrefslogtreecommitdiff
path: root/test-cli/test/tests/qethernet.py
diff options
context:
space:
mode:
authorHector Fernandez <hector@iatec.biz>2020-07-01 10:45:34 +0200
committerHector Fernandez <hector@iatec.biz>2020-07-01 10:45:34 +0200
commit34df86b37d6838b115e65e5f3a332344afeb86b8 (patch)
tree946e1d7d6d55a4339e453c84c4fbbf4b785a1712 /test-cli/test/tests/qethernet.py
parent9ac8a326412b04e4873b883c2f2a056ca0b22480 (diff)
downloadboard-34df86b37d6838b115e65e5f3a332344afeb86b8.zip
board-34df86b37d6838b115e65e5f3a332344afeb86b8.tar.gz
board-34df86b37d6838b115e65e5f3a332344afeb86b8.tar.bz2
Changes to adapt to new way to save results in DB. Created audio test. Added protections against unexpected status in DB.
Diffstat (limited to 'test-cli/test/tests/qethernet.py')
-rw-r--r--test-cli/test/tests/qethernet.py37
1 files changed, 8 insertions, 29 deletions
diff --git a/test-cli/test/tests/qethernet.py b/test-cli/test/tests/qethernet.py
index 878c0a0..3b2f197 100644
--- a/test-cli/test/tests/qethernet.py
+++ b/test-cli/test/tests/qethernet.py
@@ -1,6 +1,5 @@
import unittest
import sh
-import re
import json
@@ -53,45 +52,25 @@ class Qethernet(unittest.TestCase):
data = json.loads(p.stdout.decode('ascii'))
self.__bwreal = float(data['end']['sum_received']['bits_per_second'])/1024/1024
# save result file
- with open('/tmp/ethernet-iperf.json', 'w') as outfile:
+ with open('/tmp/station/ethernet-iperf3.json', 'w') as outfile:
json.dump(data, outfile, indent=4)
+ outfile.close()
self.__resultlist.append(
{
- "desc": "iperf3 output",
- "data": "/tmp/ethernet-iperf.json",
- "type": "file"
+ "description": "iperf3 output",
+ "filepath": "/tmp/station/ethernet-iperf3.json",
+ "mimetype": "application/json"
}
)
# check if BW is in the expected range
if self.__bwreal < float(self.__bwexpected):
- self.__resultlist.append(
- {
- "desc": "Test result",
- "data": "FAILED: speed is lower than spected. Speed(Mbits/s): " + str(self.__bwreal),
- "type": "string"
- }
- )
self.fail("failed: speed is lower than spected. Speed(Mbits/s): " + str(self.__bwreal))
else:
- self.__resultlist.append(
- {
- "desc": "Test result",
- "data": "FAILED: could not complete iperf command.",
- "type": "string"
- }
- )
self.fail("failed: could not complete iperf command.")
- # Test successful
- self.__resultlist.append(
- {
- "desc": "Test result",
- "data": "OK",
- "type": "string"
- }
- )
-
def getresults(self):
-
return self.__resultlist
+
+ def gettextresult(self):
+ return ""