def Teardown(tc): api.Logger.info("Tearing down ...") for wl in tc.workloads: sec_ip_api.ConfigWorkloadSecondaryIp(wl, False, tc.iterators.num_exports) wl_sec_ip_info[wl.workload_name].clear() if tc.skip: return api.types.status.SUCCESS return api.types.status.SUCCESS
def Setup(tc): global is_wl_type_bm global wl_sec_ip_info tc.workload_pairs = api.GetRemoteWorkloadPairs() tc.workloads = api.GetWorkloads() for wl in tc.workloads: wl_sec_ip_info[wl.workload_name] = [] # for BM type set untag collector if api.IsBareMetalWorkloadType(wl.node_name): is_wl_type_bm = True sec_ip_list = sec_ip_api.ConfigWorkloadSecondaryIp(wl, True, 2) wl_sec_ip_info[wl.workload_name] = sec_ip_list #for wl in tc.workloads: # for sec_ip in wl_sec_ip_info[wl.workload_name]: # api.Logger.info("Node: {} WL: {} Sec IP: {}".format(wl.node_name, wl.workload_name, sec_ip)) #tc.skip = True return api.types.status.SUCCESS
def Teardown(tc): api.Logger.info("Tearing down ...") for wl in tc.workloads: sec_ip_api.ConfigWorkloadSecondaryIp(wl, False, 2) wl_sec_ip_info[wl.workload_name].clear() return api.types.status.SUCCESS
def RemoveSecondaryAddress(tc): for wl in api.GetWorkloads(): sec_ip_api.ConfigWorkloadSecondaryIp(wl, False, 2) tc.wl_sec_ip_info[wl.workload_name].clear()
def PopulateSecondaryAddress(tc): for wl in api.GetWorkloads(): tc.wl_sec_ip_info[wl.workload_name] = [] sec_ip_list = sec_ip_api.ConfigWorkloadSecondaryIp(wl, True, 2) tc.wl_sec_ip_info[wl.workload_name] = sec_ip_list