summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFathi Boudra <fabo@debian.org>2012-06-08 11:14:42 +0300
committerFathi Boudra <fabo@debian.org>2012-06-08 11:14:42 +0300
commit512ceb07b76fdb70f40f894ca266b5c349bcd82a (patch)
tree7f58cb16b5d940cf5f52a4577d0989ea033fc0c6
Imported Upstream version 0.1.20120504upstream/0.1.20120504
-rw-r--r--PKG-INFO10
-rwxr-xr-xgatortests.py60
-rw-r--r--setup.py12
3 files changed, 82 insertions, 0 deletions
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..005ec1e
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,10 @@
+Metadata-Version: 1.0
+Name: gatortests
+Version: 0.1.20120504
+Summary: Gator tests
+Home-page: UNKNOWN
+Author: David Stubbs
+Author-email: david.stubbs2@arm.com
+License: GPL-3
+Description: UNKNOWN
+Platform: UNKNOWN
diff --git a/gatortests.py b/gatortests.py
new file mode 100755
index 0000000..ed1234b
--- /dev/null
+++ b/gatortests.py
@@ -0,0 +1,60 @@
+#!/usr/bin/python
+
+import subprocess
+import time
+import re
+
+def testoutput(TestName,Result):
+ if (Result==0):
+ print "***" + TestName + ": pass***"
+ else:
+ print "***" + TestName + ": fail***"
+
+def checkforerror(process):
+ ErrorLevel=0
+ stdout=""
+ try:
+ stdout= subprocess.check_output(process,shell=True,stderr=subprocess.STDOUT)
+
+ except subprocess.CalledProcessError, e:
+ ErrorLevel=-1
+ stdout=e.output
+
+ print process + "\n"+ stdout
+ return ErrorLevel
+
+def get_stdout(command):
+ stdout=""
+ try:
+ stdout= subprocess.check_output(command,shell=True,stderr=subprocess.STDOUT)
+
+ except subprocess.CalledProcessError, e:
+ stdout=e.output
+
+ print command + "\n" + stdout
+ return stdout
+
+def checkgator():
+ apt_add=checkforerror('apt-add-repository ppa:linaro-maintainers/arm-ds5 --yes')
+ apt_get_update=checkforerror('apt-get -y update')
+ apt_get_install=checkforerror('apt-get -y install gator')
+
+ time.sleep(10)
+
+ gatord_running = get_stdout('ps ax')
+ lsmod_output= get_stdout('lsmod')
+
+ modout=re.search("gator",lsmod_output)
+ if (modout>0):
+ modout=0
+ daemonout=re.search('\d+:\d+\sgatord', gatord_running)
+ if (daemonout>0):
+ daemonout=0
+
+ testoutput("AptAdd",apt_add)
+ testoutput("AptGetUpdate",apt_get_update)
+ testoutput("AptGetInstall",apt_get_install)
+ testoutput("ModuleInserted",modout)
+ testoutput("DaemonRunning",daemonout)
+
+checkgator()
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..e8989b7
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,12 @@
+from distutils.core import setup
+
+setup(
+ name='gatortests',
+ version='0.1.20120504',
+ packages=[''],
+ url='',
+ license='GPL-3',
+ author='David Stubbs',
+ author_email='david.stubbs2@arm.com ',
+ description='Gator tests'
+)