Author: jcwillia
Date: 2010-01-26 21:06:44 +0000 (Tue, 26 Jan 2010)
New Revision: 332
Added:
trunk/tests/hwlatdetect/
trunk/tests/hwlatdetect/Makefile
trunk/tests/hwlatdetect/runtest.sh
trunk/tests/hwlatdetect/v7_hwlatdetect.py
Modified:
trunk/tests/Makefile
Log:
Add realtime test v7_hwlatdetect
This adds the v7 wrapper for the realtime test hwlatdetect.
The hwlatdetect test is used to find hardware induced
latencies, usually from System Management Interrupts (SMIs)
Modified: trunk/tests/Makefile
===================================================================
--- trunk/tests/Makefile 2010-01-26 20:28:53 UTC (rev 331)
+++ trunk/tests/Makefile 2010-01-26 21:06:44 UTC (rev 332)
@@ -15,7 +15,7 @@
.PHONY: clean install
-SUBDIRS := audio bluray cdrom dvd core floppy info memory network pccard storage tape usb video battery suspend lid expresscard cpuscaling profiler fv_core fv_memory fv_network fv_storage rteval
+SUBDIRS := audio bluray cdrom dvd core floppy info memory network pccard storage tape usb video battery suspend lid expresscard cpuscaling profiler fv_core fv_memory fv_network fv_storage rteval hwlatdetect
clean:
for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
Added: trunk/tests/hwlatdetect/Makefile
===================================================================
--- trunk/tests/hwlatdetect/Makefile (rev 0)
+++ trunk/tests/hwlatdetect/Makefile 2010-01-26 21:06:44 UTC (rev 332)
@@ -0,0 +1,45 @@
+# V7
+TOPLEVEL_NAMESPACE=/V7
+
+# The name of the package under test:
+PACKAGE_NAME=v7
+
+# The path of the test below the package:
+RELATIVE_PATH=hwlatdetect
+
+# Version of the Test. Used with make tag.
+export TESTVERSION=1.1
+
+# The compiled namespace of the test.
+export TEST=$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH)
+
+.PHONY: all install download clean
+
+FILES=$(METADATA) runtest.sh v7_hwlatdetect.py
+
+run: $(FILES) build
+ ./runtest.sh
+
+build: $(BUILT_FILES)
+ chmod a+x ./runtest.sh ./v7_hwlatdetect.py
+
+clean:
+ rm -f *~ $(BUILT_FILES)
+
+# Include Common Makefile
+include $(DESTDIR)/usr/share/v7/lib/v7-make.include
+
+# Generate the testinfo.desc here:
+$(METADATA): Makefile
+ @touch $(METADATA)
+ @echo "Owner: Clark Williams <williams(a)redhat.com>" > $(METADATA)
+ @echo "Name: $(TEST)" >> $(METADATA)
+ @echo "Path: $(TEST_DIR)" >> $(METADATA)
+ @echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
+ @echo "Description: Hardware Certification Hardware Latency Detection Test">> $(METADATA)
+ @echo "TestTime: 1h" >> $(METADATA)
+ @echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA)
+ @echo "Requires: $(PACKAGE_NAME)" >> $(METADATA)
+ @echo "X-Interactive: no" >> $(METADATA)
+
+
Added: trunk/tests/hwlatdetect/runtest.sh
===================================================================
--- trunk/tests/hwlatdetect/runtest.sh (rev 0)
+++ trunk/tests/hwlatdetect/runtest.sh 2010-01-26 21:06:44 UTC (rev 332)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+v7-run-simple-test ${TEST:-$(basename $PWD)} ./v7_hwlatdetect.py
Property changes on: trunk/tests/hwlatdetect/runtest.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/tests/hwlatdetect/v7_hwlatdetect.py
===================================================================
--- trunk/tests/hwlatdetect/v7_hwlatdetect.py (rev 0)
+++ trunk/tests/hwlatdetect/v7_hwlatdetect.py 2010-01-26 21:06:44 UTC (rev 332)
@@ -0,0 +1,95 @@
+#!/usr/bin/python
+# Copyright (c) 2010 Red Hat, Inc. All rights reserved. This copyrighted material
+# is made available to anyone wishing to use, modify, copy, or
+# redistribute it subject to the terms and conditions of the GNU General
+# Public License v.2.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Author: Clark Williams <williams(a)redhat.com>
+#
+
+import os, sys, string, time
+
+if __name__ == "__main__":
+ sys.path.insert(0, '/usr/share/v7/lib')
+
+from v7.test import Test
+from v7.tags import Constants
+from v7.tags import DeviceClass
+
+###################################################
+#
+# default test parameters
+#
+###################################################
+threshold = 15 # fifteen microseconds
+window = 1000000 # one million microseconds (1.0s)
+width = 800000 # 800 thousand microseconds (0.8s)
+duration = 7022 # 2 hours
+
+class v7HWlatdetect(Test):
+
+ def __init__(self):
+ Test.__init__(self, name="hwlatdetect")
+ self.interactive = False
+ self.data = {}
+ self.hwlatdetect = None
+ self.deviceClass = DeviceClass.processor
+
+ def plan(self, devices):
+ ret = list()
+ v = os.uname()[3]
+ if v.find(" RT ") == -1:
+ return ret
+ ret.append(self.makeCopy())
+ return ret
+
+ def run(self):
+ FAILED = 1
+ PASSED = 0
+
+ sys.path.insert(0, '/usr/bin')
+ # Prepare hwlatdetect
+ try:
+ import hwlatdetect
+ except Exception, e:
+ print "Error: could not import hwlatdetect"
+ return FAILED
+
+ try:
+ detect = hwlatdetect.Detector()
+ except Exception, e:
+ print "Error: could not initialize hwlatdetect"
+ raise
+
+ detect.set("threshold", threshold)
+ detect.set("window", window)
+ detect.set("width", width)
+ detect.testduration = duration
+ detect.detect()
+ exceeding = detect.get("count")
+ print "detected %d samples exceeding threshold %d\n" % (exceeding, detect.get("threshold"))
+
+ for s in detect.samples:
+ print s
+
+ detect.cleanup()
+
+ if exceeding:
+ return FAILED
+ return PASSED
+
+
+if __name__ == "__main__":
+ test = v7HWlatdetect()
+ test.plan(None)
+ returnValue = test.do(sys.argv)
+ sys.exit(returnValue)
+
Property changes on: trunk/tests/hwlatdetect/v7_hwlatdetect.py
___________________________________________________________________
Name: svn:executable
+ *