aboutsummaryrefslogtreecommitdiffstats
path: root/func
diff options
context:
space:
mode:
authorNauman Ahad <nauman.ahad@xflowresearch.com>2016-06-01 18:44:39 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-06-01 18:44:39 +0000
commit6a75ef2591b93d05c96a9aace7266dcf952fa495 (patch)
tree911167262797ba3bd23b5fba60e57295a2a48424 /func
parent052df6190466f5b9f2722fa1885cf08f6da1e629 (diff)
parent1dd916e557d60a05dcedc0e741ab7cbb94f85c64 (diff)
Merge "Read the proxy info from testcase, and set it to hosts when dhrystone benchmarks test."
Diffstat (limited to 'func')
-rw-r--r--func/cli.py5
-rw-r--r--func/driver.py20
-rw-r--r--func/env_setup.py9
3 files changed, 22 insertions, 12 deletions
diff --git a/func/cli.py b/func/cli.py
index 03a5cc69..76e0e19a 100644
--- a/func/cli.py
+++ b/func/cli.py
@@ -87,7 +87,7 @@ class cli():
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/'
+ [benchmark, roles, vm_info, benchmark_details, pip, proxy_info] = obj.parse('./test_cases/'
+args.lab.lower()+'/'+suite[0]+'/'+benchmarks[items])
if len(vm_info) != 0:
@@ -101,7 +101,8 @@ class cli():
obj.roles_dict.items(),
self._get_fname(benchmarks[items]),
benchmark_details,
- obj.ip_pw_dict.items())
+ obj.ip_pw_dict.items(),
+ proxy_info)
else:
print (benchmarks[items], ' is not a Template in the Directory - \
Enter a Valid file name. or use qtip.py -h for list')
diff --git a/func/driver.py b/func/driver.py
index 94fc1432..48c09c5d 100644
--- a/func/driver.py
+++ b/func/driver.py
@@ -21,20 +21,22 @@ class Driver:
print os.environ['PWD']
self.dic_json = defaultdict()
- def drive_bench(self, benchmark, roles, benchmark_fname, benchmark_detail = None, pip_dict = None):
-
+ def drive_bench(self, benchmark, roles, benchmark_fname, benchmark_detail = None, pip_dict = None, proxy_info = None):
roles= sorted(roles)
pip_dict = sorted(pip_dict)
result_dir = 'results'
benchmark_name = benchmark + '.yaml'
self.dic_json['Dest_dir'] = str(result_dir)
- self.dic_json['ip1']=''
- self.dic_json['ip2']=''
- self.dic_json['installer']=str(os.environ['INSTALLER_TYPE'])
- self.dic_json['workingdir']=str(os.environ['PWD'])
- self.dic_json['fname']=str(benchmark_fname)
- self.dic_json['username']= str('root')
-
+ self.dic_json['ip1'] = ''
+ self.dic_json['ip2'] = ''
+ self.dic_json['installer'] = str(os.environ['INSTALLER_TYPE'])
+ self.dic_json['workingdir'] = str(os.environ['PWD'])
+ self.dic_json['fname'] = str(benchmark_fname)
+ self.dic_json['username'] = str('root')
+
+ for key in proxy_info.keys():
+ self.dic_json[key] = proxy_info[key]
+
if os.environ['INSTALLER_TYPE'] == str('joid'):
self.dic_json['username']=str('ubuntu')
if os.environ['INSTALLER_TYPE'] == str('apex'):
diff --git a/func/env_setup.py b/func/env_setup.py
index 9fd7c106..487d7af3 100644
--- a/func/env_setup.py
+++ b/func/env_setup.py
@@ -31,6 +31,7 @@ class Env_setup():
self.roles_dict.clear()
self.ip_pw_dict.clear()
self.ip_pip_list[:] = []
+ self.proxy_info = {}
self.vm_parameters.clear()
self.benchmark_details.clear()
self.benchmark = ''
@@ -141,6 +142,10 @@ class Env_setup():
self.GetHostMachineinfo(doc['Context']['Host_Machines'])
if doc.get('Scenario',{}).get('benchmark_details',{}):
self.GetBenchmarkDetails(doc.get('Scenario',{}).get('benchmark_details',{}))
+ if 'Proxy_Environment' in doc['Context'].keys():
+ self.proxy_info['http_proxy'] = doc['Context']['Proxy_Environment']['http_proxy']
+ self.proxy_info['https_proxy'] = doc['Context']['Proxy_Environment']['https_proxy']
+ self.proxy_info['no_proxy'] = doc['Context']['Proxy_Environment']['no_proxy']
for k, v in self.roles_ip_list:
self.roles_dict[k].append(v)
for k, v in self.ip_pw_list:
@@ -150,7 +155,9 @@ class Env_setup():
self.roles_dict.items(),
self.vm_parameters,
self.benchmark_details.items(),
- self.ip_pw_dict.items())
+ self.ip_pw_dict.items(),
+ self.proxy_info)
+
except KeyboardInterrupt:
fname.close()
print 'ConfigFile Closed: exiting!'