Ejemplo n.º 1
0
isMYSQL = serverInfo['InstanceType']
isGlobal = serverInfo['InstanceName']

#mytime = str(time.time())
mytime = time.strftime("_%Y%m%d_%Hh%Mm%Ss",time.localtime())

f = open("result.txt", "a+")

apiObj = DbsUnitTestApi(api.insertPrimaryDataset, f)
apiObj.setVerboseLevel(opts.verbose)
f.write("\n\n***********************insertPrimaryDataset API tests***************************")

primary = 'TestPrimary_001' + mytime

pri1 = DbsPrimaryDataset (Name = primary, Type="test")
apiObj.run(pri1, excep = False)

primary = 'TestPrimary_002' + mytime
pri2 = DbsPrimaryDataset (Name = primary, Type="test")
apiObj.run(pri2, excep = False)

pri = DbsPrimaryDataset ()
apiObj.run(pri, excep = True)

pri = DbsPrimaryDataset (Name = "Test Het", Type="test")
apiObj.run(pri, excep = True)

pri = DbsPrimaryDataset (Name = "Test;Het", Type="test")
apiObj.run(pri, excep = True)

pri = DbsPrimaryDataset (Name = "Test*Het", Type="test")
Ejemplo n.º 2
0
path= pathfile.readline()
pathfile.close()

blockfile = open('blockfile', 'r')
block = blockfile.readline()
blockfile.close()

lfnfile = open('lfnfile', 'r')
lfn = lfnfile.readline()
lfnfile.close()

#path =  apiObj.getExistingPDPath()
#block =  apiObj.getExistingBlock()

f.write("\n\n***********************listPrimaryDatasets API tests***************************")
apiObj.run("*", excep = False)
apiObj.run("*test*", excep = False)
apiObj.run(excep = False)
apiObj.run("", excep = False)
apiObj.run("abc*", excep = False)
apiObj.run("ab;bc", excep = True)
apiObj.run("ab/bc", excep = False)
apiObj.run("//*/ab/bc", excep = False)   ## / and * are allowed in pattern
apiObj.run("abc bc", excep = True)
apiObj.run("","", excep = True)
f.write("\n***********************listPrimaryDatasets API tests***************************")
apiObj = DbsUnitTestApi(api.listAlgorithms,f)
apiObj.setVerboseLevel(opts.verbose)
f.write("\n\n***********************listAlgorithm API tests***************************")
apiObj.run("*","*", excep = False)
apiObj.run(excep = False)
#print "FILENAME: "+filename
f = open(filename, "w")

#################  WRITING TO STDOUT COMMENT THIS LINE (UNCOMMENT ABOVE) TO WRITE TO A FILE ###########
#f=sys.stdout

for i in range(maxDS):
        # Make this cycle unique
        mytime = os.popen('uuidgen').readline().strip()
        mytime += str(i)
        fileList = []
	#Insert Primary
	apiObj = DbsUnitTestApi(api.insertPrimaryDataset, f)
	primary = 'StressTestPrimary' + mytime
	pri1 = DbsPrimaryDataset (Name = primary, Type='MC')
	apiObj.run(pri1, excep = False)

	#Insert Algorithm
	apiObj = DbsUnitTestApi(api.insertAlgorithm,f)
	algo1 = DbsAlgorithm (ExecutableName="StressTestExe01", 
		ApplicationVersion= "StressTestVersion01" + mytime, 
		ApplicationFamily="StressTestAppFamily01", 
		ParameterSetID=DbsQueryableParameterSet(Hash="001234565798685", 
							Name="StressTestParam01", 
							Version="V001", 
							Type="test", 
							Annotation="This is a stress test param", 
							Content="int a= {}, b={c=1, d=33}, f={}, x, y, x"
			                              )
	)
	apiObj.run(algo1, excep = False)
Ejemplo n.º 4
0
path= pathfile.readline()
pathfile.close()

blockfile = open('blockfile', 'r')
block = blockfile.readline()
blockfile.close()

lfnfile = open('lfnfile', 'r')
lfn = lfnfile.readline()
lfnfile.close()

#path =  apiObj.getExistingPDPath()
#block =  apiObj.getExistingBlock()

f.write("\n\n***********************listPrimaryDatasets API tests***************************")
apiObj.run("*", excep = False)
apiObj.run("*test*", excep = False)
apiObj.run(excep = False)
apiObj.run("", excep = False)
apiObj.run("abc*", excep = False)
apiObj.run("ab;bc", excep = True)
apiObj.run("ab/bc", excep = False)
apiObj.run("//*/ab/bc", excep = False)   ## / and * are allowed in pattern
apiObj.run("abc bc", excep = True)
apiObj.run("","", excep = True)
f.write("\n***********************listPrimaryDatasets API tests***************************")
apiObj = DbsUnitTestApi(api.listAlgorithms,f)
apiObj.setVerboseLevel(opts.verbose)
f.write("\n\n***********************listAlgorithm API tests***************************")
apiObj.run("*","*", excep = False)
apiObj.run(excep = False)
Ejemplo n.º 5
0
#print "FILENAME: "+filename
f = open(filename, "w")

