diff options
author | DR695H <dr695h@att.com> | 2019-04-18 10:56:38 -0400 |
---|---|---|
committer | Gary Wu <gary.i.wu@huawei.com> | 2019-04-23 10:34:04 -0700 |
commit | d050b58d3fde6a049104d8287f8d8cfbe3013d5d (patch) | |
tree | 7563bfffabfc4f713996b1f12e52b5f2317fc6e2 /robotframework-onap/loadtest/RunEte.py | |
parent | 5709f89501b9ecf93fcb1667de017e1736c8919f (diff) |
move robotframeworkonap to subdirectory
i also moved the build to maven based, although that isnt needed
to work right now.
Change-Id: Ib18d70e3ea4858cc4b9d51fdc2046b59202640ab
Issue-ID: TEST-141
Signed-off-by: DR695H <dr695h@att.com>
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'robotframework-onap/loadtest/RunEte.py')
-rw-r--r-- | robotframework-onap/loadtest/RunEte.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/robotframework-onap/loadtest/RunEte.py b/robotframework-onap/loadtest/RunEte.py new file mode 100644 index 0000000..5012e7d --- /dev/null +++ b/robotframework-onap/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()))) |