7 import sys, subprocess, random, os, shlex, ROOT, shutil
9 def CITest(testname, cutfile, cutfilepath, inputfile, sedreplace):
10 """ Templated test to allow extension """
11 print(
"CI Integration Test :",testname)
15 inputfilename = inputfile
19 rundir =
str(random.randrange(10**8))
26 print(
"CI Integration Test : Using cutfile %s"%(cutfilepath))
27 print(
"CI Integration Test : Using inputfile %s"%(inputfilename))
30 shutil.copyfile(cutfilepath, cutfilename)
33 inputfilepath =
open(
"input.txt",
"w")
34 inputfilepath.write(inputfilename+
"\n")
38 for (old, new)
in sedreplace:
39 cmd =
"sed -i -e 's/"+old+
"/"+new+
"/g' %s"%(cutfilename)
40 proc = subprocess.Popen(shlex.split(cmd))
44 cmd =
"top-xaod %s input.txt"%(cutfilename)
45 proc = subprocess.Popen(shlex.split(cmd))
52 return proc.returncode