diff --git a/basic/componentHandling.py b/basic/componentHandling.py index 960721a..0439398 100644 --- a/basic/componentHandling.py +++ b/basic/componentHandling.py @@ -183,6 +183,12 @@ class ComponentManager: if name in parContent["comps"]: for k in parContent["comps"][name].keys(): c.conf[k] = parContent["comps"][name][k] + if B.SUBJECT_ARTS in c.conf and B.TOPIC_NODE_DB in c.conf[B.SUBJECT_ARTS]: + if not B.DATA_NODE_DDL in c.conf: + c.conf[B.DATA_NODE_DDL] = {} + for table in c.conf[B.SUBJECT_ARTS][B.SUBJECT_ARTS]: + conf = utils.config_tool.getConfig("DATASTRUCTURE", c.name, table) + c.conf[B.DATA_NODE_DDL][table] = conf comps[name] = c return c diff --git a/basic/constants.py b/basic/constants.py index e4aefd8..c388977 100644 --- a/basic/constants.py +++ b/basic/constants.py @@ -40,6 +40,7 @@ PAR_COMP = 'component' PAR_FCT = 'function' PAR_TOOL = 'tool' PAR_TESTCASE = "testcase" +PAR_TESTSUITE = "usecase" """ name of testcase extracted from PAR_TCDIR """ diff --git a/basic/program.py b/basic/program.py index 05ed4d9..a409cd1 100644 --- a/basic/program.py +++ b/basic/program.py @@ -34,7 +34,14 @@ jobdef = { "basedir": "envbase", "dirname": "envdir", "logdir": "{job.par.envdir}/{log}/log_{time}.txt" }, - "init_testset": { + "test_executer": { + "pardef": "", + "pfilesource" : "", + "pfiletarget" : "tsparfile", + "basedir": "tsbase", + "dirname": "tsdir", + "logdir": "{job.par.tsdir}/{log}/log_{time}.txt" }, + "init_testsuite": { "pardef": "tsdir", # ,tdtyp,tdsrc,tdname", "pfilesource" : "envparfile", "pfiletarget" : "tsparfile", @@ -62,7 +69,7 @@ jobdef = { "basedir": "tcbase", "dirname": "tcdir", "logdir": "{job.par.tcdir}/{log}/log_{tctime}.txt"}, - "finish_testset": { + "finish_testsuite": { "pardef": "tcdir,tdtyp,tdsrc,tdname", "pfilesource": "tsparfile", "pfiletarget": "tcparfile", @@ -99,6 +106,16 @@ class Job: self.m = basic.message.Message(basic.message.LIMIT_DEBUG, logTime, None) print("prog-50 " + str(self.par.basedir)) + @staticmethod + def popInstance(): + job = Job.getInstance() + Job.__instance = None + return job + + @staticmethod + def pushInstance(job): + Job.__instance = job + return job def resetInstance(program): job = Job.getInstance() @@ -224,6 +241,9 @@ class Parameter: self.basedir = jobdef[program]["basedir"] if hasattr(self, jobdef[program]["dirname"]): utils.path_tool.extractPath(self.basedir, getattr(self, jobdef[program]["dirname"])) + elif program != "unit": + dirpath = utils.path_tool.composePatttern("{"+jobdef[program]["basedir"]+"}", None) + setattr(self, jobdef[program]["dirname"], dirpath) else: self.basedir = "debugs" diff --git a/bereinige.py b/bereinige.py new file mode 100644 index 0000000..e69de29 diff --git a/test_executer.py b/test_executer.py new file mode 100644 index 0000000..2627a19 --- /dev/null +++ b/test_executer.py @@ -0,0 +1,61 @@ +from datetime import datetime +import basic.program +import basic.program as program +import utils.tdata_tool + + +PROGRAM_NAME = "test_executer" + +def getTime(): + time = datetime.now().strftime("%Y-%m-%d_%H-%M-%S") + return time + +def start(job): + job.m.setMsg("# # # # # start executer # # # # # ") + tdata = utils.tdata_tool.getTestdata() + myjob = job + for step in tdata["_steps"]: + for arg in step["args"]: + if arg == "start": + if "testsuite" in step["args"][arg]: + jobargs = {"application": job.par.application, "environment": job.par.environment, + "usecase": job.par.usecase, "tstime": getTime()} + job.popInstance() + job = basic.program.Job("unit") + job.par.setParameterArgs(jobargs) + job.setProgram(step["args"][arg]) + print("Job initialisiert "+job.program+" in Verzeichnis "+getattr(job.par, "tsdir")) + job.stopJob(1) + job.popInstance() + basic.program.Job.pushInstance(myjob) + print("ende") + job = myjob + if "testcase" in step["args"][arg]: + jobargs = {"application": job.par.application, "environment": job.par.environment, + "testcase": step["comp"], "tctime": getTime()} + job.popInstance() + job = basic.program.Job("unit") + job.par.setParameterArgs(jobargs) + job.setProgram(step["args"][arg]) + print("Job initialisiert "+job.program+" in Verzeichnis "+getattr(job.par, "tcdir")) + job.stopJob(1) + job.popInstance() + basic.program.Job.pushInstance(myjob) + print("ende") + job = myjob + + +if __name__ == '__main__': + print(PROGRAM_NAME) + x = program.Job(PROGRAM_NAME) + #m = message.Message(3) + #m.closeMessage() + x.startJob() + x.m.logInfo("hier eine LogInfo") + x.m.logDebug("hier eine DbugMeldung") + x.m.logDebug(str(vars(x.par)) + "\n" + str(vars(x.conf))) + if x.m.isRc("fatal"): + x.stopJob() + exit(x.m.rc * (-1) + 3) + start(x) + x.stopJob() diff --git a/utils/configs/path.yml b/utils/configs/path.yml index 44d9df5..4c6a9c7 100644 --- a/utils/configs/path.yml +++ b/utils/configs/path.yml @@ -24,7 +24,7 @@ pattern: envlog: "{envbase}/{log}" envparfile: "{envbase}/{parfile}" # testcase - tcbase: "{job.conf.archiv}/{job.par.release}/{job.par.testcase}/{job.par.tctime}" + tcbase: "{job.conf.archiv}/{job.par.testcase}/{job.par.tctime}" tclog: "{tcbase}/{log}" tcresult: "{tcbase}/{result}" tcparfile: "{tcbase}/{parfile}" @@ -34,7 +34,7 @@ pattern: tcprecond: "{tcresult}/{precond}" tcpostcond: "{tcresult}/{postcond}" # testset - tsbase: "{job.conf.archiv}/{job.par.release}/{job.par.usecase}_{job.par.tltime}" + tsbase: "{job.conf.archiv}/{ts}/{job.par.usecase}_{job.par.tstime}" tslog: "{tsbase}/{log}" tsparfile: "{tsbase}/{parfile}" tssum: "{tsbase}/Ergebnis"