#################  WRITING TO STDOUT COMMENT THIS LINE (UNCOMMENT ABOVE) TO WRITE TO A FILE ###########
#f=sys.stdout

for i in range(maxDS):
        # Make this cycle unique
        mytime = os.popen('uuidgen').readline().strip()
        mytime += str(i)
        fileList = []
	#Insert Primary
	apiObj = DbsUnitTestApi(api.insertPrimaryDataset, f)
	primary = 'StressTestPrimary' + mytime
	pri1 = DbsPrimaryDataset (Name = primary)
	apiObj.run(pri1, excep = False)

	#Insert Algorithm
	apiObj = DbsUnitTestApi(api.insertAlgorithm,f)
	algo1 = DbsAlgorithm (ExecutableName="StressTestExe01", 
		ApplicationVersion= "StressTestVersion01" + mytime, 
		ApplicationFamily="StressTestAppFamily01", 
		ParameterSetID=DbsQueryableParameterSet(Hash="001234565798685", 
							Name="StressTestParam01", 
							Version="V001", 
							Type="test", 
							Annotation="This is a stress test param", 
							Content="int a= {}, b={c=1, d=33}, f={}, x, y, x"
			                              )
	)
	apiObj.run(algo1, excep = False)
Ejemplo n.º 6
0
optManager  = DbsOptionParser()
(opts,args) = optManager.getOpt()
api = DbsApi(opts.__dict__)
#mytime = str(time.time())
mytime = time.strftime("_%Y%m%d_%Hh%Mm%Ss",time.localtime())

f = open("result.txt", "a+")

apiObj = DbsUnitTestApi(api.insertPrimaryDataset, f)
apiObj.setVerboseLevel(opts.verbose)
f.write("\n\n***********************insertPrimaryDataset API tests***************************")

primary = 'TestPrimary_001' + mytime

pri1 = DbsPrimaryDataset (Name = primary, Type="TEST")
apiObj.run(pri1, excep = False)

primary = 'TestPrimary_002' + mytime
pri2 = DbsPrimaryDataset (Name = primary, Type="TEST")
apiObj.run(pri2, excep = False)

pri = DbsPrimaryDataset ()
apiObj.run(pri, excep = True)

pri = DbsPrimaryDataset (Name = "Test Het", Type="TEST")
apiObj.run(pri, excep = True)

pri = DbsPrimaryDataset (Name = "Test;Het", Type="TEST")
apiObj.run(pri, excep = True)

pri = DbsPrimaryDataset (Name = "Test*Het", Type="TEST")
Ejemplo n.º 7
0
#print "FILENAME: "+filename
f = open(filename, "w")

#################  WRITING TO STDOUT COMMENT THIS LINE (UNCOMMENT ABOVE) TO WRITE TO A FILE ###########
#f=sys.stdout

for i in range(maxDS):
        # Make this cycle unique
        mytime = os.popen('uuidgen').readline().strip()
        mytime += str(i)
        fileList = []
	#Insert Primary
	apiObj = DbsUnitTestApi(api.insertPrimaryDataset, f)
	primary = 'TestPrimary' + mytime
	pri1 = DbsPrimaryDataset (Name = primary)
	apiObj.run(pri1, excep = False)

	#Insert Algorithm
	apiObj = DbsUnitTestApi(api.insertAlgorithm,f)
	algo1 = DbsAlgorithm (ExecutableName="TestExe01", 
		ApplicationVersion= "TestVersion01" + mytime, 
		ApplicationFamily="AppFamily01", 
		ParameterSetID=DbsQueryableParameterSet(Hash="001234565798685", 
							Name="MyFirstParam01", 
							Version="V001", 
							Type="test", 
							Annotation="This is test", 
							Content="int a= {}, b={c=1, d=33}, f={}, x, y, x"
			                              )
	)
	apiObj.run(algo1, excep = False)
Ejemplo n.º 8
0
#print "FILENAME: "+filename
f = open(filename, "w")

#################  WRITING TO STDOUT COMMENT THIS LINE (UNCOMMENT ABOVE) TO WRITE TO A FILE ###########
#f=sys.stdout

for i in range(maxDS):
        # Make this cycle unique
        mytime = os.popen('uuidgen').readline().strip()+str(random.random())
        mytime += str(i)
        fileList = []
	#Insert Primary
	apiObj = DbsUnitTestApi(api.insertPrimaryDataset, f)
	primary = 'DBSStressTestPrimaryDataset' 
	pri1 = DbsPrimaryDataset (Name = primary, Type="TEST")
	apiObj.run(pri1, excep = False)

	#Insert Algorithm
	apiObj = DbsUnitTestApi(api.insertAlgorithm,f)
	algo1 = DbsAlgorithm (ExecutableName="DBSStressTestExe", 
		ApplicationVersion= "DBSStressTestVersion" + mytime, 
		ApplicationFamily="DBSStressTestAppFam", 
		ParameterSetID=DbsQueryableParameterSet(Hash="001234565798685", 
							Name="DBSStressTestParam", 
							Version="V001", 
							Type="test", 
							Annotation="This is test", 
							Content="int a= {}, b={c=1, d=33}, f={}, x, y, x"
			                              )
	)
	apiObj.run(algo1, excep = False)