summaryrefslogtreecommitdiffstats
path: root/loadtest/RunEte.py
diff options
context:
space:
mode:
authorJerry Flood <jf9860@att.com>2017-04-12 09:46:44 -0400
committerJerry Flood <jf9860@att.com>2017-04-12 10:36:32 -0400
commitb88fc2d930537a47b12115a899322fb9cebbc0c1 (patch)
treeb6bfa126823c1937159e0a6cb0fbcac6621d551d /loadtest/RunEte.py
parent26151066fb0c53c62cc5ecbe1637482be59c497c (diff)
TEST-2 load/soak test utility
Command line load/soak test utility to run multple ETE tests at once. Change-Id: I4b0224d4fbdf82964acaf7704a5e6d9802d8a0e1 Signed-off-by: Jerry Flood <jf9860@att.com>
Diffstat (limited to 'loadtest/RunEte.py')
-rw-r--r--loadtest/RunEte.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/loadtest/RunEte.py b/loadtest/RunEte.py
new file mode 100644
index 0000000..5012e7d
--- /dev/null
+++ b/loadtest/RunEte.py
@@ -0,0 +1,39 @@
+'''
+Created on Apr 7, 2017
+
+@author: jf9860
+'''
+from threading import Thread
+import subprocess
+import os
+from datetime import datetime
+import logging
+
+class RunEte(Thread):
+ '''
+ classdocs
+ '''
+ robot_test = ""
+ robot_command = "runEteTag.sh"
+ soaksubfolder = ""
+ test_number =0
+
+ def __init__(self, test_name, soaksubfolder, test_number):
+ '''
+ Constructor
+ '''
+ super(RunEte, self).__init__()
+ self.robot_test = test_name
+ self.soaksubfolder = soaksubfolder
+ self.test_number = test_number
+
+ def run(self):
+ logging.info("{} ({}) started - {}".format(self.getName(), self.robot_test, str(datetime.now())))
+ try:
+ ''' Add the '/' here so that the shell doesn't require a subfolder... '''
+ env = dict(os.environ, SOAKSUBFOLDER=self.soaksubfolder + "/")
+ output = subprocess.check_output(["bash", self.robot_command, self.robot_test, self.test_number], shell=False, env=env)
+ logging.info("{} ({}) {}".format(self.getName(), self.robot_test, output))
+ except Exception, e:
+ logging.error("{} ({}) Unexpected error {}".format(self.getName(), self.robot_test, repr(e)))
+ logging.info("{} ({}) ended - {}".format(self.getName(), self.robot_test, str(datetime.now())))