summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClark Williams <williams@redhat.com>2016-08-15 15:22:02 -0500
committerJohn Kacur <jkacur@redhat.com>2017-03-20 22:19:30 +0100
commitc9706d9861ee4ebc9b67c39b62f0107879bd0eec (patch)
tree00c159a38c2f38586247f1332419d6e66b97e235
parent4c0e5dc2d94e4ab2f62b97beed1323246d2cb5f3 (diff)
downloadrt-tests-c9706d9861ee4ebc9b67c39b62f0107879bd0eec.tar.gz
hwlatdetect: Add --hardlimit to define the real test failing criteria
We decided it is more interesting, in our automated tests, to have a higher tolerance to SMI as most of the test boxes are not optimized for RT. On the other hand, we would like to know how big are the SMI latencies on these boxes. This commit adds the --hardlimit parameter, which defines the real PASS/FAIL latency criteria. Latencies above --threshold will be annotated, but the test may PASS if the observed latencies are smaller than --hardlimit. When --hardlimit is not informed, the value used for --threshold is also used as the hard limit. Signed-off-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com> Signed-off-by: Clark Williams <williams@redhat.com> Signed-off-by: John Kacur <jkacur@redhat.com>
-rwxr-xr-xsrc/hwlatdetect/hwlatdetect.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/hwlatdetect/hwlatdetect.py b/src/hwlatdetect/hwlatdetect.py
index 4a01434..e08c798 100755
--- a/src/hwlatdetect/hwlatdetect.py
+++ b/src/hwlatdetect/hwlatdetect.py
@@ -474,6 +474,10 @@ if __name__ == '__main__':
dest="threshold",
help="value above which is considered an hardware latency")
+ parser.add_option("--hardlimit", default=None, type="string",
+ dest="hardlimit",
+ help="value above which the test is considered to fail")
+
parser.add_option("--window", default=None, type="string",
dest="window",
help="time between samples")
@@ -526,6 +530,12 @@ if __name__ == '__main__':
detect.set("threshold", t)
debug("threshold set to %dus" % t)
+ if o.hardlimit:
+ hardlimit = microseconds(o.hardlimit)
+ else:
+ hardlimit = detect.get("threshold")
+ debug("hardlimit set to %dus" % hardlimit)
+
if o.window:
w = microseconds(o.window)
if w < detect.get("width"):
@@ -601,5 +611,6 @@ if __name__ == '__main__':
for s in detect.samples:
print("%s" % s)
+ maxlatency = int(detect.get("max"))
detect.cleanup()
- sys.exit(exceeding)
+ sys.exit(maxlatency > hardlimit)