From 1dd916e557d60a05dcedc0e741ab7cbb94f85c64 Mon Sep 17 00:00:00 2001 From: "zhifeng.jiang" Date: Fri, 20 May 2016 15:56:13 +0800 Subject: Read the proxy info from testcase, and set it to hosts when dhrystone benchmarks test. modification: Write the git_proxy_pbook.yaml to set git proxy info in hosts or vms. Write the sys_proxy_pbook.yaml to set yum apt wget env proxy info in hosts or vms. Change the dhrystone.yaml to include proxy and add the zte-pod1 /compute/dhrystone_bm.yaml.Tested and passed.Other playbooks did not include the proxy yet. I will test and push lately. QTIP-74 Change-Id: Ia820bc32798b9f1f6f4165a111524e04c129a5df Signed-off-by: zhifeng.jiang --- func/env_setup.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'func/env_setup.py') 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!' -- cgit 1.2.3-korg