def AddSShContract(self,apicip): """ Adds SSH contract between NS and EPG Needed for SNAT Tests """ LOG.info( "\n ADDING SSH-Filter to Svc_epg created for every dhcp_agent") if not PLUGIN_TYPE: if conf.get('apic_passwd'): aci=gbpApic(apicip, password=conf['apic_passwd']) else: aci=gbpApic(apicip) aci.create_add_filter('admin') else: if not CONTAINERIZED_SERVICES: cmd = "python add_ssh_filter.py create" else: cmd = "python /home/add_ssh_filter.py create" if isinstance (run_remote_cli(cmd, CNTRLRIP, CTRLR_USER, CTRLR_PSWD, service='aim'), tuple): LOG.warning("adding filter to SvcEpg failed in AIM") return 0 sleep(15) # TODO: SSH/Ping fails possible its taking time PolicyDownload return 1
def AddSShContract(self, apicip): """ Adds SSH contract between NS and EPG Needed for SNAT Tests """ LOG.info( "\n ADDING SSH-Filter to Svc_epg created for every dhcp_agent") if not PLUGIN_TYPE: if conf.get('apic_passwd'): aci = gbpApic(apicip, password=conf['apic_passwd']) else: aci = gbpApic(apicip) aci.create_add_filter('admin') else: if not CONTAINERIZED_SERVICES: cmd = "python add_ssh_filter.py create" else: cmd = "python /home/add_ssh_filter.py create" if isinstance( run_remote_cli(cmd, CNTRLRIP, CTRLR_USER, CTRLR_PSWD, service='aim'), tuple): LOG.warning("adding filter to SvcEpg failed in AIM") return 0 sleep( 15) # TODO: SSH/Ping fails possible its taking time PolicyDownload return 1
def __init__(self): """ Iniatizing the test-cfg variables & classes """ self.apicsystemID = conf['apic_system_id'] self.nova_agg = conf['nova_agg_name'] self.nova_az = conf['nova_az_name'] self.comp_node = conf['az_comp_node'] self.network_node = conf['network_node'] self.cntlr_ip = conf['controller_ip'] self.cntlr_user = conf.get('controller_user') or 'root' self.cntlr_passwd = conf.get('controller_password') or 'noir0123' self.key_ip = conf.get('keystone_ip') or self.cntlr_ip self.key_user = conf.get('keystone_user') or 'admin' self.key_passwd = conf.get('keystone_password') or 'noir0123' self.apic_ip = conf['apic_ip'] self.leaf1_ip = conf['leaf1_ip'] self.leaf2_ip = conf['leaf2_ip'] self.spine_ip = conf['spine_ip'] self.apic_passwd = conf.get('apic_passwd') self.heat_temp_test = conf['main_setup_heat_temp'] self.num_hosts = conf['num_comp_nodes'] self.heat_stack_name = conf['heat_dp_stack_name'] self.pausetodebug = conf['pausetodebug'] self.test_parameters = conf['test_parameters'] self.plugin = conf['plugin-type'] self.gbpnova = gbpNova(self.cntlr_ip,cntrlr_uname=self.cntlr_user,cntrlr_passwd=self.cntlr_passwd, keystone_user=self.key_user,keystone_password=self.key_passwd) self.gbpheat = gbpHeat(self.cntlr_ip,cntrlr_uname=self.cntlr_user, cntrlr_passwd=self.cntlr_passwd) if self.plugin: #Incase of MergedPlugin if self.apic_passwd: self.gbpaci = gbpApic(self.apic_ip, mode='aim', password=self.apic_passwd) else: self.gbpaci = gbpApic(self.apic_ip, mode='aim') else: self.gbpaci = gbpApic(self.apic_ip, password=self.apic_passwd, apicsystemID=self.apicsystemID) self.vmlist = ['VM1','VM2','VM3','VM4', 'VM5','VM6','VM7','VM8', 'VM9','VM10','VM11','VM12' ] #Below L2Ps needed for APIC Verification self.L2plist = [ 'demo_same_ptg_l2p_l3p_bd', 'demo_diff_ptg_same_l2p_l3p_bd', 'demo_diff_ptg_l2p_same_l3p_bd_1', 'demo_diff_ptg_l2p_same_l3p_bd_2', 'demo_srvr_bd', 'demo_clnt_bd' ]
def __init__(self, objs_uuid): self.gbpcfg = gbpCfgCli(super_hdr.cntlr_ip, cntrlr_username=cntlr_user, cntrlr_passwd=cntlr_passwd, rcfile=rcfile) self.gbpdeftraff = gbpFabTraff() stack_name = super_hdr.stack_name heat_temp = super_hdr.heat_temp self.ntk_node = super_hdr.network_node self.apic_ip = super_hdr.apic_ip self.apic_passwd = super_hdr.apic_passwd self.pausetodebug = super_hdr.pausetodebug self.plugin_mode = super_hdr.plugin self.gbpaci = gbpApic(self.apic_ip, password=self.apic_passwd, apicsystemID=super_hdr.apicsystemID) self.ptg = objs_uuid['demo_same_ptg_l2p_l3p_ptg_id'] self.test_2_prs = objs_uuid['demo_ruleset_norule_id'] self.test_3_prs = objs_uuid['demo_ruleset_icmp_id'] self.test_4_prs = objs_uuid['demo_ruleset_tcp_id'] self.test_5_prs = objs_uuid['demo_ruleset_icmp_tcp_id'] self.test_6_prs = objs_uuid['demo_ruleset_icmp_udp_id'] self.test_7_prs = objs_uuid['demo_ruleset_all_id'] self.vm1_ip = self.gbpcfg.get_vm_subnet('VM1')[0] self.vm1_subn = self.gbpcfg.get_vm_subnet('VM1')[1] #self.dhcp_ns = self.gbpcfg.get_netns(self.ntk_node, self.vm1_subn) self.dhcp_ns = self.gbpcfg.get_netns('VM1')
#SNAT: Prexisting L3Out in Common, Ext-Seg being tenant-specific #will result in tenant-specific NAT-EPG where SNAT EPs will get #learned. Apparently thats will cause inconsistency and we should #not support such config. Discussed with Amit snat_heat_temp = conf['snat_heat_temp'] num_hosts = conf['num_comp_nodes'] heat_stack_name = conf['heat_dp_nat_stack_name'] ips_of_extgw = [conf['extrtr_ip1'], conf['extrtr_ip2'], extgw] routefordest = re.search( '\\b(\d+.\d+.\d+.)\d+' '',conf['extrtr_ip2'], re.I).group(1)+'0/24' pausetodebug = conf['pausetodebug'] neutronconffile = conf['neutronconffile'] gbpnova = gbpNova(cntlr_ip) gbpheat = gbpHeat(cntlr_ip) gbpaci = gbpApic(apic_ip, apicsystemID=apicsystemID) gbpcrud = GBPCrud(cntlr_ip) hostpoolcidrL3OutA = '55.55.55.1/24' hostpoolcidrL3OutB = '66.66.66.1/24' #Instead of defining the below static labels/vars #could have sourced the heat.yaml file and read it #But since this TestConfig defined in yaml file #WILL NOT change hence being lazy as a mule targetvm_list = ['Web-Server', 'Web-Client-1', 'Web-Client-2', 'App-Server'] L3plist = ['DCL3P1','DCL3P2'] #Note: change the order of list will affect the below dict Epglist = ['APPPTG','WEBSRVRPTG','WEBCLNTPTG'] L2plist = ['APPL2P','WEBSRVRL2P','WEBCLNTL2P'] EpgL2p = dict(zip(Epglist,L2plist)) L3Outlist = [priL3Out, secL3Out]
spine_ip = conf['spine_ip'] apic_passwd = conf.get('apic_passwd') heat_temp_test = conf['main_setup_heat_temp'] num_hosts = conf['num_comp_nodes'] heat_stack_name = conf['heat_dp_stack_name'] pausetodebug = conf['pausetodebug'] test_parameters = conf['test_parameters'] plugin = conf['plugin-type'] CONTAINERIZED_SERVICES=conf.get('containerized_services', []) gbpnova = gbpNova(cntlr_ip,cntrlr_uname=cntlr_user,cntrlr_passwd=cntlr_passwd, keystone_user=key_user,keystone_password=key_passwd) gbpheat = gbpHeat(cntlr_ip,cntrlr_uname=cntlr_user, cntrlr_passwd=cntlr_passwd) if plugin: #Incase of MergedPlugin if apic_passwd: gbpaci = gbpApic(apic_ip, mode='aim', password=apic_passwd) else: gbpaci = gbpApic(apic_ip, mode='aim') else: gbpaci = gbpApic(apic_ip, password=apic_passwd, apicsystemID=APICSYSTEM_ID) vmlist = ['VM1','VM2','VM3','VM4', 'VM5','VM6','VM7','VM8', 'VM9','VM10','VM11','VM12' ] #Below L2Ps needed for APIC Verification L2plist = [ 'demo_same_ptg_l2p_l3p_bd', 'demo_diff_ptg_same_l2p_l3p_bd', 'demo_diff_ptg_l2p_same_l3p_bd_1', 'demo_diff_ptg_l2p_same_l3p_bd_2',