diff options
author | 2015-12-22 04:17:57 -0800 | |
---|---|---|
committer | 2015-12-22 04:17:57 -0800 | |
commit | 39342467e5e647ae605f40bed04c5a3b3bc50f5e (patch) | |
tree | 9c7b73c5e32a816c83db93bbac6aa3af80e7f9fa /func/cli.py | |
parent | 4b3e9b6cf97296dd591dc2cf95ead96ee60075f5 (diff) |
Restructured QTIP directories and CLI
I have changed the arguments for the CLI and now QTIP
takes a file along withthe name of the lab to run on
Right now only the config files for the dell lab have
been added, These will increase when we make QTIP available
for other labs. I have also added the provision of changing
the public network from the config file and some leftover
files from previous verisons have been remove
Change-Id: Ifeb01d80099eab06dc77a7b2e07097ebb17a13a2
Signed-off-by: Mofassir Arif <Mofassir_arif@dellteam.com>
Diffstat (limited to 'func/cli.py')
-rw-r--r-- | func/cli.py | 75 |
1 files changed, 42 insertions, 33 deletions
diff --git a/func/cli.py b/func/cli.py index 83a7c36f..87b205a0 100644 --- a/func/cli.py +++ b/func/cli.py @@ -16,41 +16,50 @@ import argparse class cli(): - + + def _getfile(self, filepath): + with open('test_list/'+filepath,'r') as finput: + _benchmarks=finput.readlines() + for items in range( len(_benchmarks)): + _benchmarks[items]=_benchmarks[items].rstrip() + return _benchmarks + def _getsuite(self, filepath): + for suites in range (len(filepath)): + xindex= filepath[suites].find('.') + filepath[suites]=filepath[suites][0:xindex] + return filepath def __init__(self): - + suite=[] parser = argparse.ArgumentParser() - - parser.add_argument('-s ', '--suite', help='compute network storage ') - parser.add_argument('-b', '--benchmark', - help='''COMPUTE: - dhrystone_serial.yaml \n - dhrystone_paralle.yaml \n - whetstone_serial.yaml \n - whetstone_parllel.yaml \n - dpi_serial.yaml \n - dpi_paralle.yaml \n - ssl_serial.yaml \n - ssl_parallel.yaml ''') + parser.add_argument('-l ', '--lab', help='Name of Lab on which being tested ') + parser.add_argument('-f', '--file', help = 'File in test_list with the list ' \ + 'of tests') args = parser.parse_args() - if not (args.suite or args.benchmark): - parser.error('Not enough arguments, -h, --help ') - sys.exit(0) - if (args.suite and args.benchmark): - obj = Env_setup() - if os.path.isfile('./test_cases/' + args.suite + - '/' + args.benchmark): + benchmarks = self._getfile(args.file) + suite.append(args.file) + suite=self._getsuite(suite) + for items in range (len(benchmarks)): + if (suite and benchmarks): - [benchmark, roles, vm_info, benchmark_details, pip] = obj.parse('./test_cases/' + args.suite - + '/' + args.benchmark) + roles='' + vm_info='' + benchmark_details='' + pip='' + obj='' + obj = Env_setup() + if os.path.isfile('./test_cases/'+args.lab.lower()+'/'+suite[0]+'/' +benchmarks[items]): + [benchmark, roles, vm_info, benchmark_details, pip] = obj.parse('./test_cases/' + +args.lab.lower()+'/'+suite[0]+'/'+benchmarks[items]) - if len(vm_info) != 0: - vmObj = SpawnVM(vm_info) - obj.callpingtest() - obj.callsshtest() - obj.updateAnsible() - dvr = Driver() - dvr.drive_bench(benchmark, obj.roles_dict.items(), benchmark_details, obj.ip_pw_dict.items()) - else: - print (args.benchmark, ' is not a Template in the Directory - \ - Enter a Valid file name. or use qtip.py -h for list') + if len(vm_info) != 0: + vmObj ='' + vmObj = SpawnVM(vm_info) + obj.callpingtest() + obj.callsshtest() + obj.updateAnsible() + dvr = Driver() + dvr.drive_bench(benchmark, obj.roles_dict.items(), benchmark_details, obj.ip_pw_dict.items()) + else: + print (args.benchmark, ' is not a Template in the Directory - \ + Enter a Valid file name. or use qtip.py -h for list') +
\ No newline at end of file |