blob: 0d5df84b77fc49511655ea6b4515247d7692b8ed [file] [log] [blame]
Jerry Floodb88fc2d2017-04-12 09:46:44 -04001'''
2Created on Apr 7, 2017
3
4@author: jf9860
5'''
6from threading import Thread
7import subprocess
8import os
9from datetime import datetime
10import logging
11
12class RunEte(Thread):
13 '''
14 classdocs
15 '''
16 robot_test = ""
17 robot_command = "runEteTag.sh"
18 soaksubfolder = ""
19 test_number =0
20
21 def __init__(self, test_name, soaksubfolder, test_number):
22 '''
23 Constructor
24 '''
25 super(RunEte, self).__init__()
26 self.robot_test = test_name
27 self.soaksubfolder = soaksubfolder
28 self.test_number = test_number
29
30 def run(self):
31 logging.info("{} ({}) started - {}".format(self.getName(), self.robot_test, str(datetime.now())))
32 try:
33 ''' Add the '/' here so that the shell doesn't require a subfolder... '''
34 env = dict(os.environ, SOAKSUBFOLDER=self.soaksubfolder + "/")
35 output = subprocess.check_output(["bash", self.robot_command, self.robot_test, self.test_number], shell=False, env=env)
36 logging.info("{} ({}) {}".format(self.getName(), self.robot_test, output))
DR695Hae6fedd2019-05-01 18:52:33 -040037 except Exception as e:
Jerry Floodb88fc2d2017-04-12 09:46:44 -040038 logging.error("{} ({}) Unexpected error {}".format(self.getName(), self.robot_test, repr(e)))
39 logging.info("{} ({}) ended - {}".format(self.getName(), self.robot_test, str(datetime.now())))