Author: dsommers
Date: 2010-01-12 17:04:41 +0000 (Tue, 12 Jan 2010)
New Revision: 296
Added:
trunk/tests/rteval/
trunk/tests/rteval/v7_rteval.py
Log:
Added first cut of a v7 rteval test
Added: trunk/tests/rteval/v7_rteval.py
===================================================================
--- trunk/tests/rteval/v7_rteval.py (rev 0)
+++ trunk/tests/rteval/v7_rteval.py 2010-01-12 17:04:41 UTC (rev 296)
@@ -0,0 +1,78 @@
+#!/usr/bin/python
+# Copyright (c) 2009 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: David Sommerseth <davids(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
+
+class v7RTeval(Test):
+
+ def __init__(self):
+ Test.__init__(self, name="rteval")
+ self.interactive = False
+ self.data = {}
+ self.rteval = None
+
+
+ def __read_sys_dmi(self, name):
+ try:
+ f = open("/sys/class/dmi/id/%s" % name, "r")
+ ret = f.readline().strip()
+ f.close()
+ return ret
+ except IOError:
+ print "Could not open /sys/class/dmi/id/%s ... are you running the right
kernel?" % name
+ return None
+
+
+ def plan(self, devices):
+ # Check if we have some interesting data from the /sys/class/dmi/id directory
+ self.data['sysdmi'] = {}
+ files = ('sys_vendor','product_name','product_version')
+ for f in files:
+ self.data['sysdmi'][f] = self.__read_sys_dmi(f)
+ if self.data['sysdmi'][f] is None:
+ # If one of the /sys/class/dmi/id files is missing, abort this test
planning
+ return ()
+
+ # Prepare rteval
+ import rteval.rteval
+
+ args = ['-d', '30s']
+ self.rteval = rteval.rteval.RtEval(args)
+ return (self.makeCopy())
+
+
+ def run(self):
+ FAILED = 1
+ PASSED = 0
+
+ if self.rteval.rteval() == 0:
+ return PASSED
+ return FAILED
+
+
+if __name__ == "__main__":
+ test = v7RTeval()
+ test.plan(None)
+ returnValue = test.do(sys.argv)
+ sys.exit(returnValue)
+
Property changes on: trunk/tests/rteval/v7_rteval.py
___________________________________________________________________
Name: svn:executable
+ *
Show replies by date