From 512ceb07b76fdb70f40f894ca266b5c349bcd82a Mon Sep 17 00:00:00 2001 From: Fathi Boudra Date: Fri, 8 Jun 2012 11:14:42 +0300 Subject: Imported Upstream version 0.1.20120504 --- PKG-INFO | 10 ++++++++++ gatortests.py | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 12 ++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 PKG-INFO create mode 100755 gatortests.py create mode 100644 setup.py 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' +) -- cgit v1.2.3