How to use continue_ method in Playwright Python

Best Python code snippet using playwright-python

vlan_verify_api.py

Source:vlan_verify_api.py Github

copy

Full Screen

1# system imports2from os import chdir3from time import sleep4from datetime import datetime5import logging6import yaml7import sys8from pyats import aetest9from pyats.log.utils import banner10from genie import testbed11#from pyats.topology import loader12from multiprocessing import Process13log = logging.getLogger(__name__)14log.setLevel(logging.DEBUG)15#importing custom modules16from Config.config import *17from Fetch.fetch import *18from Misc.misc import misc19#Fetching input values from input.yaml20global lis21lis=[]22global lis123lis1=[]24class common_setup(aetest.CommonSetup): 25 @aetest.subsection26 def initial_configs(self,steps, testbed, **param):27 28 ref_pp = self.parent.parameters29 ref_pp['ctrl'] = testbed.devices[param['ctrl_alias']]30 ref_pp['dn'] = testbed.devices[param['dn_alias']]31 ref_pp['server'] = testbed.devices[param['server_alias']]32 ref_pp['client'] = testbed.devices[param['client_alias']]33 ref_pp['client2'] = testbed.devices[param['client2_alias']]34 ref_pp['client3'] = testbed.devices[param['client3_alias']]35 ref_pp['ctrl_ip'] = ref_pp['ctrl'].connections.cli.ip36 ref_pp['link_name'] = ref_pp['ctrl'].custom['link_name']37 ref_pp['pop_name'] = ref_pp['ctrl'].custom['name']38 ref_pp['pop_mac'] = ref_pp['ctrl'].custom['mac']39 ref_pp['pop_iface'] = ref_pp['ctrl'].custom['iface']40 ref_pp['pop_iface'] = ref_pp['ctrl'].custom['iface']41 ref_pp['pop_mcvlan'] = ref_pp['ctrl'].custom['mcvlan']42 ref_pp['pop_msvlan'] = ref_pp['ctrl'].custom['msvlan']43 ref_pp['pop_management_ip']=ref_pp['ctrl'].custom['management_ip']44 ref_pp['path']=ref_pp['ctrl'].custom['location']45 46 ref_pp['dn1_name']=ref_pp['dn'].custom['name']47 ref_pp['dn1_site']=ref_pp['dn'].custom['site']48 ref_pp['dn1_lat'] = ref_pp['dn'].custom['lat']49 ref_pp['dn1_lon'] = ref_pp['dn'].custom['lon']50 ref_pp['dn1_alt'] = ref_pp['dn'].custom['alt']51 ref_pp['dn1_acc'] = ref_pp['dn'].custom['acc']52 ref_pp['dn1_inf'] = ref_pp['dn'].custom['inf']53 ref_pp['dn1_inf1'] = ref_pp['dn'].custom['inf1'] 54 ref_pp['dn1_mac'] = ref_pp['dn'].custom['mac']55 ref_pp['dn1_management_ip']=ref_pp['dn'].custom['management_ip']56 ref_pp['dn1_cvlan'] = ref_pp['dn'].custom['cvlan']57 ref_pp['dn1_svlan'] = ref_pp['dn'].custom['svlan']58 ref_pp['dn1_mcvlan'] = ref_pp['dn'].custom['mcvlan']59 ref_pp['dn1_msvlan'] = ref_pp['dn'].custom['msvlan']60 ref_pp['server_inf']=ref_pp['server'].custom['inf']61 ref_pp['server_data_ipv6']=ref_pp['server'].custom['ipv6']62 ref_pp['server_data_ipv4']=ref_pp['server'].custom['ipv4']63 ref_pp['server_mgmt_ipv4']=ref_pp['server'].custom['mgmt_ipv4']64 ref_pp['server_file']=ref_pp['server'].custom['capture_file']65 ref_pp['client_inf']=ref_pp['client'].custom['inf']66 ref_pp['client_data_ipv4']=ref_pp['client'].custom['ipv4']67 ref_pp['client2_inf']=ref_pp['client2'].custom['inf']68 ref_pp['client2_data_ipv4']=ref_pp['client2'].custom['ipv4']69 ref_pp['client3_inf']=ref_pp['client3'].custom['inf']70 ref_pp['client3_data_ipv4']=ref_pp['client3'].custom['ipv4']71 72 vlan=int(ref_pp['dn1_cvlan'])73 #global lis74 #lis=[]75 for i in range(0,5):76 lis.append(vlan+i)77 78 svlan=int(ref_pp['dn1_svlan'])79 #global lis180 #lis1=[]81 for i in range(0,5):82 lis1.append(svlan+i) 83 84 85 ref_pp['server'].connect()86 ref_pp['client'].connect()87 88 '''@aetest.subsection89 def create_site(self,steps,ctrl,server,client,**param):90 misc.execute_command(server,'sudo ifconfig {} mtu 1492'.format(param['server_inf']))91 misc.execute_command(client,'sudo ifconfig {} mtu 1492'.format(param['client_inf']))92 log.info('Creating Site')93 assert api.add_site(param['ctrl_ip'],param['dn1_site'],param['dn1_lat'],param['dn1_lon'],param['dn1_alt'],param['dn1_acc'])94 log.info('Successful in adding site')95 96 @aetest.subsection97 def Adding_node(self,steps,ctrl,server,client,**param):98 #Adding dn99 log.info('Adding dn1')100 assert api.add_dn(param['ctrl_ip'],param['dn1_name'],param['dn1_site'],param['dn1_mac']) 101 log.info('Successful in adding dn1')102 103 @aetest.subsection104 def Adding_link(self,steps,ctrl,server,client,**param):105 #Adding link POP to dn1 link106 log.info('Adding link from controller')107 assert api.add_link(param['ctrl_ip'],param['pop_name'],param['dn1_name'],param['pop_mac'],param['dn1_mac'],init_radio='radio1',resp_radio='radio1')108 log.info('Successful in Adding link') 109 log.info('Verify link status')'''110 @aetest.subsection111 def configuring_mgmt_ip(self,steps,ctrl,server,client,**param):112 with steps.start('Configuring Management ip on POP',continue_=True) as step:113 assert api.config_management_ip(param['ctrl_ip'],param['pop_name'],param['pop_management_ip'])114 log.info('Successful in configuring Mgmt ip on POP')115 with steps.start('Configuring Management ip on DN',continue_=True) as step:116 assert api.config_management_ip(param['ctrl_ip'],param['dn1_name'],param['dn1_management_ip'])117 log.info('Successful in configuring Mgmt ip on DN1')118 119 @aetest.subsection120 def start_iperf_server(self,steps,ctrl,server,client,**param):121 misc.config_iperf_server(server)122 @aetest.subsection123 def verify_links(self,steps,ctrl,server,client,**param): 124 log.info('Verify link status')125 for i in range(0,5):126 127 sleep(5)128 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])129 logger.info(data)130 if data["is_alive"] == True: 131 logger.info('Link is Up') 132 break133 elif i == 4:134 if data["is_alive"] == True:135 logger.info('Link is Up')136 else:137 assert False138 139 140 log.info('Successful in bringing up')141 142 @aetest.subsection143 def configure_l2_bridge(self,steps,ctrl,server,client,**param):144 #configuring l2bridge145 log.info('configuring l2bridge')146 147 assert api.config_l2_bridge(param['ctrl_ip'],status='true')148 log.info('Successful in configuring l2bridge')149 150 #sleep(150)151 152 @aetest.subsection153 def verify_links(self,steps,ctrl,server,client,**param):154 log.info('Verify link status')155 for i in range(0,5):156 157 sleep(5)158 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])159 logger.info(data)160 if data["is_alive"] == True: 161 logger.info('Link is Up') 162 break163 elif i == 4:164 if data["is_alive"] == True:165 logger.info('Link is Up')166 else:167 assert False168 log.info('Successful in bringing up') 169 170 171 172class Q_Vlan(aetest.Testcase):173 def Capturing_Server_interface(self,server,server_inf,server_file):174 assert misc.capture_interface(server,server_inf,server_file)175 176 def Verify_traffic(self,client,server_data_ipv4):177 log.info('Starting iperf client')178 up,down=misc.config_iperf_client(client,server_data_ipv4)179 assert ((up != 0.0) and (down != 0.0))180 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))181 182 @aetest.setup183 def Setup(self, steps,ctrl,server,client,**param):184 with steps.start('Verifying links',continue_=True) as step: 185 log.info('Verify link status')186 for i in range(0,5):187 188 sleep(5)189 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])190 logger.info(data)191 if data["is_alive"] == True: 192 logger.info('Link is Up') 193 break194 elif i == 4:195 if data["is_alive"] == True:196 logger.info('Link is Up')197 else:198 assert False199 200 with steps.start('Configure Q VLAN in dn',continue_=True) as step:201 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 202 log.info('sucessful in Enabling Single VLAN on dn')203 204 sleep(60)205 with steps.start('Verifying links',continue_=True) as step: 206 log.info('Verify link status')207 for i in range(0,5):208 209 sleep(5)210 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])211 logger.info(data)212 if data["is_alive"] == True: 213 logger.info('Link is Up') 214 break215 elif i == 4:216 if data["is_alive"] == True:217 logger.info('Link is Up')218 else:219 assert False220 221 with steps.start('Configure Q VLAN in Server',continue_=True) as step:222 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])223 log.info('Successful in configuring vlan in Server')224 225 #Configure IP on client PC226 with steps.start('Configure IP in client',continue_=True) as step: 227 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])228 log.info('Successful in configuring IP in Client')229 230 231 232 with steps.start('Capturing and verifying traffic',continue_=True) as step:233 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))234 p1.start()235 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))236 p2.start()237 p1.join()238 p2.join()239 with steps.start('Analyse Capture',continue_=True) as step:240 ip = param['client_data_ipv4'].rsplit('/', 1)[0]241 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])242 res=misc.analyse_capture(server,filter,param['server_file'])243 if res > 0:244 log.info('Successful in VLAN tagging')245 else:246 assert False247 @aetest.cleanup248 def Disabling_Q_VLAN(self,steps,ctrl,server,client,**param):249 250 log.info('Disabling Single VLAN in dn')251 with steps.start('Configure Q VLAN in Server',continue_=True) as step:252 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')253 log.info('Successful in configuring vlan in Server')254 with steps.start('Removing vlan configs from server',continue_=True) as step:255 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 256 log.info('sucessful in Enabling Single VLAN on dn')257 with steps.start('Configure IP in client',continue_=True) as step:258 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')259 log.info('Successful in configuring IP in Client')260 sleep(60)261 with steps.start('Verifying links',continue_=True) as step: 262 log.info('Verify link status')263 for i in range(0,5):264 265 sleep(5)266 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])267 logger.info(data)268 if data["is_alive"] == True: 269 logger.info('Link is Up') 270 break271 elif i == 4:272 if data["is_alive"] == True:273 logger.info('Link is Up')274 else:275 assert False276 277@aetest.loop(etype = ['0x8100', '0x88A8'])278class QinQ_Vlan(aetest.Testcase):279 def Capturing_Server_interface(self,server,server_inf,server_file):280 assert misc.capture_interface(server,server_inf,server_file)281 def Verify_traffic(self,client,server_data_ipv4):282 log.info('Starting iperf client')283 up,down=misc.config_iperf_client(client,server_data_ipv4)284 assert ((up != 0.0) and (down != 0.0))285 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))286 287 @aetest.setup288 def Configure_QinQ_Vlan(self, etype, steps,ctrl,server,client,**param):289 with steps.start('Verifying links',continue_=True) as step: 290 log.info('Verify link status')291 for i in range(0,5):292 293 sleep(5)294 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])295 logger.info(data)296 if data["is_alive"] == True: 297 logger.info('Link is Up') 298 break299 elif i == 4:300 if data["is_alive"] == True:301 logger.info('Link is Up')302 else:303 assert False304 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:305 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 306 log.info('sucessful in Enabling Double VLAN on dn')307 sleep(60)308 with steps.start('Verifying links',continue_=True) as step: 309 log.info('Verify link status')310 for i in range(0,5):311 312 sleep(5)313 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])314 logger.info(data)315 if data["is_alive"] == True: 316 logger.info('Link is Up') 317 break318 elif i == 4:319 if data["is_alive"] == True:320 logger.info('Link is Up')321 else:322 assert False323 324 325 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:326 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)327 log.info('Successful in configuring vlan in Server')328 329 #Configure IP on client PC330 with steps.start('Configure IP in client',continue_=True) as step: 331 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])332 log.info('Successful in configuring IP in Client')333 334 335 with steps.start('Capturing and verifying traffic',continue_=True) as step:336 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))337 p1.start()338 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))339 p2.start()340 p1.join()341 p2.join()342 with steps.start('Analyse Capture',continue_=True) as step:343 if etype =='0x8100':344 ip = param['client_data_ipv4'].rsplit('/', 1)[0]345 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])346 else:347 ip = param['client_data_ipv4'].rsplit('/', 1)[0]348 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])349 res=misc.analyse_capture(server,filter,param['server_file'])350 if res > 0:351 log.info('Successful in QinQ VLAN tagging')352 else:353 assert False354 355 356 357 @aetest.cleanup358 def Disabling_QinQ_VLAN(self,etype,steps,ctrl,server,client,**param):359 360 log.info('Disabling Double VLAN in dn')361 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:362 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')363 log.info('Successful in Removing vlan in Server')364 with steps.start('Removing vlan configs from DN',continue_=True) as step:365 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,status='disable') 366 log.info('sucessful in Removing QinQ VLAN on dn')367 368 sleep(60)369 with steps.start('Verifying links',continue_=True) as step: 370 log.info('Verify link status')371 for i in range(0,5):372 373 sleep(5)374 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])375 logger.info(data)376 if data["is_alive"] == True: 377 logger.info('Link is Up') 378 break379 elif i == 4:380 if data["is_alive"] == True:381 logger.info('Link is Up')382 else:383 assert False384 with steps.start('Configure IP in client',continue_=True) as step:385 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')386 log.info('Successful in configuring IP in Client')387class Allowed_Q_Vlan(aetest.Testcase):388 389 @aetest.setup390 def Configure_Q_Vlan_allowed_list(self, steps,ctrl,server,client,**param):391 vlans='{},{}-{}'.format(lis[0],lis[1],lis[3])392 with steps.start('Verifying links',continue_=True) as step: 393 log.info('Verify link status')394 for i in range(0,5):395 396 sleep(5)397 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])398 logger.info(data)399 if data["is_alive"] == True: 400 logger.info('Link is Up') 401 break402 elif i == 4:403 if data["is_alive"] == True:404 logger.info('Link is Up')405 else:406 assert False407 408 with steps.start('Configure Q VLAN in dn',continue_=True) as step:409 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=str(int(param['dn1_cvlan'])-1),status='enable') 410 log.info('sucessful in Enabling Single VLAN on dn')411 412 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:413 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='enable') 414 log.info('sucessful in configuring allowed q VLAN on dn')415 sleep(60)416 with steps.start('Verifying links',continue_=True) as step: 417 log.info('Verify link status')418 for i in range(0,5):419 420 sleep(5)421 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])422 logger.info(data)423 if data["is_alive"] == True: 424 logger.info('Link is Up') 425 break426 elif i == 4:427 if data["is_alive"] == True:428 logger.info('Link is Up')429 else:430 assert False431 432 433 def test_untagged_packets(self,steps,ctrl,server,client,**param):434 with steps.start('Configure Q VLAN in Server',continue_=True) as step:435 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'])436 log.info('Successful in configuring vlan in Server')437 with steps.start('Configure IP in client',continue_=True) as step:438 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])439 log.info('Successful in configuring IP in Client')440 log.info('Starting iperf client')441 #sleep(20)442 with steps.start('Verifying Traffic',continue_=True) as step:443 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])444 assert ((up != 0.0) and (down != 0.0))445 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))446 with steps.start('Removing Q VLAN in Server',continue_=True) as step:447 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'],status='disable')448 log.info('Removing Q vlan in Server')449 with steps.start('Removing IP in client',continue_=True) as step:450 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')451 log.info('Successful in Removing IP in Client')452 @ aetest.test.loop(c_vlan=lis)453 def test_single_tagged_packets(self,c_vlan,steps,ctrl,server,client,**param):454 455 with steps.start('Configure Q VLAN in Server',continue_=True) as step:456 assert misc.config_Q(server,param['server_inf'],c_vlan,param['server_data_ipv4'])457 log.info('Successful in configuring vlan in Server')458 459 with steps.start('Configure Q VLAN in client',continue_=True) as step:460 assert misc.config_Q(client,param['client_inf'],c_vlan,param['client_data_ipv4'])461 log.info('Successful in configuring vlan in client')462 463 log.info('Starting iperf client')464 sleep(20) 465 with steps.start('Verifying Traffic',continue_=True) as step:466 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])467 result=((up != 0.0) and (down != 0.0))468 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))469 if c_vlan==int(param['dn1_cvlan'])+4:470 if result == False:471 log.info('No traffic due to unallowed vlan')472 else:473 assert False474 else:475 assert result476 477 with steps.start('Removing Q VLAN in Server',continue_=True) as step:478 assert misc.config_Q(server,param['server_inf'],c_vlan,param['server_data_ipv4'],status='disable')479 log.info('Removing Q vlan in Server')480 481 with steps.start('Removing Q VLAN in client',continue_=True) as step:482 assert misc.config_Q(client,param['client_inf'],c_vlan,param['client_data_ipv4'],status='disable')483 log.info('Removing Q vlan in client')484 485 486 487 488 489 490 @aetest.cleanup491 def VLAN_config_cleanup(self,steps,ctrl,server,client,**param):492 vlans='{},{}-{}'.format(lis[0],lis[1],lis[3])493 494 with steps.start('Remove Q VLAN in dn',continue_=True) as step:495 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id='1',status='disable') 496 log.info('sucessful in Removing Single VLAN on dn')497 498 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:499 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='disable') 500 log.info('sucessful in Removing allowed q VLAN on dn')501 sleep(60)502 with steps.start('Verifying links',continue_=True) as step: 503 log.info('Verify link status')504 for i in range(0,5):505 506 sleep(5)507 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])508 logger.info(data)509 if data["is_alive"] == True: 510 logger.info('Link is Up') 511 break512 elif i == 4:513 if data["is_alive"] == True:514 logger.info('Link is Up')515 else:516 assert False517class Q_Vlan_Remarking(aetest.Testcase):518 519 @aetest.setup520 def Configure_Q_Vlan_allowed_list(self, steps,ctrl,server,client,**param):521 remark=int(param['dn1_cvlan'])+1522 with steps.start('Verifying links',continue_=True) as step: 523 log.info('Verify link status')524 for i in range(0,5):525 526 sleep(5)527 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])528 logger.info(data)529 if data["is_alive"] == True: 530 logger.info('Link is Up') 531 break532 elif i == 4:533 if data["is_alive"] == True:534 logger.info('Link is Up')535 else:536 assert False537 538 with steps.start('Configure Q VLAN in dn',continue_=True) as step:539 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=str(int(param['dn1_cvlan'])-1),status='enable') 540 log.info('sucessful in Enabling Single VLAN on dn')541 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:542 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='enable') 543 log.info('sucessful in configuring allowed q VLAN on dn')544 545 with steps.start('Configuring Remark VLAN',continue_=True) as step:546 assert api.config_vlan_remarking(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],param['dn1_cvlan'],remark)547 log.info('sucessful in Configuring Single VLAN Remarking on dn')548 sleep(60)549 with steps.start('Verifying links',continue_=True) as step: 550 log.info('Verify link status')551 for i in range(0,5):552 553 sleep(5)554 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])555 logger.info(data)556 if data["is_alive"] == True: 557 logger.info('Link is Up') 558 break559 elif i == 4:560 if data["is_alive"] == True:561 logger.info('Link is Up')562 else:563 assert False564 @ aetest.test565 def test_untagged_packets(self,steps,ctrl,server,client,**param):566 with steps.start('Configure Q VLAN in Server',continue_=True) as step:567 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'])568 log.info('Successful in configuring vlan in Server')569 with steps.start('Configure IP in client',continue_=True) as step:570 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])571 log.info('Successful in configuring IP in Client') 572 with steps.start('Starting client iperf',continue_=True) as step:573 sleep(20) 574 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])575 assert ((up != 0) and (down != 0))576 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))577 578 579 with steps.start('Removing Q VLAN in Server',continue_=True) as step:580 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'],status='disable')581 log.info('Removing Q vlan in Server')582 with steps.start('Removing IP in client',continue_=True) as step:583 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')584 log.info('Successful in Removing IP in Client')585 @ aetest.test586 def test_single_tagged_packets(self,steps,ctrl,server,client,**param):587 remark=int(param['dn1_cvlan'])+1588 with steps.start('Configure Q VLAN in Server',continue_=True) as step:589 assert misc.config_Q(server,param['server_inf'],remark,param['server_data_ipv4'])590 log.info('Successful in configuring vlan in Server')591 with steps.start('Configure Q VLAN in client',continue_=True) as step:592 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'])593 log.info('Successful in configuring vlan in client')594 with steps.start('Starting client iperf',continue_=True) as step:595 sleep(20) 596 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])597 assert ((up != 0) and (down != 0))598 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))599 with steps.start('Removing Q VLAN in Server',continue_=True) as step:600 assert misc.config_Q(server,param['server_inf'],remark,param['server_data_ipv4'],status='disable')601 log.info('Removing Q vlan in Server')602 with steps.start('Removing Q VLAN in client',continue_=True) as step:603 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'],status='disable')604 log.info('Removing Q vlan in client') 605 @aetest.cleanup606 def Removing_configs_from_node_and_PCs(self,steps,ctrl,server,client,**param):607 remark=int(param['dn1_cvlan'])+1608 with steps.start('Removing Q VLAN in dn',continue_=True) as step:609 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id='1',status='disable') 610 log.info('sucessful in Removing Single VLAN on dn')611 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:612 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='disable') 613 log.info('sucessful in Removing allowed q VLAN on dn')614 615 with steps.start('Removing Remark VLAN',continue_=True) as step:616 assert api.config_vlan_remarking(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],param['dn1_cvlan'],remark,status='disable')617 log.info('sucessful in Removing Single VLAN Remarking on dn')618 sleep(60)619 with steps.start('Verifying links',continue_=True) as step: 620 log.info('Verify link status')621 for i in range(0,5):622 623 sleep(5)624 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])625 logger.info(data)626 if data["is_alive"] == True: 627 logger.info('Link is Up') 628 break629 elif i == 4:630 if data["is_alive"] == True:631 logger.info('Link is Up')632 else:633 assert False634class Q_Vlan_Drop_Untag(aetest.Testcase):635 636 @aetest.setup637 def Configure_Q_Vlan(self, steps,ctrl,server,client,**param):638 with steps.start('Verifying links',continue_=True) as step: 639 log.info('Verify link status')640 for i in range(0,5):641 642 sleep(5)643 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])644 logger.info(data)645 if data["is_alive"] == True: 646 logger.info('Link is Up') 647 break648 elif i == 4:649 if data["is_alive"] == True:650 logger.info('Link is Up')651 else:652 assert False653 with steps.start('Configure Q VLAN in dn',continue_=True) as step:654 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=str(int(param['dn1_cvlan'])-1),status='enable') 655 log.info('sucessful in Enabling Single VLAN on dn')656 657 with steps.start('Configure drop untag packets in Q VLAN',continue_=True) as step:658 assert api.config_vlan_drop_untag(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],status='enable') 659 log.info('sucessful in configuring Drop untag VLAN')660 661 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:662 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='enable') 663 log.info('sucessful in configuring allowed q VLAN on dn') 664 sleep(60)665 with steps.start('Verifying links',continue_=True) as step: 666 log.info('Verify link status')667 for i in range(0,5):668 669 sleep(5)670 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])671 logger.info(data)672 if data["is_alive"] == True: 673 logger.info('Link is Up') 674 break675 elif i == 4:676 if data["is_alive"] == True:677 logger.info('Link is Up')678 else:679 assert False680 @ aetest.test681 def test_untagged_packets(self,steps,ctrl,server,client,**param):682 with steps.start('Configure Q VLAN in Server',continue_=True) as step:683 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'])684 log.info('Successful in configuring vlan in Server')685 686 #Configure IP on client PC687 with steps.start('Configure IP in client',continue_=True) as step: 688 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])689 log.info('Successful in configuring IP in Client')690 691 692 with steps.start('Starting iperf in client',continue_=True) as step:693 sleep(20) 694 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])695 result=((up != 0.0) and (down != 0.0))696 if result == False:697 log.info('Traffic Failed due to drop untag')698 else:699 log.info('Failed to drop untagged packets')700 assert False701 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 702 703 704 with steps.start('Configure Q VLAN in Server',continue_=True) as step:705 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'],status='disable')706 log.info('Successful in configuring vlan in Server')707 with steps.start('Removing IP in client',continue_=True) as step:708 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')709 log.info('Successful in Removing IP in Client')710 711 @ aetest.test712 def test_single_tagged_packets(self,steps,ctrl,server,client,**param):713 with steps.start('Configure Q VLAN in Server',continue_=True) as step:714 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])715 log.info('Successful in configuring vlan in Server')716 717 with steps.start('Configure Q VLAN in client',continue_=True) as step:718 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'])719 log.info('Successful in configuring vlan in client')720 721 with steps.start('Starting iperf in client',continue_=True) as step:722 sleep(20) 723 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])724 assert ((up != 0.0) and (down != 0.0))725 log.info('througput numbers up={} down={}'.format(up,down)) 726 with steps.start('Removing Q VLAN in Server',continue_=True) as step:727 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')728 log.info('Successful in Removing vlan in Server')729 730 with steps.start('Removing Q VLAN in client',continue_=True) as step:731 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'],status='disable')732 log.info('Removing Q vlan in client')733 @aetest.cleanup734 def Disabling_Q_VLAN_configs(self,steps,ctrl,server,client,**param):735 736 log.info('Disabling Single VLAN in dn')737 with steps.start('Removing drop untag packets in Q VLAN',continue_=True) as step:738 assert api.config_vlan_drop_untag(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],status='disable') 739 log.info('sucessful in Removing Drop untag VLAN')740 with steps.start('Removing vlan configs from dn',continue_=True) as step:741 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 742 log.info('sucessful in Enabling Single VLAN on dn')743 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:744 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='disable') 745 log.info('sucessful in Removing allowed q VLAN on dn')746 sleep(60)747 with steps.start('Verifying links',continue_=True) as step: 748 log.info('Verify link status')749 for i in range(0,5):750 751 sleep(5)752 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])753 logger.info(data)754 if data["is_alive"] == True: 755 logger.info('Link is Up') 756 break757 elif i == 4:758 if data["is_alive"] == True:759 logger.info('Link is Up')760 else:761 assert False762 763class Q_Vlan_Priority_Remarking(aetest.Testcase):764 765 def Capturing_Server_interface(self,server,server_inf,server_file):766 assert misc.capture_interface(server,server_inf,server_file)767 def Verify_traffic(self,client,server_data_ipv4):768 log.info('Starting iperf client')769 up,down=misc.config_iperf_client(client,server_data_ipv4)770 assert ((up != 0.0) and (down != 0.0))771 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))772 773 @aetest.setup774 def Configure_Q_Vlan(self, steps,ctrl,server,client,**param):775 776 with steps.start('Verifying links',continue_=True) as step: 777 log.info('Verify link status')778 for i in range(0,5):779 780 sleep(5)781 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])782 logger.info(data)783 if data["is_alive"] == True: 784 logger.info('Link is Up') 785 break786 elif i == 4:787 if data["is_alive"] == True:788 logger.info('Link is Up')789 else:790 assert False791 792 with steps.start('Configure Q VLAN in dn',continue_=True) as step:793 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=str(int(param['dn1_cvlan'])-1),status='enable') 794 log.info('sucessful in Enabling Single VLAN on dn')795 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:796 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='enable') 797 log.info('sucessful in configuring allowed q VLAN on dn')798 799 with steps.start('Configuring Remark VLAN priority',continue_=True) as step:800 assert api.config_vlan_prio_remarking(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],param['dn1_cvlan'],'7')801 log.info('sucessful in Configuring Single VLAN priority Remarking on dn')802 sleep(60)803 with steps.start('Verifying links',continue_=True) as step: 804 log.info('Verify link status')805 for i in range(0,5):806 807 sleep(5)808 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])809 logger.info(data)810 if data["is_alive"] == True: 811 logger.info('Link is Up') 812 break813 elif i == 4:814 if data["is_alive"] == True:815 logger.info('Link is Up')816 else:817 assert False818 @ aetest.test819 def test_untagged_packets(self,steps,ctrl,server,client,**param):820 with steps.start('Configure Q VLAN in Server',continue_=True) as step:821 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'])822 log.info('Successful in configuring vlan in Server')823 824 with steps.start('Configure IP in client',continue_=True) as step:825 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])826 log.info('Successful in configuring IP in Client')827 with steps.start('Capturing and verifying traffic',continue_=True) as step:828 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))829 p1.start()830 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))831 p2.start()832 p1.join()833 p2.join()834 835 with steps.start('Analyse Capture',continue_=True) as step:836 ip = param['client_data_ipv4'].rsplit('/', 1)[0]837 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==0'.format(ip,str(int(param['dn1_cvlan'])-1)) 838 res=misc.analyse_capture(server,filter,param['server_file'])839 if res > 0:840 log.info('Successful in priority remarking')841 else:842 assert False843 844 with steps.start('Removing Q VLAN in Server',continue_=True) as step:845 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'],status='disable')846 log.info('Removing Q vlan in Server')847 with steps.start('Removing IP in client',continue_=True) as step:848 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')849 log.info('Successful in Removing IP in Client') 850 851 @ aetest.test852 def test_single_tagged_packets(self,steps,ctrl,server,client,**param):853 854 with steps.start('Configure Q VLAN in Server',continue_=True) as step:855 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])856 log.info('Successful in configuring vlan in Server')857 with steps.start('Configure Q VLAN in client',continue_=True) as step:858 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'])859 log.info('Successful in configuring vlan in client')860 sleep(20)861 862 with steps.start('Capturing and verifying traffic',continue_=True) as step:863 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))864 p1.start()865 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))866 p2.start()867 p1.join()868 p2.join()869 with steps.start('Analyse Capture',continue_=True) as step:870 ip = param['client_data_ipv4'].rsplit('/', 1)[0]871 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])872 res=misc.analyse_capture(server,filter,param['server_file'])873 if res > 0:874 log.info('Successful in priority remarking')875 else:876 assert False877 with steps.start('Removing Q VLAN in Server',continue_=True) as step:878 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')879 log.info('Removing Q vlan in Server')880 881 with steps.start('Removing Q VLAN in client',continue_=True) as step:882 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'],status='disable')883 log.info('Removing Q vlan in client')884 @aetest.cleanup885 def Removing_configs_from_node_and_PCs(self,steps,ctrl,server,client,**param):886 with steps.start('Removing Q VLAN in dn',continue_=True) as step:887 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id='1',status='disable') 888 log.info('sucessful in Removing Single VLAN on dn')889 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:890 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='enable') 891 log.info('sucessful in Removing allowed q VLAN on dn')892 893 with steps.start('Removing Remark VLAN prio',continue_=True) as step:894 assert api.config_vlan_prio_remarking(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],param['dn1_cvlan'],'7',status='disable')895 log.info('sucessful in Removing Single VLAN priority Remarking on dn')896 sleep(60)897 with steps.start('Verifying links',continue_=True) as step: 898 log.info('Verify link status')899 for i in range(0,5):900 901 sleep(5)902 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])903 logger.info(data)904 if data["is_alive"] == True: 905 logger.info('Link is Up') 906 break907 elif i == 4:908 if data["is_alive"] == True:909 logger.info('Link is Up')910 else:911 assert False912@aetest.loop(etype = ['0x8100', '0x88A8'])913class Q_port_Behaviour_When_QinQ_Ingress(aetest.Testcase):914 @aetest.setup915 def Configure_Q_Vlan(self, steps,ctrl,server,client,etype,**param):916 with steps.start('Verifying links',continue_=True) as step: 917 log.info('Verify link status')918 for i in range(0,5):919 920 sleep(5)921 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])922 logger.info(data)923 if data["is_alive"] == True: 924 logger.info('Link is Up') 925 break926 elif i == 4:927 if data["is_alive"] == True:928 logger.info('Link is Up')929 else:930 assert False931 with steps.start('Configure Q VLAN in dn',continue_=True) as step:932 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id='1',status='enable')933 log.info('sucessful in Enabling Single VLAN on dn')934 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:935 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')936 log.info('sucessful in configuring allowed q VLAN on dn')937 sleep(60)938 with steps.start('Verifying links',continue_=True) as step: 939 log.info('Verify link status')940 for i in range(0,5):941 942 sleep(5)943 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])944 logger.info(data)945 if data["is_alive"] == True: 946 logger.info('Link is Up') 947 break948 elif i == 4:949 if data["is_alive"] == True:950 logger.info('Link is Up')951 else:952 assert False953 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:954 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)955 log.info('Successful in configuring vlan in Server')956 with steps.start('Configure QinQ VLAN in client',continue_=True) as step:957 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)958 log.info('Successful in configuring vlan in Server')959 @ aetest.test960 def Verify_traffic(self,steps,ctrl,server,client,**param):961 log.info('Starting iperf client')962 sleep(20)963 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])964 result=((up != 0.0) and (down != 0.0))965 if result == False:966 log.info('Traffic dropped due to double tagged packets')967 else:968 log.info('Failed to drop double tagged packets')969 assert False970 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))971 @aetest.cleanup972 def Removing_Vlan_configs(self, steps,ctrl,server,client,etype,**param):973 with steps.start('Removing Q VLAN in dn',continue_=True) as step:974 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id='1',status='disable')975 log.info('sucessful in Removing Single VLAN on dn')976 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:977 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')978 log.info('sucessful in Removing allowed q VLAN on dn')979 sleep(60)980 with steps.start('Verifying links',continue_=True) as step: 981 log.info('Verify link status')982 for i in range(0,5):983 984 sleep(5)985 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])986 logger.info(data)987 if data["is_alive"] == True: 988 logger.info('Link is Up') 989 break990 elif i == 4:991 if data["is_alive"] == True:992 logger.info('Link is Up')993 else:994 assert False995 with steps.start('Remonving QinQ VLAN in Server',continue_=True) as step:996 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')997 log.info('Successful in Removing vlan in Server')998 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:999 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1000 log.info('Successful in Removing vlan in Server')1001@aetest.loop(etype = ['0x8100', '0x88A8'])1002class Allowed_QinQ_Vlan(aetest.Testcase):1003 @aetest.setup1004 def Configure_QinQ_Vlan_allowed_list(self, steps,ctrl,server,client,etype,**param):1005 vlans='{},{}-{}'.format(lis1[0],lis1[1],lis1[3])1006 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1007 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1008 log.info('sucessful in Enabling Single VLAN on dn')1009 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1010 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='enable')1011 log.info('sucessful in configuring allowed QinQ VLAN on dn')1012 sleep(60)1013 with steps.start('Verifying links',continue_=True) as step: 1014 log.info('Verify link status')1015 for i in range(0,5):1016 1017 sleep(5)1018 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1019 logger.info(data)1020 if data["is_alive"] == True: 1021 logger.info('Link is Up') 1022 break1023 elif i == 4:1024 if data["is_alive"] == True:1025 logger.info('Link is Up')1026 else:1027 assert False1028 @ aetest.test1029 def test_untagged_packets(self,steps,ctrl,server,client,etype,**parm):1030 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1031 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1032 log.info('Successful in configuring vlan in Server')1033 with steps.start('Configure IP in client',continue_=True) as step:1034 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1035 log.info('Successful in configuring IP in Client')1036 with steps.start('Starting iperf in client',continue_=True) as step:1037 sleep(20)1038 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1039 assert ((up != 0.0) and (down != 0.0))1040 with steps.start('Removing Q VLAN in Server',continue_=True) as step:1041 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1042 log.info('Successful in Removing vlan in Server')1043 with steps.start('Removing IP in client',continue_=True) as step:1044 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1045 log.info('Successful in Removing IP in Client') 1046 @ aetest.test.loop(s_vlan=lis1)1047 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,s_vlan,**param):1048 1049 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1050 assert misc.config_QinQ(server,param['server_inf'],s_vlan,str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1051 log.info('Successful in configuring vlan in Server')1052 with steps.start('Configure Q VLAN in client',continue_=True) as step:1053 assert misc.config_Q(client,param['client_inf'],s_vlan,param['client_data_ipv4'])1054 log.info('Successful in configuring vlan in client')1055 with steps.start('Verifying Traffic',continue_=True) as step:1056 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1057 result=((up != 0.0) and (down != 0.0))1058 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1059 if s_vlan==int(param['dn1_svlan'])+4:1060 if result == False:1061 log.info('No traffic due to unallowed vlan')1062 else:1063 assert False1064 else:1065 assert result1066 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1067 assert misc.config_QinQ(server,param['server_inf'],s_vlan,str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1068 log.info('Successful in Removing vlan in Server')1069 with steps.start('Removing Q VLAN in client',continue_=True) as step:1070 assert misc.config_Q(client,param['client_inf'],s_vlan,param['client_data_ipv4'],status='disable')1071 log.info('Removing Q vlan in client')1072 @ aetest.test.loop(s_vlan=lis1)1073 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,s_vlan,**param):1074 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1075 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],s_vlan,param['server_data_ipv4'],ethertype=etype)1076 log.info('Successful in configuring QinQ vlan in Server')1077 with steps.start('Configure Q VLAN in client',continue_=True) as step:1078 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],s_vlan,param['client_data_ipv4'],ethertype=etype)1079 log.info('Successful in configuring QinQ vlan in client')1080 log.info('Starting iperf client')1081 sleep(20)1082 with steps.start('Verifying Traffic',continue_=True) as step:1083 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1084 result=((up != 0.0) and (down != 0.0))1085 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1086 if s_vlan==int(param['dn1_svlan'])+4:1087 if result == False:1088 log.info('No traffic due to unallowed vlan')1089 else:1090 assert False1091 else:1092 assert result1093 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1094 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],s_vlan,param['server_data_ipv4'],status='disable')1095 log.info('Removing QinQ vlan in Server')1096 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1097 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],s_vlan,param['client_data_ipv4'],status='disable')1098 log.info('Removing QiNQ vlan in client')1099 @aetest.cleanup1100 def VLAN_config_cleanup(self,steps,ctrl,server,client,etype,**param):1101 vlans='{},{}-{}'.format(lis1[0],lis1[1],lis1[3])1102 with steps.start('Remove QinQ VLAN in dn',continue_=True) as step:1103 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],svlan='1',cvlan='1',ethertype=etype,status='disable')1104 log.info('sucessful in Removing Double VLAN on dn')1105 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1106 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='disable')1107 log.info('sucessful in Removing allowed QinQ VLAN on dn')1108 sleep(60)1109 with steps.start('Verifying links',continue_=True) as step: 1110 log.info('Verify link status')1111 for i in range(0,5):1112 1113 sleep(5)1114 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1115 logger.info(data)1116 if data["is_alive"] == True: 1117 logger.info('Link is Up') 1118 break1119 elif i == 4:1120 if data["is_alive"] == True:1121 logger.info('Link is Up')1122 else:1123 assert False1124@aetest.loop(etype = ['0x8100', '0x88A8'])1125class Allowed_QinQ_Vlan(aetest.Testcase):1126 @aetest.setup1127 def Configure_QinQ_Vlan_allowed_list(self, steps,ctrl,server,client,etype,**param):1128 vlans='{},{}-{}'.format(lis1[0],lis1[1],lis1[3])1129 with steps.start('Verifying links',continue_=True) as step: 1130 log.info('Verify link status')1131 for i in range(0,5):1132 1133 sleep(5)1134 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1135 logger.info(data)1136 if data["is_alive"] == True: 1137 logger.info('Link is Up') 1138 break1139 elif i == 4:1140 if data["is_alive"] == True:1141 logger.info('Link is Up')1142 else:1143 assert False1144 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1145 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1146 log.info('sucessful in Enabling Single VLAN on dn')1147 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1148 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='enable')1149 log.info('sucessful in configuring allowed QinQ VLAN on dn')1150 sleep(60)1151 with steps.start('Verifying links',continue_=True) as step: 1152 log.info('Verify link status')1153 for i in range(0,5):1154 1155 sleep(5)1156 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1157 logger.info(data)1158 if data["is_alive"] == True: 1159 logger.info('Link is Up') 1160 break1161 elif i == 4:1162 if data["is_alive"] == True:1163 logger.info('Link is Up')1164 else:1165 assert False1166 @ aetest.test1167 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1168 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1169 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1170 log.info('Successful in configuring vlan in Server')1171 with steps.start('Configure IP in client',continue_=True) as step:1172 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1173 log.info('Successful in configuring IP in Client')1174 with steps.start('Starting iperf in client',continue_=True) as step:1175 sleep(20)1176 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1177 assert ((up != 0.0) and (down != 0.0))1178 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1179 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1180 log.info('Successful in Removing vlan in Server')1181 with steps.start('Removing IP in client',continue_=True) as step:1182 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1183 log.info('Successful in Removing IP in Client') 1184 @ aetest.test.loop(s_vlan=lis1)1185 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,s_vlan,**param):1186 1187 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1188 assert misc.config_QinQ(server,param['server_inf'],s_vlan,str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1189 log.info('Successful in configuring vlan in Server')1190 with steps.start('Configure Q VLAN in client',continue_=True) as step:1191 assert misc.config_Q(client,param['client_inf'],s_vlan,param['client_data_ipv4'])1192 log.info('Successful in configuring vlan in client')1193 with steps.start('Verifying Traffic',continue_=True) as step:1194 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1195 result=((up != 0.0) and (down != 0.0))1196 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1197 if s_vlan==int(param['dn1_svlan'])+4:1198 if result == False:1199 log.info('No traffic due to unallowed vlan')1200 else:1201 assert False1202 else:1203 assert result1204 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1205 assert misc.config_QinQ(server,param['server_inf'],s_vlan,str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1206 log.info('Successful in Removing vlan in Server')1207 with steps.start('Removing Q VLAN in client',continue_=True) as step:1208 assert misc.config_Q(client,param['client_inf'],s_vlan,param['client_data_ipv4'],status='disable')1209 log.info('Removing Q vlan in client')1210 @ aetest.test.loop(s_vlan=lis1)1211 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,s_vlan,**param):1212 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1213 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],s_vlan,param['server_data_ipv4'],ethertype=etype)1214 log.info('Successful in configuring QinQ vlan in Server')1215 with steps.start('Configure QinQ VLAN in client',continue_=True) as step:1216 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],s_vlan,param['client_data_ipv4'],ethertype=etype)1217 log.info('Successful in configuring QinQ vlan in client')1218 log.info('Starting iperf client')1219 sleep(20)1220 with steps.start('Verifying Traffic',continue_=True) as step:1221 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1222 result=((up != 0.0) and (down != 0.0))1223 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1224 if s_vlan==int(param['dn1_svlan'])+4:1225 if result == False:1226 log.info('No traffic due to unallowed vlan')1227 else:1228 assert False1229 else:1230 assert result1231 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1232 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],s_vlan,param['server_data_ipv4'],status='disable')1233 log.info('Removing QinQ vlan in Server')1234 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1235 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],s_vlan,param['client_data_ipv4'],status='disable')1236 log.info('Removing QiNQ vlan in client')1237 @aetest.cleanup1238 def VLAN_config_cleanup(self,steps,ctrl,server,client,etype,**param):1239 vlans='{},{}-{}'.format(lis1[0],lis1[1],lis1[3])1240 with steps.start('Remove QinQ VLAN in dn',continue_=True) as step:1241 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],svlan='1',cvlan='1',ethertype=etype,status='disable')1242 log.info('sucessful in Removing Double VLAN on dn')1243 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1244 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='disable')1245 log.info('sucessful in Removing allowed QinQ VLAN on dn')1246 sleep(60)1247 with steps.start('Verifying links',continue_=True) as step: 1248 log.info('Verify link status')1249 for i in range(0,5):1250 1251 sleep(5)1252 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1253 logger.info(data)1254 if data["is_alive"] == True: 1255 logger.info('Link is Up') 1256 break1257 elif i == 4:1258 if data["is_alive"] == True:1259 logger.info('Link is Up')1260 else:1261 assert False1262@aetest.loop(etype = ['0x8100', '0x88A8'])1263class QinQ_Vlan_Remarking(aetest.Testcase):1264 1265 @aetest.setup1266 def Configure_Q_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1267 remark=int(param['dn1_svlan'])+11268 with steps.start('Verifying links',continue_=True) as step: 1269 log.info('Verify link status')1270 for i in range(0,5):1271 1272 sleep(5)1273 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1274 logger.info(data)1275 if data["is_alive"] == True: 1276 logger.info('Link is Up') 1277 break1278 elif i == 4:1279 if data["is_alive"] == True:1280 logger.info('Link is Up')1281 else:1282 assert False1283 1284 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1285 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],svlan=param['dn1_svlan'],cvlan=param['dn1_cvlan'],ethertype=etype,status='enable')1286 log.info('sucessful in Enabling Single VLAN on dn')1287 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1288 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1289 log.info('sucessful in configuring allowed QinQ VLAN on dn')1290 1291 with steps.start('Configuring Remark VLAN',continue_=True) as step:1292 assert api.config_vlan_remarking(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],param['dn1_svlan'],remark)1293 log.info('sucessful in Configuring Single VLAN Remarking on dn')1294 sleep(60)1295 with steps.start('Verifying links',continue_=True) as step: 1296 log.info('Verify link status')1297 for i in range(0,5):1298 1299 sleep(5)1300 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1301 logger.info(data)1302 if data["is_alive"] == True: 1303 logger.info('Link is Up') 1304 break1305 elif i == 4:1306 if data["is_alive"] == True:1307 logger.info('Link is Up')1308 else:1309 assert False1310 @ aetest.test1311 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1312 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1313 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1314 log.info('Successful in configuring vlan in Server')1315 with steps.start('Configure IP in client',continue_=True) as step:1316 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1317 log.info('Successful in configuring IP in Client')1318 with steps.start('Starting iperf in client',continue_=True) as step:1319 sleep(20)1320 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1321 assert ((up != 0.0) and (down != 0.0))1322 with steps.start('Removing Q VLAN in Server',continue_=True) as step:1323 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1324 log.info('Successful in Removing vlan in Server')1325 with steps.start('Removing IP in client',continue_=True) as step:1326 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1327 log.info('Successful in Removing IP in Client') 1328 @ aetest.test1329 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1330 remark=int(param['dn1_svlan'])+11331 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1332 assert misc.config_QinQ(server,param['server_inf'],remark,param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1333 log.info('Successful in configuring vlan in Server')1334 with steps.start('Configure Q VLAN in client',continue_=True) as step:1335 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1336 log.info('Successful in configuring vlan in client')1337 with steps.start('Verifying Traffic',continue_=True) as step:1338 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1339 assert ((up != 0.0) and (down != 0.0))1340 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1341 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1342 assert misc.config_QinQ(server,param['server_inf'],remark,param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1343 log.info('Successful in Removing vlan in Server')1344 with steps.start('Removing Q VLAN in client',continue_=True) as step:1345 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1346 log.info('Removing Q vlan in client')1347 @ aetest.test1348 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1349 remark=int(param['dn1_svlan'])+11350 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1351 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],remark,param['server_data_ipv4'],ethertype=etype)1352 log.info('Successful in configuring QinQ vlan in Server')1353 with steps.start('Configure Q VLAN in client',continue_=True) as step:1354 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1355 log.info('Successful in configuring QinQ vlan in client')1356 log.info('Starting iperf client')1357 sleep(20)1358 with steps.start('Verifying Traffic',continue_=True) as step:1359 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1360 assert ((up != 0.0) and (down != 0.0))1361 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1362 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1363 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],remark,param['server_data_ipv4'],status='disable')1364 log.info('Removing QinQ vlan in Server')1365 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1366 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1367 log.info('Removing QiNQ vlan in client')1368 1369 @aetest.cleanup1370 def Removing_configs_from_node_and_PCs(self,steps,ctrl,server,client,etype,**param):1371 remark=int(param['dn1_svlan'])+11372 1373 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1374 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1375 log.info('sucessful in Removing QinQ VLAN on dn')1376 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1377 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1378 log.info('sucessful in Removing allowed QinQ VLAN on dn')1379 1380 with steps.start('Removing Remark VLAN',continue_=True) as step:1381 assert api.config_vlan_remarking(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],param['dn1_svlan'],remark,status='disable')1382 log.info('sucessful in Removing Single VLAN Remarking on dn')1383 sleep(60)1384 with steps.start('Verifying links',continue_=True) as step: 1385 log.info('Verify link status')1386 for i in range(0,5):1387 1388 sleep(5)1389 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1390 logger.info(data)1391 if data["is_alive"] == True: 1392 logger.info('Link is Up') 1393 break1394 elif i == 4:1395 if data["is_alive"] == True:1396 logger.info('Link is Up')1397 else:1398 assert False1399@aetest.loop(etype = ['0x8100', '0x88A8'])1400class QinQ_Vlan_Prio_Remarking(aetest.Testcase):1401 1402 def Capturing_Server_interface(self,server,server_inf,server_file):1403 assert misc.capture_interface(server,server_inf,server_file)1404 def Verify_traffic(self,client,server_data_ipv4):1405 log.info('Starting iperf client')1406 up,down=misc.config_iperf_client(client,server_data_ipv4)1407 assert ((up != 0.0) and (down != 0.0))1408 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1409 1410 @aetest.setup1411 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1412 1413 with steps.start('Verifying links',continue_=True) as step: 1414 log.info('Verify link status')1415 for i in range(0,5):1416 1417 sleep(5)1418 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1419 logger.info(data)1420 if data["is_alive"] == True: 1421 logger.info('Link is Up') 1422 break1423 elif i == 4:1424 if data["is_alive"] == True:1425 logger.info('Link is Up')1426 else:1427 assert False1428 1429 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1430 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1431 log.info('sucessful in Enabling Single VLAN on dn')1432 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1433 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1434 log.info('sucessful in configuring allowed QinQ VLAN on dn')1435 1436 with steps.start('Configuring Remark VLAN Priority',continue_=True) as step:1437 assert api.config_vlan_prio_remarking(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],param['dn1_svlan'],'7')1438 log.info('sucessful in Configuring Single VLAN prirotiy Remarking on dn')1439 sleep(60)1440 with steps.start('Verifying links',continue_=True) as step: 1441 log.info('Verify link status')1442 for i in range(0,5):1443 1444 sleep(5)1445 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1446 logger.info(data)1447 if data["is_alive"] == True: 1448 logger.info('Link is Up') 1449 break1450 elif i == 4:1451 if data["is_alive"] == True:1452 logger.info('Link is Up')1453 else:1454 assert False1455 @ aetest.test1456 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1457 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1458 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1459 log.info('Successful in configuring vlan in Server')1460 with steps.start('Configure IP in client',continue_=True) as step:1461 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1462 log.info('Successful in configuring IP in Client')1463 sleep(20)1464 with steps.start('Capturing and verifying traffic',continue_=True) as step:1465 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))1466 p1.start()1467 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))1468 p2.start()1469 p1.join()1470 p2.join()1471 with steps.start('Analyse Capture',continue_=True) as step:1472 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1473 if etype == '0x8100':1474 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id== {}&&vlan.priority==0'.format(ip,str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1))1475 1476 else:1477 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==0&&vlan.priority==0'.format(ip,str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1))1478 1479 res=misc.analyse_capture(server,filter,param['server_file'])1480 if res > 0:1481 log.info('Successful in VLAN tagging')1482 else:1483 assert False1484 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1485 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1486 log.info('Successful in Removing vlan in Server')1487 with steps.start('Removing IP in client',continue_=True) as step:1488 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1489 log.info('Successful in Removing IP in Client') 1490 @ aetest.test1491 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1492 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1493 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1494 log.info('Successful in configuring vlan in Server')1495 with steps.start('Configure Q VLAN in client',continue_=True) as step:1496 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1497 log.info('Successful in configuring vlan in client')1498 1499 with steps.start('Capturing and verifying traffic',continue_=True) as step:1500 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))1501 p1.start()1502 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))1503 p2.start()1504 p1.join()1505 p2.join()1506 with steps.start('Analyse Capture',continue_=True) as step:1507 if etype == '0x8100':1508 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1509 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id== {}&&vlan.priority==0'.format(ip,str(int(param['dn1_svlan'])-1),param['dn1_svlan'])1510 1511 else:1512 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1513 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==0&&vlan.priority==7'.format(ip,param['dn1_svlan'],int(param['dn1_svlan'])-1)1514 1515 res=misc.analyse_capture(server,filter,param['server_file'])1516 if res > 0:1517 log.info('Successful in VLAN tagging')1518 else:1519 assert False1520 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1521 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1522 log.info('Successful in Removing vlan in Server')1523 with steps.start('Removing Q VLAN in client',continue_=True) as step:1524 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1525 log.info('Removing Q vlan in client')1526 @ aetest.test1527 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1528 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1529 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1530 log.info('Successful in configuring QinQ vlan in Server')1531 with steps.start('Configure Q VLAN in client',continue_=True) as step:1532 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1533 log.info('Successful in configuring QinQ vlan in client')1534 with steps.start('Capturing and verifying traffic',continue_=True) as step:1535 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))1536 p1.start()1537 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))1538 p2.start()1539 p1.join()1540 p2.join()1541 with steps.start('Analyse Capture',continue_=True) as step:1542 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1543 if etype == '0x8100': 1544 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id== {}&&vlan.priority==7&&vlan.priority==0'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])1545 else:1546 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==7&&vlan.priority==0'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])1547 res=misc.analyse_capture(server,filter,param['server_file'])1548 if res > 0:1549 log.info('Successful in VLAN tagging')1550 else:1551 assert False1552 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1553 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1554 log.info('Removing QinQ vlan in Server')1555 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1556 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype,status='disable')1557 log.info('Removing QiNQ vlan in client')1558 @aetest.cleanup1559 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1560 1561 1562 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1563 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1564 log.info('sucessful in Removing Single VLAN on dn')1565 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1566 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1567 log.info('sucessful in Removing allowed QinQ VLAN on dn')1568 1569 with steps.start('Removing Remark VLAN Priority',continue_=True) as step:1570 assert api.config_vlan_prio_remarking(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],param['dn1_svlan'],'7',status='disable')1571 log.info('sucessful in Removing Single VLAN prirotiy Remarking on dn')1572 sleep(60)1573 with steps.start('Verifying links',continue_=True) as step: 1574 log.info('Verify link status')1575 for i in range(0,5):1576 1577 sleep(5)1578 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1579 logger.info(data)1580 if data["is_alive"] == True: 1581 logger.info('Link is Up') 1582 break1583 elif i == 4:1584 if data["is_alive"] == True:1585 logger.info('Link is Up')1586 else:1587 assert False1588@aetest.loop(etype = ['0x8100', '0x88A8'])1589class QinQ_Allow_untag_Allow_Singe_Tag(aetest.Testcase):1590 1591 @aetest.setup1592 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1593 1594 with steps.start('Verifying links',continue_=True) as step: 1595 log.info('Verify link status')1596 for i in range(0,5):1597 1598 sleep(5)1599 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1600 logger.info(data)1601 if data["is_alive"] == True: 1602 logger.info('Link is Up') 1603 break1604 elif i == 4:1605 if data["is_alive"] == True:1606 logger.info('Link is Up')1607 else:1608 assert False1609 client.disconnect()1610 client.connect()1611 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1612 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1613 log.info('sucessful in Enabling Single VLAN on dn')1614 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1615 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1616 log.info('sucessful in configuring allowed QinQ VLAN on dn')1617 1618 with steps.start('Configure drop untag packets in QinQ VLAN',continue_=True) as step:1619 assert api.config_vlan_drop_untag(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],status='disable') 1620 log.info('sucessful in configuring Drop untag VLAN')1621 1622 sleep(60)1623 with steps.start('Verifying links',continue_=True) as step: 1624 log.info('Verify link status')1625 for i in range(0,5):1626 1627 sleep(5)1628 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1629 logger.info(data)1630 if data["is_alive"] == True: 1631 logger.info('Link is Up') 1632 break1633 elif i == 4:1634 if data["is_alive"] == True:1635 logger.info('Link is Up')1636 else:1637 assert False1638 1639 1640 @ aetest.test1641 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1642 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1643 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1644 log.info('Successful in configuring vlan in Server')1645 with steps.start('Configure IP in client',continue_=True) as step:1646 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1647 log.info('Successful in configuring IP in Client')1648 1649 with steps.start('Starting client iperf',continue_=True) as step:1650 sleep(20) 1651 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1652 assert ((up != 0) and (down != 0))1653 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1654 1655 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1656 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1657 log.info('Successful in Removing vlan in Server')1658 with steps.start('Removing IP in client',continue_=True) as step:1659 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1660 log.info('Successful in Removing IP in Client') 1661 @ aetest.test1662 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1663 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1664 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1665 log.info('Successful in configuring vlan in Server')1666 with steps.start('Configure Q VLAN in client',continue_=True) as step:1667 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1668 log.info('Successful in configuring vlan in client')1669 1670 with steps.start('Starting client iperf',continue_=True) as step:1671 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1672 assert ((up != 0) and (down != 0))1673 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1674 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1675 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1676 log.info('Successful in Removing vlan in Server')1677 with steps.start('Removing Q VLAN in client',continue_=True) as step:1678 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1679 log.info('Removing Q vlan in client')1680 @ aetest.test1681 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1682 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1683 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1684 log.info('Successful in configuring QinQ vlan in Server')1685 with steps.start('Configure Q VLAN in client',continue_=True) as step:1686 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1687 log.info('Successful in configuring QinQ vlan in client')1688 with steps.start('Starting client iperf',continue_=True) as step:1689 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1690 assert ((up != 0) and (down != 0))1691 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1692 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1693 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1694 log.info('Removing QinQ vlan in Server')1695 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1696 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype,status='disable')1697 log.info('Removing QiNQ vlan in client')1698 1699 @aetest.cleanup1700 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1701 1702 1703 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1704 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1705 log.info('sucessful in Removing Single VLAN on dn')1706 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1707 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1708 log.info('sucessful in Removing allowed QinQ VLAN on dn')1709 sleep(60)1710 with steps.start('Verifying links',continue_=True) as step: 1711 log.info('Verify link status')1712 for i in range(0,5):1713 1714 sleep(5)1715 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1716 logger.info(data)1717 if data["is_alive"] == True: 1718 logger.info('Link is Up') 1719 break1720 elif i == 4:1721 if data["is_alive"] == True:1722 logger.info('Link is Up')1723 else:1724 assert False1725 1726 client.disconnect()1727 client.connect()1728@aetest.loop(etype = ['0x8100', '0x88A8'])1729class QinQ_Drop_untag_Allow_Singe_Tag(aetest.Testcase):1730 1731 @aetest.setup1732 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1733 1734 with steps.start('Verifying links',continue_=True) as step: 1735 log.info('Verify link status')1736 for i in range(0,5):1737 1738 sleep(5)1739 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1740 logger.info(data)1741 if data["is_alive"] == True: 1742 logger.info('Link is Up') 1743 break1744 elif i == 4:1745 if data["is_alive"] == True:1746 logger.info('Link is Up')1747 else:1748 assert False1749 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1750 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1751 log.info('sucessful in Enabling Single VLAN on dn')1752 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1753 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1754 log.info('sucessful in configuring allowed QinQ VLAN on dn')1755 1756 with steps.start('Configure drop untag packets in QinQ VLAN',continue_=True) as step:1757 assert api.config_vlan_drop_untag(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],status='enable') 1758 log.info('sucessful in configuring Drop untag VLAN')1759 1760 sleep(60)1761 with steps.start('Verifying links',continue_=True) as step: 1762 log.info('Verify link status')1763 for i in range(0,5):1764 1765 sleep(5)1766 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1767 logger.info(data)1768 if data["is_alive"] == True: 1769 logger.info('Link is Up') 1770 break1771 elif i == 4:1772 if data["is_alive"] == True:1773 logger.info('Link is Up')1774 else:1775 assert False1776 1777 @ aetest.test1778 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1779 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1780 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1781 log.info('Successful in configuring vlan in Server')1782 1783 #Configure IP on client PC1784 with steps.start('Configure IP in client',continue_=True) as step: 1785 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1786 log.info('Successful in configuring IP in Client')1787 1788 with steps.start('Starting iperf in client',continue_=True) as step:1789 sleep(20) 1790 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1791 result=((up != 0.0) and (down != 0.0))1792 log.info(result)1793 if result == False:1794 log.info('Traffic Failed due to drop untag')1795 else:1796 log.info('Failed to drop untagged packets')1797 assert False1798 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1799 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1800 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1801 log.info('Successful in Removing vlan in Server')1802 with steps.start('Removing IP in client',continue_=True) as step:1803 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1804 log.info('Successful in Removing IP in Client') 1805 @ aetest.test1806 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1807 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1808 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1809 log.info('Successful in configuring vlan in Server')1810 with steps.start('Configure Q VLAN in client',continue_=True) as step:1811 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1812 log.info('Successful in configuring vlan in client')1813 1814 with steps.start('Starting client iperf',continue_=True) as step:1815 sleep(20)1816 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1817 assert ((up != 0) and (down != 0))1818 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1819 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1820 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1821 log.info('Successful in Removing vlan in Server')1822 with steps.start('Removing Q VLAN in client',continue_=True) as step:1823 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1824 log.info('Removing Q vlan in client')1825 @ aetest.test1826 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1827 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1828 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1829 log.info('Successful in configuring QinQ vlan in Server')1830 with steps.start('Configure Q VLAN in client',continue_=True) as step:1831 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1832 log.info('Successful in configuring QinQ vlan in client')1833 with steps.start('Starting client iperf',continue_=True) as step:1834 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1835 assert ((up != 0) and (down != 0))1836 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1837 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1838 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],status='disable')1839 log.info('Removing QinQ vlan in Server')1840 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1841 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1842 log.info('Removing QiNQ vlan in client')1843 1844 @aetest.cleanup1845 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1846 1847 1848 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1849 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1850 log.info('sucessful in Removing Single VLAN on dn')1851 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1852 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1853 log.info('sucessful in Removing allowed QinQ VLAN on dn')1854 1855 with steps.start('Removing drop untag packets in QinQ VLAN',continue_=True) as step:1856 assert api.config_vlan_drop_untag(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],status='disable') 1857 log.info('sucessful in Removing Drop untag VLAN')1858 sleep(60)1859 with steps.start('Verifying links',continue_=True) as step: 1860 log.info('Verify link status')1861 for i in range(0,5):1862 1863 sleep(5)1864 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1865 logger.info(data)1866 if data["is_alive"] == True: 1867 logger.info('Link is Up') 1868 break1869 elif i == 4:1870 if data["is_alive"] == True:1871 logger.info('Link is Up')1872 else:1873 assert False1874@aetest.loop(etype = ['0x8100', '0x88A8'])1875class QinQ_Allow_untag_Drop_Singe_Tag(aetest.Testcase):1876 1877 @aetest.setup1878 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1879 1880 1881 with steps.start('Verifying links',continue_=True) as step: 1882 log.info('Verify link status')1883 for i in range(0,5):1884 1885 sleep(5)1886 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1887 logger.info(data)1888 if data["is_alive"] == True: 1889 logger.info('Link is Up') 1890 break1891 elif i == 4:1892 if data["is_alive"] == True:1893 logger.info('Link is Up')1894 else:1895 assert False1896 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1897 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1898 log.info('sucessful in Enabling Single VLAN on dn')1899 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1900 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1901 log.info('sucessful in configuring allowed QinQ VLAN on dn')1902 1903 with steps.start('Configure Allow untag packets in QinQ VLAN',continue_=True) as step:1904 assert api.config_vlan_drop_untag(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],status='disable') 1905 log.info('sucessful in configuring Allow untag ')1906 1907 with steps.start('Configure Drop Single packets in QinQ VLAN',continue_=True) as step:1908 assert api.config_drop_single_tag(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],status='enable') 1909 log.info('sucessful in configuring Drop Singletag')1910 sleep(60)1911 with steps.start('Verifying links',continue_=True) as step: 1912 log.info('Verify link status')1913 for i in range(0,5):1914 1915 sleep(5)1916 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])1917 logger.info(data)1918 if data["is_alive"] == True: 1919 logger.info('Link is Up') 1920 break1921 elif i == 4:1922 if data["is_alive"] == True:1923 logger.info('Link is Up')1924 else:1925 assert False1926 1927 1928 1929 @ aetest.test1930 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1931 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1932 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1933 log.info('Successful in configuring vlan in Server')1934 with steps.start('Configure IP in client',continue_=True) as step:1935 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1936 log.info('Successful in configuring IP in Client')1937 1938 1939 with steps.start('Starting client iperf',continue_=True) as step:1940 sleep(20)1941 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1942 assert ((up != 0) and (down != 0))1943 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1944 1945 1946 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1947 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1948 log.info('Successful in Removing vlan in Server')1949 with steps.start('Removing IP in client',continue_=True) as step:1950 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1951 log.info('Successful in Removing IP in Client') 1952 @ aetest.test1953 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1954 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1955 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1956 log.info('Successful in configuring vlan in Server')1957 with steps.start('Configure Q VLAN in client',continue_=True) as step:1958 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1959 log.info('Successful in configuring vlan in client')1960 1961 with steps.start('Starting client iperf',continue_=True) as step:1962 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1963 result=((up != 0) and (down != 0))1964 if result == False:1965 log.info('Packets dropped due to drop config')1966 else:1967 assert False1968 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1969 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1970 log.info('Successful in Removing vlan in Server')1971 with steps.start('Removing Q VLAN in client',continue_=True) as step:1972 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1973 log.info('Removing Q vlan in client')1974 @ aetest.test1975 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1976 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1977 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1978 log.info('Successful in configuring QinQ vlan in Server')1979 with steps.start('Configure Q VLAN in client',continue_=True) as step:1980 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1981 log.info('Successful in configuring QinQ vlan in client')1982 with steps.start('Starting client iperf',continue_=True) as step:1983 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1984 assert ((up != 0) and (down != 0))1985 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1986 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1987 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],status='disable')1988 log.info('Removing QinQ vlan in Server')1989 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1990 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1991 log.info('Removing QiNQ vlan in client')1992 1993 @aetest.cleanup1994 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1995 1996 1997 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1998 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1999 log.info('sucessful in Removing Single VLAN on dn')2000 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:2001 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')2002 log.info('sucessful in Removing allowed QinQ VLAN on dn')2003 2004 with steps.start('Removing drop Single tag packets in QinQ VLAN',continue_=True) as step:2005 assert api.config_drop_single_tag(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],status='disable') 2006 log.info('sucessful in Removing Drop Single tag')2007 sleep(60)2008 with steps.start('Verifying links',continue_=True) as step: 2009 log.info('Verify link status')2010 for i in range(0,5):2011 2012 sleep(5)2013 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2014 logger.info(data)2015 if data["is_alive"] == True: 2016 logger.info('Link is Up') 2017 break2018 elif i == 4:2019 if data["is_alive"] == True:2020 logger.info('Link is Up')2021 else:2022 assert False2023 2024@aetest.loop(etype = ['0x8100', '0x88A8'])2025class QinQ_Drop_untag_Drop_Singe_Tag(aetest.Testcase):2026 2027 @aetest.setup2028 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):2029 2030 with steps.start('Verifying links',continue_=True) as step: 2031 log.info('Verify link status')2032 for i in range(0,5):2033 2034 sleep(5)2035 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2036 logger.info(data)2037 if data["is_alive"] == True: 2038 logger.info('Link is Up') 2039 break2040 elif i == 4:2041 if data["is_alive"] == True:2042 logger.info('Link is Up')2043 else:2044 assert False2045 client.disconnect()2046 client.connect()2047 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:2048 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')2049 log.info('sucessful in Enabling Single VLAN on dn')2050 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:2051 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')2052 log.info('sucessful in configuring allowed QinQ VLAN on dn')2053 2054 with steps.start('Configure Drop untag packets in QinQ VLAN',continue_=True) as step:2055 assert api.config_vlan_drop_untag(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],status='enable') 2056 log.info('sucessful in configuring Drop untag ')2057 2058 with steps.start('Configure Drop Single packets in QinQ VLAN',continue_=True) as step:2059 assert api.config_drop_single_tag(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],status='enable') 2060 log.info('sucessful in configuring Drop Singletag')2061 2062 sleep(60)2063 with steps.start('Verifying links',continue_=True) as step: 2064 log.info('Verify link status')2065 for i in range(0,5):2066 2067 sleep(5)2068 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2069 logger.info(data)2070 if data["is_alive"] == True: 2071 logger.info('Link is Up') 2072 break2073 elif i == 4:2074 if data["is_alive"] == True:2075 logger.info('Link is Up')2076 else:2077 assert False2078 2079 @ aetest.test2080 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):2081 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2082 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)2083 log.info('Successful in configuring vlan in Server')2084 with steps.start('Configure IP in client',continue_=True) as step:2085 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2086 log.info('Successful in configuring IP in Client')2087 2088 2089 with steps.start('Starting client iperf',continue_=True) as step:2090 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2091 result=((up != 0) and (down != 0))2092 if result == False:2093 log.info('Packets dropped due to drop config')2094 else:2095 assert False2096 2097 2098 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2099 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')2100 log.info('Successful in Removing vlan in Server')2101 with steps.start('Removing IP in client',continue_=True) as step:2102 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2103 log.info('Successful in Removing IP in Client') 2104 @ aetest.test2105 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):2106 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2107 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)2108 log.info('Successful in configuring vlan in Server')2109 with steps.start('Configure Q VLAN in client',continue_=True) as step:2110 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])2111 log.info('Successful in configuring vlan in client')2112 2113 with steps.start('Starting client iperf',continue_=True) as step:2114 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2115 result=((up != 0) and (down != 0))2116 if result == False:2117 log.info('Packets dropped due to drop config')2118 else:2119 assert False2120 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2121 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')2122 log.info('Successful in Removing vlan in Server')2123 with steps.start('Removing Q VLAN in client',continue_=True) as step:2124 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')2125 log.info('Removing Q vlan in client')2126 @ aetest.test2127 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):2128 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2129 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2130 log.info('Successful in configuring QinQ vlan in Server')2131 with steps.start('Configure Q VLAN in client',continue_=True) as step:2132 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)2133 log.info('Successful in configuring QinQ vlan in client')2134 with steps.start('Starting client iperf',continue_=True) as step:2135 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2136 assert ((up != 0) and (down != 0))2137 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2138 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2139 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],status='disable')2140 log.info('Removing QinQ vlan in Server')2141 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:2142 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')2143 log.info('Removing QiNQ vlan in client')2144 2145 @aetest.cleanup2146 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):2147 2148 2149 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:2150 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')2151 log.info('sucessful in Removing Single VLAN on dn')2152 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:2153 assert api.config_vlan_allowed_list(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')2154 log.info('sucessful in Removing allowed QinQ VLAN on dn')2155 with steps.start('Removing drop untag packets in QinQ VLAN',continue_=True) as step:2156 assert api.config_vlan_drop_untag(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],status='disable') 2157 log.info('sucessful in Removing Drop untag') 2158 2159 with steps.start('Removing drop Single tag packets in QinQ VLAN',continue_=True) as step:2160 assert api.config_drop_single_tag(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],status='disable') 2161 log.info('sucessful in Removing Drop Single tag')2162 sleep(60)2163 with steps.start('Verifying links',continue_=True) as step: 2164 log.info('Verify link status')2165 for i in range(0,5):2166 2167 sleep(5)2168 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2169 logger.info(data)2170 if data["is_alive"] == True: 2171 logger.info('Link is Up') 2172 break2173 elif i == 4:2174 if data["is_alive"] == True:2175 logger.info('Link is Up')2176 else:2177 assert False2178@aetest.loop(etype = ['0x8100', '0x88A8'])2179class Same_S_And_C_QinQ_Vlan(aetest.Testcase):2180 def Capturing_Server_interface(self,server,server_inf,server_file):2181 assert misc.capture_interface(server,server_inf,server_file)2182 def Verify_traffic(self,client,server_data_ipv4):2183 log.info('Starting iperf client')2184 up,down=misc.config_iperf_client(client,server_data_ipv4)2185 assert ((up != 0.0) and (down != 0.0))2186 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2187 2188 @aetest.setup2189 def Configure_QinQ_Vlan(self, etype, steps,ctrl,server,client,**param):2190 2191 with steps.start('Verifying links',continue_=True) as step: 2192 log.info('Verify link status')2193 for i in range(0,5):2194 2195 sleep(5)2196 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2197 logger.info(data)2198 if data["is_alive"] == True: 2199 logger.info('Link is Up') 2200 break2201 elif i == 4:2202 if data["is_alive"] == True:2203 logger.info('Link is Up')2204 else:2205 assert False2206 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:2207 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_svlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2208 log.info('sucessful in Enabling Double VLAN on dn')2209 sleep(60)2210 with steps.start('Verifying links',continue_=True) as step: 2211 log.info('Verify link status')2212 for i in range(0,5):2213 2214 sleep(5)2215 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2216 logger.info(data)2217 if data["is_alive"] == True: 2218 logger.info('Link is Up') 2219 break2220 elif i == 4:2221 if data["is_alive"] == True:2222 logger.info('Link is Up')2223 else:2224 assert False2225 2226 2227 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2228 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2229 log.info('Successful in configuring vlan in Server')2230 2231 #Configure IP on client PC2232 with steps.start('Configure IP in client',continue_=True) as step: 2233 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2234 log.info('Successful in configuring IP in Client')2235 2236 2237 with steps.start('Capturing and verifying traffic',continue_=True) as step:2238 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))2239 p1.start()2240 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))2241 p2.start()2242 p1.join()2243 p2.join()2244 with steps.start('Analyse Capture',continue_=True) as step:2245 if etype =='0x8100':2246 ip = param['client_data_ipv4'].rsplit('/', 1)[0]2247 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_svlan'],param['dn1_svlan'])2248 else:2249 ip = param['client_data_ipv4'].rsplit('/', 1)[0]2250 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_svlan'],param['dn1_svlan'])2251 res=misc.analyse_capture(server,filter,param['server_file'])2252 if res > 0:2253 log.info('Successful in QinQ VLAN tagging')2254 else:2255 assert False2256 2257 2258 2259 @aetest.cleanup2260 def Disabling_QinQ_VLAN(self,etype,steps,ctrl,server,client,**param):2261 2262 log.info('Disabling Double VLAN in dn')2263 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2264 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2265 log.info('Successful in Removing vlan in Server')2266 sleep(60)2267 with steps.start('Verifying links',continue_=True) as step: 2268 log.info('Verify link status')2269 for i in range(0,5):2270 2271 sleep(5)2272 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2273 logger.info(data)2274 if data["is_alive"] == True: 2275 logger.info('Link is Up') 2276 break2277 elif i == 4:2278 if data["is_alive"] == True:2279 logger.info('Link is Up')2280 else:2281 assert False2282 with steps.start('Removing vlan configs from server',continue_=True) as step:2283 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_svlan'],svlan=param['dn1_svlan'],ethertype=etype,status='disable') 2284 log.info('sucessful in Removing QinQ VLAN on dn')2285 with steps.start('Configure IP in client',continue_=True) as step:2286 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2287 log.info('Successful in configuring IP in Client')2288@aetest.skip(reason = 'Failure in client3 reachability')2289class POP_Bridge_Q_Vlan(aetest.Testcase):2290 def Capturing_Server_interface(self,server,server_inf,server_file):2291 assert misc.capture_interface(server,server_inf,server_file)2292 2293 def Verify_traffic(self,client,server_data_ipv4):2294 log.info('Starting iperf client')2295 up,down=misc.config_iperf_client(client,server_data_ipv4)2296 assert ((up != 0.0) and (down != 0.0))2297 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2298 2299 @aetest.setup2300 def Setup(self, steps,ctrl,server,client3,**param):2301 with steps.start('Verifying links',continue_=True) as step: 2302 log.info('Verify link status')2303 for i in range(0,5):2304 2305 sleep(5)2306 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2307 logger.info(data)2308 if data["is_alive"] == True: 2309 logger.info('Link is Up') 2310 break2311 elif i == 4:2312 if data["is_alive"] == True:2313 logger.info('Link is Up')2314 else:2315 assert False2316 2317 client3.connect()2318 with steps.start('Configure Q VLAN in POP',continue_=True) as step:2319 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['pop_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2320 log.info('sucessful in Enabling Single VLAN on POP')2321 sleep(60)2322 with steps.start('Verifying links',continue_=True) as step: 2323 log.info('Verify link status')2324 for i in range(0,5):2325 2326 sleep(5)2327 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2328 logger.info(data)2329 if data["is_alive"] == True: 2330 logger.info('Link is Up') 2331 break2332 elif i == 4:2333 if data["is_alive"] == True:2334 logger.info('Link is Up')2335 else:2336 assert False2337 2338 2339 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2340 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2341 log.info('Successful in configuring vlan in Server')2342 2343 #Configure IP on client PC2344 with steps.start('Configure IP in client',continue_=True) as step: 2345 assert misc.config_ip(client3,param['client3_inf'],param['client3_data_ipv4'])2346 log.info('Successful in configuring IP in Client')2347 2348 2349 2350 with steps.start('Capturing and verifying traffic',continue_=True) as step:2351 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))2352 p1.start()2353 p2 = Process(target=self.Verify_traffic,args=(client3,param['server_data_ipv4']))2354 p2.start()2355 p1.join()2356 p2.join()2357 with steps.start('Analyse Capture',continue_=True) as step:2358 ip = param['client_data_ipv4'].rsplit('/', 1)[0]2359 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])2360 res=misc.analyse_capture(server,filter,param['server_file'])2361 if res > 0:2362 log.info('Successful in VLAN tagging')2363 else:2364 assert False2365 @aetest.cleanup2366 def Disabling_Q_VLAN(self,steps,ctrl,server,client3,**param):2367 2368 log.info('Disabling Single VLAN in POP')2369 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2370 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2371 log.info('Successful in configuring vlan in Server')2372 with steps.start('Removing vlan configs from server',continue_=True) as step:2373 assert api.config_single_vlan(param['ctrl_ip'],param['pop_name'],param['pop_inf1'],vlan_id=param['dn1_cvlan'],status='disable') 2374 log.info('sucessful in Enabling Single VLAN on POP')2375 sleep(60)2376 with steps.start('Verifying links',continue_=True) as step: 2377 log.info('Verify link status')2378 for i in range(0,5):2379 2380 sleep(5)2381 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2382 logger.info(data)2383 if data["is_alive"] == True: 2384 logger.info('Link is Up') 2385 break2386 elif i == 4:2387 if data["is_alive"] == True:2388 logger.info('Link is Up')2389 else:2390 assert False2391 with steps.start('Configure IP in client',continue_=True) as step:2392 assert misc.config_ip(client3,param['client_inf'],param['client_data_ipv4'],status='disable')2393 log.info('Successful in configuring IP in Client')2394 client3.disconnect()2395 2396class Transparent_Port(aetest.Testcase):2397 @aetest.setup2398 def Configure_Transparent(self, steps,ctrl,server,client,**param):2399 2400 with steps.start('Verifying links',continue_=True) as step: 2401 log.info('Verify link status')2402 for i in range(0,5):2403 2404 sleep(5)2405 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2406 logger.info(data)2407 if data["is_alive"] == True: 2408 logger.info('Link is Up') 2409 break2410 elif i == 4:2411 if data["is_alive"] == True:2412 logger.info('Link is Up')2413 else:2414 assert False2415 with steps.start('Configure Transparent in dn',continue_=True) as step:2416 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2417 log.info('sucessful in Enabling Transparent on dn')2418 sleep(60)2419 with steps.start('Verifying links',continue_=True) as step: 2420 log.info('Verify link status')2421 for i in range(0,5):2422 2423 sleep(5)2424 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2425 logger.info(data)2426 if data["is_alive"] == True: 2427 logger.info('Link is Up') 2428 break2429 elif i == 4:2430 if data["is_alive"] == True:2431 logger.info('Link is Up')2432 else:2433 assert False2434 2435 with steps.start('Configure IP in Server',continue_=True) as step: 2436 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'])2437 log.info('Successful in configuring IP in Server')2438 2439 #Configure IP on client PC2440 with steps.start('Configure IP in client',continue_=True) as step: 2441 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2442 log.info('Successful in configuring IP in Client')2443 2444 2445 @ aetest.test2446 def verify_traffic(self,steps,ctrl,server,client,**param):2447 sleep(20) 2448 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2449 assert ((up != 0) and (down != 0))2450 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2451 @aetest.cleanup2452 def Removing_Ips(self,steps,ctrl,server,client,**param):2453 2454 2455 with steps.start('Removing IP in Server',continue_=True) as step: 2456 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'],status='disable')2457 log.info('Successful in Removing IP in Server')2458 2459 #Configure IP on client PC2460 with steps.start('Removing IP in client',continue_=True) as step: 2461 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2462 log.info('Successful in Removing IP in Client')2463class Transparent_Port_With_Q_Packets(aetest.Testcase):2464 @aetest.setup2465 def Configure_Transparent_port(self, steps,ctrl,server,client,**param):2466 with steps.start('Verifying links',continue_=True) as step: 2467 log.info('Verify link status')2468 for i in range(0,5):2469 2470 sleep(5)2471 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2472 logger.info(data)2473 if data["is_alive"] == True: 2474 logger.info('Link is Up') 2475 break2476 elif i == 4:2477 if data["is_alive"] == True:2478 logger.info('Link is Up')2479 else:2480 assert False2481 with steps.start('Configure Transparent port',continue_=True) as step:2482 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2483 log.info('sucessful in Enabling Transparent port on dn')2484 2485 sleep(60)2486 with steps.start('Verifying links',continue_=True) as step: 2487 log.info('Verify link status')2488 for i in range(0,5):2489 2490 sleep(5)2491 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2492 logger.info(data)2493 if data["is_alive"] == True: 2494 logger.info('Link is Up') 2495 break2496 elif i == 4:2497 if data["is_alive"] == True:2498 logger.info('Link is Up')2499 else:2500 assert False2501 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2502 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2503 log.info('Successful in configuring vlan in Server')2504 2505 with steps.start('Configure Q VLAN in client',continue_=True) as step:2506 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'])2507 log.info('Successful in configuring vlan in client')2508 2509 @ aetest.test2510 def verify_traffic(self,steps,ctrl,server,client,**param):2511 sleep(20) 2512 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2513 assert ((up != 0) and (down != 0))2514 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2515 @aetest.cleanup2516 def Disabling_VLAN_in_Server(self,steps,ctrl,server,client,**param):2517 2518 2519 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2520 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2521 log.info('Successful in Removing vlan in Server')2522 2523 with steps.start('Removing Q VLAN in client',continue_=True) as step:2524 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'],status='disable')2525 log.info('Successful in Removing vlan in client')2526@aetest.loop(etype = ['0x8100', '0x88A8'])2527class Transparent_Port_With_QinQ_Packets(aetest.Testcase):2528 @aetest.setup2529 def Configure_Transparent_Port(self, etype, steps,ctrl,server,client,**param):2530 2531 with steps.start('Verifying links',continue_=True) as step: 2532 log.info('Verify link status')2533 for i in range(0,5):2534 2535 sleep(5)2536 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2537 logger.info(data)2538 if data["is_alive"] == True: 2539 logger.info('Link is Up') 2540 break2541 elif i == 4:2542 if data["is_alive"] == True:2543 logger.info('Link is Up')2544 else:2545 assert False2546 with steps.start('Configure Transparent port',continue_=True) as step:2547 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2548 log.info('sucessful in Enabling Transparent port on dn')2549 2550 sleep(60)2551 with steps.start('Verifying links',continue_=True) as step: 2552 log.info('Verify link status')2553 for i in range(0,5):2554 2555 sleep(5)2556 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2557 logger.info(data)2558 if data["is_alive"] == True: 2559 logger.info('Link is Up') 2560 break2561 elif i == 4:2562 if data["is_alive"] == True:2563 logger.info('Link is Up')2564 else:2565 assert False2566 2567 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2568 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2569 log.info('Successful in configuring vlan in Server')2570 2571 with steps.start('Configure QinQ VLAN in Client',continue_=True) as step:2572 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)2573 log.info('Successful in configuring vlan in client') 2574 2575 2576 @ aetest.test2577 def verify_traffic(self,etype,steps,ctrl,server,client,**param):2578 sleep(20) 2579 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2580 assert ((up != 0) and (down != 0))2581 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2582 2583 @aetest.cleanup2584 def Removing_VLAN(self,etype,steps,ctrl,server,client,**param):2585 2586 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2587 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2588 log.info('Successful in Removing vlan in Server')2589 2590 with steps.start('Removnig QinQ VLAN in Client',continue_=True) as step:2591 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype,status='disable')2592 log.info('Successful in Removing vlan in client')2593class Two_Interface_Transaprent(aetest.Testcase):2594 @aetest.setup2595 def Configure_Transparent(self, steps,ctrl,server,client,client2,**param):2596 client2.connect()2597 misc.execute_command(client2,'sudo ifconfig {} mtu 1492'.format(param['client2_inf']))2598 with steps.start('Verifying links',continue_=True) as step: 2599 log.info('Verify link status')2600 for i in range(0,5):2601 2602 sleep(5)2603 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2604 logger.info(data)2605 if data["is_alive"] == True: 2606 logger.info('Link is Up') 2607 break2608 elif i == 4:2609 if data["is_alive"] == True:2610 logger.info('Link is Up')2611 else:2612 assert False2613 2614 with steps.start('Configure Transparent in dn port1',continue_=True) as step:2615 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2616 log.info('sucessful in Enabling Transparent on dn')2617 with steps.start('Configure Transparent in dn port2',continue_=True) as step:2618 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2619 log.info('sucessful in Enabling Transparent on dn')2620 sleep(60)2621 with steps.start('Verifying links',continue_=True) as step: 2622 log.info('Verify link status')2623 for i in range(0,5):2624 2625 sleep(5)2626 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2627 logger.info(data)2628 if data["is_alive"] == True: 2629 logger.info('Link is Up') 2630 break2631 elif i == 4:2632 if data["is_alive"] == True:2633 logger.info('Link is Up')2634 else:2635 assert False2636 2637 with steps.start('Configure IP in Server',continue_=True) as step: 2638 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'])2639 log.info('Successful in configuring IP in Server')2640 2641 #Configure IP on client PC2642 with steps.start('Configure IP in client',continue_=True) as step: 2643 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2644 log.info('Successful in configuring IP in Client')2645 with steps.start('Configure IP in client2',continue_=True) as step: 2646 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2647 log.info('Successful in configuring IP in Client')2648 2649 2650 @ aetest.test2651 def verify_traffic(self,steps,ctrl,server,client,client2,**param):2652 sleep(20) 2653 with steps.start('client1 traffic',continue_=True) as step:2654 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2655 assert ((up != 0) and (down != 0))2656 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2657 with steps.start('client2 traffic',continue_=True) as step:2658 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2659 assert ((up != 0) and (down != 0))2660 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2661 @aetest.cleanup2662 def Removing_Ips(self,steps,ctrl,server,client,client2,**param):2663 2664 2665 with steps.start('Removing IP in Server',continue_=True) as step: 2666 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'],status='disable')2667 log.info('Successful in Removing IP in Server')2668 2669 #Configure IP on client PC2670 with steps.start('Removing IP in client',continue_=True) as step: 2671 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2672 log.info('Successful in Removing IP in Client')2673 with steps.start('Removing IP in client2',continue_=True) as step: 2674 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2675 log.info('Successful in Removing IP in Client2')2676 misc.execute_command(client2,'sudo ifconfig {} mtu 1500'.format(param['client2_inf']))2677 client2.disconnect()2678class Two_Interface_Transaprent_Q(aetest.Testcase):2679 @aetest.setup2680 def Configure_Transparent(self, steps,ctrl,server,client,client2,**param):2681 with steps.start('Verifying links',continue_=True) as step: 2682 log.info('Verify link status')2683 for i in range(0,5):2684 2685 sleep(5)2686 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2687 logger.info(data)2688 if data["is_alive"] == True: 2689 logger.info('Link is Up') 2690 break2691 elif i == 4:2692 if data["is_alive"] == True:2693 logger.info('Link is Up')2694 else:2695 assert False2696 client2.connect()2697 with steps.start('Configure Transparent in dn port1',continue_=True) as step:2698 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2699 log.info('sucessful in Enabling Transparent on dn')2700 with steps.start('Configure Qvlan in dn port2',continue_=True) as step:2701 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2702 log.info('sucessful in Enabling Qvlan on dn')2703 2704 sleep(60)2705 with steps.start('Verifying links',continue_=True) as step: 2706 log.info('Verify link status')2707 for i in range(0,5):2708 2709 sleep(5)2710 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2711 logger.info(data)2712 if data["is_alive"] == True: 2713 logger.info('Link is Up') 2714 break2715 elif i == 4:2716 if data["is_alive"] == True:2717 logger.info('Link is Up')2718 else:2719 assert False2720 2721 #Configure IP on client PC2722 with steps.start('Configure IP in client',continue_=True) as step: 2723 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2724 log.info('Successful in configuring IP in Client')2725 with steps.start('Configure IP in client2',continue_=True) as step: 2726 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2727 log.info('Successful in configuring IP in Client')2728 2729 2730 @ aetest.test2731 def verify_traffic(self,steps,ctrl,server,client,client2,**param):2732 with steps.start('Configure IP in Server',continue_=True) as step: 2733 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'])2734 log.info('Successful in configuring IP in Server')2735 sleep(20) 2736 with steps.start('client1 traffic',continue_=True) as step:2737 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2738 assert ((up != 0) and (down != 0))2739 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2740 with steps.start('Removing IP in Server',continue_=True) as step: 2741 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'],status='disable')2742 log.info('Successful in Removing IP in Server')2743 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2744 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2745 log.info('Successful in configuring vlan in Server')2746 2747 sleep(20)2748 with steps.start('client2 traffic',continue_=True) as step:2749 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2750 assert ((up != 0) and (down != 0))2751 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2752 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2753 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2754 log.info('Successful in Removing vlan in Server')2755 @aetest.cleanup2756 def Removing_Ips(self,steps,ctrl,server,client,client2,**param):2757 2758 2759 with steps.start('Configure Qvlan in dn port2',continue_=True) as step:2760 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2761 log.info('sucessful in Enabling Qvlan on dn')2762 sleep(60)2763 with steps.start('Verifying links',continue_=True) as step: 2764 log.info('Verify link status')2765 for i in range(0,5):2766 2767 sleep(5)2768 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2769 logger.info(data)2770 if data["is_alive"] == True: 2771 logger.info('Link is Up') 2772 break2773 elif i == 4:2774 if data["is_alive"] == True:2775 logger.info('Link is Up')2776 else:2777 assert False2778 2779 #Configure IP on client PC2780 with steps.start('Removing IP in client',continue_=True) as step: 2781 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2782 log.info('Successful in Removing IP in Client')2783 with steps.start('Removing IP in client2',continue_=True) as step: 2784 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2785 log.info('Successful in Removing IP in Client2')2786 client2.disconnect()2787@aetest.loop(etype = ['0x8100', '0x88A8'])2788class Two_Interface_Transaprent_QinQ(aetest.Testcase):2789 @aetest.setup2790 def Configure_Transparent(self, steps,ctrl,server,client,client2,etype,**param):2791 with steps.start('Verifying links',continue_=True) as step: 2792 log.info('Verify link status')2793 for i in range(0,5):2794 2795 sleep(5)2796 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2797 logger.info(data)2798 if data["is_alive"] == True: 2799 logger.info('Link is Up') 2800 break2801 elif i == 4:2802 if data["is_alive"] == True:2803 logger.info('Link is Up')2804 else:2805 assert False2806 client2.connect()2807 with steps.start('Configure Transparent in dn port1',continue_=True) as step:2808 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2809 log.info('sucessful in Enabling Transparent on dn')2810 with steps.start('Configure QinQ VLAN in dn port2',continue_=True) as step:2811 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2812 log.info('sucessful in Enabling Double VLAN on dn')2813 sleep(60)2814 with steps.start('Verifying links',continue_=True) as step: 2815 log.info('Verify link status')2816 for i in range(0,5):2817 2818 sleep(5)2819 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2820 logger.info(data)2821 if data["is_alive"] == True: 2822 logger.info('Link is Up') 2823 break2824 elif i == 4:2825 if data["is_alive"] == True:2826 logger.info('Link is Up')2827 else:2828 assert False2829 2830 #Configure IP on client PC2831 with steps.start('Configure IP in client',continue_=True) as step: 2832 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2833 log.info('Successful in configuring IP in Client')2834 with steps.start('Configure IP in client2',continue_=True) as step: 2835 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2836 log.info('Successful in configuring IP in Client')2837 2838 2839 @ aetest.test2840 def verify_traffic(self,steps,ctrl,server,client,client2,etype,**param):2841 with steps.start('Configure IP in Server',continue_=True) as step: 2842 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'])2843 log.info('Successful in configuring IP in Server')2844 sleep(20) 2845 with steps.start('client1 traffic',continue_=True) as step:2846 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2847 assert ((up != 0) and (down != 0))2848 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2849 with steps.start('Removing IP in Server',continue_=True) as step: 2850 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'],status='disable')2851 log.info('Successful in Removing IP in Server')2852 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2853 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2854 log.info('Successful in configuring vlan in Server')2855 2856 sleep(20)2857 with steps.start('client2 traffic',continue_=True) as step:2858 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2859 assert ((up != 0) and (down != 0))2860 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2861 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2862 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2863 log.info('Removing vlan in Server')2864 2865 @aetest.cleanup2866 def Removing_Ips(self,steps,ctrl,server,client,client2,etype,**param):2867 2868 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:2869 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 2870 log.info('sucessful in Removing Double VLAN on dn')2871 2872 sleep(60)2873 with steps.start('Verifying links',continue_=True) as step: 2874 log.info('Verify link status')2875 for i in range(0,5):2876 2877 sleep(5)2878 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2879 logger.info(data)2880 if data["is_alive"] == True: 2881 logger.info('Link is Up') 2882 break2883 elif i == 4:2884 if data["is_alive"] == True:2885 logger.info('Link is Up')2886 else:2887 assert False2888 #Configure IP on client PC2889 with steps.start('Removing IP in client',continue_=True) as step: 2890 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2891 log.info('Successful in Removing IP in Client')2892 with steps.start('Removing IP in client2',continue_=True) as step: 2893 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2894 log.info('Successful in Removing IP in Client2')2895 client2.disconnect()2896class Two_Interface_Same_Q_Vlan(aetest.Testcase):2897 @aetest.setup2898 def Configure_Transparent(self, steps,ctrl,server,client,client2,**param):2899 with steps.start('Verifying links',continue_=True) as step: 2900 log.info('Verify link status')2901 for i in range(0,5):2902 2903 sleep(5)2904 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2905 logger.info(data)2906 if data["is_alive"] == True: 2907 logger.info('Link is Up') 2908 break2909 elif i == 4:2910 if data["is_alive"] == True:2911 logger.info('Link is Up')2912 else:2913 assert False2914 client2.connect()2915 with steps.start('Configure Qvlan in dn port1',continue_=True) as step:2916 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2917 log.info('sucessful in Enabling Qvlan on dn')2918 with steps.start('Configure Qvlan in dn port2',continue_=True) as step:2919 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2920 log.info('sucessful in Enabling Qvlan on dn')2921 sleep(60)2922 with steps.start('Verifying links',continue_=True) as step: 2923 log.info('Verify link status')2924 for i in range(0,5):2925 2926 sleep(5)2927 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2928 logger.info(data)2929 if data["is_alive"] == True: 2930 logger.info('Link is Up') 2931 break2932 elif i == 4:2933 if data["is_alive"] == True:2934 logger.info('Link is Up')2935 else:2936 assert False2937 2938 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2939 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2940 log.info('Successful in configuring vlan in Server')2941 2942 #Configure IP on client PC2943 with steps.start('Configure IP in client',continue_=True) as step: 2944 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2945 log.info('Successful in configuring IP in Client')2946 with steps.start('Configure IP in client2',continue_=True) as step: 2947 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2948 log.info('Successful in configuring IP in Client')2949 2950 2951 @ aetest.test2952 def verify_traffic(self,steps,ctrl,server,client,client2,**param):2953 2954 sleep(20) 2955 with steps.start('client1 traffic',continue_=True) as step:2956 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2957 assert ((up != 0) and (down != 0))2958 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2959 sleep(20)2960 with steps.start('client2 traffic',continue_=True) as step:2961 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2962 assert ((up != 0) and (down != 0))2963 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2964 2965 @aetest.cleanup2966 def Removing_Ips(self,steps,ctrl,server,client,client2,**param):2967 with steps.start('Removing Qvlan in dn port1',continue_=True) as step:2968 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2969 log.info('sucessful in Removing Qvlan on dn')2970 with steps.start('Removing Qvlan in dn port2',continue_=True) as step:2971 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2972 log.info('sucessful in Removing Qvlan on dn')2973 sleep(60)2974 with steps.start('Verifying links',continue_=True) as step: 2975 log.info('Verify link status')2976 for i in range(0,5):2977 2978 sleep(5)2979 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])2980 logger.info(data)2981 if data["is_alive"] == True: 2982 logger.info('Link is Up') 2983 break2984 elif i == 4:2985 if data["is_alive"] == True:2986 logger.info('Link is Up')2987 else:2988 assert False2989 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2990 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2991 log.info('Successful in Removing vlan in Server')2992 2993 #Configure IP on client PC2994 with steps.start('Removing IP in client',continue_=True) as step: 2995 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2996 log.info('Successful in Removing IP in Client')2997 with steps.start('Removing IP in client2',continue_=True) as step: 2998 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2999 log.info('Successful in Removing IP in Client2')3000 client2.disconnect()3001class Two_Interface_Different_Q_Vlan(aetest.Testcase):3002 3003 @aetest.setup3004 def Configure_Transparent(self, steps,ctrl,server,client,client2,**param):3005 3006 with steps.start('Verifying links',continue_=True) as step: 3007 log.info('Verify link status')3008 for i in range(0,5):3009 3010 sleep(5)3011 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3012 logger.info(data)3013 if data["is_alive"] == True: 3014 logger.info('Link is Up') 3015 break3016 elif i == 4:3017 if data["is_alive"] == True:3018 logger.info('Link is Up')3019 else:3020 assert False3021 client2.connect()3022 with steps.start('Configure Qvlan in dn port1',continue_=True) as step:3023 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 3024 log.info('sucessful in Enabling Qvlan on dn')3025 with steps.start('Configure Qvlan in dn port2',continue_=True) as step:3026 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf1'],vlan_id=str(int(param['dn1_cvlan'])+1),vlan_prio='7',status='enable') 3027 log.info('sucessful in Enabling Qvlan on dn')3028 sleep(60)3029 with steps.start('Verifying links',continue_=True) as step: 3030 log.info('Verify link status')3031 for i in range(0,5):3032 3033 sleep(5)3034 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3035 logger.info(data)3036 if data["is_alive"] == True: 3037 logger.info('Link is Up') 3038 break3039 elif i == 4:3040 if data["is_alive"] == True:3041 logger.info('Link is Up')3042 else:3043 assert False 3044 3045 3046 #Configure IP on client PC3047 with steps.start('Configure IP in client',continue_=True) as step: 3048 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])3049 log.info('Successful in configuring IP in Client')3050 with steps.start('Configure IP in client2',continue_=True) as step: 3051 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])3052 log.info('Successful in configuring IP in Client')3053 3054 3055 @ aetest.test3056 def verify_traffic(self,steps,ctrl,server,client,client2,**param):3057 3058 with steps.start('Configure Q VLAN in Server',continue_=True) as step:3059 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])3060 log.info('Successful in configuring vlan in Server')3061 sleep(20) 3062 with steps.start('client1 traffic',continue_=True) as step:3063 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])3064 assert ((up != 0) and (down != 0))3065 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 3066 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3067 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')3068 log.info('Successful in Removing vlan in Server')3069 with steps.start('Configure Q VLAN in Server',continue_=True) as step:3070 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])+1),param['server_data_ipv4'])3071 log.info('Successful in configuring vlan in Server')3072 sleep(20)3073 with steps.start('client2 traffic',continue_=True) as step:3074 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])3075 assert ((up != 0) and (down != 0))3076 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))3077 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3078 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])+1),param['server_data_ipv4'],status='disable')3079 log.info('Successful in Removing vlan in Server')3080 3081 @aetest.cleanup3082 def Removing_Ips(self,steps,ctrl,server,client,client2,**param):3083 with steps.start('Removing Qvlan in dn port1',continue_=True) as step:3084 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 3085 log.info('sucessful in Removing Qvlan on dn')3086 3087 3088 with steps.start('Removing Qvlan in dn port2',continue_=True) as step:3089 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 3090 log.info('sucessful in Removing Qvlan on dn')3091 sleep(60)3092 with steps.start('Verifying links',continue_=True) as step: 3093 log.info('Verify link status')3094 for i in range(0,5):3095 3096 sleep(5)3097 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3098 logger.info(data)3099 if data["is_alive"] == True: 3100 logger.info('Link is Up') 3101 break3102 elif i == 4:3103 if data["is_alive"] == True:3104 logger.info('Link is Up')3105 else:3106 assert False3107 3108 #Configure IP on client PC3109 with steps.start('Removing IP in client',continue_=True) as step: 3110 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3111 log.info('Successful in Removing IP in Client')3112 with steps.start('Removing IP in client2',continue_=True) as step: 3113 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')3114 log.info('Successful in Removing IP in Client2')3115 client2.disconnect()3116@aetest.loop(etype = ['0x8100', '0x88A8'])3117class Two_Interface_Q_QinQ(aetest.Testcase):3118 @aetest.setup3119 def Configure_Transparent(self, steps,ctrl,server,client,client2,etype,**param):3120 with steps.start('Verifying links',continue_=True) as step: 3121 log.info('Verify link status')3122 for i in range(0,5):3123 3124 sleep(5)3125 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3126 logger.info(data)3127 if data["is_alive"] == True: 3128 logger.info('Link is Up') 3129 break3130 elif i == 4:3131 if data["is_alive"] == True:3132 logger.info('Link is Up')3133 else:3134 assert False3135 client2.connect()3136 with steps.start('Configure Qvlan in dn port1',continue_=True) as step:3137 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 3138 log.info('sucessful in Enabling Qvlan on dn')3139 with steps.start('Configure QinQ VLAN in dn port2',continue_=True) as step:3140 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 3141 log.info('sucessful in Enabling Double VLAN on dn')3142 sleep(60)3143 with steps.start('Verifying links',continue_=True) as step: 3144 log.info('Verify link status')3145 for i in range(0,5):3146 3147 sleep(5)3148 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3149 logger.info(data)3150 if data["is_alive"] == True: 3151 logger.info('Link is Up') 3152 break3153 elif i == 4:3154 if data["is_alive"] == True:3155 logger.info('Link is Up')3156 else:3157 assert False3158 3159 #Configure IP on client PC3160 with steps.start('Configure IP in client',continue_=True) as step: 3161 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])3162 log.info('Successful in configuring IP in Client')3163 with steps.start('Configure IP in client2',continue_=True) as step: 3164 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])3165 log.info('Successful in configuring IP in Client')3166 3167 3168 @ aetest.test3169 def verify_traffic(self,steps,ctrl,server,client,client2,etype,**param):3170 with steps.start('Configure Q VLAN in Server',continue_=True) as step:3171 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])3172 log.info('Successful in configuring vlan in Server')3173 sleep(20) 3174 with steps.start('client1 traffic',continue_=True) as step:3175 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])3176 assert ((up != 0) and (down != 0))3177 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 3178 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3179 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')3180 log.info('Successful in Removing vlan in Server')3181 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:3182 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)3183 log.info('Successful in configuring vlan in Server')3184 3185 sleep(20)3186 with steps.start('client2 traffic',continue_=True) as step:3187 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])3188 assert ((up != 0) and (down != 0))3189 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))3190 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:3191 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')3192 log.info('Removing vlan in Server')3193 3194 @aetest.cleanup3195 def Removing_Ips(self,steps,ctrl,server,client,client2,etype,**param):3196 3197 with steps.start('Removing Qvlan in dn port1',continue_=True) as step:3198 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 3199 log.info('sucessful in Removing Qvlan on dn')3200 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:3201 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 3202 log.info('sucessful in Removing Double VLAN on dn')3203 sleep(60)3204 with steps.start('Verifying links',continue_=True) as step: 3205 log.info('Verify link status')3206 for i in range(0,5):3207 3208 sleep(5)3209 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3210 logger.info(data)3211 if data["is_alive"] == True: 3212 logger.info('Link is Up') 3213 break3214 elif i == 4:3215 if data["is_alive"] == True:3216 logger.info('Link is Up')3217 else:3218 assert False3219 3220 #Configure IP on client PC3221 with steps.start('Removing IP in client',continue_=True) as step: 3222 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3223 log.info('Successful in Removing IP in Client')3224 with steps.start('Removing IP in client2',continue_=True) as step: 3225 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')3226 log.info('Successful in Removing IP in Client2')3227 client2.disconnect()3228@aetest.loop(etype = ['0x8100', '0x88A8'])3229class Two_Interface_Same_QinQ(aetest.Testcase):3230 @aetest.setup3231 def Configure_QinQ(self, steps,ctrl,server,client,client2,etype,**param):3232 with steps.start('Verifying links',continue_=True) as step: 3233 log.info('Verify link status')3234 for i in range(0,5):3235 3236 sleep(5)3237 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3238 logger.info(data)3239 if data["is_alive"] == True: 3240 logger.info('Link is Up') 3241 break3242 elif i == 4:3243 if data["is_alive"] == True:3244 logger.info('Link is Up')3245 else:3246 assert False3247 client2.connect()3248 with steps.start('Configure QinQ VLAN in dn port1',continue_=True) as step:3249 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 3250 log.info('sucessful in Enabling Double VLAN on dn')3251 with steps.start('Configure QinQ VLAN in dn port2',continue_=True) as step:3252 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 3253 log.info('sucessful in Enabling Double VLAN on dn')3254 sleep(60)3255 with steps.start('Verifying links',continue_=True) as step: 3256 log.info('Verify link status')3257 for i in range(0,5):3258 3259 sleep(5)3260 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3261 logger.info(data)3262 if data["is_alive"] == True: 3263 logger.info('Link is Up') 3264 break3265 elif i == 4:3266 if data["is_alive"] == True:3267 logger.info('Link is Up')3268 else:3269 assert False3270 3271 #Configure IP on client PC3272 with steps.start('Configure IP in client',continue_=True) as step: 3273 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])3274 log.info('Successful in configuring IP in Client')3275 with steps.start('Configure IP in client2',continue_=True) as step: 3276 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])3277 log.info('Successful in configuring IP in Client')3278 3279 3280 @ aetest.test3281 def verify_traffic(self,steps,ctrl,server,client,client2,etype,**param):3282 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:3283 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)3284 log.info('Successful in configuring vlan in Server')3285 sleep(20) 3286 with steps.start('client1 traffic',continue_=True) as step:3287 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])3288 assert ((up != 0) and (down != 0))3289 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 3290 '''with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:3291 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')3292 log.info('Removing vlan in Server')'''3293 '''with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:3294 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)3295 log.info('Successful in configuring vlan in Server')'''3296 3297 sleep(20)3298 with steps.start('client2 traffic',continue_=True) as step:3299 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])3300 assert ((up != 0) and (down != 0))3301 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))3302 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:3303 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')3304 log.info('Removing vlan in Server')3305 3306 @aetest.cleanup3307 def Removing_Ips(self,steps,ctrl,server,client,client2,etype,**param):3308 3309 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:3310 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 3311 log.info('sucessful in Removing Double VLAN on dn')3312 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:3313 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 3314 log.info('sucessful in Removing Double VLAN on dn')3315 sleep(60)3316 with steps.start('Verifying links',continue_=True) as step: 3317 log.info('Verify link status')3318 for i in range(0,5):3319 3320 sleep(5)3321 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3322 logger.info(data)3323 if data["is_alive"] == True: 3324 logger.info('Link is Up') 3325 break3326 elif i == 4:3327 if data["is_alive"] == True:3328 logger.info('Link is Up')3329 else:3330 assert False3331 3332 #Configure IP on client PC3333 with steps.start('Removing IP in client',continue_=True) as step: 3334 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3335 log.info('Successful in Removing IP in Client')3336 with steps.start('Removing IP in client2',continue_=True) as step: 3337 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')3338 log.info('Successful in Removing IP in Client2')3339 client2.disconnect()3340@aetest.loop(etype = ['0x8100', '0x88A8'])3341class Two_Interface_Different_QinQ(aetest.Testcase):3342 @aetest.setup3343 def Configure_Transparent(self, steps,ctrl,server,client,client2,etype,**param):3344 3345 with steps.start('Verifying links',continue_=True) as step: 3346 log.info('Verify link status')3347 for i in range(0,5):3348 3349 sleep(5)3350 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3351 logger.info(data)3352 if data["is_alive"] == True: 3353 logger.info('Link is Up') 3354 break3355 elif i == 4:3356 if data["is_alive"] == True:3357 logger.info('Link is Up')3358 else:3359 assert False3360 client2.connect()3361 with steps.start('Configure QinQ VLAN in dn port1',continue_=True) as step:3362 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 3363 log.info('sucessful in Enabling Double VLAN on dn')3364 with steps.start('Configure QinQ VLAN in dn port2',continue_=True) as step:3365 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf1'],cvlan=str(int(param['dn1_cvlan'])+1),svlan=str(int(param['dn1_svlan'])+1),ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 3366 log.info('sucessful in Enabling Double VLAN on dn')3367 sleep(60)3368 with steps.start('Verifying links',continue_=True) as step: 3369 log.info('Verify link status')3370 for i in range(0,5):3371 3372 sleep(5)3373 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3374 logger.info(data)3375 if data["is_alive"] == True: 3376 logger.info('Link is Up') 3377 break3378 elif i == 4:3379 if data["is_alive"] == True:3380 logger.info('Link is Up')3381 else:3382 assert False3383 3384 #Configure IP on client PC3385 with steps.start('Configure IP in client',continue_=True) as step: 3386 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])3387 log.info('Successful in configuring IP in Client')3388 with steps.start('Configure IP in client2',continue_=True) as step: 3389 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])3390 log.info('Successful in configuring IP in Client')3391 3392 3393 @ aetest.test3394 def verify_traffic(self,steps,ctrl,server,client,client2,etype,**param):3395 3396 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:3397 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)3398 log.info('Successful in configuring vlan in Server')3399 sleep(20) 3400 with steps.start('client1 traffic',continue_=True) as step:3401 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])3402 assert ((up != 0) and (down != 0))3403 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 3404 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:3405 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')3406 log.info('Removing vlan in Server')3407 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:3408 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])+1),str(int(param['dn1_svlan'])+1),param['server_data_ipv4'],ethertype=etype)3409 log.info('Successful in configuring vlan in Server')3410 3411 sleep(20)3412 with steps.start('client2 traffic',continue_=True) as step:3413 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])3414 assert ((up != 0) and (down != 0))3415 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))3416 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:3417 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])+1),str(int(param['dn1_svlan'])+1),param['server_data_ipv4'],ethertype=etype,status='disable')3418 log.info('Removing vlan in Server')3419 3420 @aetest.cleanup3421 def Removing_Ips(self,steps,ctrl,server,client,client2,etype,**param):3422 3423 3424 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:3425 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 3426 log.info('sucessful in Removing Double VLAN on dn')3427 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:3428 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf1'],cvlan=str(int(param['dn1_cvlan'])+1),svlan=str(int(param['dn1_svlan'])+1),ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 3429 log.info('sucessful in Removing Double VLAN on dn')3430 sleep(60)3431 with steps.start('Verifying links',continue_=True) as step: 3432 log.info('Verify link status')3433 for i in range(0,5):3434 3435 sleep(5)3436 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3437 logger.info(data)3438 if data["is_alive"] == True: 3439 logger.info('Link is Up') 3440 break3441 elif i == 4:3442 if data["is_alive"] == True:3443 logger.info('Link is Up')3444 else:3445 assert False3446 3447 #Configure IP on client PC3448 with steps.start('Removing IP in client',continue_=True) as step: 3449 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3450 log.info('Successful in Removing IP in Client')3451 with steps.start('Removing IP in client2',continue_=True) as step: 3452 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')3453 log.info('Successful in Removing IP in Client2')3454 client2.disconnect()3455class Same_Mvlan(aetest.Testcase):3456 @aetest.setup3457 def setup_management_vlan(self,steps,ctrl,server,**param):3458 with steps.start('Verifying links',continue_=True) as step: 3459 log.info('Verify link status')3460 for i in range(0,5):3461 3462 sleep(5)3463 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3464 logger.info(data)3465 if data["is_alive"] == True: 3466 logger.info('Link is Up') 3467 break3468 elif i == 4:3469 if data["is_alive"] == True:3470 logger.info('Link is Up')3471 else:3472 assert False3473 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:3474 assert api.config_single_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'])3475 log.info('Successful in configuring mvlan in DN')3476 assert api.config_single_mvlan(param['ctrl_ip'],param['pop_name'],param['dn1_mcvlan'])3477 log.info('Successful in configuring mvlan in POP')3478 3479 3480 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3481 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])3482 log.info('Successful in configuring vlan in Server')3483 sleep(60)3484 with steps.start('Verifying links',continue_=True) as step: 3485 log.info('Verify link status')3486 for i in range(0,5):3487 3488 sleep(5)3489 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3490 logger.info(data)3491 if data["is_alive"] == True: 3492 logger.info('Link is Up') 3493 break3494 elif i == 4:3495 if data["is_alive"] == True:3496 logger.info('Link is Up')3497 else:3498 assert False3499 @ aetest.test3500 def verify_gui_page(self,steps,ctrl,server,**param):3501 sleep(10)3502 with steps.start('Verifying GUI page of POP',continue_=True) as step:3503 assert misc.verify_web_page(server,param['pop_management_ip'])3504 log.info('Successful in verifying POP GUI with MVLAN')3505 with steps.start('Verifying GUI page of DN',continue_=True) as step:3506 assert misc.verify_web_page(server,param['dn1_management_ip'])3507 log.info('Successful in verifying DN1 GUI with MVLAN')3508 @aetest.cleanup3509 def removing_vlan_config(self,steps,ctrl,server,**param):3510 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3511 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')3512 log.info('Successful in Removing vlan in Server')3513 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:3514 assert api.config_single_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'],status='disable')3515 log.info('Successful in Removing mvlan in DN')3516 assert api.config_single_mvlan(param['ctrl_ip'],param['pop_name'],param['dn1_mcvlan'],status='disable')3517 log.info('Successful in Removing mvlan in POP')3518 sleep(60)3519 with steps.start('Verifying links',continue_=True) as step: 3520 log.info('Verify link status')3521 for i in range(0,5):3522 3523 sleep(5)3524 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3525 logger.info(data)3526 if data["is_alive"] == True: 3527 logger.info('Link is Up') 3528 break3529 elif i == 4:3530 if data["is_alive"] == True:3531 logger.info('Link is Up')3532 else:3533 assert False3534class Different_Mvlan(aetest.Testcase):3535 @aetest.setup3536 def setup_management_vlan(self,steps,ctrl,server,**param):3537 with steps.start('Verifying links',continue_=True) as step: 3538 log.info('Verify link status')3539 for i in range(0,5):3540 3541 sleep(5)3542 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3543 logger.info(data)3544 if data["is_alive"] == True: 3545 logger.info('Link is Up') 3546 break3547 elif i == 4:3548 if data["is_alive"] == True:3549 logger.info('Link is Up')3550 else:3551 assert False3552 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:3553 assert api.config_single_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'])3554 log.info('Successful in configuring mvlan in DN')3555 assert api.config_single_mvlan(param['ctrl_ip'],param['pop_name'],param['pop_mcvlan'])3556 log.info('Successful in configuring mvlan in POP')3557 3558 sleep(60)3559 with steps.start('Verifying links',continue_=True) as step: 3560 log.info('Verify link status')3561 for i in range(0,5):3562 3563 sleep(5)3564 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3565 logger.info(data)3566 if data["is_alive"] == True: 3567 logger.info('Link is Up') 3568 break3569 elif i == 4:3570 if data["is_alive"] == True:3571 logger.info('Link is Up')3572 else:3573 assert False3574 3575 @ aetest.test3576 def verify_gui_page(self,steps,ctrl,server,**param):3577 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3578 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'])3579 log.info('Successful in configuring vlan in Server')3580 sleep(10)3581 with steps.start('Verifying GUI page of POP',continue_=True) as step:3582 assert misc.verify_web_page(server,param['pop_management_ip'])3583 log.info('Successful in verifying POP GUI with MVLAN')3584 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3585 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'],status='disable')3586 log.info('Successful in Removing vlan in Server')3587 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3588 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])3589 log.info('Successful in configuring vlan in Server')3590 sleep(10)3591 with steps.start('Verifying GUI page of DN',continue_=True) as step:3592 assert misc.verify_web_page(server,param['dn1_management_ip'])3593 log.info('Successful in verifying DN1 GUI with MVLAN')3594 3595 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3596 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')3597 log.info('Successful in Removing vlan in Server')3598 @aetest.cleanup3599 def removing_vlan_config(self,steps,ctrl,server,**param):3600 3601 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:3602 assert api.config_single_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'],status='disable')3603 log.info('Successful in Removing mvlan in DN')3604 assert api.config_single_mvlan(param['ctrl_ip'],param['pop_name'],param['pop_mcvlan'],status='disable')3605 log.info('Successful in Removing mvlan in POP') 3606 sleep(60)3607 with steps.start('Verifying links',continue_=True) as step: 3608 log.info('Verify link status')3609 for i in range(0,5):3610 3611 sleep(5)3612 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3613 logger.info(data)3614 if data["is_alive"] == True: 3615 logger.info('Link is Up') 3616 break3617 elif i == 4:3618 if data["is_alive"] == True:3619 logger.info('Link is Up')3620 else:3621 assert False3622@aetest.loop(etype = ['0x8100', '0x88A8'])3623class Same_Mqinq_Vlan(aetest.Testcase):3624 @aetest.setup3625 def config_qinq_vlan(self,steps,ctrl,server,etype,**param):3626 with steps.start('Verifying links',continue_=True) as step: 3627 log.info('Verify link status')3628 for i in range(0,5):3629 3630 sleep(5)3631 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3632 logger.info(data)3633 if data["is_alive"] == True: 3634 logger.info('Link is Up') 3635 break3636 elif i == 4:3637 if data["is_alive"] == True:3638 logger.info('Link is Up')3639 else:3640 assert False3641 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:3642 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')3643 log.info('Successful in configuring QinQ mvlan on DN1')3644 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')3645 log.info('Successful in configuring QinQ mvlan on POP')3646 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:3647 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')3648 sleep(60)3649 with steps.start('Verifying links',continue_=True) as step: 3650 log.info('Verify link status')3651 for i in range(0,5):3652 3653 sleep(5)3654 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3655 logger.info(data)3656 if data["is_alive"] == True: 3657 logger.info('Link is Up') 3658 break3659 elif i == 4:3660 if data["is_alive"] == True:3661 logger.info('Link is Up')3662 else:3663 assert False3664 @ aetest.test3665 def test_QinQ_management_vlan(self,steps,ctrl,server,etype,**param):3666 sleep(10)3667 with steps.start('Verifying POP GUI access',continue_=True) as step:3668 assert misc.verify_web_page(server,param['pop_management_ip'])3669 log.info('Successful in verifying POP GUI with MVLAN')3670 with steps.start('Verifying GUI page of DN',continue_=True) as step:3671 assert misc.verify_web_page(server,param['dn1_management_ip'])3672 log.info('Successful in verifying DN1 GUI with MVLAN')3673 @aetest.cleanup3674 def removing_vlan_configs(self,steps,ctrl,server,etype,**param):3675 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:3676 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')3677 log.info('Successful in configuring QinQ mvlan on DN1')3678 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')3679 log.info('Successful in configuring QinQ mvlan on POP')3680 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:3681 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable')3682 sleep(60)3683 with steps.start('Verifying links',continue_=True) as step: 3684 log.info('Verify link status')3685 for i in range(0,5):3686 3687 sleep(5)3688 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3689 logger.info(data)3690 if data["is_alive"] == True: 3691 logger.info('Link is Up') 3692 break3693 elif i == 4:3694 if data["is_alive"] == True:3695 logger.info('Link is Up')3696 else:3697 assert False3698@aetest.loop(etype = ['0x8100', '0x88A8'])3699class Different_Mqinq_Vlan(aetest.Testcase):3700 @aetest.setup3701 def config_qinq_vlan(self,steps,ctrl,server,etype,**param):3702 with steps.start('Verifying links',continue_=True) as step: 3703 log.info('Verify link status')3704 for i in range(0,5):3705 3706 sleep(5)3707 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3708 logger.info(data)3709 if data["is_alive"] == True: 3710 logger.info('Link is Up') 3711 break3712 elif i == 4:3713 if data["is_alive"] == True:3714 logger.info('Link is Up')3715 else:3716 assert False3717 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:3718 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')3719 log.info('Successful in configuring QinQ mvlan on DN1')3720 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['pop_name'],param['pop_mcvlan'],param['pop_msvlan'],ethertype=etype,status='enable')3721 log.info('Successful in configuring QinQ mvlan on POP')3722 sleep(60)3723 with steps.start('Verifying links',continue_=True) as step: 3724 log.info('Verify link status')3725 for i in range(0,5):3726 3727 sleep(5)3728 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3729 logger.info(data)3730 if data["is_alive"] == True: 3731 logger.info('Link is Up') 3732 break3733 elif i == 4:3734 if data["is_alive"] == True:3735 logger.info('Link is Up')3736 else:3737 assert False3738 3739 @ aetest.test3740 def test_QinQ_management_vlan(self,steps,ctrl,server,etype,**param):3741 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:3742 assert misc.config_QinQ(server,param['server_inf'],param['pop_mcvlan'],param['pop_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')3743 sleep(10)3744 with steps.start('Verifying POP GUI access',continue_=True) as step:3745 assert misc.verify_web_page(server,param['pop_management_ip'])3746 log.info('Successful in verifying POP GUI with MVLAN')3747 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:3748 assert misc.config_QinQ(server,param['server_inf'],param['pop_mcvlan'],param['pop_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable')3749 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:3750 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')3751 sleep(10)3752 with steps.start('Verifying GUI page of DN',continue_=True) as step:3753 assert misc.verify_web_page(server,param['dn1_management_ip'])3754 log.info('Successful in verifying DN1 GUI with MVLAN')3755 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:3756 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable')3757 @aetest.cleanup3758 def removing_vlan_configs(self,steps,ctrl,server,etype,**param):3759 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:3760 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')3761 log.info('Successful in configuring QinQ mvlan on DN1')3762 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['pop_name'],param['pop_mcvlan'],param['pop_msvlan'],ethertype=etype,status='disable')3763 log.info('Successful in configuring QinQ mvlan on POP')3764 sleep(60)3765 with steps.start('Verifying links',continue_=True) as step: 3766 log.info('Verify link status')3767 for i in range(0,5):3768 3769 sleep(5)3770 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3771 logger.info(data)3772 if data["is_alive"] == True: 3773 logger.info('Link is Up') 3774 break3775 elif i == 4:3776 if data["is_alive"] == True:3777 logger.info('Link is Up')3778 else:3779 assert False3780class Single_Data_Vlan_Single_Same_Management_Vlan(aetest.Testcase):3781 def Capturing_Server_interface(self,server,server_inf,server_file):3782 assert misc.capture_interface(server,server_inf,server_file)3783 3784 def Verify_traffic(self,client,server_data_ipv4):3785 log.info('Starting iperf client')3786 up,down=misc.config_iperf_client(client,server_data_ipv4)3787 assert ((up != 0.0) and (down != 0.0))3788 @aetest.setup3789 def setup_vlan(self,steps,ctrl,server,client,**param):3790 with steps.start('Verifying links',continue_=True) as step: 3791 log.info('Verify link status')3792 for i in range(0,5):3793 3794 sleep(5)3795 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3796 logger.info(data)3797 if data["is_alive"] == True: 3798 logger.info('Link is Up') 3799 break3800 elif i == 4:3801 if data["is_alive"] == True:3802 logger.info('Link is Up')3803 else:3804 assert False3805 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:3806 assert api.config_single_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'])3807 log.info('Successful in configuring mvlan in DN')3808 assert api.config_single_mvlan(param['ctrl_ip'],param['pop_name'],param['dn1_mcvlan'])3809 log.info('Successful in configuring mvlan in POP')3810 with steps.start('Configure Q VLAN in dn',continue_=True) as step:3811 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 3812 log.info('sucessful in Enabling Single VLAN on dn')3813 sleep(60)3814 with steps.start('Verifying links',continue_=True) as step: 3815 log.info('Verify link status')3816 for i in range(0,5):3817 3818 sleep(5)3819 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3820 logger.info(data)3821 if data["is_alive"] == True: 3822 logger.info('Link is Up') 3823 break3824 elif i == 4:3825 if data["is_alive"] == True:3826 logger.info('Link is Up')3827 else:3828 assert False3829 3830 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3831 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])3832 log.info('Successful in configuring vlan in Server')3833 3834 3835 3836 with steps.start('Configure Q VLAN in Server',continue_=True) as step:3837 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])3838 log.info('Successful in configuring vlan in Server')3839 3840 #Configure IP on client PC3841 with steps.start('Configure IP in client',continue_=True) as step: 3842 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])3843 log.info('Successful in configuring IP in Client')3844 3845 3846 @ aetest.test3847 def verify_gui_page(self,steps,ctrl,server,client,**param):3848 with steps.start('Verifying GUI page of POP',continue_=True) as step:3849 assert misc.verify_web_page(server,param['pop_management_ip'])3850 log.info('Successful in verifying POP GUI with MVLAN')3851 sleep(10)3852 with steps.start('Verifying GUI page of DN',continue_=True) as step:3853 assert misc.verify_web_page(server,param['dn1_management_ip'])3854 log.info('Successful in verifying DN1 GUI with MVLAN')3855 with steps.start('Capturing and verifying traffic',continue_=True) as step:3856 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))3857 p1.start()3858 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))3859 p2.start()3860 p1.join()3861 p2.join()3862 with steps.start('Analyse Capture',continue_=True) as step:3863 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3864 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])3865 res=misc.analyse_capture(server,filter,param['server_file'])3866 if res > 0:3867 log.info('Successful in VLAN tagging')3868 else:3869 assert False3870 @aetest.cleanup3871 def removing_vlan_config(self,steps,ctrl,server,client,**param):3872 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3873 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')3874 log.info('Successful in Removing vlan in Server')3875 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:3876 assert api.config_single_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'],status='disable')3877 log.info('Successful in Removing mvlan in DN')3878 assert api.config_single_mvlan(param['ctrl_ip'],param['pop_name'],param['dn1_mcvlan'],status='disable')3879 log.info('Successful in Removing mvlan in POP') 3880 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:3881 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 3882 log.info('sucessful in removing Single VLAN on dn')3883 sleep(60)3884 with steps.start('Verifying links',continue_=True) as step: 3885 log.info('Verify link status')3886 for i in range(0,5):3887 3888 sleep(5)3889 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3890 logger.info(data)3891 if data["is_alive"] == True: 3892 logger.info('Link is Up') 3893 break3894 elif i == 4:3895 if data["is_alive"] == True:3896 logger.info('Link is Up')3897 else:3898 assert False3899 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3900 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')3901 log.info('Successful in configuring vlan in Server')3902 3903 with steps.start('Removing IP in client',continue_=True) as step:3904 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3905 log.info('Successful in Removing IP in Client')3906class Single_Data_Vlan_Single_Different_Management_Vlan(aetest.Testcase):3907 def Capturing_Server_interface(self,server,server_inf,server_file):3908 assert misc.capture_interface(server,server_inf,server_file)3909 3910 def Verify_traffic(self,client,server_data_ipv4):3911 log.info('Starting iperf client')3912 up,down=misc.config_iperf_client(client,server_data_ipv4)3913 assert ((up != 0.0) and (down != 0.0))3914 @aetest.setup3915 def setup_vlan(self,steps,ctrl,server,client,**param):3916 with steps.start('Verifying links',continue_=True) as step: 3917 log.info('Verify link status')3918 for i in range(0,5):3919 3920 sleep(5)3921 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3922 logger.info(data)3923 if data["is_alive"] == True: 3924 logger.info('Link is Up') 3925 break3926 elif i == 4:3927 if data["is_alive"] == True:3928 logger.info('Link is Up')3929 else:3930 assert False3931 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:3932 assert api.config_single_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'])3933 log.info('Successful in configuring mvlan in DN')3934 assert api.config_single_mvlan(param['ctrl_ip'],param['pop_name'],param['pop_mcvlan'])3935 log.info('Successful in configuring mvlan in POP')3936 with steps.start('Configure Q VLAN in dn',continue_=True) as step:3937 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 3938 log.info('sucessful in Enabling Single VLAN on dn')3939 sleep(60)3940 with steps.start('Verifying links',continue_=True) as step: 3941 log.info('Verify link status')3942 for i in range(0,5):3943 3944 sleep(5)3945 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])3946 logger.info(data)3947 if data["is_alive"] == True: 3948 logger.info('Link is Up') 3949 break3950 elif i == 4:3951 if data["is_alive"] == True:3952 logger.info('Link is Up')3953 else:3954 assert False3955 3956 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3957 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])3958 log.info('Successful in configuring vlan in Server')3959 3960 3961 3962 with steps.start('Configure Q VLAN in Server',continue_=True) as step:3963 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])3964 log.info('Successful in configuring vlan in Server')3965 3966 #Configure IP on client PC3967 with steps.start('Configure IP in client',continue_=True) as step: 3968 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])3969 log.info('Successful in configuring IP in Client')3970 3971 3972 @ aetest.test3973 def verification(self,steps,ctrl,server,client,**param):3974 3975 sleep(10)3976 with steps.start('Verifying GUI page of DN',continue_=True) as step:3977 assert misc.verify_web_page(server,param['dn1_management_ip'])3978 log.info('Successful in verifying DN1 GUI with MVLAN')3979 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3980 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')3981 log.info('Successful in Removing vlan in Server')3982 3983 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3984 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'])3985 log.info('Successful in configuring vlan in Server')3986 sleep(10)3987 with steps.start('Verifying GUI page of POP',continue_=True) as step:3988 assert misc.verify_web_page(server,param['pop_management_ip'])3989 log.info('Successful in verifying POP GUI with MVLAN')3990 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3991 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'],status='disable')3992 log.info('Successful in Removing vlan in Server')3993 with steps.start('Capturing and verifying traffic',continue_=True) as step:3994 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))3995 p1.start()3996 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))3997 p2.start()3998 p1.join()3999 p2.join()4000 with steps.start('Analyse Capture',continue_=True) as step:4001 ip = param['client_data_ipv4'].rsplit('/', 1)[0]4002 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])4003 res=misc.analyse_capture(server,filter,param['server_file'])4004 if res > 0:4005 log.info('Successful in VLAN tagging')4006 else:4007 assert False4008 @aetest.cleanup4009 def removing_vlan_config(self,steps,ctrl,server,client,**param):4010 4011 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:4012 assert api.config_single_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'],status='disable')4013 log.info('Successful in Removing mvlan in DN')4014 assert api.config_single_mvlan(param['ctrl_ip'],param['pop_name'],param['pop_mcvlan'],status='disable')4015 log.info('Successful in Removing mvlan in POP') 4016 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:4017 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 4018 log.info('sucessful in removing Single VLAN on dn')4019 sleep(60)4020 with steps.start('Verifying links',continue_=True) as step: 4021 log.info('Verify link status')4022 for i in range(0,5):4023 4024 sleep(5)4025 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4026 logger.info(data)4027 if data["is_alive"] == True: 4028 logger.info('Link is Up') 4029 break4030 elif i == 4:4031 if data["is_alive"] == True:4032 logger.info('Link is Up')4033 else:4034 assert False4035 with steps.start('Removing Q VLAN in Server',continue_=True) as step:4036 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')4037 log.info('Successful in configuring vlan in Server')4038 4039 with steps.start('Removing IP in client',continue_=True) as step:4040 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')4041 log.info('Successful in Removing IP in Client')4042@aetest.loop(etype = ['0x8100', '0x88A8'])4043class Single_Data_Vlan_Double_Same_Management_Vlan(aetest.Testcase):4044 def Capturing_Server_interface(self,server,server_inf,server_file):4045 assert misc.capture_interface(server,server_inf,server_file)4046 4047 def Verify_traffic(self,client,server_data_ipv4):4048 log.info('Starting iperf client')4049 up,down=misc.config_iperf_client(client,server_data_ipv4)4050 assert ((up != 0.0) and (down != 0.0))4051 @aetest.setup4052 def setup_vlan(self,steps,ctrl,server,client,etype,**param):4053 with steps.start('Verifying links',continue_=True) as step: 4054 log.info('Verify link status')4055 for i in range(0,5):4056 4057 sleep(5)4058 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4059 logger.info(data)4060 if data["is_alive"] == True: 4061 logger.info('Link is Up') 4062 break4063 elif i == 4:4064 if data["is_alive"] == True:4065 logger.info('Link is Up')4066 else:4067 assert False4068 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:4069 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')4070 log.info('Successful in configuring QinQ mvlan on DN1')4071 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')4072 log.info('Successful in configuring QinQ mvlan on POP')4073 with steps.start('Configure Q VLAN in dn',continue_=True) as step:4074 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 4075 log.info('sucessful in Enabling Single VLAN on dn')4076 sleep(60)4077 with steps.start('Verifying links',continue_=True) as step: 4078 log.info('Verify link status')4079 for i in range(0,5):4080 4081 sleep(5)4082 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4083 logger.info(data)4084 if data["is_alive"] == True: 4085 logger.info('Link is Up') 4086 break4087 elif i == 4:4088 if data["is_alive"] == True:4089 logger.info('Link is Up')4090 else:4091 assert False4092 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:4093 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')4094 4095 4096 4097 with steps.start('Configure Q VLAN in Server',continue_=True) as step:4098 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])4099 log.info('Successful in configuring vlan in Server')4100 4101 #Configure IP on client PC4102 with steps.start('Configure IP in client',continue_=True) as step: 4103 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])4104 log.info('Successful in configuring IP in Client')4105 4106 4107 @ aetest.test4108 def verify_gui_page(self,steps,ctrl,server,client,etype,**param):4109 sleep(10)4110 with steps.start('Verifying GUI page of POP',continue_=True) as step:4111 assert misc.verify_web_page(server,param['pop_management_ip'])4112 log.info('Successful in verifying POP GUI with MVLAN')4113 with steps.start('Verifying GUI page of DN',continue_=True) as step:4114 assert misc.verify_web_page(server,param['dn1_management_ip'])4115 log.info('Successful in verifying DN1 GUI with MVLAN')4116 with steps.start('Capturing and verifying traffic',continue_=True) as step:4117 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))4118 p1.start()4119 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))4120 p2.start()4121 p1.join()4122 p2.join()4123 with steps.start('Analyse Capture',continue_=True) as step:4124 ip = param['client_data_ipv4'].rsplit('/', 1)[0]4125 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])4126 res=misc.analyse_capture(server,filter,param['server_file'])4127 if res > 0:4128 log.info('Successful in VLAN tagging')4129 else:4130 assert False4131 @aetest.cleanup4132 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):4133 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:4134 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')4135 log.info('Successful in configuring QinQ mvlan on DN1')4136 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')4137 log.info('Successful in configuring QinQ mvlan on POP')4138 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:4139 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 4140 log.info('sucessful in removing Single VLAN on dn')4141 4142 sleep(60)4143 with steps.start('Verifying links',continue_=True) as step: 4144 log.info('Verify link status')4145 for i in range(0,5):4146 4147 sleep(5)4148 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4149 logger.info(data)4150 if data["is_alive"] == True: 4151 logger.info('Link is Up') 4152 break4153 elif i == 4:4154 if data["is_alive"] == True:4155 logger.info('Link is Up')4156 else:4157 assert False4158 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:4159 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable') 4160 with steps.start('Removing Q VLAN in Server',continue_=True) as step:4161 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')4162 log.info('Successful in configuring vlan in Server')4163 4164 with steps.start('Removing IP in client',continue_=True) as step:4165 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')4166 log.info('Successful in Removing IP in Client')4167@aetest.loop(etype = ['0x8100', '0x88A8'])4168class Single_Data_Vlan_Double_Different_Management_Vlan(aetest.Testcase):4169 def Capturing_Server_interface(self,server,server_inf,server_file):4170 assert misc.capture_interface(server,server_inf,server_file)4171 4172 def Verify_traffic(self,client,server_data_ipv4):4173 log.info('Starting iperf client')4174 up,down=misc.config_iperf_client(client,server_data_ipv4)4175 assert ((up != 0.0) and (down != 0.0))4176 @aetest.setup4177 def setup_vlan(self,steps,ctrl,server,client,etype,**param):4178 with steps.start('Verifying links',continue_=True) as step: 4179 log.info('Verify link status')4180 for i in range(0,5):4181 4182 sleep(5)4183 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4184 logger.info(data)4185 if data["is_alive"] == True: 4186 logger.info('Link is Up') 4187 break4188 elif i == 4:4189 if data["is_alive"] == True:4190 logger.info('Link is Up')4191 else:4192 assert False4193 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:4194 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')4195 log.info('Successful in configuring QinQ mvlan on DN1')4196 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['pop_name'],param['pop_mcvlan'],param['pop_msvlan'],ethertype=etype,status='enable')4197 log.info('Successful in configuring QinQ mvlan on POP')4198 with steps.start('Configure Q VLAN in dn',continue_=True) as step:4199 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 4200 log.info('sucessful in Enabling Single VLAN on dn')4201 sleep(60)4202 with steps.start('Verifying links',continue_=True) as step: 4203 log.info('Verify link status')4204 for i in range(0,5):4205 4206 sleep(5)4207 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4208 logger.info(data)4209 if data["is_alive"] == True: 4210 logger.info('Link is Up') 4211 break4212 elif i == 4:4213 if data["is_alive"] == True:4214 logger.info('Link is Up')4215 else:4216 assert False4217 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:4218 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')4219 4220 4221 4222 with steps.start('Configure Q VLAN in Server',continue_=True) as step:4223 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])4224 log.info('Successful in configuring vlan in Server')4225 4226 #Configure IP on client PC4227 with steps.start('Configure IP in client',continue_=True) as step: 4228 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])4229 log.info('Successful in configuring IP in Client')4230 4231 4232 @ aetest.test4233 def verify_gui_page(self,steps,ctrl,server,client,etype,**param):4234 sleep(10)4235 with steps.start('Verifying GUI page of DN',continue_=True) as step:4236 assert misc.verify_web_page(server,param['dn1_management_ip'])4237 log.info('Successful in verifying DN1 GUI with MVLAN')4238 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:4239 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable') 4240 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:4241 assert misc.config_QinQ(server,param['server_inf'],param['pop_mcvlan'],param['pop_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')4242 sleep(10)4243 with steps.start('Verifying GUI page of POP',continue_=True) as step:4244 assert misc.verify_web_page(server,param['pop_management_ip'])4245 log.info('Successful in verifying POP GUI with MVLAN')4246 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:4247 assert misc.config_QinQ(server,param['server_inf'],param['pop_mcvlan'],param['pop_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable') 4248 with steps.start('Capturing and verifying traffic',continue_=True) as step:4249 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))4250 p1.start()4251 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))4252 p2.start()4253 p1.join()4254 p2.join()4255 with steps.start('Analyse Capture',continue_=True) as step:4256 ip = param['client_data_ipv4'].rsplit('/', 1)[0]4257 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])4258 res=misc.analyse_capture(server,filter,param['server_file'])4259 if res > 0:4260 log.info('Successful in VLAN tagging')4261 else:4262 assert False4263 @aetest.cleanup4264 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):4265 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:4266 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')4267 log.info('Successful in configuring QinQ mvlan on DN1')4268 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')4269 log.info('Successful in configuring QinQ mvlan on POP')4270 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:4271 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 4272 log.info('sucessful in removing Single VLAN on dn')4273 4274 sleep(60)4275 with steps.start('Verifying links',continue_=True) as step: 4276 log.info('Verify link status')4277 for i in range(0,5):4278 4279 sleep(5)4280 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4281 logger.info(data)4282 if data["is_alive"] == True: 4283 logger.info('Link is Up') 4284 break4285 elif i == 4:4286 if data["is_alive"] == True:4287 logger.info('Link is Up')4288 else:4289 assert False4290 with steps.start('Removing Q VLAN in Server',continue_=True) as step:4291 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')4292 log.info('Successful in configuring vlan in Server')4293 4294 with steps.start('Removing IP in client',continue_=True) as step:4295 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')4296 log.info('Successful in Removing IP in Client')4297class Same_Single_Vlan_On_Data_Management(aetest.Testcase):4298 def Capturing_Server_interface(self,server,server_inf,server_file):4299 assert misc.capture_interface(server,server_inf,server_file)4300 4301 def Verify_traffic(self,client,server_data_ipv4):4302 log.info('Starting iperf client')4303 up,down=misc.config_iperf_client(client,server_data_ipv4)4304 assert ((up != 0.0) and (down != 0.0))4305 @aetest.setup4306 def setup_vlan(self,steps,ctrl,server,**param):4307 with steps.start('Verifying links',continue_=True) as step: 4308 log.info('Verify link status')4309 for i in range(0,5):4310 4311 sleep(5)4312 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4313 logger.info(data)4314 if data["is_alive"] == True: 4315 logger.info('Link is Up') 4316 break4317 elif i == 4:4318 if data["is_alive"] == True:4319 logger.info('Link is Up')4320 else:4321 assert False4322 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:4323 assert api.config_single_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'])4324 log.info('Successful in configuring mvlan in DN')4325 assert api.config_single_mvlan(param['ctrl_ip'],param['pop_name'],param['dn1_mcvlan'])4326 log.info('Successful in configuring mvlan in POP')4327 sleep(60)4328 with steps.start('Verifying links',continue_=True) as step: 4329 log.info('Verify link status')4330 for i in range(0,5):4331 4332 sleep(5)4333 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4334 logger.info(data)4335 if data["is_alive"] == True: 4336 logger.info('Link is Up') 4337 break4338 elif i == 4:4339 if data["is_alive"] == True:4340 logger.info('Link is Up')4341 else:4342 assert False4343 4344 with steps.start('Configuring MVLAN on Server',continue_=True) as step:4345 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])4346 log.info('Successful in configuring vlan in Server')4347 4348 4349 @ aetest.test4350 def verify_gui_page(self,steps,ctrl,server,client,**param):4351 sleep(10)4352 with steps.start('Verifying GUI page of POP',continue_=True) as step:4353 assert misc.verify_web_page(server,param['pop_management_ip'])4354 log.info('Successful in verifying POP GUI with MVLAN')4355 with steps.start('Verifying GUI page of DN',continue_=True) as step:4356 assert misc.verify_web_page(server,param['dn1_management_ip'])4357 log.info('Successful in verifying DN1 GUI with MVLAN')4358 with steps.start('Removing Q VLAN in Server',continue_=True) as step:4359 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')4360 log.info('Successful in Removing vlan in Server')4361 with steps.start('Configure Q VLAN in dn',continue_=True) as step:4362 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_mcvlan'],vlan_prio='7',status='enable') 4363 log.info('sucessful in Enabling Single VLAN on dn')4364 sleep(60)4365 with steps.start('Verifying links',continue_=True) as step: 4366 log.info('Verify link status')4367 for i in range(0,5):4368 4369 sleep(5)4370 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4371 logger.info(data)4372 if data["is_alive"] == True: 4373 logger.info('Link is Up') 4374 break4375 elif i == 4:4376 if data["is_alive"] == True:4377 logger.info('Link is Up')4378 else:4379 assert False4380 4381 4382 with steps.start('Configure Q VLAN in Server',continue_=True) as step:4383 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_data_ipv4'])4384 log.info('Successful in configuring vlan in Server')4385 4386 #Configure IP on client PC4387 with steps.start('Configure IP in client',continue_=True) as step: 4388 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])4389 log.info('Successful in configuring IP in Client')4390 4391 with steps.start('Capturing and verifying traffic',continue_=True) as step:4392 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))4393 p1.start()4394 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))4395 p2.start()4396 p1.join()4397 p2.join()4398 with steps.start('Analyse Capture',continue_=True) as step:4399 ip = param['client_data_ipv4'].rsplit('/', 1)[0]4400 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_mcvlan'])4401 res=misc.analyse_capture(server,filter,param['server_file'])4402 if res > 0:4403 log.info('Successful in VLAN tagging')4404 else:4405 assert False4406 @aetest.cleanup4407 def removing_vlan_config(self,steps,ctrl,server,client,**param):4408 4409 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:4410 assert api.config_single_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'],status='disable')4411 log.info('Successful in Removing mvlan in DN')4412 assert api.config_single_mvlan(param['ctrl_ip'],param['pop_name'],param['dn1_mcvlan'],status='disable')4413 log.info('Successful in Removing mvlan in POP') 4414 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:4415 assert api.config_single_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_mcvlan'],status='disable') 4416 log.info('sucessful in removing Single VLAN on dn') 4417 sleep(60)4418 with steps.start('Verifying links',continue_=True) as step: 4419 log.info('Verify link status')4420 for i in range(0,5):4421 4422 sleep(5)4423 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4424 logger.info(data)4425 if data["is_alive"] == True: 4426 logger.info('Link is Up') 4427 break4428 elif i == 4:4429 if data["is_alive"] == True:4430 logger.info('Link is Up')4431 else:4432 assert False 4433 with steps.start('Removing Q VLAN in Server',continue_=True) as step:4434 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_data_ipv4'],status='disable')4435 log.info('Successful in configuring vlan in Server')4436 4437 with steps.start('Removing IP in client',continue_=True) as step:4438 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')4439 log.info('Successful in Removing IP in Client')4440@aetest.loop(etype = ['0x8100', '0x88A8'])4441class Double_Data_Vlan_Single_Same_Management_Vlan(aetest.Testcase):4442 def Capturing_Server_interface(self,server,server_inf,server_file):4443 assert misc.capture_interface(server,server_inf,server_file)4444 4445 def Verify_traffic(self,client,server_data_ipv4):4446 log.info('Starting iperf client')4447 up,down=misc.config_iperf_client(client,server_data_ipv4)4448 assert ((up != 0.0) and (down != 0.0))4449 4450 @aetest.setup4451 def setup_vlan(self,steps,ctrl,server,client,etype,**param):4452 with steps.start('Verifying links',continue_=True) as step: 4453 log.info('Verify link status')4454 for i in range(0,5):4455 4456 sleep(5)4457 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4458 logger.info(data)4459 if data["is_alive"] == True: 4460 logger.info('Link is Up') 4461 break4462 elif i == 4:4463 if data["is_alive"] == True:4464 logger.info('Link is Up')4465 else:4466 assert False4467 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:4468 assert api.config_single_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'])4469 log.info('Successful in configuring mvlan in DN')4470 assert api.config_single_mvlan(param['ctrl_ip'],param['pop_name'],param['dn1_mcvlan'])4471 log.info('Successful in configuring mvlan in POP')4472 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:4473 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 4474 log.info('sucessful in Enabling Double VLAN on dn')4475 sleep(60)4476 with steps.start('Verifying links',continue_=True) as step: 4477 log.info('Verify link status')4478 for i in range(0,5):4479 4480 sleep(5)4481 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4482 logger.info(data)4483 if data["is_alive"] == True: 4484 logger.info('Link is Up') 4485 break4486 elif i == 4:4487 if data["is_alive"] == True:4488 logger.info('Link is Up')4489 else:4490 assert False 4491 4492 with steps.start('Configuring MVLAN on Server',continue_=True) as step:4493 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])4494 log.info('Successful in configuring vlan in Server')4495 4496 4497 4498 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:4499 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)4500 log.info('Successful in configuring vlan in Server')4501 4502 #Configure IP on client PC4503 with steps.start('Configure IP in client',continue_=True) as step: 4504 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])4505 log.info('Successful in configuring IP in Client')4506 4507 4508 4509 4510 4511 @ aetest.test4512 def verifyication(self,steps,ctrl,server,client,etype,**param):4513 sleep(10)4514 with steps.start('Verifying GUI page of POP',continue_=True) as step:4515 assert misc.verify_web_page(server,param['pop_management_ip'])4516 log.info('Successful in verifying POP GUI with MVLAN')4517 with steps.start('Verifying GUI page of DN',continue_=True) as step:4518 assert misc.verify_web_page(server,param['dn1_management_ip'])4519 log.info('Successful in verifying DN1 GUI with MVLAN')4520 with steps.start('Capturing and verifying traffic',continue_=True) as step:4521 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))4522 p1.start()4523 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))4524 p2.start()4525 p1.join()4526 p2.join()4527 with steps.start('Analyse Capture',continue_=True) as step:4528 if etype =='0x8100':4529 ip = param['client_data_ipv4'].rsplit('/', 1)[0]4530 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])4531 else:4532 ip = param['client_data_ipv4'].rsplit('/', 1)[0]4533 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])4534 res=misc.analyse_capture(server,filter,param['server_file'])4535 if res > 0:4536 log.info('Successful in QinQ VLAN tagging')4537 else:4538 assert False4539 @aetest.cleanup4540 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):4541 with steps.start('Removing Q VLAN in Server',continue_=True) as step:4542 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')4543 log.info('Successful in Removing vlan in Server')4544 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:4545 assert api.config_single_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'],status='disable')4546 log.info('Successful in Removing mvlan in DN')4547 assert api.config_single_mvlan(param['ctrl_ip'],param['pop_name'],param['dn1_mcvlan'],status='disable')4548 log.info('Successful in Removing mvlan in POP') 4549 with steps.start('Removing vlan configs from DN',continue_=True) as step:4550 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,status='disable') 4551 log.info('sucessful in Removing QinQ VLAN on dn')4552 sleep(60)4553 with steps.start('Verifying links',continue_=True) as step: 4554 log.info('Verify link status')4555 for i in range(0,5):4556 4557 sleep(5)4558 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4559 logger.info(data)4560 if data["is_alive"] == True: 4561 logger.info('Link is Up') 4562 break4563 elif i == 4:4564 if data["is_alive"] == True:4565 logger.info('Link is Up')4566 else:4567 assert False 4568 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:4569 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')4570 log.info('Successful in Removing vlan in Server')4571 4572 with steps.start('Configure IP in client',continue_=True) as step:4573 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')4574 log.info('Successful in configuring IP in Client')4575@aetest.loop(etype = ['0x8100', '0x88A8'])4576class Double_Data_Vlan_Single_Different_Management_Vlan(aetest.Testcase):4577 def Capturing_Server_interface(self,server,server_inf,server_file):4578 assert misc.capture_interface(server,server_inf,server_file)4579 4580 def Verify_traffic(self,client,server_data_ipv4):4581 log.info('Starting iperf client')4582 up,down=misc.config_iperf_client(client,server_data_ipv4)4583 assert ((up != 0.0) and (down != 0.0))4584 4585 @aetest.setup4586 def setup_vlan(self,steps,ctrl,server,client,etype,**param):4587 with steps.start('Verifying links',continue_=True) as step: 4588 log.info('Verify link status')4589 for i in range(0,5):4590 4591 sleep(5)4592 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4593 logger.info(data)4594 if data["is_alive"] == True: 4595 logger.info('Link is Up') 4596 break4597 elif i == 4:4598 if data["is_alive"] == True:4599 logger.info('Link is Up')4600 else:4601 assert False4602 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:4603 assert api.config_single_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'])4604 log.info('Successful in configuring mvlan in DN')4605 assert api.config_single_mvlan(param['ctrl_ip'],param['pop_name'],param['pop_mcvlan'])4606 log.info('Successful in configuring mvlan in POP')4607 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:4608 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 4609 log.info('sucessful in Enabling Double VLAN on dn')4610 sleep(60)4611 with steps.start('Verifying links',continue_=True) as step: 4612 log.info('Verify link status')4613 for i in range(0,5):4614 4615 sleep(5)4616 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4617 logger.info(data)4618 if data["is_alive"] == True: 4619 logger.info('Link is Up') 4620 break4621 elif i == 4:4622 if data["is_alive"] == True:4623 logger.info('Link is Up')4624 else:4625 assert False4626 4627 with steps.start('Configuring MVLAN on Server',continue_=True) as step:4628 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])4629 log.info('Successful in configuring vlan in Server')4630 4631 4632 4633 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:4634 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)4635 log.info('Successful in configuring vlan in Server')4636 4637 #Configure IP on client PC4638 with steps.start('Configure IP in client',continue_=True) as step: 4639 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])4640 log.info('Successful in configuring IP in Client')4641 @ aetest.test4642 def verifyication(self,steps,ctrl,server,client,etype,**param):4643 4644 sleep(10)4645 with steps.start('Verifying GUI page of DN',continue_=True) as step:4646 assert misc.verify_web_page(server,param['dn1_management_ip'])4647 log.info('Successful in verifying DN1 GUI with MVLAN')4648 with steps.start('Removing Q VLAN in Server',continue_=True) as step:4649 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')4650 log.info('Successful in Removing vlan in Server')4651 with steps.start('Configuring MVLAN on Server',continue_=True) as step:4652 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'])4653 log.info('Successful in configuring vlan in Server')4654 sleep(10)4655 with steps.start('Verifying GUI page of POP',continue_=True) as step:4656 assert misc.verify_web_page(server,param['pop_management_ip'])4657 log.info('Successful in verifying POP GUI with MVLAN')4658 with steps.start('Removing Q VLAN in Server',continue_=True) as step:4659 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'],status='disable')4660 log.info('Successful in Removing vlan in Server')4661 4662 with steps.start('Capturing and verifying traffic',continue_=True) as step:4663 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))4664 p1.start()4665 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))4666 p2.start()4667 p1.join()4668 p2.join()4669 with steps.start('Analyse Capture',continue_=True) as step:4670 if etype =='0x8100':4671 ip = param['client_data_ipv4'].rsplit('/', 1)[0]4672 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])4673 else:4674 ip = param['client_data_ipv4'].rsplit('/', 1)[0]4675 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])4676 res=misc.analyse_capture(server,filter,param['server_file'])4677 if res > 0:4678 log.info('Successful in QinQ VLAN tagging')4679 else:4680 assert False4681 @aetest.cleanup4682 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):4683 4684 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:4685 assert api.config_single_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'],status='disable')4686 log.info('Successful in Removing mvlan in DN')4687 assert api.config_single_mvlan(param['ctrl_ip'],param['pop_name'],param['pop_mcvlan'],status='disable')4688 log.info('Successful in Removing mvlan in POP') 4689 with steps.start('Removing vlan configs from server',continue_=True) as step:4690 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,status='disable') 4691 log.info('sucessful in Removing QinQ VLAN on dn') 4692 sleep(60)4693 with steps.start('Verifying links',continue_=True) as step: 4694 log.info('Verify link status')4695 for i in range(0,5):4696 4697 sleep(5)4698 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4699 logger.info(data)4700 if data["is_alive"] == True: 4701 logger.info('Link is Up') 4702 break4703 elif i == 4:4704 if data["is_alive"] == True:4705 logger.info('Link is Up')4706 else:4707 assert False4708 4709 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:4710 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')4711 log.info('Successful in Removing vlan in Server')4712 4713 with steps.start('Configure IP in client',continue_=True) as step:4714 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')4715 log.info('Successful in configuring IP in Client')4716@aetest.loop(etype = ['0x8100', '0x88A8'])4717class Same_Double_Vlan_On_Data_Management(aetest.Testcase):4718 def Capturing_Server_interface(self,server,server_inf,server_file):4719 assert misc.capture_interface(server,server_inf,server_file)4720 4721 def Verify_traffic(self,client,server_data_ipv4):4722 log.info('Starting iperf client')4723 up,down=misc.config_iperf_client(client,server_data_ipv4)4724 assert ((up != 0.0) and (down != 0.0))4725 4726 @aetest.setup4727 def setup_vlan(self,steps,ctrl,server,client,etype,**param):4728 with steps.start('Verifying links',continue_=True) as step: 4729 log.info('Verify link status')4730 for i in range(0,5):4731 4732 sleep(5)4733 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4734 logger.info(data)4735 if data["is_alive"] == True: 4736 logger.info('Link is Up') 4737 break4738 elif i == 4:4739 if data["is_alive"] == True:4740 logger.info('Link is Up')4741 else:4742 assert False4743 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:4744 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')4745 log.info('Successful in configuring QinQ mvlan on DN1')4746 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')4747 log.info('Successful in configuring QinQ mvlan on POP')4748 sleep(60)4749 with steps.start('Verifying links',continue_=True) as step: 4750 log.info('Verify link status')4751 for i in range(0,5):4752 4753 sleep(5)4754 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4755 logger.info(data)4756 if data["is_alive"] == True: 4757 logger.info('Link is Up') 4758 break4759 elif i == 4:4760 if data["is_alive"] == True:4761 logger.info('Link is Up')4762 else:4763 assert False4764 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:4765 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')4766 4767 @ aetest.test4768 def verifyication(self,steps,ctrl,server,client,etype,**param):4769 sleep(10)4770 with steps.start('Verifying POP GUI access',continue_=True) as step:4771 assert misc.verify_web_page(server,param['pop_management_ip'])4772 log.info('Successful in verifying POP GUI with MVLAN')4773 with steps.start('Verifying GUI page of DN',continue_=True) as step:4774 assert misc.verify_web_page(server,param['dn1_management_ip'])4775 log.info('Successful in verifying DN1 GUI with MVLAN')4776 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:4777 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable')4778 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:4779 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_mcvlan'],svlan=param['dn1_msvlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 4780 log.info('sucessful in Enabling Double VLAN on dn')4781 sleep(60)4782 with steps.start('Verifying links',continue_=True) as step: 4783 log.info('Verify link status')4784 for i in range(0,5):4785 4786 sleep(5)4787 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4788 logger.info(data)4789 if data["is_alive"] == True: 4790 logger.info('Link is Up') 4791 break4792 elif i == 4:4793 if data["is_alive"] == True:4794 logger.info('Link is Up')4795 else:4796 assert False4797 4798 4799 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:4800 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_data_ipv4'],ethertype=etype)4801 log.info('Successful in configuring vlan in Server')4802 4803 #Configure IP on client PC4804 with steps.start('Configure IP in client',continue_=True) as step: 4805 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])4806 log.info('Successful in configuring IP in Client')4807 with steps.start('Capturing and verifying traffic',continue_=True) as step:4808 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))4809 p1.start()4810 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))4811 p2.start()4812 p1.join()4813 p2.join()4814 with steps.start('Analyse Capture',continue_=True) as step:4815 if etype =='0x8100':4816 ip = param['client_data_ipv4'].rsplit('/', 1)[0]4817 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_mcvlan'],param['dn1_msvlan'])4818 else:4819 ip = param['client_data_ipv4'].rsplit('/', 1)[0]4820 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_mcvlan'],param['dn1_msvlan'])4821 res=misc.analyse_capture(server,filter,param['server_file'])4822 if res > 0:4823 log.info('Successful in QinQ VLAN tagging')4824 else:4825 assert False4826 @aetest.cleanup4827 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):4828 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:4829 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')4830 log.info('Successful in configuring QinQ mvlan on DN1')4831 assert api.config_QinQ_mvlan(param['ctrl_ip'],param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')4832 log.info('Successful in configuring QinQ mvlan on POP')4833 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:4834 assert api.config_double_vlan(param['ctrl_ip'],param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_mcvlan'],svlan=param['dn1_msvlan'],ethertype=etype,status='disable') 4835 log.info('sucessful in Removing QinQ VLAN on dn')4836 sleep(60)4837 with steps.start('Verifying links',continue_=True) as step: 4838 log.info('Verify link status')4839 for i in range(0,5):4840 4841 sleep(5)4842 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4843 logger.info(data)4844 if data["is_alive"] == True: 4845 logger.info('Link is Up') 4846 break4847 elif i == 4:4848 if data["is_alive"] == True:4849 logger.info('Link is Up')4850 else:4851 assert False4852 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:4853 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_data_ipv4'],ethertype=etype,status='disable')4854 log.info('Successful in Removing vlan in Server')4855 4856 with steps.start('Configure IP in client',continue_=True) as step:4857 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')4858 log.info('Successful in configuring IP in Client')4859class common_cleanup(aetest.CommonCleanup): 4860 @aetest.subsection4861 def Disabling_L2bridge(self,steps,ctrl,server,client,**param):4862 log.info('configuring l2bridge')4863 with steps.start('Disabling L2 bridge',continue_=True) as step:4864 assert api.config_l2_bridge(param['ctrl_ip'],status='false')4865 log.info('Successful in configuring l2bridge')4866 sleep(150) 4867 4868 4869 with steps.start('Verify link status',continue_=True) as step:4870 for i in range(0,5):4871 4872 sleep(5)4873 data = fetch_api.get_link_state(param['ctrl_ip'],param['link_name'])4874 logger.info(data)4875 if data["is_alive"] == True: 4876 logger.info('Link is Up') 4877 break4878 elif i == 4:4879 if data["is_alive"] == True:4880 logger.info('Link is Up')4881 else:4882 assert False4883 4884 @aetest.subsection4885 def deleting_node(self,steps,ctrl,server,client,**param):4886 assert api.del_node(param['ctrl_ip'],param['dn1_name']) 4887 log.info('Successful in deleting dn1')4888 4889 @aetest.subsection4890 def deleting_Site(self,steps,ctrl,server,client,**param):4891 assert api.del_site(param['ctrl_ip'],param['dn1_site'])4892 log.info('Successful in Deleting site')4893 4894 @aetest.subsection4895 def stopping_iperf_server(self,server,ctrl,client,**param):4896 assert misc.config_iperf_server(server,status='disable')4897 log.info('Successful in stopping iperf server')4898 4899 misc.execute_command(server,'rm index.html*')4900 misc.execute_command(server,'sudo ifconfig {} mtu 1500'.format(param['server_inf']))4901 misc.execute_command(client,'sudo ifconfig {} mtu 1500'.format(param['client_inf']))4902 server.disconnect()4903 client.disconnect()4904 4905 4906 4907if __name__ == '__main__': # pragma: no cover...

Full Screen

Full Screen

vlan_verify.py

Source:vlan_verify.py Github

copy

Full Screen

1# system imports2from os import chdir3from time import sleep4from datetime import datetime5import logging6import yaml7import sys8from pyats import aetest9from pyats.log.utils import banner10from genie import testbed11#from pyats.topology import loader12from multiprocessing import Process13log = logging.getLogger(__name__)14log.setLevel(logging.DEBUG)15#importing custom modules16from Config.config import *17from Fetch.fetch import *18from Misc.misc import misc19#Fetching input values from input.yaml20global lis21lis=[]22global lis123lis1=[]24class common_setup(aetest.CommonSetup): 25 @aetest.subsection26 def initial_configs(self,steps, testbed, **param):27 28 ref_pp = self.parent.parameters29 ref_pp['ctrl'] = testbed.devices[param['ctrl_alias']]30 ref_pp['dn'] = testbed.devices[param['dn_alias']]31 ref_pp['server'] = testbed.devices[param['server_alias']]32 ref_pp['client'] = testbed.devices[param['client_alias']]33 ref_pp['client2'] = testbed.devices[param['client2_alias']]34 ref_pp['client3'] = testbed.devices[param['client3_alias']]35 ref_pp['pop_name'] = ref_pp['ctrl'].custom['name']36 ref_pp['pop_mac'] = ref_pp['ctrl'].custom['mac']37 ref_pp['pop_iface'] = ref_pp['ctrl'].custom['iface']38 ref_pp['pop_iface'] = ref_pp['ctrl'].custom['iface']39 ref_pp['pop_mcvlan'] = ref_pp['ctrl'].custom['mcvlan']40 ref_pp['pop_msvlan'] = ref_pp['ctrl'].custom['msvlan']41 ref_pp['pop_management_ip']=ref_pp['ctrl'].custom['management_ip']42 ref_pp['path']=ref_pp['ctrl'].custom['location']43 44 ref_pp['dn1_name']=ref_pp['dn'].custom['name']45 ref_pp['dn1_site']=ref_pp['dn'].custom['site']46 ref_pp['dn1_lat'] = ref_pp['dn'].custom['lat']47 ref_pp['dn1_lon'] = ref_pp['dn'].custom['lon']48 ref_pp['dn1_alt'] = ref_pp['dn'].custom['alt']49 ref_pp['dn1_acc'] = ref_pp['dn'].custom['acc']50 ref_pp['dn1_inf'] = ref_pp['dn'].custom['inf']51 ref_pp['dn1_inf1'] = ref_pp['dn'].custom['inf1'] 52 ref_pp['dn1_mac'] = ref_pp['dn'].custom['mac']53 ref_pp['dn1_management_ip']=ref_pp['dn'].custom['management_ip']54 ref_pp['dn1_cvlan'] = ref_pp['dn'].custom['cvlan']55 ref_pp['dn1_svlan'] = ref_pp['dn'].custom['svlan']56 ref_pp['dn1_mcvlan'] = ref_pp['dn'].custom['mcvlan']57 ref_pp['dn1_msvlan'] = ref_pp['dn'].custom['msvlan']58 ref_pp['server_inf']=ref_pp['server'].custom['inf']59 ref_pp['server_data_ipv6']=ref_pp['server'].custom['ipv6']60 ref_pp['server_data_ipv4']=ref_pp['server'].custom['ipv4']61 ref_pp['server_mgmt_ipv4']=ref_pp['server'].custom['mgmt_ipv4']62 ref_pp['server_file']=ref_pp['server'].custom['capture_file']63 ref_pp['client_inf']=ref_pp['client'].custom['inf']64 ref_pp['client_data_ipv4']=ref_pp['client'].custom['ipv4']65 ref_pp['client2_inf']=ref_pp['client2'].custom['inf']66 ref_pp['client2_data_ipv4']=ref_pp['client2'].custom['ipv4']67 ref_pp['client3_inf']=ref_pp['client3'].custom['inf']68 ref_pp['client3_data_ipv4']=ref_pp['client3'].custom['ipv4']69 70 vlan=int(ref_pp['dn1_cvlan'])71 #global lis72 #lis=[]73 for i in range(0,5):74 lis.append(vlan+i)75 76 svlan=int(ref_pp['dn1_svlan'])77 #global lis178 #lis1=[]79 for i in range(0,5):80 lis1.append(svlan+i) 81 82 ref_pp['ctrl'].connect()83 ref_pp['server'].connect()84 ref_pp['client'].connect()85 86 @aetest.subsection87 def create_site(self,steps,ctrl,server,client,**param):88 misc.execute_command(server,'sudo ifconfig {} mtu 1492'.format(param['server_inf']))89 misc.execute_command(client,'sudo ifconfig {} mtu 1492'.format(param['client_inf']))90 log.info('Creating Site')91 assert cli.add_site(ctrl,param['dn1_site'],param['dn1_lat'],param['dn1_lon'],param['dn1_alt'],param['dn1_acc'])92 log.info('Successful in adding site')93 94 @aetest.subsection95 def Adding_node(self,steps,ctrl,server,client,**param):96 #Adding dn97 log.info('Adding dn1')98 assert cli.add_dn(ctrl,param['dn1_name'],param['dn1_site'],param['dn1_mac']) 99 log.info('Successful in adding dn1')100 101 @aetest.subsection102 def Adding_link(self,steps,ctrl,server,client,**param):103 #Adding link POP to dn1 link104 log.info('Adding link from controller')105 assert cli.add_link(ctrl,param['pop_name'],param['dn1_name'],param['pop_mac'],param['dn1_mac'],init_radio='radio1',resp_radio='radio1')106 log.info('Successful in Adding link') 107 log.info('Verify link status')108 @aetest.subsection109 def configuring_mgmt_ip(self,steps,ctrl,server,client,**param):110 with steps.start('Configuring Management ip on POP',continue_=True) as step:111 assert cli.config_management_ip(ctrl,param['pop_name'],param['pop_management_ip'])112 log.info('Successful in configuring Mgmt ip on POP')113 with steps.start('Configuring Management ip on DN',continue_=True) as step:114 assert cli.config_management_ip(ctrl,param['dn1_name'],param['dn1_management_ip'])115 log.info('Successful in configuring Mgmt ip on DN1')116 117 @aetest.subsection118 def start_iperf_server(self,steps,ctrl,server,client,**param):119 misc.config_iperf_server(server)120 @aetest.subsection121 def verify_links(self,steps,ctrl,server,client,**param): 122 log.info('Verify link status')123 for i in range(0,3):124 sleep(100)125 data = fetch_cli.fetch_topology(ctrl)126 verify = fetch_cli.link_status(data)127 if verify == True: 128 break129 elif i == 2: 130 assert verify131 132 133 log.info('Successful in bringing up')134 135 @aetest.subsection136 def configure_l2_bridge(self,steps,ctrl,server,client,**param):137 #configuring l2bridge138 log.info('configuring l2bridge')139 140 assert cli.modify_network_l2bridge(ctrl,state='enable')141 log.info('Successful in configuring l2bridge')142 ctrl.disconnect()143 sleep(150)144 ctrl.connect()145 @aetest.subsection146 def verify_links(self,steps,ctrl,server,client,**param):147 log.info('Verify link status')148 for i in range(0,3):149 sleep(100)150 data = fetch_cli.fetch_topology(ctrl)151 verify = fetch_cli.link_status(data)152 if verify == True:153 break154 elif i == 2:155 assert verify156 log.info('Successful in bringing up') 157 158 159 160class Q_Vlan(aetest.Testcase):161 def Capturing_Server_interface(self,server,server_inf,server_file):162 assert misc.capture_interface(server,server_inf,server_file)163 164 def Verify_traffic(self,client,server_data_ipv4):165 log.info('Starting iperf client')166 up,down=misc.config_iperf_client(client,server_data_ipv4)167 assert ((up != 0.0) and (down != 0.0))168 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))169 170 @aetest.setup171 def Setup(self, steps,ctrl,server,client,**param):172 with steps.start('Verifying links',continue_=True) as step: 173 log.info('Verify link status')174 for i in range(0,3):175 176 data = fetch_cli.fetch_topology(ctrl)177 verify = fetch_cli.link_status(data)178 if verify == True: 179 break180 elif i == 2: 181 assert verify182 sleep(100)183 184 with steps.start('Configure Q VLAN in dn',continue_=True) as step:185 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 186 log.info('sucessful in Enabling Single VLAN on dn')187 188 sleep(60)189 with steps.start('Verifying links',continue_=True) as step: 190 log.info('Verify link status')191 for i in range(0,3):192 193 data = fetch_cli.fetch_topology(ctrl)194 verify = fetch_cli.link_status(data)195 if verify == True: 196 break197 elif i == 2: 198 assert verify199 sleep(100)200 201 with steps.start('Configure Q VLAN in Server',continue_=True) as step:202 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])203 log.info('Successful in configuring vlan in Server')204 205 #Configure IP on client PC206 with steps.start('Configure IP in client',continue_=True) as step: 207 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])208 log.info('Successful in configuring IP in Client')209 210 211 212 with steps.start('Capturing and verifying traffic',continue_=True) as step:213 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))214 p1.start()215 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))216 p2.start()217 p1.join()218 p2.join()219 with steps.start('Analyse Capture',continue_=True) as step:220 ip = param['client_data_ipv4'].rsplit('/', 1)[0]221 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])222 res=misc.analyse_capture(server,filter,param['server_file'])223 if res > 0:224 log.info('Successful in VLAN tagging')225 else:226 assert False227 @aetest.cleanup228 def Disabling_Q_VLAN(self,steps,ctrl,server,client,**param):229 230 log.info('Disabling Single VLAN in dn')231 with steps.start('Configure Q VLAN in Server',continue_=True) as step:232 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')233 log.info('Successful in configuring vlan in Server')234 with steps.start('Removing vlan configs from server',continue_=True) as step:235 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 236 log.info('sucessful in Enabling Single VLAN on dn')237 with steps.start('Configure IP in client',continue_=True) as step:238 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')239 log.info('Successful in configuring IP in Client')240 sleep(60)241 with steps.start('Verifying links',continue_=True) as step: 242 log.info('Verify link status')243 for i in range(0,3):244 245 data = fetch_cli.fetch_topology(ctrl)246 verify = fetch_cli.link_status(data)247 if verify == True: 248 break249 elif i == 2: 250 assert verify251 sleep(100)252 253@aetest.loop(etype = ['0x8100', '0x88A8'])254class QinQ_Vlan(aetest.Testcase):255 def Capturing_Server_interface(self,server,server_inf,server_file):256 assert misc.capture_interface(server,server_inf,server_file)257 def Verify_traffic(self,client,server_data_ipv4):258 log.info('Starting iperf client')259 up,down=misc.config_iperf_client(client,server_data_ipv4)260 assert ((up != 0.0) and (down != 0.0))261 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))262 263 @aetest.setup264 def Configure_QinQ_Vlan(self, etype, steps,ctrl,server,client,**param):265 with steps.start('Verifying links',continue_=True) as step: 266 log.info('Verify link status')267 for i in range(0,3):268 269 data = fetch_cli.fetch_topology(ctrl)270 verify = fetch_cli.link_status(data)271 if verify == True: 272 break273 elif i == 2: 274 assert verify275 sleep(100)276 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:277 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 278 log.info('sucessful in Enabling Double VLAN on dn')279 sleep(60)280 with steps.start('Verifying links',continue_=True) as step: 281 log.info('Verify link status')282 for i in range(0,3):283 284 data = fetch_cli.fetch_topology(ctrl)285 verify = fetch_cli.link_status(data)286 if verify == True: 287 break288 elif i == 2: 289 assert verify290 sleep(100)291 292 293 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:294 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)295 log.info('Successful in configuring vlan in Server')296 297 #Configure IP on client PC298 with steps.start('Configure IP in client',continue_=True) as step: 299 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])300 log.info('Successful in configuring IP in Client')301 302 303 with steps.start('Capturing and verifying traffic',continue_=True) as step:304 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))305 p1.start()306 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))307 p2.start()308 p1.join()309 p2.join()310 with steps.start('Analyse Capture',continue_=True) as step:311 if etype =='0x8100':312 ip = param['client_data_ipv4'].rsplit('/', 1)[0]313 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])314 else:315 ip = param['client_data_ipv4'].rsplit('/', 1)[0]316 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])317 res=misc.analyse_capture(server,filter,param['server_file'])318 if res > 0:319 log.info('Successful in QinQ VLAN tagging')320 else:321 assert False322 323 324 325 @aetest.cleanup326 def Disabling_QinQ_VLAN(self,etype,steps,ctrl,server,client,**param):327 328 log.info('Disabling Double VLAN in dn')329 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:330 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')331 log.info('Successful in Removing vlan in Server')332 with steps.start('Removing vlan configs from DN',continue_=True) as step:333 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,status='disable') 334 log.info('sucessful in Removing QinQ VLAN on dn')335 336 sleep(60)337 with steps.start('Verifying links',continue_=True) as step: 338 log.info('Verify link status')339 for i in range(0,3):340 341 data = fetch_cli.fetch_topology(ctrl)342 verify = fetch_cli.link_status(data)343 if verify == True: 344 break345 elif i == 2: 346 assert verify347 sleep(100)348 with steps.start('Configure IP in client',continue_=True) as step:349 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')350 log.info('Successful in configuring IP in Client')351class Allowed_Q_Vlan(aetest.Testcase):352 353 @aetest.setup354 def Configure_Q_Vlan_allowed_list(self, steps,ctrl,server,client,**param):355 vlans='{},{}-{}'.format(lis[0],lis[1],lis[3])356 with steps.start('Verifying links',continue_=True) as step: 357 log.info('Verify link status')358 for i in range(0,3):359 360 data = fetch_cli.fetch_topology(ctrl)361 verify = fetch_cli.link_status(data)362 if verify == True: 363 break364 elif i == 2: 365 assert verify366 sleep(100)367 368 with steps.start('Configure Q VLAN in dn',continue_=True) as step:369 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=str(int(param['dn1_cvlan'])-1),status='enable') 370 log.info('sucessful in Enabling Single VLAN on dn')371 372 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:373 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='enable') 374 log.info('sucessful in configuring allowed q VLAN on dn')375 sleep(60)376 with steps.start('Verifying links',continue_=True) as step: 377 log.info('Verify link status')378 for i in range(0,3):379 380 data = fetch_cli.fetch_topology(ctrl)381 verify = fetch_cli.link_status(data)382 if verify == True: 383 break384 elif i == 2: 385 assert verify386 sleep(100)387 388 389 def test_untagged_packets(self,steps,ctrl,server,client,**param):390 with steps.start('Configure Q VLAN in Server',continue_=True) as step:391 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'])392 log.info('Successful in configuring vlan in Server')393 with steps.start('Configure IP in client',continue_=True) as step:394 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])395 log.info('Successful in configuring IP in Client')396 log.info('Starting iperf client')397 #sleep(20)398 with steps.start('Verifying Traffic',continue_=True) as step:399 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])400 assert ((up != 0.0) and (down != 0.0))401 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))402 with steps.start('Removing Q VLAN in Server',continue_=True) as step:403 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'],status='disable')404 log.info('Removing Q vlan in Server')405 with steps.start('Removing IP in client',continue_=True) as step:406 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')407 log.info('Successful in Removing IP in Client')408 @ aetest.test.loop(c_vlan=lis)409 def test_single_tagged_packets(self,c_vlan,steps,ctrl,server,client,**param):410 411 with steps.start('Configure Q VLAN in Server',continue_=True) as step:412 assert misc.config_Q(server,param['server_inf'],c_vlan,param['server_data_ipv4'])413 log.info('Successful in configuring vlan in Server')414 415 with steps.start('Configure Q VLAN in client',continue_=True) as step:416 assert misc.config_Q(client,param['client_inf'],c_vlan,param['client_data_ipv4'])417 log.info('Successful in configuring vlan in client')418 419 log.info('Starting iperf client')420 sleep(20) 421 with steps.start('Verifying Traffic',continue_=True) as step:422 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])423 result=((up != 0.0) and (down != 0.0))424 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))425 if c_vlan==int(param['dn1_cvlan'])+4:426 if result == False:427 log.info('No traffic due to unallowed vlan')428 else:429 assert False430 else:431 assert result432 433 with steps.start('Removing Q VLAN in Server',continue_=True) as step:434 assert misc.config_Q(server,param['server_inf'],c_vlan,param['server_data_ipv4'],status='disable')435 log.info('Removing Q vlan in Server')436 437 with steps.start('Removing Q VLAN in client',continue_=True) as step:438 assert misc.config_Q(client,param['client_inf'],c_vlan,param['client_data_ipv4'],status='disable')439 log.info('Removing Q vlan in client')440 441 442 443 444 445 446 @aetest.cleanup447 def VLAN_config_cleanup(self,steps,ctrl,server,client,**param):448 vlans='{},{}-{}'.format(lis[0],lis[1],lis[3])449 450 with steps.start('Remove Q VLAN in dn',continue_=True) as step:451 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id='1',status='disable') 452 log.info('sucessful in Removing Single VLAN on dn')453 454 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:455 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='disable') 456 log.info('sucessful in Removing allowed q VLAN on dn')457 sleep(60)458 with steps.start('Verifying links',continue_=True) as step: 459 log.info('Verify link status')460 for i in range(0,3):461 462 data = fetch_cli.fetch_topology(ctrl)463 verify = fetch_cli.link_status(data)464 if verify == True: 465 break466 elif i == 2: 467 assert verify468 sleep(100)469class Q_Vlan_Remarking(aetest.Testcase):470 471 @aetest.setup472 def Configure_Q_Vlan_allowed_list(self, steps,ctrl,server,client,**param):473 remark=int(param['dn1_cvlan'])+1474 with steps.start('Verifying links',continue_=True) as step: 475 log.info('Verify link status')476 for i in range(0,3):477 478 data = fetch_cli.fetch_topology(ctrl)479 verify = fetch_cli.link_status(data)480 if verify == True: 481 break482 elif i == 2: 483 assert verify484 sleep(100)485 486 with steps.start('Configure Q VLAN in dn',continue_=True) as step:487 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=str(int(param['dn1_cvlan'])-1),status='enable') 488 log.info('sucessful in Enabling Single VLAN on dn')489 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:490 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='enable') 491 log.info('sucessful in configuring allowed q VLAN on dn')492 493 with steps.start('Configuring Remark VLAN',continue_=True) as step:494 assert cli.config_vlan_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_cvlan'],remark)495 log.info('sucessful in Configuring Single VLAN Remarking on dn')496 sleep(60)497 with steps.start('Verifying links',continue_=True) as step: 498 log.info('Verify link status')499 for i in range(0,3):500 501 data = fetch_cli.fetch_topology(ctrl)502 verify = fetch_cli.link_status(data)503 if verify == True: 504 break505 elif i == 2: 506 assert verify507 sleep(100)508 @ aetest.test509 def test_untagged_packets(self,steps,ctrl,server,client,**param):510 with steps.start('Configure Q VLAN in Server',continue_=True) as step:511 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'])512 log.info('Successful in configuring vlan in Server')513 with steps.start('Configure IP in client',continue_=True) as step:514 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])515 log.info('Successful in configuring IP in Client') 516 with steps.start('Starting client iperf',continue_=True) as step:517 sleep(20) 518 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])519 assert ((up != 0) and (down != 0))520 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))521 522 523 with steps.start('Removing Q VLAN in Server',continue_=True) as step:524 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'],status='disable')525 log.info('Removing Q vlan in Server')526 with steps.start('Removing IP in client',continue_=True) as step:527 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')528 log.info('Successful in Removing IP in Client')529 @ aetest.test530 def test_single_tagged_packets(self,steps,ctrl,server,client,**param):531 remark=int(param['dn1_cvlan'])+1532 with steps.start('Configure Q VLAN in Server',continue_=True) as step:533 assert misc.config_Q(server,param['server_inf'],remark,param['server_data_ipv4'])534 log.info('Successful in configuring vlan in Server')535 with steps.start('Configure Q VLAN in client',continue_=True) as step:536 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'])537 log.info('Successful in configuring vlan in client')538 with steps.start('Starting client iperf',continue_=True) as step:539 sleep(20) 540 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])541 assert ((up != 0) and (down != 0))542 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))543 with steps.start('Removing Q VLAN in Server',continue_=True) as step:544 assert misc.config_Q(server,param['server_inf'],remark,param['server_data_ipv4'],status='disable')545 log.info('Removing Q vlan in Server')546 with steps.start('Removing Q VLAN in client',continue_=True) as step:547 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'],status='disable')548 log.info('Removing Q vlan in client') 549 @aetest.cleanup550 def Removing_configs_from_node_and_PCs(self,steps,ctrl,server,client,**param):551 remark=int(param['dn1_cvlan'])+1552 with steps.start('Removing Q VLAN in dn',continue_=True) as step:553 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id='1',status='disable') 554 log.info('sucessful in Removing Single VLAN on dn')555 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:556 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='disable') 557 log.info('sucessful in Removing allowed q VLAN on dn')558 559 with steps.start('Removing Remark VLAN',continue_=True) as step:560 assert cli.config_vlan_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_cvlan'],remark,status='disable')561 log.info('sucessful in Removing Single VLAN Remarking on dn')562 sleep(60)563 with steps.start('Verifying links',continue_=True) as step: 564 log.info('Verify link status')565 for i in range(0,3):566 567 data = fetch_cli.fetch_topology(ctrl)568 verify = fetch_cli.link_status(data)569 if verify == True: 570 break571 elif i == 2: 572 assert verify573 sleep(100)574class Q_Vlan_Drop_Untag(aetest.Testcase):575 576 @aetest.setup577 def Configure_Q_Vlan(self, steps,ctrl,server,client,**param):578 with steps.start('Verifying links',continue_=True) as step: 579 log.info('Verify link status')580 for i in range(0,3):581 582 data = fetch_cli.fetch_topology(ctrl)583 verify = fetch_cli.link_status(data)584 if verify == True: 585 break586 elif i == 2: 587 assert verify588 sleep(100)589 with steps.start('Configure Q VLAN in dn',continue_=True) as step:590 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=str(int(param['dn1_cvlan'])-1),status='enable') 591 log.info('sucessful in Enabling Single VLAN on dn')592 593 with steps.start('Configure drop untag packets in Q VLAN',continue_=True) as step:594 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='enable') 595 log.info('sucessful in configuring Drop untag VLAN')596 597 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:598 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='enable') 599 log.info('sucessful in configuring allowed q VLAN on dn') 600 sleep(60)601 with steps.start('Verifying links',continue_=True) as step: 602 log.info('Verify link status')603 for i in range(0,3):604 605 data = fetch_cli.fetch_topology(ctrl)606 verify = fetch_cli.link_status(data)607 if verify == True: 608 break609 elif i == 2: 610 assert verify611 sleep(100)612 @ aetest.test613 def test_untagged_packets(self,steps,ctrl,server,client,**param):614 with steps.start('Configure Q VLAN in Server',continue_=True) as step:615 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'])616 log.info('Successful in configuring vlan in Server')617 618 #Configure IP on client PC619 with steps.start('Configure IP in client',continue_=True) as step: 620 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])621 log.info('Successful in configuring IP in Client')622 623 624 with steps.start('Starting iperf in client',continue_=True) as step:625 sleep(20) 626 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])627 result=((up != 0.0) and (down != 0.0))628 if result == False:629 log.info('Traffic Failed due to drop untag')630 else:631 log.info('Failed to drop untagged packets')632 assert False633 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 634 635 636 with steps.start('Configure Q VLAN in Server',continue_=True) as step:637 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'],status='disable')638 log.info('Successful in configuring vlan in Server')639 with steps.start('Removing IP in client',continue_=True) as step:640 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')641 log.info('Successful in Removing IP in Client')642 643 @ aetest.test644 def test_single_tagged_packets(self,steps,ctrl,server,client,**param):645 with steps.start('Configure Q VLAN in Server',continue_=True) as step:646 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])647 log.info('Successful in configuring vlan in Server')648 649 with steps.start('Configure Q VLAN in client',continue_=True) as step:650 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'])651 log.info('Successful in configuring vlan in client')652 653 with steps.start('Starting iperf in client',continue_=True) as step:654 sleep(20) 655 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])656 assert ((up != 0.0) and (down != 0.0))657 log.info('througput numbers up={} down={}'.format(up,down)) 658 with steps.start('Removing Q VLAN in Server',continue_=True) as step:659 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')660 log.info('Successful in Removing vlan in Server')661 662 with steps.start('Removing Q VLAN in client',continue_=True) as step:663 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'],status='disable')664 log.info('Removing Q vlan in client')665 @aetest.cleanup666 def Disabling_Q_VLAN_configs(self,steps,ctrl,server,client,**param):667 668 log.info('Disabling Single VLAN in dn')669 with steps.start('Removing drop untag packets in Q VLAN',continue_=True) as step:670 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 671 log.info('sucessful in Removing Drop untag VLAN')672 with steps.start('Removing vlan configs from dn',continue_=True) as step:673 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 674 log.info('sucessful in Enabling Single VLAN on dn')675 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:676 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='disable') 677 log.info('sucessful in Removing allowed q VLAN on dn')678 sleep(60)679 with steps.start('Verifying links',continue_=True) as step: 680 log.info('Verify link status')681 for i in range(0,3):682 683 data = fetch_cli.fetch_topology(ctrl)684 verify = fetch_cli.link_status(data)685 if verify == True: 686 break687 elif i == 2: 688 assert verify689 sleep(100)690 691class Q_Vlan_Priority_Remarking(aetest.Testcase):692 693 def Capturing_Server_interface(self,server,server_inf,server_file):694 assert misc.capture_interface(server,server_inf,server_file)695 def Verify_traffic(self,client,server_data_ipv4):696 log.info('Starting iperf client')697 up,down=misc.config_iperf_client(client,server_data_ipv4)698 assert ((up != 0.0) and (down != 0.0))699 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))700 701 @aetest.setup702 def Configure_Q_Vlan(self, steps,ctrl,server,client,**param):703 704 with steps.start('Verifying links',continue_=True) as step: 705 log.info('Verify link status')706 for i in range(0,3):707 708 data = fetch_cli.fetch_topology(ctrl)709 verify = fetch_cli.link_status(data)710 if verify == True: 711 break712 elif i == 2: 713 assert verify714 sleep(100)715 716 with steps.start('Configure Q VLAN in dn',continue_=True) as step:717 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=str(int(param['dn1_cvlan'])-1),status='enable') 718 log.info('sucessful in Enabling Single VLAN on dn')719 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:720 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='enable') 721 log.info('sucessful in configuring allowed q VLAN on dn')722 723 with steps.start('Configuring Remark VLAN priority',continue_=True) as step:724 assert cli.config_vlan_prio_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_cvlan'],'7')725 log.info('sucessful in Configuring Single VLAN priority Remarking on dn')726 sleep(60)727 with steps.start('Verifying links',continue_=True) as step: 728 log.info('Verify link status')729 for i in range(0,3):730 731 data = fetch_cli.fetch_topology(ctrl)732 verify = fetch_cli.link_status(data)733 if verify == True: 734 break735 elif i == 2: 736 assert verify737 sleep(100)738 @ aetest.test739 def test_untagged_packets(self,steps,ctrl,server,client,**param):740 with steps.start('Configure Q VLAN in Server',continue_=True) as step:741 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'])742 log.info('Successful in configuring vlan in Server')743 744 with steps.start('Configure IP in client',continue_=True) as step:745 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])746 log.info('Successful in configuring IP in Client')747 with steps.start('Capturing and verifying traffic',continue_=True) as step:748 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))749 p1.start()750 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))751 p2.start()752 p1.join()753 p2.join()754 755 with steps.start('Analyse Capture',continue_=True) as step:756 ip = param['client_data_ipv4'].rsplit('/', 1)[0]757 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==0'.format(ip,str(int(param['dn1_cvlan'])-1)) 758 res=misc.analyse_capture(server,filter,param['server_file'])759 if res > 0:760 log.info('Successful in priority remarking')761 else:762 assert False763 764 with steps.start('Removing Q VLAN in Server',continue_=True) as step:765 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'],status='disable')766 log.info('Removing Q vlan in Server')767 with steps.start('Removing IP in client',continue_=True) as step:768 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')769 log.info('Successful in Removing IP in Client') 770 771 @ aetest.test772 def test_single_tagged_packets(self,steps,ctrl,server,client,**param):773 774 with steps.start('Configure Q VLAN in Server',continue_=True) as step:775 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])776 log.info('Successful in configuring vlan in Server')777 with steps.start('Configure Q VLAN in client',continue_=True) as step:778 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'])779 log.info('Successful in configuring vlan in client')780 sleep(20)781 782 with steps.start('Capturing and verifying traffic',continue_=True) as step:783 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))784 p1.start()785 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))786 p2.start()787 p1.join()788 p2.join()789 with steps.start('Analyse Capture',continue_=True) as step:790 ip = param['client_data_ipv4'].rsplit('/', 1)[0]791 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])792 res=misc.analyse_capture(server,filter,param['server_file'])793 if res > 0:794 log.info('Successful in priority remarking')795 else:796 assert False797 with steps.start('Removing Q VLAN in Server',continue_=True) as step:798 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')799 log.info('Removing Q vlan in Server')800 801 with steps.start('Removing Q VLAN in client',continue_=True) as step:802 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'],status='disable')803 log.info('Removing Q vlan in client')804 @aetest.cleanup805 def Removing_configs_from_node_and_PCs(self,steps,ctrl,server,client,**param):806 with steps.start('Removing Q VLAN in dn',continue_=True) as step:807 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id='1',status='disable') 808 log.info('sucessful in Removing Single VLAN on dn')809 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:810 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='enable') 811 log.info('sucessful in Removing allowed q VLAN on dn')812 813 with steps.start('Removing Remark VLAN prio',continue_=True) as step:814 assert cli.config_vlan_prio_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_cvlan'],'7',status='disable')815 log.info('sucessful in Removing Single VLAN priority Remarking on dn')816 sleep(60)817 with steps.start('Verifying links',continue_=True) as step: 818 log.info('Verify link status')819 for i in range(0,3):820 821 data = fetch_cli.fetch_topology(ctrl)822 verify = fetch_cli.link_status(data)823 if verify == True: 824 break825 elif i == 2: 826 assert verify827 sleep(100)828@aetest.loop(etype = ['0x8100', '0x88A8'])829class Q_port_Behaviour_When_QinQ_Ingress(aetest.Testcase):830 @aetest.setup831 def Configure_Q_Vlan(self, steps,ctrl,server,client,etype,**param):832 with steps.start('Verifying links',continue_=True) as step: 833 log.info('Verify link status')834 for i in range(0,3):835 836 data = fetch_cli.fetch_topology(ctrl)837 verify = fetch_cli.link_status(data)838 if verify == True: 839 break840 elif i == 2: 841 assert verify842 sleep(100)843 with steps.start('Configure Q VLAN in dn',continue_=True) as step:844 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id='1',status='enable')845 log.info('sucessful in Enabling Single VLAN on dn')846 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:847 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')848 log.info('sucessful in configuring allowed q VLAN on dn')849 sleep(60)850 with steps.start('Verifying links',continue_=True) as step: 851 log.info('Verify link status')852 for i in range(0,3):853 854 data = fetch_cli.fetch_topology(ctrl)855 verify = fetch_cli.link_status(data)856 if verify == True: 857 break858 elif i == 2: 859 assert verify860 sleep(100)861 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:862 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)863 log.info('Successful in configuring vlan in Server')864 with steps.start('Configure QinQ VLAN in client',continue_=True) as step:865 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)866 log.info('Successful in configuring vlan in Server')867 @ aetest.test868 def Verify_traffic(self,steps,ctrl,server,client,**param):869 log.info('Starting iperf client')870 sleep(20)871 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])872 result=((up != 0.0) and (down != 0.0))873 if result == False:874 log.info('Traffic dropped due to double tagged packets')875 else:876 log.info('Failed to drop double tagged packets')877 assert False878 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))879 @aetest.cleanup880 def Removing_Vlan_configs(self, steps,ctrl,server,client,etype,**param):881 with steps.start('Removing Q VLAN in dn',continue_=True) as step:882 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id='1',status='disable')883 log.info('sucessful in Removing Single VLAN on dn')884 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:885 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')886 log.info('sucessful in Removing allowed q VLAN on dn')887 sleep(60)888 with steps.start('Verifying links',continue_=True) as step: 889 log.info('Verify link status')890 for i in range(0,3):891 892 data = fetch_cli.fetch_topology(ctrl)893 verify = fetch_cli.link_status(data)894 if verify == True: 895 break896 elif i == 2: 897 assert verify898 sleep(100)899 with steps.start('Remonving QinQ VLAN in Server',continue_=True) as step:900 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')901 log.info('Successful in Removing vlan in Server')902 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:903 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')904 log.info('Successful in Removing vlan in Server')905@aetest.loop(etype = ['0x8100', '0x88A8'])906class Allowed_QinQ_Vlan(aetest.Testcase):907 @aetest.setup908 def Configure_QinQ_Vlan_allowed_list(self, steps,ctrl,server,client,etype,**param):909 vlans='{},{}-{}'.format(lis1[0],lis1[1],lis1[3])910 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:911 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')912 log.info('sucessful in Enabling Single VLAN on dn')913 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:914 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='enable')915 log.info('sucessful in configuring allowed QinQ VLAN on dn')916 sleep(60)917 with steps.start('Verifying links',continue_=True) as step: 918 log.info('Verify link status')919 for i in range(0,3):920 921 data = fetch_cli.fetch_topology(ctrl)922 verify = fetch_cli.link_status(data)923 if verify == True: 924 break925 elif i == 2: 926 assert verify927 sleep(100)928 @ aetest.test929 def test_untagged_packets(self,steps,ctrl,server,client,etype,**parm):930 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:931 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)932 log.info('Successful in configuring vlan in Server')933 with steps.start('Configure IP in client',continue_=True) as step:934 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])935 log.info('Successful in configuring IP in Client')936 with steps.start('Starting iperf in client',continue_=True) as step:937 sleep(20)938 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])939 assert ((up != 0.0) and (down != 0.0))940 with steps.start('Removing Q VLAN in Server',continue_=True) as step:941 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')942 log.info('Successful in Removing vlan in Server')943 with steps.start('Removing IP in client',continue_=True) as step:944 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')945 log.info('Successful in Removing IP in Client') 946 @ aetest.test.loop(s_vlan=lis1)947 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,s_vlan,**param):948 949 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:950 assert misc.config_QinQ(server,param['server_inf'],s_vlan,str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)951 log.info('Successful in configuring vlan in Server')952 with steps.start('Configure Q VLAN in client',continue_=True) as step:953 assert misc.config_Q(client,param['client_inf'],s_vlan,param['client_data_ipv4'])954 log.info('Successful in configuring vlan in client')955 with steps.start('Verifying Traffic',continue_=True) as step:956 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])957 result=((up != 0.0) and (down != 0.0))958 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))959 if s_vlan==int(param['dn1_svlan'])+4:960 if result == False:961 log.info('No traffic due to unallowed vlan')962 else:963 assert False964 else:965 assert result966 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:967 assert misc.config_QinQ(server,param['server_inf'],s_vlan,str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')968 log.info('Successful in Removing vlan in Server')969 with steps.start('Removing Q VLAN in client',continue_=True) as step:970 assert misc.config_Q(client,param['client_inf'],s_vlan,param['client_data_ipv4'],status='disable')971 log.info('Removing Q vlan in client')972 @ aetest.test.loop(s_vlan=lis1)973 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,s_vlan,**param):974 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:975 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],s_vlan,param['server_data_ipv4'],ethertype=etype)976 log.info('Successful in configuring QinQ vlan in Server')977 with steps.start('Configure Q VLAN in client',continue_=True) as step:978 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],s_vlan,param['client_data_ipv4'],ethertype=etype)979 log.info('Successful in configuring QinQ vlan in client')980 log.info('Starting iperf client')981 sleep(20)982 with steps.start('Verifying Traffic',continue_=True) as step:983 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])984 result=((up != 0.0) and (down != 0.0))985 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))986 if s_vlan==int(param['dn1_svlan'])+4:987 if result == False:988 log.info('No traffic due to unallowed vlan')989 else:990 assert False991 else:992 assert result993 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:994 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],s_vlan,param['server_data_ipv4'],status='disable')995 log.info('Removing QinQ vlan in Server')996 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:997 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],s_vlan,param['client_data_ipv4'],status='disable')998 log.info('Removing QiNQ vlan in client')999 @aetest.cleanup1000 def VLAN_config_cleanup(self,steps,ctrl,server,client,etype,**param):1001 vlans='{},{}-{}'.format(lis1[0],lis1[1],lis1[3])1002 with steps.start('Remove QinQ VLAN in dn',continue_=True) as step:1003 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan='1',cvlan='1',ethertype=etype,status='disable')1004 log.info('sucessful in Removing Double VLAN on dn')1005 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1006 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='disable')1007 log.info('sucessful in Removing allowed QinQ VLAN on dn')1008 sleep(60)1009 with steps.start('Verifying links',continue_=True) as step: 1010 log.info('Verify link status')1011 for i in range(0,3):1012 1013 data = fetch_cli.fetch_topology(ctrl)1014 verify = fetch_cli.link_status(data)1015 if verify == True: 1016 break1017 elif i == 2: 1018 assert verify1019 sleep(100)1020@aetest.loop(etype = ['0x8100', '0x88A8'])1021class Allowed_QinQ_Vlan(aetest.Testcase):1022 @aetest.setup1023 def Configure_QinQ_Vlan_allowed_list(self, steps,ctrl,server,client,etype,**param):1024 vlans='{},{}-{}'.format(lis1[0],lis1[1],lis1[3])1025 with steps.start('Verifying links',continue_=True) as step: 1026 log.info('Verify link status')1027 for i in range(0,3):1028 1029 data = fetch_cli.fetch_topology(ctrl)1030 verify = fetch_cli.link_status(data)1031 if verify == True: 1032 break1033 elif i == 2: 1034 assert verify1035 sleep(100)1036 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1037 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1038 log.info('sucessful in Enabling Single VLAN on dn')1039 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1040 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='enable')1041 log.info('sucessful in configuring allowed QinQ VLAN on dn')1042 sleep(60)1043 with steps.start('Verifying links',continue_=True) as step: 1044 log.info('Verify link status')1045 for i in range(0,3):1046 1047 data = fetch_cli.fetch_topology(ctrl)1048 verify = fetch_cli.link_status(data)1049 if verify == True: 1050 break1051 elif i == 2: 1052 assert verify1053 sleep(100)1054 @ aetest.test1055 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1056 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1057 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1058 log.info('Successful in configuring vlan in Server')1059 with steps.start('Configure IP in client',continue_=True) as step:1060 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1061 log.info('Successful in configuring IP in Client')1062 with steps.start('Starting iperf in client',continue_=True) as step:1063 sleep(20)1064 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1065 assert ((up != 0.0) and (down != 0.0))1066 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1067 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1068 log.info('Successful in Removing vlan in Server')1069 with steps.start('Removing IP in client',continue_=True) as step:1070 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1071 log.info('Successful in Removing IP in Client') 1072 @ aetest.test.loop(s_vlan=lis1)1073 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,s_vlan,**param):1074 1075 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1076 assert misc.config_QinQ(server,param['server_inf'],s_vlan,str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1077 log.info('Successful in configuring vlan in Server')1078 with steps.start('Configure Q VLAN in client',continue_=True) as step:1079 assert misc.config_Q(client,param['client_inf'],s_vlan,param['client_data_ipv4'])1080 log.info('Successful in configuring vlan in client')1081 with steps.start('Verifying Traffic',continue_=True) as step:1082 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1083 result=((up != 0.0) and (down != 0.0))1084 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1085 if s_vlan==int(param['dn1_svlan'])+4:1086 if result == False:1087 log.info('No traffic due to unallowed vlan')1088 else:1089 assert False1090 else:1091 assert result1092 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1093 assert misc.config_QinQ(server,param['server_inf'],s_vlan,str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1094 log.info('Successful in Removing vlan in Server')1095 with steps.start('Removing Q VLAN in client',continue_=True) as step:1096 assert misc.config_Q(client,param['client_inf'],s_vlan,param['client_data_ipv4'],status='disable')1097 log.info('Removing Q vlan in client')1098 @ aetest.test.loop(s_vlan=lis1)1099 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,s_vlan,**param):1100 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1101 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],s_vlan,param['server_data_ipv4'],ethertype=etype)1102 log.info('Successful in configuring QinQ vlan in Server')1103 with steps.start('Configure QinQ VLAN in client',continue_=True) as step:1104 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],s_vlan,param['client_data_ipv4'],ethertype=etype)1105 log.info('Successful in configuring QinQ vlan in client')1106 log.info('Starting iperf client')1107 sleep(20)1108 with steps.start('Verifying Traffic',continue_=True) as step:1109 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1110 result=((up != 0.0) and (down != 0.0))1111 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1112 if s_vlan==int(param['dn1_svlan'])+4:1113 if result == False:1114 log.info('No traffic due to unallowed vlan')1115 else:1116 assert False1117 else:1118 assert result1119 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1120 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],s_vlan,param['server_data_ipv4'],status='disable')1121 log.info('Removing QinQ vlan in Server')1122 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1123 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],s_vlan,param['client_data_ipv4'],status='disable')1124 log.info('Removing QiNQ vlan in client')1125 @aetest.cleanup1126 def VLAN_config_cleanup(self,steps,ctrl,server,client,etype,**param):1127 vlans='{},{}-{}'.format(lis1[0],lis1[1],lis1[3])1128 with steps.start('Remove QinQ VLAN in dn',continue_=True) as step:1129 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan='1',cvlan='1',ethertype=etype,status='disable')1130 log.info('sucessful in Removing Double VLAN on dn')1131 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1132 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='disable')1133 log.info('sucessful in Removing allowed QinQ VLAN on dn')1134 sleep(60)1135 with steps.start('Verifying links',continue_=True) as step: 1136 log.info('Verify link status')1137 for i in range(0,3):1138 1139 data = fetch_cli.fetch_topology(ctrl)1140 verify = fetch_cli.link_status(data)1141 if verify == True: 1142 break1143 elif i == 2: 1144 assert verify1145 sleep(100)1146@aetest.loop(etype = ['0x8100', '0x88A8'])1147class QinQ_Vlan_Remarking(aetest.Testcase):1148 1149 @aetest.setup1150 def Configure_Q_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1151 remark=int(param['dn1_svlan'])+11152 with steps.start('Verifying links',continue_=True) as step: 1153 log.info('Verify link status')1154 for i in range(0,3):1155 1156 data = fetch_cli.fetch_topology(ctrl)1157 verify = fetch_cli.link_status(data)1158 if verify == True: 1159 break1160 elif i == 2: 1161 assert verify1162 sleep(100)1163 1164 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1165 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=param['dn1_svlan'],cvlan=param['dn1_cvlan'],ethertype=etype,status='enable')1166 log.info('sucessful in Enabling Single VLAN on dn')1167 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1168 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1169 log.info('sucessful in configuring allowed QinQ VLAN on dn')1170 1171 with steps.start('Configuring Remark VLAN',continue_=True) as step:1172 assert cli.config_vlan_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_svlan'],remark)1173 log.info('sucessful in Configuring Single VLAN Remarking on dn')1174 sleep(60)1175 with steps.start('Verifying links',continue_=True) as step: 1176 log.info('Verify link status')1177 for i in range(0,3):1178 1179 data = fetch_cli.fetch_topology(ctrl)1180 verify = fetch_cli.link_status(data)1181 if verify == True: 1182 break1183 elif i == 2: 1184 assert verify1185 sleep(100)1186 @ aetest.test1187 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1188 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1189 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1190 log.info('Successful in configuring vlan in Server')1191 with steps.start('Configure IP in client',continue_=True) as step:1192 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1193 log.info('Successful in configuring IP in Client')1194 with steps.start('Starting iperf in client',continue_=True) as step:1195 sleep(20)1196 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1197 assert ((up != 0.0) and (down != 0.0))1198 with steps.start('Removing Q VLAN in Server',continue_=True) as step:1199 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1200 log.info('Successful in Removing vlan in Server')1201 with steps.start('Removing IP in client',continue_=True) as step:1202 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1203 log.info('Successful in Removing IP in Client') 1204 @ aetest.test1205 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1206 remark=int(param['dn1_svlan'])+11207 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1208 assert misc.config_QinQ(server,param['server_inf'],remark,param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1209 log.info('Successful in configuring vlan in Server')1210 with steps.start('Configure Q VLAN in client',continue_=True) as step:1211 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1212 log.info('Successful in configuring vlan in client')1213 with steps.start('Verifying Traffic',continue_=True) as step:1214 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1215 assert ((up != 0.0) and (down != 0.0))1216 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1217 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1218 assert misc.config_QinQ(server,param['server_inf'],remark,param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1219 log.info('Successful in Removing vlan in Server')1220 with steps.start('Removing Q VLAN in client',continue_=True) as step:1221 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1222 log.info('Removing Q vlan in client')1223 @ aetest.test1224 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1225 remark=int(param['dn1_svlan'])+11226 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1227 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],remark,param['server_data_ipv4'],ethertype=etype)1228 log.info('Successful in configuring QinQ vlan in Server')1229 with steps.start('Configure Q VLAN in client',continue_=True) as step:1230 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1231 log.info('Successful in configuring QinQ vlan in client')1232 log.info('Starting iperf client')1233 sleep(20)1234 with steps.start('Verifying Traffic',continue_=True) as step:1235 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1236 assert ((up != 0.0) and (down != 0.0))1237 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1238 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1239 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],remark,param['server_data_ipv4'],status='disable')1240 log.info('Removing QinQ vlan in Server')1241 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1242 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1243 log.info('Removing QiNQ vlan in client')1244 1245 @aetest.cleanup1246 def Removing_configs_from_node_and_PCs(self,steps,ctrl,server,client,etype,**param):1247 remark=int(param['dn1_svlan'])+11248 1249 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1250 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1251 log.info('sucessful in Removing QinQ VLAN on dn')1252 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1253 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1254 log.info('sucessful in Removing allowed QinQ VLAN on dn')1255 1256 with steps.start('Removing Remark VLAN',continue_=True) as step:1257 assert cli.config_vlan_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_svlan'],remark,status='disable')1258 log.info('sucessful in Removing Single VLAN Remarking on dn')1259 sleep(60)1260 with steps.start('Verifying links',continue_=True) as step: 1261 log.info('Verify link status')1262 for i in range(0,3):1263 1264 data = fetch_cli.fetch_topology(ctrl)1265 verify = fetch_cli.link_status(data)1266 if verify == True: 1267 break1268 elif i == 2: 1269 assert verify1270 sleep(100)1271@aetest.loop(etype = ['0x8100', '0x88A8'])1272class QinQ_Vlan_Prio_Remarking(aetest.Testcase):1273 1274 def Capturing_Server_interface(self,server,server_inf,server_file):1275 assert misc.capture_interface(server,server_inf,server_file)1276 def Verify_traffic(self,client,server_data_ipv4):1277 log.info('Starting iperf client')1278 up,down=misc.config_iperf_client(client,server_data_ipv4)1279 assert ((up != 0.0) and (down != 0.0))1280 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1281 1282 @aetest.setup1283 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1284 1285 with steps.start('Verifying links',continue_=True) as step: 1286 log.info('Verify link status')1287 for i in range(0,3):1288 1289 data = fetch_cli.fetch_topology(ctrl)1290 verify = fetch_cli.link_status(data)1291 if verify == True: 1292 break1293 elif i == 2: 1294 assert verify1295 sleep(100)1296 1297 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1298 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1299 log.info('sucessful in Enabling Single VLAN on dn')1300 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1301 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1302 log.info('sucessful in configuring allowed QinQ VLAN on dn')1303 1304 with steps.start('Configuring Remark VLAN Priority',continue_=True) as step:1305 assert cli.config_vlan_prio_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_svlan'],'7')1306 log.info('sucessful in Configuring Single VLAN prirotiy Remarking on dn')1307 sleep(60)1308 with steps.start('Verifying links',continue_=True) as step: 1309 log.info('Verify link status')1310 for i in range(0,3):1311 1312 data = fetch_cli.fetch_topology(ctrl)1313 verify = fetch_cli.link_status(data)1314 if verify == True: 1315 break1316 elif i == 2: 1317 assert verify1318 sleep(100)1319 @ aetest.test1320 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1321 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1322 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1323 log.info('Successful in configuring vlan in Server')1324 with steps.start('Configure IP in client',continue_=True) as step:1325 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1326 log.info('Successful in configuring IP in Client')1327 sleep(20)1328 with steps.start('Capturing and verifying traffic',continue_=True) as step:1329 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))1330 p1.start()1331 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))1332 p2.start()1333 p1.join()1334 p2.join()1335 with steps.start('Analyse Capture',continue_=True) as step:1336 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1337 if etype == '0x8100':1338 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id== {}&&vlan.priority==0'.format(ip,str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1))1339 1340 else:1341 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==0&&vlan.priority==0'.format(ip,str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1))1342 1343 res=misc.analyse_capture(server,filter,param['server_file'])1344 if res > 0:1345 log.info('Successful in VLAN tagging')1346 else:1347 assert False1348 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1349 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1350 log.info('Successful in Removing vlan in Server')1351 with steps.start('Removing IP in client',continue_=True) as step:1352 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1353 log.info('Successful in Removing IP in Client') 1354 @ aetest.test1355 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1356 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1357 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1358 log.info('Successful in configuring vlan in Server')1359 with steps.start('Configure Q VLAN in client',continue_=True) as step:1360 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1361 log.info('Successful in configuring vlan in client')1362 1363 with steps.start('Capturing and verifying traffic',continue_=True) as step:1364 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))1365 p1.start()1366 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))1367 p2.start()1368 p1.join()1369 p2.join()1370 with steps.start('Analyse Capture',continue_=True) as step:1371 if etype == '0x8100':1372 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1373 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id== {}&&vlan.priority==0'.format(ip,str(int(param['dn1_svlan'])-1),param['dn1_svlan'])1374 1375 else:1376 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1377 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==0&&vlan.priority==7'.format(ip,param['dn1_svlan'],int(param['dn1_svlan'])-1)1378 1379 res=misc.analyse_capture(server,filter,param['server_file'])1380 if res > 0:1381 log.info('Successful in VLAN tagging')1382 else:1383 assert False1384 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1385 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1386 log.info('Successful in Removing vlan in Server')1387 with steps.start('Removing Q VLAN in client',continue_=True) as step:1388 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1389 log.info('Removing Q vlan in client')1390 @ aetest.test1391 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1392 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1393 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1394 log.info('Successful in configuring QinQ vlan in Server')1395 with steps.start('Configure Q VLAN in client',continue_=True) as step:1396 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1397 log.info('Successful in configuring QinQ vlan in client')1398 with steps.start('Capturing and verifying traffic',continue_=True) as step:1399 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))1400 p1.start()1401 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))1402 p2.start()1403 p1.join()1404 p2.join()1405 with steps.start('Analyse Capture',continue_=True) as step:1406 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1407 if etype == '0x8100': 1408 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id== {}&&vlan.priority==7&&vlan.priority==0'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])1409 else:1410 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==7&&vlan.priority==0'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])1411 res=misc.analyse_capture(server,filter,param['server_file'])1412 if res > 0:1413 log.info('Successful in VLAN tagging')1414 else:1415 assert False1416 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1417 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1418 log.info('Removing QinQ vlan in Server')1419 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1420 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype,status='disable')1421 log.info('Removing QiNQ vlan in client')1422 @aetest.cleanup1423 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1424 1425 1426 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1427 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1428 log.info('sucessful in Removing Single VLAN on dn')1429 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1430 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1431 log.info('sucessful in Removing allowed QinQ VLAN on dn')1432 1433 with steps.start('Removing Remark VLAN Priority',continue_=True) as step:1434 assert cli.config_vlan_prio_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_svlan'],'7',status='disable')1435 log.info('sucessful in Removing Single VLAN prirotiy Remarking on dn')1436 sleep(60)1437 with steps.start('Verifying links',continue_=True) as step: 1438 log.info('Verify link status')1439 for i in range(0,3):1440 1441 data = fetch_cli.fetch_topology(ctrl)1442 verify = fetch_cli.link_status(data)1443 if verify == True: 1444 break1445 elif i == 2: 1446 assert verify1447 sleep(100)1448@aetest.loop(etype = ['0x8100', '0x88A8'])1449class QinQ_Allow_untag_Allow_Singe_Tag(aetest.Testcase):1450 1451 @aetest.setup1452 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1453 1454 with steps.start('Verifying links',continue_=True) as step: 1455 log.info('Verify link status')1456 for i in range(0,3):1457 1458 data = fetch_cli.fetch_topology(ctrl)1459 verify = fetch_cli.link_status(data)1460 if verify == True: 1461 break1462 elif i == 2: 1463 assert verify1464 sleep(100)1465 client.disconnect()1466 client.connect()1467 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1468 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1469 log.info('sucessful in Enabling Single VLAN on dn')1470 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1471 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1472 log.info('sucessful in configuring allowed QinQ VLAN on dn')1473 1474 with steps.start('Configure drop untag packets in QinQ VLAN',continue_=True) as step:1475 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 1476 log.info('sucessful in configuring Drop untag VLAN')1477 1478 sleep(60)1479 with steps.start('Verifying links',continue_=True) as step: 1480 log.info('Verify link status')1481 for i in range(0,3):1482 1483 data = fetch_cli.fetch_topology(ctrl)1484 verify = fetch_cli.link_status(data)1485 if verify == True: 1486 break1487 elif i == 2: 1488 assert verify1489 sleep(100)1490 1491 1492 @ aetest.test1493 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1494 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1495 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1496 log.info('Successful in configuring vlan in Server')1497 with steps.start('Configure IP in client',continue_=True) as step:1498 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1499 log.info('Successful in configuring IP in Client')1500 1501 with steps.start('Starting client iperf',continue_=True) as step:1502 sleep(20) 1503 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1504 assert ((up != 0) and (down != 0))1505 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1506 1507 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1508 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1509 log.info('Successful in Removing vlan in Server')1510 with steps.start('Removing IP in client',continue_=True) as step:1511 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1512 log.info('Successful in Removing IP in Client') 1513 @ aetest.test1514 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1515 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1516 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1517 log.info('Successful in configuring vlan in Server')1518 with steps.start('Configure Q VLAN in client',continue_=True) as step:1519 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1520 log.info('Successful in configuring vlan in client')1521 1522 with steps.start('Starting client iperf',continue_=True) as step:1523 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1524 assert ((up != 0) and (down != 0))1525 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1526 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1527 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1528 log.info('Successful in Removing vlan in Server')1529 with steps.start('Removing Q VLAN in client',continue_=True) as step:1530 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1531 log.info('Removing Q vlan in client')1532 @ aetest.test1533 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1534 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1535 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1536 log.info('Successful in configuring QinQ vlan in Server')1537 with steps.start('Configure Q VLAN in client',continue_=True) as step:1538 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1539 log.info('Successful in configuring QinQ vlan in client')1540 with steps.start('Starting client iperf',continue_=True) as step:1541 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1542 assert ((up != 0) and (down != 0))1543 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1544 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1545 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1546 log.info('Removing QinQ vlan in Server')1547 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1548 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype,status='disable')1549 log.info('Removing QiNQ vlan in client')1550 1551 @aetest.cleanup1552 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1553 1554 1555 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1556 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1557 log.info('sucessful in Removing Single VLAN on dn')1558 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1559 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1560 log.info('sucessful in Removing allowed QinQ VLAN on dn')1561 sleep(60)1562 with steps.start('Verifying links',continue_=True) as step: 1563 log.info('Verify link status')1564 for i in range(0,3):1565 1566 data = fetch_cli.fetch_topology(ctrl)1567 verify = fetch_cli.link_status(data)1568 if verify == True: 1569 break1570 elif i == 2: 1571 assert verify1572 sleep(100)1573 1574 client.disconnect()1575 client.connect()1576@aetest.loop(etype = ['0x8100', '0x88A8'])1577class QinQ_Drop_untag_Allow_Singe_Tag(aetest.Testcase):1578 1579 @aetest.setup1580 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1581 1582 with steps.start('Verifying links',continue_=True) as step: 1583 log.info('Verify link status')1584 for i in range(0,3):1585 1586 data = fetch_cli.fetch_topology(ctrl)1587 verify = fetch_cli.link_status(data)1588 if verify == True: 1589 break1590 elif i == 2: 1591 assert verify1592 sleep(100)1593 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1594 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1595 log.info('sucessful in Enabling Single VLAN on dn')1596 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1597 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1598 log.info('sucessful in configuring allowed QinQ VLAN on dn')1599 1600 with steps.start('Configure drop untag packets in QinQ VLAN',continue_=True) as step:1601 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='enable') 1602 log.info('sucessful in configuring Drop untag VLAN')1603 1604 sleep(60)1605 with steps.start('Verifying links',continue_=True) as step: 1606 log.info('Verify link status')1607 for i in range(0,3):1608 1609 data = fetch_cli.fetch_topology(ctrl)1610 verify = fetch_cli.link_status(data)1611 if verify == True: 1612 break1613 elif i == 2: 1614 assert verify1615 sleep(100)1616 1617 @ aetest.test1618 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1619 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1620 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1621 log.info('Successful in configuring vlan in Server')1622 1623 #Configure IP on client PC1624 with steps.start('Configure IP in client',continue_=True) as step: 1625 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1626 log.info('Successful in configuring IP in Client')1627 1628 with steps.start('Starting iperf in client',continue_=True) as step:1629 sleep(20) 1630 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1631 result=((up != 0.0) and (down != 0.0))1632 log.info(result)1633 if result == False:1634 log.info('Traffic Failed due to drop untag')1635 else:1636 log.info('Failed to drop untagged packets')1637 assert False1638 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1639 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1640 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1641 log.info('Successful in Removing vlan in Server')1642 with steps.start('Removing IP in client',continue_=True) as step:1643 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1644 log.info('Successful in Removing IP in Client') 1645 @ aetest.test1646 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1647 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1648 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1649 log.info('Successful in configuring vlan in Server')1650 with steps.start('Configure Q VLAN in client',continue_=True) as step:1651 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1652 log.info('Successful in configuring vlan in client')1653 1654 with steps.start('Starting client iperf',continue_=True) as step:1655 sleep(20)1656 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1657 assert ((up != 0) and (down != 0))1658 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1659 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1660 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1661 log.info('Successful in Removing vlan in Server')1662 with steps.start('Removing Q VLAN in client',continue_=True) as step:1663 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1664 log.info('Removing Q vlan in client')1665 @ aetest.test1666 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1667 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1668 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1669 log.info('Successful in configuring QinQ vlan in Server')1670 with steps.start('Configure Q VLAN in client',continue_=True) as step:1671 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1672 log.info('Successful in configuring QinQ vlan in client')1673 with steps.start('Starting client iperf',continue_=True) as step:1674 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1675 assert ((up != 0) and (down != 0))1676 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1677 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1678 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],status='disable')1679 log.info('Removing QinQ vlan in Server')1680 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1681 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1682 log.info('Removing QiNQ vlan in client')1683 1684 @aetest.cleanup1685 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1686 1687 1688 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1689 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1690 log.info('sucessful in Removing Single VLAN on dn')1691 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1692 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1693 log.info('sucessful in Removing allowed QinQ VLAN on dn')1694 1695 with steps.start('Removing drop untag packets in QinQ VLAN',continue_=True) as step:1696 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 1697 log.info('sucessful in Removing Drop untag VLAN')1698 sleep(60)1699 with steps.start('Verifying links',continue_=True) as step: 1700 log.info('Verify link status')1701 for i in range(0,3):1702 1703 data = fetch_cli.fetch_topology(ctrl)1704 verify = fetch_cli.link_status(data)1705 if verify == True: 1706 break1707 elif i == 2: 1708 assert verify1709 sleep(100)1710@aetest.loop(etype = ['0x8100', '0x88A8'])1711class QinQ_Allow_untag_Drop_Singe_Tag(aetest.Testcase):1712 1713 @aetest.setup1714 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1715 1716 1717 with steps.start('Verifying links',continue_=True) as step: 1718 log.info('Verify link status')1719 for i in range(0,3):1720 1721 data = fetch_cli.fetch_topology(ctrl)1722 verify = fetch_cli.link_status(data)1723 if verify == True: 1724 break1725 elif i == 2: 1726 assert verify1727 sleep(100)1728 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1729 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1730 log.info('sucessful in Enabling Single VLAN on dn')1731 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1732 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1733 log.info('sucessful in configuring allowed QinQ VLAN on dn')1734 1735 with steps.start('Configure Allow untag packets in QinQ VLAN',continue_=True) as step:1736 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 1737 log.info('sucessful in configuring Allow untag ')1738 1739 with steps.start('Configure Drop Single packets in QinQ VLAN',continue_=True) as step:1740 assert cli.config_drop_single_tag(ctrl,param['dn1_name'],param['dn1_inf'],status='enable') 1741 log.info('sucessful in configuring Drop Singletag')1742 sleep(60)1743 with steps.start('Verifying links',continue_=True) as step: 1744 log.info('Verify link status')1745 for i in range(0,3):1746 1747 data = fetch_cli.fetch_topology(ctrl)1748 verify = fetch_cli.link_status(data)1749 if verify == True: 1750 break1751 elif i == 2: 1752 assert verify1753 sleep(100)1754 1755 1756 1757 @ aetest.test1758 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1759 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1760 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1761 log.info('Successful in configuring vlan in Server')1762 with steps.start('Configure IP in client',continue_=True) as step:1763 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1764 log.info('Successful in configuring IP in Client')1765 1766 1767 with steps.start('Starting client iperf',continue_=True) as step:1768 sleep(20)1769 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1770 assert ((up != 0) and (down != 0))1771 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1772 1773 1774 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1775 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1776 log.info('Successful in Removing vlan in Server')1777 with steps.start('Removing IP in client',continue_=True) as step:1778 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1779 log.info('Successful in Removing IP in Client') 1780 @ aetest.test1781 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1782 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1783 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1784 log.info('Successful in configuring vlan in Server')1785 with steps.start('Configure Q VLAN in client',continue_=True) as step:1786 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1787 log.info('Successful in configuring vlan in client')1788 1789 with steps.start('Starting client iperf',continue_=True) as step:1790 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1791 result=((up != 0) and (down != 0))1792 if result == False:1793 log.info('Packets dropped due to drop config')1794 else:1795 assert False1796 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1797 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1798 log.info('Successful in Removing vlan in Server')1799 with steps.start('Removing Q VLAN in client',continue_=True) as step:1800 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1801 log.info('Removing Q vlan in client')1802 @ aetest.test1803 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1804 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1805 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1806 log.info('Successful in configuring QinQ vlan in Server')1807 with steps.start('Configure Q VLAN in client',continue_=True) as step:1808 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1809 log.info('Successful in configuring QinQ vlan in client')1810 with steps.start('Starting client iperf',continue_=True) as step:1811 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1812 assert ((up != 0) and (down != 0))1813 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1814 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1815 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],status='disable')1816 log.info('Removing QinQ vlan in Server')1817 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1818 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1819 log.info('Removing QiNQ vlan in client')1820 1821 @aetest.cleanup1822 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1823 1824 1825 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1826 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1827 log.info('sucessful in Removing Single VLAN on dn')1828 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1829 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1830 log.info('sucessful in Removing allowed QinQ VLAN on dn')1831 1832 with steps.start('Removing drop Single tag packets in QinQ VLAN',continue_=True) as step:1833 assert cli.config_drop_single_tag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 1834 log.info('sucessful in Removing Drop Single tag')1835 sleep(60)1836 with steps.start('Verifying links',continue_=True) as step: 1837 log.info('Verify link status')1838 for i in range(0,3):1839 1840 data = fetch_cli.fetch_topology(ctrl)1841 verify = fetch_cli.link_status(data)1842 if verify == True: 1843 break1844 elif i == 2: 1845 assert verify1846 sleep(100)1847 1848@aetest.loop(etype = ['0x8100', '0x88A8'])1849class QinQ_Drop_untag_Drop_Singe_Tag(aetest.Testcase):1850 1851 @aetest.setup1852 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1853 1854 with steps.start('Verifying links',continue_=True) as step: 1855 log.info('Verify link status')1856 for i in range(0,3):1857 1858 data = fetch_cli.fetch_topology(ctrl)1859 verify = fetch_cli.link_status(data)1860 if verify == True: 1861 break1862 elif i == 2: 1863 assert verify1864 sleep(100)1865 client.disconnect()1866 client.connect()1867 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1868 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1869 log.info('sucessful in Enabling Single VLAN on dn')1870 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1871 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1872 log.info('sucessful in configuring allowed QinQ VLAN on dn')1873 1874 with steps.start('Configure Drop untag packets in QinQ VLAN',continue_=True) as step:1875 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='enable') 1876 log.info('sucessful in configuring Drop untag ')1877 1878 with steps.start('Configure Drop Single packets in QinQ VLAN',continue_=True) as step:1879 assert cli.config_drop_single_tag(ctrl,param['dn1_name'],param['dn1_inf'],status='enable') 1880 log.info('sucessful in configuring Drop Singletag')1881 1882 sleep(60)1883 with steps.start('Verifying links',continue_=True) as step: 1884 log.info('Verify link status')1885 for i in range(0,3):1886 1887 data = fetch_cli.fetch_topology(ctrl)1888 verify = fetch_cli.link_status(data)1889 if verify == True: 1890 break1891 elif i == 2: 1892 assert verify1893 sleep(100)1894 1895 @ aetest.test1896 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1897 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1898 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1899 log.info('Successful in configuring vlan in Server')1900 with steps.start('Configure IP in client',continue_=True) as step:1901 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1902 log.info('Successful in configuring IP in Client')1903 1904 1905 with steps.start('Starting client iperf',continue_=True) as step:1906 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1907 result=((up != 0) and (down != 0))1908 if result == False:1909 log.info('Packets dropped due to drop config')1910 else:1911 assert False1912 1913 1914 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1915 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1916 log.info('Successful in Removing vlan in Server')1917 with steps.start('Removing IP in client',continue_=True) as step:1918 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1919 log.info('Successful in Removing IP in Client') 1920 @ aetest.test1921 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1922 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1923 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1924 log.info('Successful in configuring vlan in Server')1925 with steps.start('Configure Q VLAN in client',continue_=True) as step:1926 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1927 log.info('Successful in configuring vlan in client')1928 1929 with steps.start('Starting client iperf',continue_=True) as step:1930 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1931 result=((up != 0) and (down != 0))1932 if result == False:1933 log.info('Packets dropped due to drop config')1934 else:1935 assert False1936 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1937 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1938 log.info('Successful in Removing vlan in Server')1939 with steps.start('Removing Q VLAN in client',continue_=True) as step:1940 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1941 log.info('Removing Q vlan in client')1942 @ aetest.test1943 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1944 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1945 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1946 log.info('Successful in configuring QinQ vlan in Server')1947 with steps.start('Configure Q VLAN in client',continue_=True) as step:1948 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1949 log.info('Successful in configuring QinQ vlan in client')1950 with steps.start('Starting client iperf',continue_=True) as step:1951 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1952 assert ((up != 0) and (down != 0))1953 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1954 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1955 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],status='disable')1956 log.info('Removing QinQ vlan in Server')1957 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1958 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1959 log.info('Removing QiNQ vlan in client')1960 1961 @aetest.cleanup1962 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1963 1964 1965 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1966 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1967 log.info('sucessful in Removing Single VLAN on dn')1968 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1969 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1970 log.info('sucessful in Removing allowed QinQ VLAN on dn')1971 with steps.start('Removing drop untag packets in QinQ VLAN',continue_=True) as step:1972 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 1973 log.info('sucessful in Removing Drop untag') 1974 1975 with steps.start('Removing drop Single tag packets in QinQ VLAN',continue_=True) as step:1976 assert cli.config_drop_single_tag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 1977 log.info('sucessful in Removing Drop Single tag')1978 sleep(60)1979 with steps.start('Verifying links',continue_=True) as step: 1980 log.info('Verify link status')1981 for i in range(0,3):1982 1983 data = fetch_cli.fetch_topology(ctrl)1984 verify = fetch_cli.link_status(data)1985 if verify == True: 1986 break1987 elif i == 2: 1988 assert verify1989 sleep(100)1990@aetest.loop(etype = ['0x8100', '0x88A8'])1991class Same_S_And_C_QinQ_Vlan(aetest.Testcase):1992 def Capturing_Server_interface(self,server,server_inf,server_file):1993 assert misc.capture_interface(server,server_inf,server_file)1994 def Verify_traffic(self,client,server_data_ipv4):1995 log.info('Starting iperf client')1996 up,down=misc.config_iperf_client(client,server_data_ipv4)1997 assert ((up != 0.0) and (down != 0.0))1998 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1999 2000 @aetest.setup2001 def Configure_QinQ_Vlan(self, etype, steps,ctrl,server,client,**param):2002 2003 with steps.start('Verifying links',continue_=True) as step: 2004 log.info('Verify link status')2005 for i in range(0,3):2006 2007 data = fetch_cli.fetch_topology(ctrl)2008 verify = fetch_cli.link_status(data)2009 if verify == True: 2010 break2011 elif i == 2: 2012 assert verify2013 sleep(100)2014 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:2015 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_svlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2016 log.info('sucessful in Enabling Double VLAN on dn')2017 sleep(60)2018 with steps.start('Verifying links',continue_=True) as step: 2019 log.info('Verify link status')2020 for i in range(0,3):2021 2022 data = fetch_cli.fetch_topology(ctrl)2023 verify = fetch_cli.link_status(data)2024 if verify == True: 2025 break2026 elif i == 2: 2027 assert verify2028 sleep(100)2029 2030 2031 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2032 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2033 log.info('Successful in configuring vlan in Server')2034 2035 #Configure IP on client PC2036 with steps.start('Configure IP in client',continue_=True) as step: 2037 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2038 log.info('Successful in configuring IP in Client')2039 2040 2041 with steps.start('Capturing and verifying traffic',continue_=True) as step:2042 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))2043 p1.start()2044 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))2045 p2.start()2046 p1.join()2047 p2.join()2048 with steps.start('Analyse Capture',continue_=True) as step:2049 if etype =='0x8100':2050 ip = param['client_data_ipv4'].rsplit('/', 1)[0]2051 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_svlan'],param['dn1_svlan'])2052 else:2053 ip = param['client_data_ipv4'].rsplit('/', 1)[0]2054 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_svlan'],param['dn1_svlan'])2055 res=misc.analyse_capture(server,filter,param['server_file'])2056 if res > 0:2057 log.info('Successful in QinQ VLAN tagging')2058 else:2059 assert False2060 2061 2062 2063 @aetest.cleanup2064 def Disabling_QinQ_VLAN(self,etype,steps,ctrl,server,client,**param):2065 2066 log.info('Disabling Double VLAN in dn')2067 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2068 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2069 log.info('Successful in Removing vlan in Server')2070 sleep(60)2071 with steps.start('Verifying links',continue_=True) as step: 2072 log.info('Verify link status')2073 for i in range(0,3):2074 2075 data = fetch_cli.fetch_topology(ctrl)2076 verify = fetch_cli.link_status(data)2077 if verify == True: 2078 break2079 elif i == 2: 2080 assert verify2081 sleep(100)2082 with steps.start('Removing vlan configs from server',continue_=True) as step:2083 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_svlan'],svlan=param['dn1_svlan'],ethertype=etype,status='disable') 2084 log.info('sucessful in Removing QinQ VLAN on dn')2085 with steps.start('Configure IP in client',continue_=True) as step:2086 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2087 log.info('Successful in configuring IP in Client')2088@aetest.skip(reason = 'Failure in client3 reachability')2089class POP_Bridge_Q_Vlan(aetest.Testcase):2090 def Capturing_Server_interface(self,server,server_inf,server_file):2091 assert misc.capture_interface(server,server_inf,server_file)2092 2093 def Verify_traffic(self,client,server_data_ipv4):2094 log.info('Starting iperf client')2095 up,down=misc.config_iperf_client(client,server_data_ipv4)2096 assert ((up != 0.0) and (down != 0.0))2097 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2098 2099 @aetest.setup2100 def Setup(self, steps,ctrl,server,client3,**param):2101 with steps.start('Verifying links',continue_=True) as step: 2102 log.info('Verify link status')2103 for i in range(0,3):2104 2105 data = fetch_cli.fetch_topology(ctrl)2106 verify = fetch_cli.link_status(data)2107 if verify == True: 2108 break2109 elif i == 2: 2110 assert verify2111 sleep(100)2112 2113 client3.connect()2114 with steps.start('Configure Q VLAN in POP',continue_=True) as step:2115 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['pop_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2116 log.info('sucessful in Enabling Single VLAN on POP')2117 sleep(60)2118 with steps.start('Verifying links',continue_=True) as step: 2119 log.info('Verify link status')2120 for i in range(0,3):2121 2122 data = fetch_cli.fetch_topology(ctrl)2123 verify = fetch_cli.link_status(data)2124 if verify == True: 2125 break2126 elif i == 2: 2127 assert verify2128 sleep(100)2129 2130 2131 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2132 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2133 log.info('Successful in configuring vlan in Server')2134 2135 #Configure IP on client PC2136 with steps.start('Configure IP in client',continue_=True) as step: 2137 assert misc.config_ip(client3,param['client3_inf'],param['client3_data_ipv4'])2138 log.info('Successful in configuring IP in Client')2139 2140 2141 2142 with steps.start('Capturing and verifying traffic',continue_=True) as step:2143 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))2144 p1.start()2145 p2 = Process(target=self.Verify_traffic,args=(client3,param['server_data_ipv4']))2146 p2.start()2147 p1.join()2148 p2.join()2149 with steps.start('Analyse Capture',continue_=True) as step:2150 ip = param['client_data_ipv4'].rsplit('/', 1)[0]2151 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])2152 res=misc.analyse_capture(server,filter,param['server_file'])2153 if res > 0:2154 log.info('Successful in VLAN tagging')2155 else:2156 assert False2157 @aetest.cleanup2158 def Disabling_Q_VLAN(self,steps,ctrl,server,client3,**param):2159 2160 log.info('Disabling Single VLAN in POP')2161 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2162 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2163 log.info('Successful in configuring vlan in Server')2164 with steps.start('Removing vlan configs from server',continue_=True) as step:2165 assert cli.config_single_vlan(ctrl,param['pop_name'],param['pop_inf1'],vlan_id=param['dn1_cvlan'],status='disable') 2166 log.info('sucessful in Enabling Single VLAN on POP')2167 sleep(60)2168 with steps.start('Verifying links',continue_=True) as step: 2169 log.info('Verify link status')2170 for i in range(0,3):2171 2172 data = fetch_cli.fetch_topology(ctrl)2173 verify = fetch_cli.link_status(data)2174 if verify == True: 2175 break2176 elif i == 2: 2177 assert verify2178 sleep(100)2179 with steps.start('Configure IP in client',continue_=True) as step:2180 assert misc.config_ip(client3,param['client_inf'],param['client_data_ipv4'],status='disable')2181 log.info('Successful in configuring IP in Client')2182 client3.disconnect()2183 2184class Transparent_Port(aetest.Testcase):2185 @aetest.setup2186 def Configure_Transparent(self, steps,ctrl,server,client,**param):2187 2188 with steps.start('Verifying links',continue_=True) as step: 2189 log.info('Verify link status')2190 for i in range(0,3):2191 2192 data = fetch_cli.fetch_topology(ctrl)2193 verify = fetch_cli.link_status(data)2194 if verify == True: 2195 break2196 elif i == 2: 2197 assert verify2198 sleep(100)2199 with steps.start('Configure Transparent in dn',continue_=True) as step:2200 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2201 log.info('sucessful in Enabling Transparent on dn')2202 sleep(60)2203 with steps.start('Verifying links',continue_=True) as step: 2204 log.info('Verify link status')2205 for i in range(0,3):2206 2207 data = fetch_cli.fetch_topology(ctrl)2208 verify = fetch_cli.link_status(data)2209 if verify == True: 2210 break2211 elif i == 2: 2212 assert verify2213 sleep(100)2214 2215 with steps.start('Configure IP in Server',continue_=True) as step: 2216 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'])2217 log.info('Successful in configuring IP in Server')2218 2219 #Configure IP on client PC2220 with steps.start('Configure IP in client',continue_=True) as step: 2221 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2222 log.info('Successful in configuring IP in Client')2223 2224 2225 @ aetest.test2226 def verify_traffic(self,steps,ctrl,server,client,**param):2227 sleep(20) 2228 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2229 assert ((up != 0) and (down != 0))2230 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2231 @aetest.cleanup2232 def Removing_Ips(self,steps,ctrl,server,client,**param):2233 2234 2235 with steps.start('Removing IP in Server',continue_=True) as step: 2236 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'],status='disable')2237 log.info('Successful in Removing IP in Server')2238 2239 #Configure IP on client PC2240 with steps.start('Removing IP in client',continue_=True) as step: 2241 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2242 log.info('Successful in Removing IP in Client')2243class Transparent_Port_With_Q_Packets(aetest.Testcase):2244 @aetest.setup2245 def Configure_Transparent_port(self, steps,ctrl,server,client,**param):2246 with steps.start('Verifying links',continue_=True) as step: 2247 log.info('Verify link status')2248 for i in range(0,3):2249 2250 data = fetch_cli.fetch_topology(ctrl)2251 verify = fetch_cli.link_status(data)2252 if verify == True: 2253 break2254 elif i == 2: 2255 assert verify2256 sleep(100)2257 with steps.start('Configure Transparent port',continue_=True) as step:2258 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2259 log.info('sucessful in Enabling Transparent port on dn')2260 2261 sleep(60)2262 with steps.start('Verifying links',continue_=True) as step: 2263 log.info('Verify link status')2264 for i in range(0,3):2265 2266 data = fetch_cli.fetch_topology(ctrl)2267 verify = fetch_cli.link_status(data)2268 if verify == True: 2269 break2270 elif i == 2: 2271 assert verify2272 sleep(100)2273 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2274 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2275 log.info('Successful in configuring vlan in Server')2276 2277 with steps.start('Configure Q VLAN in client',continue_=True) as step:2278 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'])2279 log.info('Successful in configuring vlan in client')2280 2281 @ aetest.test2282 def verify_traffic(self,steps,ctrl,server,client,**param):2283 sleep(20) 2284 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2285 assert ((up != 0) and (down != 0))2286 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2287 @aetest.cleanup2288 def Disabling_VLAN_in_Server(self,steps,ctrl,server,client,**param):2289 2290 2291 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2292 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2293 log.info('Successful in Removing vlan in Server')2294 2295 with steps.start('Removing Q VLAN in client',continue_=True) as step:2296 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'],status='disable')2297 log.info('Successful in Removing vlan in client')2298@aetest.loop(etype = ['0x8100', '0x88A8'])2299class Transparent_Port_With_QinQ_Packets(aetest.Testcase):2300 @aetest.setup2301 def Configure_Transparent_Port(self, etype, steps,ctrl,server,client,**param):2302 2303 with steps.start('Verifying links',continue_=True) as step: 2304 log.info('Verify link status')2305 for i in range(0,3):2306 2307 data = fetch_cli.fetch_topology(ctrl)2308 verify = fetch_cli.link_status(data)2309 if verify == True: 2310 break2311 elif i == 2: 2312 assert verify2313 sleep(100)2314 with steps.start('Configure Transparent port',continue_=True) as step:2315 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2316 log.info('sucessful in Enabling Transparent port on dn')2317 2318 sleep(60)2319 with steps.start('Verifying links',continue_=True) as step: 2320 log.info('Verify link status')2321 for i in range(0,3):2322 2323 data = fetch_cli.fetch_topology(ctrl)2324 verify = fetch_cli.link_status(data)2325 if verify == True: 2326 break2327 elif i == 2: 2328 assert verify2329 sleep(100)2330 2331 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2332 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2333 log.info('Successful in configuring vlan in Server')2334 2335 with steps.start('Configure QinQ VLAN in Client',continue_=True) as step:2336 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)2337 log.info('Successful in configuring vlan in client') 2338 2339 2340 @ aetest.test2341 def verify_traffic(self,etype,steps,ctrl,server,client,**param):2342 sleep(20) 2343 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2344 assert ((up != 0) and (down != 0))2345 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2346 2347 @aetest.cleanup2348 def Removing_VLAN(self,etype,steps,ctrl,server,client,**param):2349 2350 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2351 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2352 log.info('Successful in Removing vlan in Server')2353 2354 with steps.start('Removnig QinQ VLAN in Client',continue_=True) as step:2355 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype,status='disable')2356 log.info('Successful in Removing vlan in client')2357class Two_Interface_Transaprent(aetest.Testcase):2358 @aetest.setup2359 def Configure_Transparent(self, steps,ctrl,server,client,client2,**param):2360 client2.connect()2361 misc.execute_command(client2,'sudo ifconfig {} mtu 1492'.format(param['client2_inf']))2362 with steps.start('Verifying links',continue_=True) as step: 2363 log.info('Verify link status')2364 for i in range(0,3):2365 2366 data = fetch_cli.fetch_topology(ctrl)2367 verify = fetch_cli.link_status(data)2368 if verify == True: 2369 break2370 elif i == 2: 2371 assert verify2372 sleep(100)2373 2374 with steps.start('Configure Transparent in dn port1',continue_=True) as step:2375 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2376 log.info('sucessful in Enabling Transparent on dn')2377 with steps.start('Configure Transparent in dn port2',continue_=True) as step:2378 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2379 log.info('sucessful in Enabling Transparent on dn')2380 sleep(60)2381 with steps.start('Verifying links',continue_=True) as step: 2382 log.info('Verify link status')2383 for i in range(0,3):2384 2385 data = fetch_cli.fetch_topology(ctrl)2386 verify = fetch_cli.link_status(data)2387 if verify == True: 2388 break2389 elif i == 2: 2390 assert verify2391 sleep(100)2392 2393 with steps.start('Configure IP in Server',continue_=True) as step: 2394 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'])2395 log.info('Successful in configuring IP in Server')2396 2397 #Configure IP on client PC2398 with steps.start('Configure IP in client',continue_=True) as step: 2399 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2400 log.info('Successful in configuring IP in Client')2401 with steps.start('Configure IP in client2',continue_=True) as step: 2402 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2403 log.info('Successful in configuring IP in Client')2404 2405 2406 @ aetest.test2407 def verify_traffic(self,steps,ctrl,server,client,client2,**param):2408 sleep(20) 2409 with steps.start('client1 traffic',continue_=True) as step:2410 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2411 assert ((up != 0) and (down != 0))2412 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2413 with steps.start('client2 traffic',continue_=True) as step:2414 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2415 assert ((up != 0) and (down != 0))2416 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2417 @aetest.cleanup2418 def Removing_Ips(self,steps,ctrl,server,client,client2,**param):2419 2420 2421 with steps.start('Removing IP in Server',continue_=True) as step: 2422 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'],status='disable')2423 log.info('Successful in Removing IP in Server')2424 2425 #Configure IP on client PC2426 with steps.start('Removing IP in client',continue_=True) as step: 2427 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2428 log.info('Successful in Removing IP in Client')2429 with steps.start('Removing IP in client2',continue_=True) as step: 2430 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2431 log.info('Successful in Removing IP in Client2')2432 misc.execute_command(client2,'sudo ifconfig {} mtu 1500'.format(param['client2_inf']))2433 client2.disconnect()2434class Two_Interface_Transaprent_Q(aetest.Testcase):2435 @aetest.setup2436 def Configure_Transparent(self, steps,ctrl,server,client,client2,**param):2437 with steps.start('Verifying links',continue_=True) as step: 2438 log.info('Verify link status')2439 for i in range(0,3):2440 2441 data = fetch_cli.fetch_topology(ctrl)2442 verify = fetch_cli.link_status(data)2443 if verify == True: 2444 break2445 elif i == 2: 2446 assert verify2447 sleep(100)2448 client2.connect()2449 with steps.start('Configure Transparent in dn port1',continue_=True) as step:2450 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2451 log.info('sucessful in Enabling Transparent on dn')2452 with steps.start('Configure Qvlan in dn port2',continue_=True) as step:2453 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2454 log.info('sucessful in Enabling Qvlan on dn')2455 2456 sleep(60)2457 with steps.start('Verifying links',continue_=True) as step: 2458 log.info('Verify link status')2459 for i in range(0,3):2460 2461 data = fetch_cli.fetch_topology(ctrl)2462 verify = fetch_cli.link_status(data)2463 if verify == True: 2464 break2465 elif i == 2: 2466 assert verify2467 sleep(100)2468 2469 #Configure IP on client PC2470 with steps.start('Configure IP in client',continue_=True) as step: 2471 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2472 log.info('Successful in configuring IP in Client')2473 with steps.start('Configure IP in client2',continue_=True) as step: 2474 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2475 log.info('Successful in configuring IP in Client')2476 2477 2478 @ aetest.test2479 def verify_traffic(self,steps,ctrl,server,client,client2,**param):2480 with steps.start('Configure IP in Server',continue_=True) as step: 2481 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'])2482 log.info('Successful in configuring IP in Server')2483 sleep(20) 2484 with steps.start('client1 traffic',continue_=True) as step:2485 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2486 assert ((up != 0) and (down != 0))2487 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2488 with steps.start('Removing IP in Server',continue_=True) as step: 2489 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'],status='disable')2490 log.info('Successful in Removing IP in Server')2491 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2492 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2493 log.info('Successful in configuring vlan in Server')2494 2495 sleep(20)2496 with steps.start('client2 traffic',continue_=True) as step:2497 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2498 assert ((up != 0) and (down != 0))2499 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2500 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2501 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2502 log.info('Successful in Removing vlan in Server')2503 @aetest.cleanup2504 def Removing_Ips(self,steps,ctrl,server,client,client2,**param):2505 2506 2507 with steps.start('Configure Qvlan in dn port2',continue_=True) as step:2508 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2509 log.info('sucessful in Enabling Qvlan on dn')2510 sleep(60)2511 with steps.start('Verifying links',continue_=True) as step: 2512 log.info('Verify link status')2513 for i in range(0,3):2514 2515 data = fetch_cli.fetch_topology(ctrl)2516 verify = fetch_cli.link_status(data)2517 if verify == True: 2518 break2519 elif i == 2: 2520 assert verify2521 sleep(100)2522 2523 #Configure IP on client PC2524 with steps.start('Removing IP in client',continue_=True) as step: 2525 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2526 log.info('Successful in Removing IP in Client')2527 with steps.start('Removing IP in client2',continue_=True) as step: 2528 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2529 log.info('Successful in Removing IP in Client2')2530 client2.disconnect()2531@aetest.loop(etype = ['0x8100', '0x88A8'])2532class Two_Interface_Transaprent_QinQ(aetest.Testcase):2533 @aetest.setup2534 def Configure_Transparent(self, steps,ctrl,server,client,client2,etype,**param):2535 with steps.start('Verifying links',continue_=True) as step: 2536 log.info('Verify link status')2537 for i in range(0,3):2538 2539 data = fetch_cli.fetch_topology(ctrl)2540 verify = fetch_cli.link_status(data)2541 if verify == True: 2542 break2543 elif i == 2: 2544 assert verify2545 sleep(100)2546 client2.connect()2547 with steps.start('Configure Transparent in dn port1',continue_=True) as step:2548 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2549 log.info('sucessful in Enabling Transparent on dn')2550 with steps.start('Configure QinQ VLAN in dn port2',continue_=True) as step:2551 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2552 log.info('sucessful in Enabling Double VLAN on dn')2553 sleep(60)2554 with steps.start('Verifying links',continue_=True) as step: 2555 log.info('Verify link status')2556 for i in range(0,3):2557 2558 data = fetch_cli.fetch_topology(ctrl)2559 verify = fetch_cli.link_status(data)2560 if verify == True: 2561 break2562 elif i == 2: 2563 assert verify2564 sleep(100)2565 2566 #Configure IP on client PC2567 with steps.start('Configure IP in client',continue_=True) as step: 2568 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2569 log.info('Successful in configuring IP in Client')2570 with steps.start('Configure IP in client2',continue_=True) as step: 2571 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2572 log.info('Successful in configuring IP in Client')2573 2574 2575 @ aetest.test2576 def verify_traffic(self,steps,ctrl,server,client,client2,etype,**param):2577 with steps.start('Configure IP in Server',continue_=True) as step: 2578 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'])2579 log.info('Successful in configuring IP in Server')2580 sleep(20) 2581 with steps.start('client1 traffic',continue_=True) as step:2582 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2583 assert ((up != 0) and (down != 0))2584 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2585 with steps.start('Removing IP in Server',continue_=True) as step: 2586 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'],status='disable')2587 log.info('Successful in Removing IP in Server')2588 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2589 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2590 log.info('Successful in configuring vlan in Server')2591 2592 sleep(20)2593 with steps.start('client2 traffic',continue_=True) as step:2594 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2595 assert ((up != 0) and (down != 0))2596 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2597 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2598 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2599 log.info('Removing vlan in Server')2600 2601 @aetest.cleanup2602 def Removing_Ips(self,steps,ctrl,server,client,client2,etype,**param):2603 2604 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:2605 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 2606 log.info('sucessful in Removing Double VLAN on dn')2607 2608 sleep(60)2609 with steps.start('Verifying links',continue_=True) as step: 2610 log.info('Verify link status')2611 for i in range(0,3):2612 2613 data = fetch_cli.fetch_topology(ctrl)2614 verify = fetch_cli.link_status(data)2615 if verify == True: 2616 break2617 elif i == 2: 2618 assert verify2619 sleep(100)2620 #Configure IP on client PC2621 with steps.start('Removing IP in client',continue_=True) as step: 2622 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2623 log.info('Successful in Removing IP in Client')2624 with steps.start('Removing IP in client2',continue_=True) as step: 2625 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2626 log.info('Successful in Removing IP in Client2')2627 client2.disconnect()2628class Two_Interface_Same_Q_Vlan(aetest.Testcase):2629 @aetest.setup2630 def Configure_Transparent(self, steps,ctrl,server,client,client2,**param):2631 with steps.start('Verifying links',continue_=True) as step: 2632 log.info('Verify link status')2633 for i in range(0,3):2634 2635 data = fetch_cli.fetch_topology(ctrl)2636 verify = fetch_cli.link_status(data)2637 if verify == True: 2638 break2639 elif i == 2: 2640 assert verify2641 sleep(100)2642 client2.connect()2643 with steps.start('Configure Qvlan in dn port1',continue_=True) as step:2644 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2645 log.info('sucessful in Enabling Qvlan on dn')2646 with steps.start('Configure Qvlan in dn port2',continue_=True) as step:2647 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2648 log.info('sucessful in Enabling Qvlan on dn')2649 sleep(60)2650 with steps.start('Verifying links',continue_=True) as step: 2651 log.info('Verify link status')2652 for i in range(0,3):2653 2654 data = fetch_cli.fetch_topology(ctrl)2655 verify = fetch_cli.link_status(data)2656 if verify == True: 2657 break2658 elif i == 2: 2659 assert verify2660 sleep(100)2661 2662 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2663 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2664 log.info('Successful in configuring vlan in Server')2665 2666 #Configure IP on client PC2667 with steps.start('Configure IP in client',continue_=True) as step: 2668 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2669 log.info('Successful in configuring IP in Client')2670 with steps.start('Configure IP in client2',continue_=True) as step: 2671 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2672 log.info('Successful in configuring IP in Client')2673 2674 2675 @ aetest.test2676 def verify_traffic(self,steps,ctrl,server,client,client2,**param):2677 2678 sleep(20) 2679 with steps.start('client1 traffic',continue_=True) as step:2680 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2681 assert ((up != 0) and (down != 0))2682 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2683 sleep(20)2684 with steps.start('client2 traffic',continue_=True) as step:2685 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2686 assert ((up != 0) and (down != 0))2687 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2688 2689 @aetest.cleanup2690 def Removing_Ips(self,steps,ctrl,server,client,client2,**param):2691 with steps.start('Removing Qvlan in dn port1',continue_=True) as step:2692 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2693 log.info('sucessful in Removing Qvlan on dn')2694 with steps.start('Removing Qvlan in dn port2',continue_=True) as step:2695 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2696 log.info('sucessful in Removing Qvlan on dn')2697 sleep(60)2698 with steps.start('Verifying links',continue_=True) as step: 2699 log.info('Verify link status')2700 for i in range(0,3):2701 2702 data = fetch_cli.fetch_topology(ctrl)2703 verify = fetch_cli.link_status(data)2704 if verify == True: 2705 break2706 elif i == 2: 2707 assert verify2708 sleep(100)2709 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2710 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2711 log.info('Successful in Removing vlan in Server')2712 2713 #Configure IP on client PC2714 with steps.start('Removing IP in client',continue_=True) as step: 2715 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2716 log.info('Successful in Removing IP in Client')2717 with steps.start('Removing IP in client2',continue_=True) as step: 2718 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2719 log.info('Successful in Removing IP in Client2')2720 client2.disconnect()2721class Two_Interface_Different_Q_Vlan(aetest.Testcase):2722 2723 @aetest.setup2724 def Configure_Transparent(self, steps,ctrl,server,client,client2,**param):2725 2726 with steps.start('Verifying links',continue_=True) as step: 2727 log.info('Verify link status')2728 for i in range(0,3):2729 2730 data = fetch_cli.fetch_topology(ctrl)2731 verify = fetch_cli.link_status(data)2732 if verify == True: 2733 break2734 elif i == 2: 2735 assert verify2736 sleep(100)2737 client2.connect()2738 with steps.start('Configure Qvlan in dn port1',continue_=True) as step:2739 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2740 log.info('sucessful in Enabling Qvlan on dn')2741 with steps.start('Configure Qvlan in dn port2',continue_=True) as step:2742 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=str(int(param['dn1_cvlan'])+1),vlan_prio='7',status='enable') 2743 log.info('sucessful in Enabling Qvlan on dn')2744 sleep(60)2745 with steps.start('Verifying links',continue_=True) as step: 2746 log.info('Verify link status')2747 for i in range(0,3):2748 2749 data = fetch_cli.fetch_topology(ctrl)2750 verify = fetch_cli.link_status(data)2751 if verify == True: 2752 break2753 elif i == 2: 2754 assert verify2755 sleep(100) 2756 2757 2758 #Configure IP on client PC2759 with steps.start('Configure IP in client',continue_=True) as step: 2760 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2761 log.info('Successful in configuring IP in Client')2762 with steps.start('Configure IP in client2',continue_=True) as step: 2763 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2764 log.info('Successful in configuring IP in Client')2765 2766 2767 @ aetest.test2768 def verify_traffic(self,steps,ctrl,server,client,client2,**param):2769 2770 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2771 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2772 log.info('Successful in configuring vlan in Server')2773 sleep(20) 2774 with steps.start('client1 traffic',continue_=True) as step:2775 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2776 assert ((up != 0) and (down != 0))2777 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2778 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2779 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2780 log.info('Successful in Removing vlan in Server')2781 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2782 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])+1),param['server_data_ipv4'])2783 log.info('Successful in configuring vlan in Server')2784 sleep(20)2785 with steps.start('client2 traffic',continue_=True) as step:2786 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2787 assert ((up != 0) and (down != 0))2788 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2789 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2790 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])+1),param['server_data_ipv4'],status='disable')2791 log.info('Successful in Removing vlan in Server')2792 2793 @aetest.cleanup2794 def Removing_Ips(self,steps,ctrl,server,client,client2,**param):2795 with steps.start('Removing Qvlan in dn port1',continue_=True) as step:2796 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2797 log.info('sucessful in Removing Qvlan on dn')2798 2799 2800 with steps.start('Removing Qvlan in dn port2',continue_=True) as step:2801 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2802 log.info('sucessful in Removing Qvlan on dn')2803 sleep(60)2804 with steps.start('Verifying links',continue_=True) as step: 2805 log.info('Verify link status')2806 for i in range(0,3):2807 2808 data = fetch_cli.fetch_topology(ctrl)2809 verify = fetch_cli.link_status(data)2810 if verify == True: 2811 break2812 elif i == 2: 2813 assert verify2814 sleep(100)2815 2816 #Configure IP on client PC2817 with steps.start('Removing IP in client',continue_=True) as step: 2818 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2819 log.info('Successful in Removing IP in Client')2820 with steps.start('Removing IP in client2',continue_=True) as step: 2821 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2822 log.info('Successful in Removing IP in Client2')2823 client2.disconnect()2824@aetest.loop(etype = ['0x8100', '0x88A8'])2825class Two_Interface_Q_QinQ(aetest.Testcase):2826 @aetest.setup2827 def Configure_Transparent(self, steps,ctrl,server,client,client2,etype,**param):2828 with steps.start('Verifying links',continue_=True) as step: 2829 log.info('Verify link status')2830 for i in range(0,3):2831 2832 data = fetch_cli.fetch_topology(ctrl)2833 verify = fetch_cli.link_status(data)2834 if verify == True: 2835 break2836 elif i == 2: 2837 assert verify2838 sleep(100)2839 client2.connect()2840 with steps.start('Configure Qvlan in dn port1',continue_=True) as step:2841 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2842 log.info('sucessful in Enabling Qvlan on dn')2843 with steps.start('Configure QinQ VLAN in dn port2',continue_=True) as step:2844 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2845 log.info('sucessful in Enabling Double VLAN on dn')2846 sleep(60)2847 with steps.start('Verifying links',continue_=True) as step: 2848 log.info('Verify link status')2849 for i in range(0,3):2850 2851 data = fetch_cli.fetch_topology(ctrl)2852 verify = fetch_cli.link_status(data)2853 if verify == True: 2854 break2855 elif i == 2: 2856 assert verify2857 sleep(100)2858 2859 #Configure IP on client PC2860 with steps.start('Configure IP in client',continue_=True) as step: 2861 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2862 log.info('Successful in configuring IP in Client')2863 with steps.start('Configure IP in client2',continue_=True) as step: 2864 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2865 log.info('Successful in configuring IP in Client')2866 2867 2868 @ aetest.test2869 def verify_traffic(self,steps,ctrl,server,client,client2,etype,**param):2870 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2871 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2872 log.info('Successful in configuring vlan in Server')2873 sleep(20) 2874 with steps.start('client1 traffic',continue_=True) as step:2875 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2876 assert ((up != 0) and (down != 0))2877 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2878 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2879 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2880 log.info('Successful in Removing vlan in Server')2881 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2882 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2883 log.info('Successful in configuring vlan in Server')2884 2885 sleep(20)2886 with steps.start('client2 traffic',continue_=True) as step:2887 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2888 assert ((up != 0) and (down != 0))2889 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2890 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2891 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2892 log.info('Removing vlan in Server')2893 2894 @aetest.cleanup2895 def Removing_Ips(self,steps,ctrl,server,client,client2,etype,**param):2896 2897 with steps.start('Removing Qvlan in dn port1',continue_=True) as step:2898 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2899 log.info('sucessful in Removing Qvlan on dn')2900 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:2901 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 2902 log.info('sucessful in Removing Double VLAN on dn')2903 sleep(60)2904 with steps.start('Verifying links',continue_=True) as step: 2905 log.info('Verify link status')2906 for i in range(0,3):2907 2908 data = fetch_cli.fetch_topology(ctrl)2909 verify = fetch_cli.link_status(data)2910 if verify == True: 2911 break2912 elif i == 2: 2913 assert verify2914 sleep(100)2915 2916 #Configure IP on client PC2917 with steps.start('Removing IP in client',continue_=True) as step: 2918 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2919 log.info('Successful in Removing IP in Client')2920 with steps.start('Removing IP in client2',continue_=True) as step: 2921 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2922 log.info('Successful in Removing IP in Client2')2923 client2.disconnect()2924@aetest.loop(etype = ['0x8100', '0x88A8'])2925class Two_Interface_Same_QinQ(aetest.Testcase):2926 @aetest.setup2927 def Configure_QinQ(self, steps,ctrl,server,client,client2,etype,**param):2928 with steps.start('Verifying links',continue_=True) as step: 2929 log.info('Verify link status')2930 for i in range(0,3):2931 2932 data = fetch_cli.fetch_topology(ctrl)2933 verify = fetch_cli.link_status(data)2934 if verify == True: 2935 break2936 elif i == 2: 2937 assert verify2938 sleep(100)2939 client2.connect()2940 with steps.start('Configure QinQ VLAN in dn port1',continue_=True) as step:2941 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2942 log.info('sucessful in Enabling Double VLAN on dn')2943 with steps.start('Configure QinQ VLAN in dn port2',continue_=True) as step:2944 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2945 log.info('sucessful in Enabling Double VLAN on dn')2946 sleep(60)2947 with steps.start('Verifying links',continue_=True) as step: 2948 log.info('Verify link status')2949 for i in range(0,3):2950 2951 data = fetch_cli.fetch_topology(ctrl)2952 verify = fetch_cli.link_status(data)2953 if verify == True: 2954 break2955 elif i == 2: 2956 assert verify2957 sleep(100)2958 2959 #Configure IP on client PC2960 with steps.start('Configure IP in client',continue_=True) as step: 2961 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2962 log.info('Successful in configuring IP in Client')2963 with steps.start('Configure IP in client2',continue_=True) as step: 2964 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2965 log.info('Successful in configuring IP in Client')2966 2967 2968 @ aetest.test2969 def verify_traffic(self,steps,ctrl,server,client,client2,etype,**param):2970 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2971 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2972 log.info('Successful in configuring vlan in Server')2973 sleep(20) 2974 with steps.start('client1 traffic',continue_=True) as step:2975 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2976 assert ((up != 0) and (down != 0))2977 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2978 '''with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2979 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2980 log.info('Removing vlan in Server')'''2981 '''with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2982 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2983 log.info('Successful in configuring vlan in Server')'''2984 2985 sleep(20)2986 with steps.start('client2 traffic',continue_=True) as step:2987 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2988 assert ((up != 0) and (down != 0))2989 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2990 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2991 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2992 log.info('Removing vlan in Server')2993 2994 @aetest.cleanup2995 def Removing_Ips(self,steps,ctrl,server,client,client2,etype,**param):2996 2997 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:2998 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 2999 log.info('sucessful in Removing Double VLAN on dn')3000 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:3001 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 3002 log.info('sucessful in Removing Double VLAN on dn')3003 sleep(60)3004 with steps.start('Verifying links',continue_=True) as step: 3005 log.info('Verify link status')3006 for i in range(0,3):3007 3008 data = fetch_cli.fetch_topology(ctrl)3009 verify = fetch_cli.link_status(data)3010 if verify == True: 3011 break3012 elif i == 2: 3013 assert verify3014 sleep(100)3015 3016 #Configure IP on client PC3017 with steps.start('Removing IP in client',continue_=True) as step: 3018 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3019 log.info('Successful in Removing IP in Client')3020 with steps.start('Removing IP in client2',continue_=True) as step: 3021 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')3022 log.info('Successful in Removing IP in Client2')3023 client2.disconnect()3024@aetest.loop(etype = ['0x8100', '0x88A8'])3025class Two_Interface_Different_QinQ(aetest.Testcase):3026 @aetest.setup3027 def Configure_Transparent(self, steps,ctrl,server,client,client2,etype,**param):3028 3029 with steps.start('Verifying links',continue_=True) as step: 3030 log.info('Verify link status')3031 for i in range(0,3):3032 3033 data = fetch_cli.fetch_topology(ctrl)3034 verify = fetch_cli.link_status(data)3035 if verify == True: 3036 break3037 elif i == 2: 3038 assert verify3039 sleep(100)3040 client2.connect()3041 with steps.start('Configure QinQ VLAN in dn port1',continue_=True) as step:3042 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 3043 log.info('sucessful in Enabling Double VLAN on dn')3044 with steps.start('Configure QinQ VLAN in dn port2',continue_=True) as step:3045 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=str(int(param['dn1_cvlan'])+1),svlan=str(int(param['dn1_svlan'])+1),ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 3046 log.info('sucessful in Enabling Double VLAN on dn')3047 sleep(60)3048 with steps.start('Verifying links',continue_=True) as step: 3049 log.info('Verify link status')3050 for i in range(0,3):3051 3052 data = fetch_cli.fetch_topology(ctrl)3053 verify = fetch_cli.link_status(data)3054 if verify == True: 3055 break3056 elif i == 2: 3057 assert verify3058 sleep(100)3059 3060 #Configure IP on client PC3061 with steps.start('Configure IP in client',continue_=True) as step: 3062 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])3063 log.info('Successful in configuring IP in Client')3064 with steps.start('Configure IP in client2',continue_=True) as step: 3065 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])3066 log.info('Successful in configuring IP in Client')3067 3068 3069 @ aetest.test3070 def verify_traffic(self,steps,ctrl,server,client,client2,etype,**param):3071 3072 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:3073 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)3074 log.info('Successful in configuring vlan in Server')3075 sleep(20) 3076 with steps.start('client1 traffic',continue_=True) as step:3077 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])3078 assert ((up != 0) and (down != 0))3079 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 3080 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:3081 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')3082 log.info('Removing vlan in Server')3083 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:3084 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])+1),str(int(param['dn1_svlan'])+1),param['server_data_ipv4'],ethertype=etype)3085 log.info('Successful in configuring vlan in Server')3086 3087 sleep(20)3088 with steps.start('client2 traffic',continue_=True) as step:3089 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])3090 assert ((up != 0) and (down != 0))3091 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))3092 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:3093 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])+1),str(int(param['dn1_svlan'])+1),param['server_data_ipv4'],ethertype=etype,status='disable')3094 log.info('Removing vlan in Server')3095 3096 @aetest.cleanup3097 def Removing_Ips(self,steps,ctrl,server,client,client2,etype,**param):3098 3099 3100 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:3101 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 3102 log.info('sucessful in Removing Double VLAN on dn')3103 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:3104 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=str(int(param['dn1_cvlan'])+1),svlan=str(int(param['dn1_svlan'])+1),ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 3105 log.info('sucessful in Removing Double VLAN on dn')3106 sleep(60)3107 with steps.start('Verifying links',continue_=True) as step: 3108 log.info('Verify link status')3109 for i in range(0,3):3110 3111 data = fetch_cli.fetch_topology(ctrl)3112 verify = fetch_cli.link_status(data)3113 if verify == True: 3114 break3115 elif i == 2: 3116 assert verify3117 sleep(100)3118 3119 #Configure IP on client PC3120 with steps.start('Removing IP in client',continue_=True) as step: 3121 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3122 log.info('Successful in Removing IP in Client')3123 with steps.start('Removing IP in client2',continue_=True) as step: 3124 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')3125 log.info('Successful in Removing IP in Client2')3126 client2.disconnect()3127class Same_Mvlan(aetest.Testcase):3128 @aetest.setup3129 def setup_management_vlan(self,steps,ctrl,server,**param):3130 with steps.start('Verifying links',continue_=True) as step: 3131 log.info('Verify link status')3132 for i in range(0,3):3133 3134 data = fetch_cli.fetch_topology(ctrl)3135 verify = fetch_cli.link_status(data)3136 if verify == True: 3137 break3138 elif i == 2: 3139 assert verify3140 sleep(100)3141 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:3142 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])3143 log.info('Successful in configuring mvlan in DN')3144 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'])3145 log.info('Successful in configuring mvlan in POP')3146 3147 3148 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3149 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])3150 log.info('Successful in configuring vlan in Server')3151 sleep(60)3152 with steps.start('Verifying links',continue_=True) as step: 3153 log.info('Verify link status')3154 for i in range(0,3):3155 3156 data = fetch_cli.fetch_topology(ctrl)3157 verify = fetch_cli.link_status(data)3158 if verify == True: 3159 break3160 elif i == 2: 3161 assert verify3162 sleep(100)3163 @ aetest.test3164 def verify_gui_page(self,steps,ctrl,server,**param):3165 sleep(10)3166 with steps.start('Verifying GUI page of POP',continue_=True) as step:3167 assert misc.verify_web_page(server,param['pop_management_ip'])3168 log.info('Successful in verifying POP GUI with MVLAN')3169 with steps.start('Verifying GUI page of DN',continue_=True) as step:3170 assert misc.verify_web_page(server,param['dn1_management_ip'])3171 log.info('Successful in verifying DN1 GUI with MVLAN')3172 @aetest.cleanup3173 def removing_vlan_config(self,steps,ctrl,server,**param):3174 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3175 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')3176 log.info('Successful in Removing vlan in Server')3177 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:3178 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')3179 log.info('Successful in Removing mvlan in DN')3180 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],status='disable')3181 log.info('Successful in Removing mvlan in POP')3182 sleep(60)3183 with steps.start('Verifying links',continue_=True) as step: 3184 log.info('Verify link status')3185 for i in range(0,3):3186 3187 data = fetch_cli.fetch_topology(ctrl)3188 verify = fetch_cli.link_status(data)3189 if verify == True: 3190 break3191 elif i == 2: 3192 assert verify3193 sleep(100)3194class Different_Mvlan(aetest.Testcase):3195 @aetest.setup3196 def setup_management_vlan(self,steps,ctrl,server,**param):3197 with steps.start('Verifying links',continue_=True) as step: 3198 log.info('Verify link status')3199 for i in range(0,3):3200 3201 data = fetch_cli.fetch_topology(ctrl)3202 verify = fetch_cli.link_status(data)3203 if verify == True: 3204 break3205 elif i == 2: 3206 assert verify3207 sleep(100)3208 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:3209 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])3210 log.info('Successful in configuring mvlan in DN')3211 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'])3212 log.info('Successful in configuring mvlan in POP')3213 3214 sleep(60)3215 with steps.start('Verifying links',continue_=True) as step: 3216 log.info('Verify link status')3217 for i in range(0,3):3218 3219 data = fetch_cli.fetch_topology(ctrl)3220 verify = fetch_cli.link_status(data)3221 if verify == True: 3222 break3223 elif i == 2: 3224 assert verify3225 sleep(100)3226 3227 @ aetest.test3228 def verify_gui_page(self,steps,ctrl,server,**param):3229 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3230 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'])3231 log.info('Successful in configuring vlan in Server')3232 sleep(10)3233 with steps.start('Verifying GUI page of POP',continue_=True) as step:3234 assert misc.verify_web_page(server,param['pop_management_ip'])3235 log.info('Successful in verifying POP GUI with MVLAN')3236 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3237 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'],status='disable')3238 log.info('Successful in Removing vlan in Server')3239 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3240 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])3241 log.info('Successful in configuring vlan in Server')3242 sleep(10)3243 with steps.start('Verifying GUI page of DN',continue_=True) as step:3244 assert misc.verify_web_page(server,param['dn1_management_ip'])3245 log.info('Successful in verifying DN1 GUI with MVLAN')3246 3247 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3248 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')3249 log.info('Successful in Removing vlan in Server')3250 @aetest.cleanup3251 def removing_vlan_config(self,steps,ctrl,server,**param):3252 3253 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:3254 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')3255 log.info('Successful in Removing mvlan in DN')3256 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'],status='disable')3257 log.info('Successful in Removing mvlan in POP') 3258 sleep(60)3259 with steps.start('Verifying links',continue_=True) as step: 3260 log.info('Verify link status')3261 for i in range(0,3):3262 3263 data = fetch_cli.fetch_topology(ctrl)3264 verify = fetch_cli.link_status(data)3265 if verify == True: 3266 break3267 elif i == 2: 3268 assert verify3269 sleep(100)3270@aetest.loop(etype = ['0x8100', '0x88A8'])3271class Same_Mqinq_Vlan(aetest.Testcase):3272 @aetest.setup3273 def config_qinq_vlan(self,steps,ctrl,server,etype,**param):3274 with steps.start('Verifying links',continue_=True) as step: 3275 log.info('Verify link status')3276 for i in range(0,3):3277 3278 data = fetch_cli.fetch_topology(ctrl)3279 verify = fetch_cli.link_status(data)3280 if verify == True: 3281 break3282 elif i == 2: 3283 assert verify3284 sleep(100)3285 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:3286 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')3287 log.info('Successful in configuring QinQ mvlan on DN1')3288 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')3289 log.info('Successful in configuring QinQ mvlan on POP')3290 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:3291 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')3292 sleep(60)3293 with steps.start('Verifying links',continue_=True) as step: 3294 log.info('Verify link status')3295 for i in range(0,3):3296 3297 data = fetch_cli.fetch_topology(ctrl)3298 verify = fetch_cli.link_status(data)3299 if verify == True: 3300 break3301 elif i == 2: 3302 assert verify3303 sleep(100)3304 @ aetest.test3305 def test_QinQ_management_vlan(self,steps,ctrl,server,etype,**param):3306 sleep(10)3307 with steps.start('Verifying POP GUI access',continue_=True) as step:3308 assert misc.verify_web_page(server,param['pop_management_ip'])3309 log.info('Successful in verifying POP GUI with MVLAN')3310 with steps.start('Verifying GUI page of DN',continue_=True) as step:3311 assert misc.verify_web_page(server,param['dn1_management_ip'])3312 log.info('Successful in verifying DN1 GUI with MVLAN')3313 @aetest.cleanup3314 def removing_vlan_configs(self,steps,ctrl,server,etype,**param):3315 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:3316 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')3317 log.info('Successful in configuring QinQ mvlan on DN1')3318 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')3319 log.info('Successful in configuring QinQ mvlan on POP')3320 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:3321 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable')3322 sleep(60)3323 with steps.start('Verifying links',continue_=True) as step: 3324 log.info('Verify link status')3325 for i in range(0,3):3326 3327 data = fetch_cli.fetch_topology(ctrl)3328 verify = fetch_cli.link_status(data)3329 if verify == True: 3330 break3331 elif i == 2: 3332 assert verify3333 sleep(100)3334@aetest.loop(etype = ['0x8100', '0x88A8'])3335class Different_Mqinq_Vlan(aetest.Testcase):3336 @aetest.setup3337 def config_qinq_vlan(self,steps,ctrl,server,etype,**param):3338 with steps.start('Verifying links',continue_=True) as step: 3339 log.info('Verify link status')3340 for i in range(0,3):3341 3342 data = fetch_cli.fetch_topology(ctrl)3343 verify = fetch_cli.link_status(data)3344 if verify == True: 3345 break3346 elif i == 2: 3347 assert verify3348 sleep(100)3349 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:3350 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')3351 log.info('Successful in configuring QinQ mvlan on DN1')3352 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'],param['pop_msvlan'],ethertype=etype,status='enable')3353 log.info('Successful in configuring QinQ mvlan on POP')3354 sleep(60)3355 with steps.start('Verifying links',continue_=True) as step: 3356 log.info('Verify link status')3357 for i in range(0,3):3358 3359 data = fetch_cli.fetch_topology(ctrl)3360 verify = fetch_cli.link_status(data)3361 if verify == True: 3362 break3363 elif i == 2: 3364 assert verify3365 sleep(100)3366 3367 @ aetest.test3368 def test_QinQ_management_vlan(self,steps,ctrl,server,etype,**param):3369 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:3370 assert misc.config_QinQ(server,param['server_inf'],param['pop_mcvlan'],param['pop_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')3371 sleep(10)3372 with steps.start('Verifying POP GUI access',continue_=True) as step:3373 assert misc.verify_web_page(server,param['pop_management_ip'])3374 log.info('Successful in verifying POP GUI with MVLAN')3375 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:3376 assert misc.config_QinQ(server,param['server_inf'],param['pop_mcvlan'],param['pop_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable')3377 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:3378 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')3379 sleep(10)3380 with steps.start('Verifying GUI page of DN',continue_=True) as step:3381 assert misc.verify_web_page(server,param['dn1_management_ip'])3382 log.info('Successful in verifying DN1 GUI with MVLAN')3383 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:3384 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable')3385 @aetest.cleanup3386 def removing_vlan_configs(self,steps,ctrl,server,etype,**param):3387 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:3388 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')3389 log.info('Successful in configuring QinQ mvlan on DN1')3390 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'],param['pop_msvlan'],ethertype=etype,status='disable')3391 log.info('Successful in configuring QinQ mvlan on POP')3392 sleep(60)3393 with steps.start('Verifying links',continue_=True) as step: 3394 log.info('Verify link status')3395 for i in range(0,3):3396 3397 data = fetch_cli.fetch_topology(ctrl)3398 verify = fetch_cli.link_status(data)3399 if verify == True: 3400 break3401 elif i == 2: 3402 assert verify3403 sleep(100)3404class Single_Data_Vlan_Single_Same_Management_Vlan(aetest.Testcase):3405 def Capturing_Server_interface(self,server,server_inf,server_file):3406 assert misc.capture_interface(server,server_inf,server_file)3407 3408 def Verify_traffic(self,client,server_data_ipv4):3409 log.info('Starting iperf client')3410 up,down=misc.config_iperf_client(client,server_data_ipv4)3411 assert ((up != 0.0) and (down != 0.0))3412 @aetest.setup3413 def setup_vlan(self,steps,ctrl,server,client,**param):3414 with steps.start('Verifying links',continue_=True) as step: 3415 log.info('Verify link status')3416 for i in range(0,3):3417 3418 data = fetch_cli.fetch_topology(ctrl)3419 verify = fetch_cli.link_status(data)3420 if verify == True: 3421 break3422 elif i == 2: 3423 assert verify3424 sleep(100)3425 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:3426 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])3427 log.info('Successful in configuring mvlan in DN')3428 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'])3429 log.info('Successful in configuring mvlan in POP')3430 with steps.start('Configure Q VLAN in dn',continue_=True) as step:3431 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 3432 log.info('sucessful in Enabling Single VLAN on dn')3433 sleep(60)3434 with steps.start('Verifying links',continue_=True) as step: 3435 log.info('Verify link status')3436 for i in range(0,3):3437 3438 data = fetch_cli.fetch_topology(ctrl)3439 verify = fetch_cli.link_status(data)3440 if verify == True: 3441 break3442 elif i == 2: 3443 assert verify3444 sleep(100)3445 3446 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3447 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])3448 log.info('Successful in configuring vlan in Server')3449 3450 3451 3452 with steps.start('Configure Q VLAN in Server',continue_=True) as step:3453 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])3454 log.info('Successful in configuring vlan in Server')3455 3456 #Configure IP on client PC3457 with steps.start('Configure IP in client',continue_=True) as step: 3458 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])3459 log.info('Successful in configuring IP in Client')3460 3461 3462 @ aetest.test3463 def verify_gui_page(self,steps,ctrl,server,client,**param):3464 with steps.start('Verifying GUI page of POP',continue_=True) as step:3465 assert misc.verify_web_page(server,param['pop_management_ip'])3466 log.info('Successful in verifying POP GUI with MVLAN')3467 sleep(10)3468 with steps.start('Verifying GUI page of DN',continue_=True) as step:3469 assert misc.verify_web_page(server,param['dn1_management_ip'])3470 log.info('Successful in verifying DN1 GUI with MVLAN')3471 with steps.start('Capturing and verifying traffic',continue_=True) as step:3472 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))3473 p1.start()3474 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))3475 p2.start()3476 p1.join()3477 p2.join()3478 with steps.start('Analyse Capture',continue_=True) as step:3479 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3480 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])3481 res=misc.analyse_capture(server,filter,param['server_file'])3482 if res > 0:3483 log.info('Successful in VLAN tagging')3484 else:3485 assert False3486 @aetest.cleanup3487 def removing_vlan_config(self,steps,ctrl,server,client,**param):3488 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3489 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')3490 log.info('Successful in Removing vlan in Server')3491 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:3492 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')3493 log.info('Successful in Removing mvlan in DN')3494 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],status='disable')3495 log.info('Successful in Removing mvlan in POP') 3496 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:3497 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 3498 log.info('sucessful in removing Single VLAN on dn')3499 sleep(60)3500 with steps.start('Verifying links',continue_=True) as step: 3501 log.info('Verify link status')3502 for i in range(0,3):3503 3504 data = fetch_cli.fetch_topology(ctrl)3505 verify = fetch_cli.link_status(data)3506 if verify == True: 3507 break3508 elif i == 2: 3509 assert verify3510 sleep(100)3511 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3512 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')3513 log.info('Successful in configuring vlan in Server')3514 3515 with steps.start('Removing IP in client',continue_=True) as step:3516 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3517 log.info('Successful in Removing IP in Client')3518class Single_Data_Vlan_Single_Different_Management_Vlan(aetest.Testcase):3519 def Capturing_Server_interface(self,server,server_inf,server_file):3520 assert misc.capture_interface(server,server_inf,server_file)3521 3522 def Verify_traffic(self,client,server_data_ipv4):3523 log.info('Starting iperf client')3524 up,down=misc.config_iperf_client(client,server_data_ipv4)3525 assert ((up != 0.0) and (down != 0.0))3526 @aetest.setup3527 def setup_vlan(self,steps,ctrl,server,client,**param):3528 with steps.start('Verifying links',continue_=True) as step: 3529 log.info('Verify link status')3530 for i in range(0,3):3531 3532 data = fetch_cli.fetch_topology(ctrl)3533 verify = fetch_cli.link_status(data)3534 if verify == True: 3535 break3536 elif i == 2: 3537 assert verify3538 sleep(100)3539 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:3540 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])3541 log.info('Successful in configuring mvlan in DN')3542 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'])3543 log.info('Successful in configuring mvlan in POP')3544 with steps.start('Configure Q VLAN in dn',continue_=True) as step:3545 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 3546 log.info('sucessful in Enabling Single VLAN on dn')3547 sleep(60)3548 with steps.start('Verifying links',continue_=True) as step: 3549 log.info('Verify link status')3550 for i in range(0,3):3551 3552 data = fetch_cli.fetch_topology(ctrl)3553 verify = fetch_cli.link_status(data)3554 if verify == True: 3555 break3556 elif i == 2: 3557 assert verify3558 sleep(100)3559 3560 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3561 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])3562 log.info('Successful in configuring vlan in Server')3563 3564 3565 3566 with steps.start('Configure Q VLAN in Server',continue_=True) as step:3567 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])3568 log.info('Successful in configuring vlan in Server')3569 3570 #Configure IP on client PC3571 with steps.start('Configure IP in client',continue_=True) as step: 3572 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])3573 log.info('Successful in configuring IP in Client')3574 3575 3576 @ aetest.test3577 def verification(self,steps,ctrl,server,client,**param):3578 3579 sleep(10)3580 with steps.start('Verifying GUI page of DN',continue_=True) as step:3581 assert misc.verify_web_page(server,param['dn1_management_ip'])3582 log.info('Successful in verifying DN1 GUI with MVLAN')3583 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3584 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')3585 log.info('Successful in Removing vlan in Server')3586 3587 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3588 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'])3589 log.info('Successful in configuring vlan in Server')3590 sleep(10)3591 with steps.start('Verifying GUI page of POP',continue_=True) as step:3592 assert misc.verify_web_page(server,param['pop_management_ip'])3593 log.info('Successful in verifying POP GUI with MVLAN')3594 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3595 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'],status='disable')3596 log.info('Successful in Removing vlan in Server')3597 with steps.start('Capturing and verifying traffic',continue_=True) as step:3598 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))3599 p1.start()3600 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))3601 p2.start()3602 p1.join()3603 p2.join()3604 with steps.start('Analyse Capture',continue_=True) as step:3605 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3606 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])3607 res=misc.analyse_capture(server,filter,param['server_file'])3608 if res > 0:3609 log.info('Successful in VLAN tagging')3610 else:3611 assert False3612 @aetest.cleanup3613 def removing_vlan_config(self,steps,ctrl,server,client,**param):3614 3615 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:3616 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')3617 log.info('Successful in Removing mvlan in DN')3618 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'],status='disable')3619 log.info('Successful in Removing mvlan in POP') 3620 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:3621 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 3622 log.info('sucessful in removing Single VLAN on dn')3623 sleep(60)3624 with steps.start('Verifying links',continue_=True) as step: 3625 log.info('Verify link status')3626 for i in range(0,3):3627 3628 data = fetch_cli.fetch_topology(ctrl)3629 verify = fetch_cli.link_status(data)3630 if verify == True: 3631 break3632 elif i == 2: 3633 assert verify3634 sleep(100)3635 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3636 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')3637 log.info('Successful in configuring vlan in Server')3638 3639 with steps.start('Removing IP in client',continue_=True) as step:3640 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3641 log.info('Successful in Removing IP in Client')3642@aetest.loop(etype = ['0x8100', '0x88A8'])3643class Single_Data_Vlan_Double_Same_Management_Vlan(aetest.Testcase):3644 def Capturing_Server_interface(self,server,server_inf,server_file):3645 assert misc.capture_interface(server,server_inf,server_file)3646 3647 def Verify_traffic(self,client,server_data_ipv4):3648 log.info('Starting iperf client')3649 up,down=misc.config_iperf_client(client,server_data_ipv4)3650 assert ((up != 0.0) and (down != 0.0))3651 @aetest.setup3652 def setup_vlan(self,steps,ctrl,server,client,etype,**param):3653 with steps.start('Verifying links',continue_=True) as step: 3654 log.info('Verify link status')3655 for i in range(0,3):3656 3657 data = fetch_cli.fetch_topology(ctrl)3658 verify = fetch_cli.link_status(data)3659 if verify == True: 3660 break3661 elif i == 2: 3662 assert verify3663 sleep(100)3664 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:3665 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')3666 log.info('Successful in configuring QinQ mvlan on DN1')3667 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')3668 log.info('Successful in configuring QinQ mvlan on POP')3669 with steps.start('Configure Q VLAN in dn',continue_=True) as step:3670 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 3671 log.info('sucessful in Enabling Single VLAN on dn')3672 sleep(60)3673 with steps.start('Verifying links',continue_=True) as step: 3674 log.info('Verify link status')3675 for i in range(0,3):3676 3677 data = fetch_cli.fetch_topology(ctrl)3678 verify = fetch_cli.link_status(data)3679 if verify == True: 3680 break3681 elif i == 2: 3682 assert verify3683 sleep(100)3684 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:3685 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')3686 3687 3688 3689 with steps.start('Configure Q VLAN in Server',continue_=True) as step:3690 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])3691 log.info('Successful in configuring vlan in Server')3692 3693 #Configure IP on client PC3694 with steps.start('Configure IP in client',continue_=True) as step: 3695 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])3696 log.info('Successful in configuring IP in Client')3697 3698 3699 @ aetest.test3700 def verify_gui_page(self,steps,ctrl,server,client,etype,**param):3701 sleep(10)3702 with steps.start('Verifying GUI page of POP',continue_=True) as step:3703 assert misc.verify_web_page(server,param['pop_management_ip'])3704 log.info('Successful in verifying POP GUI with MVLAN')3705 with steps.start('Verifying GUI page of DN',continue_=True) as step:3706 assert misc.verify_web_page(server,param['dn1_management_ip'])3707 log.info('Successful in verifying DN1 GUI with MVLAN')3708 with steps.start('Capturing and verifying traffic',continue_=True) as step:3709 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))3710 p1.start()3711 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))3712 p2.start()3713 p1.join()3714 p2.join()3715 with steps.start('Analyse Capture',continue_=True) as step:3716 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3717 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])3718 res=misc.analyse_capture(server,filter,param['server_file'])3719 if res > 0:3720 log.info('Successful in VLAN tagging')3721 else:3722 assert False3723 @aetest.cleanup3724 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):3725 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:3726 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')3727 log.info('Successful in configuring QinQ mvlan on DN1')3728 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')3729 log.info('Successful in configuring QinQ mvlan on POP')3730 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:3731 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 3732 log.info('sucessful in removing Single VLAN on dn')3733 3734 sleep(60)3735 with steps.start('Verifying links',continue_=True) as step: 3736 log.info('Verify link status')3737 for i in range(0,3):3738 3739 data = fetch_cli.fetch_topology(ctrl)3740 verify = fetch_cli.link_status(data)3741 if verify == True: 3742 break3743 elif i == 2: 3744 assert verify3745 sleep(100)3746 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:3747 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable') 3748 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3749 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')3750 log.info('Successful in configuring vlan in Server')3751 3752 with steps.start('Removing IP in client',continue_=True) as step:3753 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3754 log.info('Successful in Removing IP in Client')3755@aetest.loop(etype = ['0x8100', '0x88A8'])3756class Single_Data_Vlan_Double_Different_Management_Vlan(aetest.Testcase):3757 def Capturing_Server_interface(self,server,server_inf,server_file):3758 assert misc.capture_interface(server,server_inf,server_file)3759 3760 def Verify_traffic(self,client,server_data_ipv4):3761 log.info('Starting iperf client')3762 up,down=misc.config_iperf_client(client,server_data_ipv4)3763 assert ((up != 0.0) and (down != 0.0))3764 @aetest.setup3765 def setup_vlan(self,steps,ctrl,server,client,etype,**param):3766 with steps.start('Verifying links',continue_=True) as step: 3767 log.info('Verify link status')3768 for i in range(0,3):3769 3770 data = fetch_cli.fetch_topology(ctrl)3771 verify = fetch_cli.link_status(data)3772 if verify == True: 3773 break3774 elif i == 2: 3775 assert verify3776 sleep(100)3777 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:3778 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')3779 log.info('Successful in configuring QinQ mvlan on DN1')3780 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'],param['pop_msvlan'],ethertype=etype,status='enable')3781 log.info('Successful in configuring QinQ mvlan on POP')3782 with steps.start('Configure Q VLAN in dn',continue_=True) as step:3783 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 3784 log.info('sucessful in Enabling Single VLAN on dn')3785 sleep(60)3786 with steps.start('Verifying links',continue_=True) as step: 3787 log.info('Verify link status')3788 for i in range(0,3):3789 3790 data = fetch_cli.fetch_topology(ctrl)3791 verify = fetch_cli.link_status(data)3792 if verify == True: 3793 break3794 elif i == 2: 3795 assert verify3796 sleep(100)3797 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:3798 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')3799 3800 3801 3802 with steps.start('Configure Q VLAN in Server',continue_=True) as step:3803 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])3804 log.info('Successful in configuring vlan in Server')3805 3806 #Configure IP on client PC3807 with steps.start('Configure IP in client',continue_=True) as step: 3808 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])3809 log.info('Successful in configuring IP in Client')3810 3811 3812 @ aetest.test3813 def verify_gui_page(self,steps,ctrl,server,client,etype,**param):3814 sleep(10)3815 with steps.start('Verifying GUI page of DN',continue_=True) as step:3816 assert misc.verify_web_page(server,param['dn1_management_ip'])3817 log.info('Successful in verifying DN1 GUI with MVLAN')3818 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:3819 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable') 3820 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:3821 assert misc.config_QinQ(server,param['server_inf'],param['pop_mcvlan'],param['pop_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')3822 sleep(10)3823 with steps.start('Verifying GUI page of POP',continue_=True) as step:3824 assert misc.verify_web_page(server,param['pop_management_ip'])3825 log.info('Successful in verifying POP GUI with MVLAN')3826 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:3827 assert misc.config_QinQ(server,param['server_inf'],param['pop_mcvlan'],param['pop_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable') 3828 with steps.start('Capturing and verifying traffic',continue_=True) as step:3829 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))3830 p1.start()3831 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))3832 p2.start()3833 p1.join()3834 p2.join()3835 with steps.start('Analyse Capture',continue_=True) as step:3836 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3837 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])3838 res=misc.analyse_capture(server,filter,param['server_file'])3839 if res > 0:3840 log.info('Successful in VLAN tagging')3841 else:3842 assert False3843 @aetest.cleanup3844 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):3845 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:3846 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')3847 log.info('Successful in configuring QinQ mvlan on DN1')3848 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')3849 log.info('Successful in configuring QinQ mvlan on POP')3850 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:3851 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 3852 log.info('sucessful in removing Single VLAN on dn')3853 3854 sleep(60)3855 with steps.start('Verifying links',continue_=True) as step: 3856 log.info('Verify link status')3857 for i in range(0,3):3858 3859 data = fetch_cli.fetch_topology(ctrl)3860 verify = fetch_cli.link_status(data)3861 if verify == True: 3862 break3863 elif i == 2: 3864 assert verify3865 sleep(100)3866 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3867 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')3868 log.info('Successful in configuring vlan in Server')3869 3870 with steps.start('Removing IP in client',continue_=True) as step:3871 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3872 log.info('Successful in Removing IP in Client')3873class Same_Single_Vlan_On_Data_Management(aetest.Testcase):3874 def Capturing_Server_interface(self,server,server_inf,server_file):3875 assert misc.capture_interface(server,server_inf,server_file)3876 3877 def Verify_traffic(self,client,server_data_ipv4):3878 log.info('Starting iperf client')3879 up,down=misc.config_iperf_client(client,server_data_ipv4)3880 assert ((up != 0.0) and (down != 0.0))3881 @aetest.setup3882 def setup_vlan(self,steps,ctrl,server,**param):3883 with steps.start('Verifying links',continue_=True) as step: 3884 log.info('Verify link status')3885 for i in range(0,3):3886 3887 data = fetch_cli.fetch_topology(ctrl)3888 verify = fetch_cli.link_status(data)3889 if verify == True: 3890 break3891 elif i == 2: 3892 assert verify3893 sleep(100)3894 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:3895 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])3896 log.info('Successful in configuring mvlan in DN')3897 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'])3898 log.info('Successful in configuring mvlan in POP')3899 sleep(60)3900 with steps.start('Verifying links',continue_=True) as step: 3901 log.info('Verify link status')3902 for i in range(0,3):3903 3904 data = fetch_cli.fetch_topology(ctrl)3905 verify = fetch_cli.link_status(data)3906 if verify == True: 3907 break3908 elif i == 2: 3909 assert verify3910 sleep(100)3911 3912 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3913 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])3914 log.info('Successful in configuring vlan in Server')3915 3916 3917 @ aetest.test3918 def verify_gui_page(self,steps,ctrl,server,client,**param):3919 sleep(10)3920 with steps.start('Verifying GUI page of POP',continue_=True) as step:3921 assert misc.verify_web_page(server,param['pop_management_ip'])3922 log.info('Successful in verifying POP GUI with MVLAN')3923 with steps.start('Verifying GUI page of DN',continue_=True) as step:3924 assert misc.verify_web_page(server,param['dn1_management_ip'])3925 log.info('Successful in verifying DN1 GUI with MVLAN')3926 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3927 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')3928 log.info('Successful in Removing vlan in Server')3929 with steps.start('Configure Q VLAN in dn',continue_=True) as step:3930 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_mcvlan'],vlan_prio='7',status='enable') 3931 log.info('sucessful in Enabling Single VLAN on dn')3932 sleep(60)3933 with steps.start('Verifying links',continue_=True) as step: 3934 log.info('Verify link status')3935 for i in range(0,3):3936 3937 data = fetch_cli.fetch_topology(ctrl)3938 verify = fetch_cli.link_status(data)3939 if verify == True: 3940 break3941 elif i == 2: 3942 assert verify3943 sleep(100)3944 3945 3946 with steps.start('Configure Q VLAN in Server',continue_=True) as step:3947 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_data_ipv4'])3948 log.info('Successful in configuring vlan in Server')3949 3950 #Configure IP on client PC3951 with steps.start('Configure IP in client',continue_=True) as step: 3952 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])3953 log.info('Successful in configuring IP in Client')3954 3955 with steps.start('Capturing and verifying traffic',continue_=True) as step:3956 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))3957 p1.start()3958 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))3959 p2.start()3960 p1.join()3961 p2.join()3962 with steps.start('Analyse Capture',continue_=True) as step:3963 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3964 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_mcvlan'])3965 res=misc.analyse_capture(server,filter,param['server_file'])3966 if res > 0:3967 log.info('Successful in VLAN tagging')3968 else:3969 assert False3970 @aetest.cleanup3971 def removing_vlan_config(self,steps,ctrl,server,client,**param):3972 3973 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:3974 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')3975 log.info('Successful in Removing mvlan in DN')3976 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],status='disable')3977 log.info('Successful in Removing mvlan in POP') 3978 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:3979 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_mcvlan'],status='disable') 3980 log.info('sucessful in removing Single VLAN on dn') 3981 sleep(60)3982 with steps.start('Verifying links',continue_=True) as step: 3983 log.info('Verify link status')3984 for i in range(0,3):3985 3986 data = fetch_cli.fetch_topology(ctrl)3987 verify = fetch_cli.link_status(data)3988 if verify == True: 3989 break3990 elif i == 2: 3991 assert verify3992 sleep(100) 3993 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3994 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_data_ipv4'],status='disable')3995 log.info('Successful in configuring vlan in Server')3996 3997 with steps.start('Removing IP in client',continue_=True) as step:3998 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3999 log.info('Successful in Removing IP in Client')4000@aetest.loop(etype = ['0x8100', '0x88A8'])4001class Double_Data_Vlan_Single_Same_Management_Vlan(aetest.Testcase):4002 def Capturing_Server_interface(self,server,server_inf,server_file):4003 assert misc.capture_interface(server,server_inf,server_file)4004 4005 def Verify_traffic(self,client,server_data_ipv4):4006 log.info('Starting iperf client')4007 up,down=misc.config_iperf_client(client,server_data_ipv4)4008 assert ((up != 0.0) and (down != 0.0))4009 4010 @aetest.setup4011 def setup_vlan(self,steps,ctrl,server,client,etype,**param):4012 with steps.start('Verifying links',continue_=True) as step: 4013 log.info('Verify link status')4014 for i in range(0,3):4015 4016 data = fetch_cli.fetch_topology(ctrl)4017 verify = fetch_cli.link_status(data)4018 if verify == True: 4019 break4020 elif i == 2: 4021 assert verify4022 sleep(100)4023 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:4024 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])4025 log.info('Successful in configuring mvlan in DN')4026 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'])4027 log.info('Successful in configuring mvlan in POP')4028 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:4029 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 4030 log.info('sucessful in Enabling Double VLAN on dn')4031 sleep(60)4032 with steps.start('Verifying links',continue_=True) as step: 4033 log.info('Verify link status')4034 for i in range(0,3):4035 4036 data = fetch_cli.fetch_topology(ctrl)4037 verify = fetch_cli.link_status(data)4038 if verify == True: 4039 break4040 elif i == 2: 4041 assert verify4042 sleep(100) 4043 4044 with steps.start('Configuring MVLAN on Server',continue_=True) as step:4045 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])4046 log.info('Successful in configuring vlan in Server')4047 4048 4049 4050 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:4051 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)4052 log.info('Successful in configuring vlan in Server')4053 4054 #Configure IP on client PC4055 with steps.start('Configure IP in client',continue_=True) as step: 4056 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])4057 log.info('Successful in configuring IP in Client')4058 4059 4060 4061 4062 4063 @ aetest.test4064 def verifyication(self,steps,ctrl,server,client,etype,**param):4065 sleep(10)4066 with steps.start('Verifying GUI page of POP',continue_=True) as step:4067 assert misc.verify_web_page(server,param['pop_management_ip'])4068 log.info('Successful in verifying POP GUI with MVLAN')4069 with steps.start('Verifying GUI page of DN',continue_=True) as step:4070 assert misc.verify_web_page(server,param['dn1_management_ip'])4071 log.info('Successful in verifying DN1 GUI with MVLAN')4072 with steps.start('Capturing and verifying traffic',continue_=True) as step:4073 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))4074 p1.start()4075 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))4076 p2.start()4077 p1.join()4078 p2.join()4079 with steps.start('Analyse Capture',continue_=True) as step:4080 if etype =='0x8100':4081 ip = param['client_data_ipv4'].rsplit('/', 1)[0]4082 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])4083 else:4084 ip = param['client_data_ipv4'].rsplit('/', 1)[0]4085 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])4086 res=misc.analyse_capture(server,filter,param['server_file'])4087 if res > 0:4088 log.info('Successful in QinQ VLAN tagging')4089 else:4090 assert False4091 @aetest.cleanup4092 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):4093 with steps.start('Removing Q VLAN in Server',continue_=True) as step:4094 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')4095 log.info('Successful in Removing vlan in Server')4096 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:4097 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')4098 log.info('Successful in Removing mvlan in DN')4099 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],status='disable')4100 log.info('Successful in Removing mvlan in POP') 4101 with steps.start('Removing vlan configs from DN',continue_=True) as step:4102 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,status='disable') 4103 log.info('sucessful in Removing QinQ VLAN on dn')4104 sleep(60)4105 with steps.start('Verifying links',continue_=True) as step: 4106 log.info('Verify link status')4107 for i in range(0,3):4108 4109 data = fetch_cli.fetch_topology(ctrl)4110 verify = fetch_cli.link_status(data)4111 if verify == True: 4112 break4113 elif i == 2: 4114 assert verify4115 sleep(100) 4116 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:4117 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')4118 log.info('Successful in Removing vlan in Server')4119 4120 with steps.start('Configure IP in client',continue_=True) as step:4121 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')4122 log.info('Successful in configuring IP in Client')4123@aetest.loop(etype = ['0x8100', '0x88A8'])4124class Double_Data_Vlan_Single_Different_Management_Vlan(aetest.Testcase):4125 def Capturing_Server_interface(self,server,server_inf,server_file):4126 assert misc.capture_interface(server,server_inf,server_file)4127 4128 def Verify_traffic(self,client,server_data_ipv4):4129 log.info('Starting iperf client')4130 up,down=misc.config_iperf_client(client,server_data_ipv4)4131 assert ((up != 0.0) and (down != 0.0))4132 4133 @aetest.setup4134 def setup_vlan(self,steps,ctrl,server,client,etype,**param):4135 with steps.start('Verifying links',continue_=True) as step: 4136 log.info('Verify link status')4137 for i in range(0,3):4138 4139 data = fetch_cli.fetch_topology(ctrl)4140 verify = fetch_cli.link_status(data)4141 if verify == True: 4142 break4143 elif i == 2: 4144 assert verify4145 sleep(100)4146 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:4147 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])4148 log.info('Successful in configuring mvlan in DN')4149 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'])4150 log.info('Successful in configuring mvlan in POP')4151 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:4152 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 4153 log.info('sucessful in Enabling Double VLAN on dn')4154 sleep(60)4155 with steps.start('Verifying links',continue_=True) as step: 4156 log.info('Verify link status')4157 for i in range(0,3):4158 4159 data = fetch_cli.fetch_topology(ctrl)4160 verify = fetch_cli.link_status(data)4161 if verify == True: 4162 break4163 elif i == 2: 4164 assert verify4165 sleep(100)4166 4167 with steps.start('Configuring MVLAN on Server',continue_=True) as step:4168 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])4169 log.info('Successful in configuring vlan in Server')4170 4171 4172 4173 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:4174 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)4175 log.info('Successful in configuring vlan in Server')4176 4177 #Configure IP on client PC4178 with steps.start('Configure IP in client',continue_=True) as step: 4179 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])4180 log.info('Successful in configuring IP in Client')4181 @ aetest.test4182 def verifyication(self,steps,ctrl,server,client,etype,**param):4183 4184 sleep(10)4185 with steps.start('Verifying GUI page of DN',continue_=True) as step:4186 assert misc.verify_web_page(server,param['dn1_management_ip'])4187 log.info('Successful in verifying DN1 GUI with MVLAN')4188 with steps.start('Removing Q VLAN in Server',continue_=True) as step:4189 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')4190 log.info('Successful in Removing vlan in Server')4191 with steps.start('Configuring MVLAN on Server',continue_=True) as step:4192 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'])4193 log.info('Successful in configuring vlan in Server')4194 sleep(10)4195 with steps.start('Verifying GUI page of POP',continue_=True) as step:4196 assert misc.verify_web_page(server,param['pop_management_ip'])4197 log.info('Successful in verifying POP GUI with MVLAN')4198 with steps.start('Removing Q VLAN in Server',continue_=True) as step:4199 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'],status='disable')4200 log.info('Successful in Removing vlan in Server')4201 4202 with steps.start('Capturing and verifying traffic',continue_=True) as step:4203 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))4204 p1.start()4205 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))4206 p2.start()4207 p1.join()4208 p2.join()4209 with steps.start('Analyse Capture',continue_=True) as step:4210 if etype =='0x8100':4211 ip = param['client_data_ipv4'].rsplit('/', 1)[0]4212 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])4213 else:4214 ip = param['client_data_ipv4'].rsplit('/', 1)[0]4215 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])4216 res=misc.analyse_capture(server,filter,param['server_file'])4217 if res > 0:4218 log.info('Successful in QinQ VLAN tagging')4219 else:4220 assert False4221 @aetest.cleanup4222 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):4223 4224 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:4225 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')4226 log.info('Successful in Removing mvlan in DN')4227 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'],status='disable')4228 log.info('Successful in Removing mvlan in POP') 4229 with steps.start('Removing vlan configs from server',continue_=True) as step:4230 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,status='disable') 4231 log.info('sucessful in Removing QinQ VLAN on dn') 4232 sleep(60)4233 with steps.start('Verifying links',continue_=True) as step: 4234 log.info('Verify link status')4235 for i in range(0,3):4236 4237 data = fetch_cli.fetch_topology(ctrl)4238 verify = fetch_cli.link_status(data)4239 if verify == True: 4240 break4241 elif i == 2: 4242 assert verify4243 sleep(100)4244 4245 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:4246 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')4247 log.info('Successful in Removing vlan in Server')4248 4249 with steps.start('Configure IP in client',continue_=True) as step:4250 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')4251 log.info('Successful in configuring IP in Client')4252@aetest.loop(etype = ['0x8100', '0x88A8'])4253class Same_Double_Vlan_On_Data_Management(aetest.Testcase):4254 def Capturing_Server_interface(self,server,server_inf,server_file):4255 assert misc.capture_interface(server,server_inf,server_file)4256 4257 def Verify_traffic(self,client,server_data_ipv4):4258 log.info('Starting iperf client')4259 up,down=misc.config_iperf_client(client,server_data_ipv4)4260 assert ((up != 0.0) and (down != 0.0))4261 4262 @aetest.setup4263 def setup_vlan(self,steps,ctrl,server,client,etype,**param):4264 with steps.start('Verifying links',continue_=True) as step: 4265 log.info('Verify link status')4266 for i in range(0,3):4267 4268 data = fetch_cli.fetch_topology(ctrl)4269 verify = fetch_cli.link_status(data)4270 if verify == True: 4271 break4272 elif i == 2: 4273 assert verify4274 sleep(100)4275 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:4276 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')4277 log.info('Successful in configuring QinQ mvlan on DN1')4278 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')4279 log.info('Successful in configuring QinQ mvlan on POP')4280 sleep(60)4281 with steps.start('Verifying links',continue_=True) as step: 4282 log.info('Verify link status')4283 for i in range(0,3):4284 4285 data = fetch_cli.fetch_topology(ctrl)4286 verify = fetch_cli.link_status(data)4287 if verify == True: 4288 break4289 elif i == 2: 4290 assert verify4291 sleep(100)4292 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:4293 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')4294 4295 @ aetest.test4296 def verifyication(self,steps,ctrl,server,client,etype,**param):4297 sleep(10)4298 with steps.start('Verifying POP GUI access',continue_=True) as step:4299 assert misc.verify_web_page(server,param['pop_management_ip'])4300 log.info('Successful in verifying POP GUI with MVLAN')4301 with steps.start('Verifying GUI page of DN',continue_=True) as step:4302 assert misc.verify_web_page(server,param['dn1_management_ip'])4303 log.info('Successful in verifying DN1 GUI with MVLAN')4304 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:4305 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable')4306 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:4307 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_mcvlan'],svlan=param['dn1_msvlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 4308 log.info('sucessful in Enabling Double VLAN on dn')4309 sleep(60)4310 with steps.start('Verifying links',continue_=True) as step: 4311 log.info('Verify link status')4312 for i in range(0,3):4313 4314 data = fetch_cli.fetch_topology(ctrl)4315 verify = fetch_cli.link_status(data)4316 if verify == True: 4317 break4318 elif i == 2: 4319 assert verify4320 sleep(100)4321 4322 4323 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:4324 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_data_ipv4'],ethertype=etype)4325 log.info('Successful in configuring vlan in Server')4326 4327 #Configure IP on client PC4328 with steps.start('Configure IP in client',continue_=True) as step: 4329 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])4330 log.info('Successful in configuring IP in Client')4331 with steps.start('Capturing and verifying traffic',continue_=True) as step:4332 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))4333 p1.start()4334 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))4335 p2.start()4336 p1.join()4337 p2.join()4338 with steps.start('Analyse Capture',continue_=True) as step:4339 if etype =='0x8100':4340 ip = param['client_data_ipv4'].rsplit('/', 1)[0]4341 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_mcvlan'],param['dn1_msvlan'])4342 else:4343 ip = param['client_data_ipv4'].rsplit('/', 1)[0]4344 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_mcvlan'],param['dn1_msvlan'])4345 res=misc.analyse_capture(server,filter,param['server_file'])4346 if res > 0:4347 log.info('Successful in QinQ VLAN tagging')4348 else:4349 assert False4350 @aetest.cleanup4351 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):4352 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:4353 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')4354 log.info('Successful in configuring QinQ mvlan on DN1')4355 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')4356 log.info('Successful in configuring QinQ mvlan on POP')4357 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:4358 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_mcvlan'],svlan=param['dn1_msvlan'],ethertype=etype,status='disable') 4359 log.info('sucessful in Removing QinQ VLAN on dn')4360 sleep(60)4361 with steps.start('Verifying links',continue_=True) as step: 4362 log.info('Verify link status')4363 for i in range(0,3):4364 4365 data = fetch_cli.fetch_topology(ctrl)4366 verify = fetch_cli.link_status(data)4367 if verify == True: 4368 break4369 elif i == 2: 4370 assert verify4371 sleep(100)4372 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:4373 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_data_ipv4'],ethertype=etype,status='disable')4374 log.info('Successful in Removing vlan in Server')4375 4376 with steps.start('Configure IP in client',continue_=True) as step:4377 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')4378 log.info('Successful in configuring IP in Client')4379class common_cleanup(aetest.CommonCleanup): 4380 @aetest.subsection4381 def Disabling_L2bridge(self,steps,ctrl,server,client,**param):4382 log.info('configuring l2bridge')4383 with steps.start('Disabling L2 bridge',continue_=True) as step:4384 assert cli.modify_network_l2bridge(ctrl,state='disable')4385 log.info('Successful in configuring l2bridge')4386 sleep(150) 4387 ctrl.disconnect()4388 ctrl.connect()4389 with steps.start('Verify link status',continue_=True) as step:4390 for i in range(0,3):4391 sleep(100)4392 data = fetch_cli.fetch_topology(ctrl)4393 verify = fetch_cli.link_status(data)4394 if verify == True: 4395 break4396 elif i == 2: 4397 assert verify4398 4399 @aetest.subsection4400 def deleting_node(self,steps,ctrl,server,client,**param):4401 assert cli.del_node(ctrl,param['dn1_name']) 4402 log.info('Successful in deleting dn1')4403 4404 @aetest.subsection4405 def deleting_Site(self,steps,ctrl,server,client,**param):4406 assert cli.del_site(ctrl,param['dn1_site'])4407 log.info('Successful in Deleting site')4408 4409 @aetest.subsection4410 def stopping_iperf_server(self,server,ctrl,client,**param):4411 assert misc.config_iperf_server(server,status='disable')4412 log.info('Successful in stopping iperf server')4413 ctrl.disconnect()4414 misc.execute_command(server,'rm index.html*')4415 misc.execute_command(server,'sudo ifconfig {} mtu 1500'.format(param['server_inf']))4416 misc.execute_command(client,'sudo ifconfig {} mtu 1500'.format(param['client_inf']))4417 server.disconnect()4418 client.disconnect()4419 4420 4421 4422if __name__ == '__main__': # pragma: no cover...

Full Screen

Full Screen

vlan_verify_copy.py

Source:vlan_verify_copy.py Github

copy

Full Screen

1# system imports2from os import chdir3from time import sleep4from datetime import datetime5import logging6import yaml7import sys8from pyats import aetest9from pyats.log.utils import banner10from genie import testbed11#from pyats.topology import loader12from multiprocessing import Process13log = logging.getLogger(__name__)14log.setLevel(logging.DEBUG)15#importing custom modules16from Config.config import *17from Fetch.fetch import *18from Misc.misc import misc19#Fetching input values from input.yaml20global lis21lis=[]22global lis123lis1=[]24class common_setup(aetest.CommonSetup): 25 @aetest.subsection26 def initial_configs(self,steps, testbed, **param):27 28 ref_pp = self.parent.parameters29 ref_pp['ctrl'] = testbed.devices[param['ctrl_alias']]30 ref_pp['dn'] = testbed.devices[param['dn_alias']]31 ref_pp['server'] = testbed.devices[param['server_alias']]32 ref_pp['client'] = testbed.devices[param['client_alias']]33 ref_pp['client2'] = testbed.devices[param['client2_alias']]34 ref_pp['client3'] = testbed.devices[param['client3_alias']]35 ref_pp['pop_name'] = ref_pp['ctrl'].custom['name']36 ref_pp['pop_mac'] = ref_pp['ctrl'].custom['mac']37 ref_pp['pop_iface'] = ref_pp['ctrl'].custom['iface']38 ref_pp['pop_iface'] = ref_pp['ctrl'].custom['iface']39 ref_pp['pop_mcvlan'] = ref_pp['ctrl'].custom['mcvlan']40 ref_pp['pop_msvlan'] = ref_pp['ctrl'].custom['msvlan']41 ref_pp['pop_management_ip']=ref_pp['ctrl'].custom['management_ip']42 ref_pp['path']=ref_pp['ctrl'].custom['location']43 44 ref_pp['dn1_name']=ref_pp['dn'].custom['name']45 ref_pp['dn1_site']=ref_pp['dn'].custom['site']46 ref_pp['dn1_lat'] = ref_pp['dn'].custom['lat']47 ref_pp['dn1_lon'] = ref_pp['dn'].custom['lon']48 ref_pp['dn1_alt'] = ref_pp['dn'].custom['alt']49 ref_pp['dn1_acc'] = ref_pp['dn'].custom['acc']50 ref_pp['dn1_inf'] = ref_pp['dn'].custom['inf']51 ref_pp['dn1_inf1'] = ref_pp['dn'].custom['inf1'] 52 ref_pp['dn1_mac'] = ref_pp['dn'].custom['mac']53 ref_pp['dn1_management_ip']=ref_pp['dn'].custom['management_ip']54 ref_pp['dn1_cvlan'] = ref_pp['dn'].custom['cvlan']55 ref_pp['dn1_svlan'] = ref_pp['dn'].custom['svlan']56 ref_pp['dn1_mcvlan'] = ref_pp['dn'].custom['mcvlan']57 ref_pp['dn1_msvlan'] = ref_pp['dn'].custom['msvlan']58 ref_pp['server_inf']=ref_pp['server'].custom['inf']59 ref_pp['server_data_ipv6']=ref_pp['server'].custom['ipv6']60 ref_pp['server_data_ipv4']=ref_pp['server'].custom['ipv4']61 ref_pp['server_mgmt_ipv4']=ref_pp['server'].custom['mgmt_ipv4']62 ref_pp['server_file']=ref_pp['server'].custom['capture_file']63 ref_pp['client_inf']=ref_pp['client'].custom['inf']64 ref_pp['client_data_ipv4']=ref_pp['client'].custom['ipv4']65 ref_pp['client2_inf']=ref_pp['client2'].custom['inf']66 ref_pp['client2_data_ipv4']=ref_pp['client2'].custom['ipv4']67 ref_pp['client3_inf']=ref_pp['client3'].custom['inf']68 ref_pp['client3_data_ipv4']=ref_pp['client3'].custom['ipv4']69 70 vlan=int(ref_pp['dn1_cvlan'])71 #global lis72 #lis=[]73 for i in range(0,5):74 lis.append(vlan+i)75 76 svlan=int(ref_pp['dn1_svlan'])77 #global lis178 #lis1=[]79 for i in range(0,5):80 lis1.append(svlan+i) 81 82 ref_pp['ctrl'].connect()83 ref_pp['server'].connect()84 ref_pp['client'].connect()85 86 @aetest.subsection87 def create_site(self,steps,ctrl,server,client,**param):88 misc.execute_command(server,'sudo ifconfig {} mtu 1492'.format(param['server_inf']))89 misc.execute_command(client,'sudo ifconfig {} mtu 1492'.format(param['client_inf']))90 log.info('Creating Site')91 assert cli.add_site(ctrl,param['dn1_site'],param['dn1_lat'],param['dn1_lon'],param['dn1_alt'],param['dn1_acc'])92 log.info('Successful in adding site')93 94 @aetest.subsection95 def Adding_node(self,steps,ctrl,server,client,**param):96 #Adding dn97 log.info('Adding dn1')98 assert cli.add_dn(ctrl,param['dn1_name'],param['dn1_site'],param['dn1_mac']) 99 log.info('Successful in adding dn1')100 101 @aetest.subsection102 def Adding_link(self,steps,ctrl,server,client,**param):103 #Adding link POP to dn1 link104 log.info('Adding link from controller')105 assert cli.add_link(ctrl,param['pop_name'],param['dn1_name'],param['pop_mac'],param['dn1_mac'],init_radio='radio1',resp_radio='radio1')106 log.info('Successful in Adding link') 107 log.info('Verify link status')108 @aetest.subsection109 def configuring_mgmt_ip(self,steps,ctrl,server,client,**param):110 with steps.start('Configuring Management ip on POP',continue_=True) as step:111 assert cli.config_management_ip(ctrl,param['pop_name'],param['pop_management_ip'])112 log.info('Successful in configuring Mgmt ip on POP')113 with steps.start('Configuring Management ip on DN',continue_=True) as step:114 assert cli.config_management_ip(ctrl,param['dn1_name'],param['dn1_management_ip'])115 log.info('Successful in configuring Mgmt ip on DN1')116 117 @aetest.subsection118 def start_iperf_server(self,steps,ctrl,server,client,**param):119 misc.config_iperf_server(server)120 @aetest.subsection121 def verify_links(self,steps,ctrl,server,client,**param): 122 log.info('Verify link status')123 for i in range(0,3):124 sleep(100)125 data = fetch_cli.fetch_topology(ctrl)126 verify = fetch_cli.link_status(data)127 if verify == True: 128 break129 elif i == 2: 130 assert verify131 132 133 log.info('Successful in bringing up')134 135 @aetest.subsection136 def configure_l2_bridge(self,steps,ctrl,server,client,**param):137 #configuring l2bridge138 log.info('configuring l2bridge')139 140 assert cli.modify_network_l2bridge(ctrl,state='enable')141 log.info('Successful in configuring l2bridge')142 ctrl.disconnect()143 sleep(150)144 ctrl.connect()145 @aetest.subsection146 def verify_links(self,steps,ctrl,server,client,**param):147 log.info('Verify link status')148 for i in range(0,3):149 sleep(100)150 data = fetch_cli.fetch_topology(ctrl)151 verify = fetch_cli.link_status(data)152 if verify == True:153 break154 elif i == 2:155 assert verify156 log.info('Successful in bringing up') 157 158 159 160class Q_Vlan(aetest.Testcase):161 def Capturing_Server_interface(self,server,server_inf,server_file):162 assert misc.capture_interface(server,server_inf,server_file)163 164 def Verify_traffic(self,client,server_data_ipv4):165 log.info('Starting iperf client')166 up,down=misc.config_iperf_client(client,server_data_ipv4)167 assert ((up != 0.0) and (down != 0.0))168 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))169 170 @aetest.setup171 def Setup(self, steps,ctrl,server,client,**param):172 with steps.start('Verifying links',continue_=True) as step: 173 log.info('Verify link status')174 for i in range(0,3):175 176 data = fetch_cli.fetch_topology(ctrl)177 verify = fetch_cli.link_status(data)178 if verify == True: 179 break180 elif i == 2: 181 assert verify182 sleep(100)183 184 with steps.start('Configure Q VLAN in dn',continue_=True) as step:185 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 186 log.info('sucessful in Enabling Single VLAN on dn')187 188 sleep(60)189 with steps.start('Verifying links',continue_=True) as step: 190 log.info('Verify link status')191 for i in range(0,3):192 193 data = fetch_cli.fetch_topology(ctrl)194 verify = fetch_cli.link_status(data)195 if verify == True: 196 break197 elif i == 2: 198 assert verify199 sleep(100)200 201 with steps.start('Configure Q VLAN in Server',continue_=True) as step:202 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])203 log.info('Successful in configuring vlan in Server')204 205 #Configure IP on client PC206 with steps.start('Configure IP in client',continue_=True) as step: 207 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])208 log.info('Successful in configuring IP in Client')209 210 211 212 with steps.start('Capturing and verifying traffic',continue_=True) as step:213 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))214 p1.start()215 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))216 p2.start()217 p1.join()218 p2.join()219 with steps.start('Analyse Capture',continue_=True) as step:220 ip = param['client_data_ipv4'].rsplit('/', 1)[0]221 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])222 res=misc.analyse_capture(server,filter,param['server_file'])223 if res > 0:224 log.info('Successful in VLAN tagging')225 else:226 assert False227 @aetest.cleanup228 def Disabling_Q_VLAN(self,steps,ctrl,server,client,**param):229 230 log.info('Disabling Single VLAN in dn')231 with steps.start('Configure Q VLAN in Server',continue_=True) as step:232 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')233 log.info('Successful in configuring vlan in Server')234 with steps.start('Removing vlan configs from server',continue_=True) as step:235 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 236 log.info('sucessful in Enabling Single VLAN on dn')237 with steps.start('Configure IP in client',continue_=True) as step:238 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')239 log.info('Successful in configuring IP in Client')240 sleep(60)241 with steps.start('Verifying links',continue_=True) as step: 242 log.info('Verify link status')243 for i in range(0,3):244 245 data = fetch_cli.fetch_topology(ctrl)246 verify = fetch_cli.link_status(data)247 if verify == True: 248 break249 elif i == 2: 250 assert verify251 sleep(100)252 253@aetest.loop(etype = ['0x8100', '0x88A8'])254class QinQ_Vlan(aetest.Testcase):255 def Capturing_Server_interface(self,server,server_inf,server_file):256 assert misc.capture_interface(server,server_inf,server_file)257 def Verify_traffic(self,client,server_data_ipv4):258 log.info('Starting iperf client')259 up,down=misc.config_iperf_client(client,server_data_ipv4)260 assert ((up != 0.0) and (down != 0.0))261 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))262 263 @aetest.setup264 def Configure_QinQ_Vlan(self, etype, steps,ctrl,server,client,**param):265 with steps.start('Verifying links',continue_=True) as step: 266 log.info('Verify link status')267 for i in range(0,3):268 269 data = fetch_cli.fetch_topology(ctrl)270 verify = fetch_cli.link_status(data)271 if verify == True: 272 break273 elif i == 2: 274 assert verify275 sleep(100)276 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:277 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 278 log.info('sucessful in Enabling Double VLAN on dn')279 sleep(60)280 with steps.start('Verifying links',continue_=True) as step: 281 log.info('Verify link status')282 for i in range(0,3):283 284 data = fetch_cli.fetch_topology(ctrl)285 verify = fetch_cli.link_status(data)286 if verify == True: 287 break288 elif i == 2: 289 assert verify290 sleep(100)291 292 293 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:294 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)295 log.info('Successful in configuring vlan in Server')296 297 #Configure IP on client PC298 with steps.start('Configure IP in client',continue_=True) as step: 299 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])300 log.info('Successful in configuring IP in Client')301 302 303 with steps.start('Capturing and verifying traffic',continue_=True) as step:304 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))305 p1.start()306 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))307 p2.start()308 p1.join()309 p2.join()310 with steps.start('Analyse Capture',continue_=True) as step:311 if etype =='0x8100':312 ip = param['client_data_ipv4'].rsplit('/', 1)[0]313 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])314 else:315 ip = param['client_data_ipv4'].rsplit('/', 1)[0]316 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])317 res=misc.analyse_capture(server,filter,param['server_file'])318 if res > 0:319 log.info('Successful in QinQ VLAN tagging')320 else:321 assert False322 323 324 325 @aetest.cleanup326 def Disabling_QinQ_VLAN(self,etype,steps,ctrl,server,client,**param):327 328 log.info('Disabling Double VLAN in dn')329 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:330 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')331 log.info('Successful in Removing vlan in Server')332 with steps.start('Removing vlan configs from DN',continue_=True) as step:333 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,status='disable') 334 log.info('sucessful in Removing QinQ VLAN on dn')335 336 sleep(60)337 with steps.start('Verifying links',continue_=True) as step: 338 log.info('Verify link status')339 for i in range(0,3):340 341 data = fetch_cli.fetch_topology(ctrl)342 verify = fetch_cli.link_status(data)343 if verify == True: 344 break345 elif i == 2: 346 assert verify347 sleep(100)348 with steps.start('Configure IP in client',continue_=True) as step:349 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')350 log.info('Successful in configuring IP in Client')351class Allowed_Q_Vlan(aetest.Testcase):352 353 @aetest.setup354 def Configure_Q_Vlan_allowed_list(self, steps,ctrl,server,client,**param):355 vlans='{},{}-{}'.format(lis[0],lis[1],lis[3])356 with steps.start('Verifying links',continue_=True) as step: 357 log.info('Verify link status')358 for i in range(0,3):359 360 data = fetch_cli.fetch_topology(ctrl)361 verify = fetch_cli.link_status(data)362 if verify == True: 363 break364 elif i == 2: 365 assert verify366 sleep(100)367 368 with steps.start('Configure Q VLAN in dn',continue_=True) as step:369 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=str(int(param['dn1_cvlan'])-1),status='enable') 370 log.info('sucessful in Enabling Single VLAN on dn')371 sleep(60)372 with steps.start('Verifying links',continue_=True) as step: 373 log.info('Verify link status')374 for i in range(0,3):375 376 data = fetch_cli.fetch_topology(ctrl)377 verify = fetch_cli.link_status(data)378 if verify == True: 379 break380 elif i == 2: 381 assert verify382 sleep(100)383 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:384 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='enable') 385 log.info('sucessful in configuring allowed q VLAN on dn')386 387 388 def test_untagged_packets(self,steps,ctrl,server,client,**param):389 with steps.start('Configure Q VLAN in Server',continue_=True) as step:390 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'])391 log.info('Successful in configuring vlan in Server')392 with steps.start('Configure IP in client',continue_=True) as step:393 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])394 log.info('Successful in configuring IP in Client')395 log.info('Starting iperf client')396 #sleep(20)397 with steps.start('Verifying Traffic',continue_=True) as step:398 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])399 assert ((up != 0.0) and (down != 0.0))400 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))401 with steps.start('Removing Q VLAN in Server',continue_=True) as step:402 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'],status='disable')403 log.info('Removing Q vlan in Server')404 with steps.start('Removing IP in client',continue_=True) as step:405 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')406 log.info('Successful in Removing IP in Client')407 @ aetest.test.loop(c_vlan=lis)408 def test_single_tagged_packets(self,c_vlan,steps,ctrl,server,client,**param):409 410 with steps.start('Configure Q VLAN in Server',continue_=True) as step:411 assert misc.config_Q(server,param['server_inf'],c_vlan,param['server_data_ipv4'])412 log.info('Successful in configuring vlan in Server')413 414 with steps.start('Configure Q VLAN in client',continue_=True) as step:415 assert misc.config_Q(client,param['client_inf'],c_vlan,param['client_data_ipv4'])416 log.info('Successful in configuring vlan in client')417 418 log.info('Starting iperf client')419 sleep(20) 420 with steps.start('Verifying Traffic',continue_=True) as step:421 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])422 result=((up != 0.0) and (down != 0.0))423 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))424 if c_vlan==int(param['dn1_cvlan'])+4:425 if result == False:426 log.info('No traffic due to unallowed vlan')427 else:428 assert False429 else:430 assert result431 432 with steps.start('Removing Q VLAN in Server',continue_=True) as step:433 assert misc.config_Q(server,param['server_inf'],c_vlan,param['server_data_ipv4'],status='disable')434 log.info('Removing Q vlan in Server')435 436 with steps.start('Removing Q VLAN in client',continue_=True) as step:437 assert misc.config_Q(client,param['client_inf'],c_vlan,param['client_data_ipv4'],status='disable')438 log.info('Removing Q vlan in client')439 440 441 442 443 444 445 @aetest.cleanup446 def VLAN_config_cleanup(self,steps,ctrl,server,client,**param):447 vlans='{},{}-{}'.format(lis[0],lis[1],lis[3])448 449 with steps.start('Remove Q VLAN in dn',continue_=True) as step:450 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id='1',status='disable') 451 log.info('sucessful in Removing Single VLAN on dn')452 sleep(60)453 with steps.start('Verifying links',continue_=True) as step: 454 log.info('Verify link status')455 for i in range(0,3):456 457 data = fetch_cli.fetch_topology(ctrl)458 verify = fetch_cli.link_status(data)459 if verify == True: 460 break461 elif i == 2: 462 assert verify463 sleep(100)464 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:465 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='disable') 466 log.info('sucessful in Removing allowed q VLAN on dn')467 sleep(60)468 with steps.start('Verifying links',continue_=True) as step: 469 log.info('Verify link status')470 for i in range(0,3):471 472 data = fetch_cli.fetch_topology(ctrl)473 verify = fetch_cli.link_status(data)474 if verify == True: 475 break476 elif i == 2: 477 assert verify478 sleep(100)479class Q_Vlan_Remarking(aetest.Testcase):480 481 @aetest.setup482 def Configure_Q_Vlan_allowed_list(self, steps,ctrl,server,client,**param):483 remark=int(param['dn1_cvlan'])+1484 with steps.start('Verifying links',continue_=True) as step: 485 log.info('Verify link status')486 for i in range(0,3):487 488 data = fetch_cli.fetch_topology(ctrl)489 verify = fetch_cli.link_status(data)490 if verify == True: 491 break492 elif i == 2: 493 assert verify494 sleep(100)495 496 with steps.start('Configure Q VLAN in dn',continue_=True) as step:497 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=str(int(param['dn1_cvlan'])-1),status='enable') 498 log.info('sucessful in Enabling Single VLAN on dn')499 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:500 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='enable') 501 log.info('sucessful in configuring allowed q VLAN on dn')502 503 with steps.start('Configuring Remark VLAN',continue_=True) as step:504 assert cli.config_vlan_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_cvlan'],remark)505 log.info('sucessful in Configuring Single VLAN Remarking on dn')506 @ aetest.test507 def test_untagged_packets(self,steps,ctrl,server,client,**param):508 with steps.start('Configure Q VLAN in Server',continue_=True) as step:509 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'])510 log.info('Successful in configuring vlan in Server')511 with steps.start('Configure IP in client',continue_=True) as step:512 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])513 log.info('Successful in configuring IP in Client') 514 with steps.start('Starting client iperf',continue_=True) as step:515 sleep(20) 516 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])517 assert ((up != 0) and (down != 0))518 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))519 520 521 with steps.start('Removing Q VLAN in Server',continue_=True) as step:522 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'],status='disable')523 log.info('Removing Q vlan in Server')524 with steps.start('Removing IP in client',continue_=True) as step:525 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')526 log.info('Successful in Removing IP in Client')527 @ aetest.test528 def test_single_tagged_packets(self,steps,ctrl,server,client,**param):529 remark=int(param['dn1_cvlan'])+1530 with steps.start('Configure Q VLAN in Server',continue_=True) as step:531 assert misc.config_Q(server,param['server_inf'],remark,param['server_data_ipv4'])532 log.info('Successful in configuring vlan in Server')533 with steps.start('Configure Q VLAN in client',continue_=True) as step:534 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'])535 log.info('Successful in configuring vlan in client')536 with steps.start('Starting client iperf',continue_=True) as step:537 sleep(20) 538 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])539 assert ((up != 0) and (down != 0))540 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))541 with steps.start('Removing Q VLAN in Server',continue_=True) as step:542 assert misc.config_Q(server,param['server_inf'],remark,param['server_data_ipv4'],status='disable')543 log.info('Removing Q vlan in Server')544 with steps.start('Removing Q VLAN in client',continue_=True) as step:545 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'],status='disable')546 log.info('Removing Q vlan in client') 547 @aetest.cleanup548 def Removing_configs_from_node_and_PCs(self,steps,ctrl,server,client,**param):549 remark=int(param['dn1_cvlan'])+1550 with steps.start('Removing Q VLAN in dn',continue_=True) as step:551 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id='1',status='disable') 552 log.info('sucessful in Removing Single VLAN on dn')553 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:554 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='disable') 555 log.info('sucessful in Removing allowed q VLAN on dn')556 557 with steps.start('Removing Remark VLAN',continue_=True) as step:558 assert cli.config_vlan_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_cvlan'],remark,status='disable')559 log.info('sucessful in Removing Single VLAN Remarking on dn')560class Q_Vlan_Drop_Untag(aetest.Testcase):561 562 @aetest.setup563 def Configure_Q_Vlan(self, steps,ctrl,server,client,**param):564 with steps.start('Verifying links',continue_=True) as step: 565 log.info('Verify link status')566 for i in range(0,3):567 568 data = fetch_cli.fetch_topology(ctrl)569 verify = fetch_cli.link_status(data)570 if verify == True: 571 break572 elif i == 2: 573 assert verify574 sleep(100)575 with steps.start('Configure Q VLAN in dn',continue_=True) as step:576 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=str(int(param['dn1_cvlan'])-1),status='enable') 577 log.info('sucessful in Enabling Single VLAN on dn')578 579 with steps.start('Configure drop untag packets in Q VLAN',continue_=True) as step:580 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='enable') 581 log.info('sucessful in configuring Drop untag VLAN')582 583 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:584 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='enable') 585 log.info('sucessful in configuring allowed q VLAN on dn') 586 587 @ aetest.test588 def test_untagged_packets(self,steps,ctrl,server,client,**param):589 with steps.start('Configure Q VLAN in Server',continue_=True) as step:590 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'])591 log.info('Successful in configuring vlan in Server')592 593 #Configure IP on client PC594 with steps.start('Configure IP in client',continue_=True) as step: 595 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])596 log.info('Successful in configuring IP in Client')597 598 599 with steps.start('Starting iperf in client',continue_=True) as step:600 sleep(20) 601 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])602 result=((up != 0.0) and (down != 0.0))603 if result == False:604 log.info('Traffic Failed due to drop untag')605 else:606 log.info('Failed to drop untagged packets')607 assert False608 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 609 610 611 with steps.start('Configure Q VLAN in Server',continue_=True) as step:612 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'],status='disable')613 log.info('Successful in configuring vlan in Server')614 with steps.start('Removing IP in client',continue_=True) as step:615 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')616 log.info('Successful in Removing IP in Client')617 618 @ aetest.test619 def test_single_tagged_packets(self,steps,ctrl,server,client,**param):620 with steps.start('Configure Q VLAN in Server',continue_=True) as step:621 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])622 log.info('Successful in configuring vlan in Server')623 624 with steps.start('Configure Q VLAN in client',continue_=True) as step:625 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'])626 log.info('Successful in configuring vlan in client')627 628 with steps.start('Starting iperf in client',continue_=True) as step:629 sleep(20) 630 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])631 assert ((up != 0.0) and (down != 0.0))632 log.info('througput numbers up={} down={}'.format(up,down)) 633 with steps.start('Removing Q VLAN in Server',continue_=True) as step:634 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')635 log.info('Successful in Removing vlan in Server')636 637 with steps.start('Removing Q VLAN in client',continue_=True) as step:638 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'],status='disable')639 log.info('Removing Q vlan in client')640 @aetest.cleanup641 def Disabling_Q_VLAN_configs(self,steps,ctrl,server,client,**param):642 643 log.info('Disabling Single VLAN in dn')644 with steps.start('Removing drop untag packets in Q VLAN',continue_=True) as step:645 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 646 log.info('sucessful in Removing Drop untag VLAN')647 with steps.start('Removing vlan configs from dn',continue_=True) as step:648 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 649 log.info('sucessful in Enabling Single VLAN on dn')650 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:651 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='disable') 652 log.info('sucessful in Removing allowed q VLAN on dn')653class Q_Vlan_Priority_Remarking(aetest.Testcase):654 655 def Capturing_Server_interface(self,server,server_inf,server_file):656 assert misc.capture_interface(server,server_inf,server_file)657 def Verify_traffic(self,client,server_data_ipv4):658 log.info('Starting iperf client')659 up,down=misc.config_iperf_client(client,server_data_ipv4)660 assert ((up != 0.0) and (down != 0.0))661 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))662 663 @aetest.setup664 def Configure_Q_Vlan(self, steps,ctrl,server,client,**param):665 666 with steps.start('Verifying links',continue_=True) as step: 667 log.info('Verify link status')668 for i in range(0,3):669 670 data = fetch_cli.fetch_topology(ctrl)671 verify = fetch_cli.link_status(data)672 if verify == True: 673 break674 elif i == 2: 675 assert verify676 sleep(100)677 678 with steps.start('Configure Q VLAN in dn',continue_=True) as step:679 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=str(int(param['dn1_cvlan'])-1),status='enable') 680 log.info('sucessful in Enabling Single VLAN on dn')681 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:682 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='enable') 683 log.info('sucessful in configuring allowed q VLAN on dn')684 685 with steps.start('Configuring Remark VLAN priority',continue_=True) as step:686 assert cli.config_vlan_prio_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_cvlan'],'7')687 log.info('sucessful in Configuring Single VLAN priority Remarking on dn')688 @ aetest.test689 def test_untagged_packets(self,steps,ctrl,server,client,**param):690 with steps.start('Configure Q VLAN in Server',continue_=True) as step:691 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'])692 log.info('Successful in configuring vlan in Server')693 694 with steps.start('Configure IP in client',continue_=True) as step:695 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])696 log.info('Successful in configuring IP in Client')697 with steps.start('Capturing and verifying traffic',continue_=True) as step:698 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))699 p1.start()700 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))701 p2.start()702 p1.join()703 p2.join()704 705 with steps.start('Analyse Capture',continue_=True) as step:706 ip = param['client_data_ipv4'].rsplit('/', 1)[0]707 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==0'.format(ip,str(int(param['dn1_cvlan'])-1)) 708 res=misc.analyse_capture(server,filter,param['server_file'])709 if res > 0:710 log.info('Successful in priority remarking')711 else:712 assert False713 714 with steps.start('Removing Q VLAN in Server',continue_=True) as step:715 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'],status='disable')716 log.info('Removing Q vlan in Server')717 with steps.start('Removing IP in client',continue_=True) as step:718 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')719 log.info('Successful in Removing IP in Client') 720 721 @ aetest.test722 def test_single_tagged_packets(self,steps,ctrl,server,client,**param):723 724 with steps.start('Configure Q VLAN in Server',continue_=True) as step:725 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])726 log.info('Successful in configuring vlan in Server')727 with steps.start('Configure Q VLAN in client',continue_=True) as step:728 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'])729 log.info('Successful in configuring vlan in client')730 sleep(20)731 732 with steps.start('Capturing and verifying traffic',continue_=True) as step:733 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))734 p1.start()735 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))736 p2.start()737 p1.join()738 p2.join()739 with steps.start('Analyse Capture',continue_=True) as step:740 ip = param['client_data_ipv4'].rsplit('/', 1)[0]741 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])742 res=misc.analyse_capture(server,filter,param['server_file'])743 if res > 0:744 log.info('Successful in priority remarking')745 else:746 assert False747 with steps.start('Removing Q VLAN in Server',continue_=True) as step:748 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')749 log.info('Removing Q vlan in Server')750 751 with steps.start('Removing Q VLAN in client',continue_=True) as step:752 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'],status='disable')753 log.info('Removing Q vlan in client')754 @aetest.cleanup755 def Removing_configs_from_node_and_PCs(self,steps,ctrl,server,client,**param):756 with steps.start('Removing Q VLAN in dn',continue_=True) as step:757 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id='1',status='disable') 758 log.info('sucessful in Removing Single VLAN on dn')759 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:760 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='enable') 761 log.info('sucessful in Removing allowed q VLAN on dn')762 763 with steps.start('Removing Remark VLAN prio',continue_=True) as step:764 assert cli.config_vlan_prio_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_cvlan'],'7',status='disable')765 log.info('sucessful in Removing Single VLAN priority Remarking on dn')766@aetest.loop(etype = ['0x8100', '0x88A8'])767class Q_port_Behaviour_When_QinQ_Ingress(aetest.Testcase):768 @aetest.setup769 def Configure_Q_Vlan(self, steps,ctrl,server,client,etype,**param):770 with steps.start('Verifying links',continue_=True) as step: 771 log.info('Verify link status')772 for i in range(0,3):773 774 data = fetch_cli.fetch_topology(ctrl)775 verify = fetch_cli.link_status(data)776 if verify == True: 777 break778 elif i == 2: 779 assert verify780 sleep(100)781 with steps.start('Configure Q VLAN in dn',continue_=True) as step:782 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id='1',status='enable')783 log.info('sucessful in Enabling Single VLAN on dn')784 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:785 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')786 log.info('sucessful in configuring allowed q VLAN on dn')787 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:788 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)789 log.info('Successful in configuring vlan in Server')790 with steps.start('Configure QinQ VLAN in client',continue_=True) as step:791 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)792 log.info('Successful in configuring vlan in Server')793 @ aetest.test794 def Verify_traffic(self,steps,ctrl,server,client,**param):795 log.info('Starting iperf client')796 sleep(20)797 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])798 result=((up != 0.0) and (down != 0.0))799 if result == False:800 log.info('Traffic dropped due to double tagged packets')801 else:802 log.info('Failed to drop double tagged packets')803 assert False804 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))805 @aetest.cleanup806 def Removing_Vlan_configs(self, steps,ctrl,server,client,etype,**param):807 with steps.start('Removing Q VLAN in dn',continue_=True) as step:808 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id='1',status='disable')809 log.info('sucessful in Removing Single VLAN on dn')810 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:811 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')812 log.info('sucessful in Removing allowed q VLAN on dn')813 with steps.start('Remonving QinQ VLAN in Server',continue_=True) as step:814 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')815 log.info('Successful in Removing vlan in Server')816 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:817 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')818 log.info('Successful in Removing vlan in Server')819@aetest.loop(etype = ['0x8100', '0x88A8'])820class Allowed_QinQ_Vlan(aetest.Testcase):821 @aetest.setup822 def Configure_QinQ_Vlan_allowed_list(self, steps,ctrl,server,client,etype,**param):823 vlans='{},{}-{}'.format(lis1[0],lis1[1],lis1[3])824 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:825 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')826 log.info('sucessful in Enabling Single VLAN on dn')827 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:828 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='enable')829 log.info('sucessful in configuring allowed QinQ VLAN on dn')830 @ aetest.test831 def test_untagged_packets(self,steps,ctrl,server,client,etype,**parm):832 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:833 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)834 log.info('Successful in configuring vlan in Server')835 with steps.start('Configure IP in client',continue_=True) as step:836 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])837 log.info('Successful in configuring IP in Client')838 with steps.start('Starting iperf in client',continue_=True) as step:839 sleep(20)840 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])841 assert ((up != 0.0) and (down != 0.0))842 with steps.start('Removing Q VLAN in Server',continue_=True) as step:843 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')844 log.info('Successful in Removing vlan in Server')845 with steps.start('Removing IP in client',continue_=True) as step:846 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')847 log.info('Successful in Removing IP in Client') 848 @ aetest.test.loop(s_vlan=lis1)849 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,s_vlan,**param):850 851 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:852 assert misc.config_QinQ(server,param['server_inf'],s_vlan,str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)853 log.info('Successful in configuring vlan in Server')854 with steps.start('Configure Q VLAN in client',continue_=True) as step:855 assert misc.config_Q(client,param['client_inf'],s_vlan,param['client_data_ipv4'])856 log.info('Successful in configuring vlan in client')857 with steps.start('Verifying Traffic',continue_=True) as step:858 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])859 result=((up != 0.0) and (down != 0.0))860 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))861 if s_vlan==int(param['dn1_svlan'])+4:862 if result == False:863 log.info('No traffic due to unallowed vlan')864 else:865 assert False866 else:867 assert result868 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:869 assert misc.config_QinQ(server,param['server_inf'],s_vlan,str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')870 log.info('Successful in Removing vlan in Server')871 with steps.start('Removing Q VLAN in client',continue_=True) as step:872 assert misc.config_Q(client,param['client_inf'],s_vlan,param['client_data_ipv4'],status='disable')873 log.info('Removing Q vlan in client')874 @ aetest.test.loop(s_vlan=lis1)875 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,s_vlan,**param):876 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:877 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],s_vlan,param['server_data_ipv4'],ethertype=etype)878 log.info('Successful in configuring QinQ vlan in Server')879 with steps.start('Configure Q VLAN in client',continue_=True) as step:880 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],s_vlan,param['client_data_ipv4'],ethertype=etype)881 log.info('Successful in configuring QinQ vlan in client')882 log.info('Starting iperf client')883 sleep(20)884 with steps.start('Verifying Traffic',continue_=True) as step:885 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])886 result=((up != 0.0) and (down != 0.0))887 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))888 if s_vlan==int(param['dn1_svlan'])+4:889 if result == False:890 log.info('No traffic due to unallowed vlan')891 else:892 assert False893 else:894 assert result895 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:896 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],s_vlan,param['server_data_ipv4'],status='disable')897 log.info('Removing QinQ vlan in Server')898 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:899 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],s_vlan,param['client_data_ipv4'],status='disable')900 log.info('Removing QiNQ vlan in client')901 @aetest.cleanup902 def VLAN_config_cleanup(self,steps,ctrl,server,client,etype,**param):903 vlans='{},{}-{}'.format(lis1[0],lis1[1],lis1[3])904 with steps.start('Remove QinQ VLAN in dn',continue_=True) as step:905 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan='1',cvlan='1',ethertype=etype,status='disable')906 log.info('sucessful in Removing Double VLAN on dn')907 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:908 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='disable')909 log.info('sucessful in Removing allowed QinQ VLAN on dn')910@aetest.loop(etype = ['0x8100', '0x88A8'])911class Allowed_QinQ_Vlan(aetest.Testcase):912 @aetest.setup913 def Configure_QinQ_Vlan_allowed_list(self, steps,ctrl,server,client,etype,**param):914 vlans='{},{}-{}'.format(lis1[0],lis1[1],lis1[3])915 with steps.start('Verifying links',continue_=True) as step: 916 log.info('Verify link status')917 for i in range(0,3):918 919 data = fetch_cli.fetch_topology(ctrl)920 verify = fetch_cli.link_status(data)921 if verify == True: 922 break923 elif i == 2: 924 assert verify925 sleep(100)926 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:927 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')928 log.info('sucessful in Enabling Single VLAN on dn')929 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:930 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='enable')931 log.info('sucessful in configuring allowed QinQ VLAN on dn')932 @ aetest.test933 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):934 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:935 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)936 log.info('Successful in configuring vlan in Server')937 with steps.start('Configure IP in client',continue_=True) as step:938 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])939 log.info('Successful in configuring IP in Client')940 with steps.start('Starting iperf in client',continue_=True) as step:941 sleep(20)942 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])943 assert ((up != 0.0) and (down != 0.0))944 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:945 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')946 log.info('Successful in Removing vlan in Server')947 with steps.start('Removing IP in client',continue_=True) as step:948 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')949 log.info('Successful in Removing IP in Client') 950 @ aetest.test.loop(s_vlan=lis1)951 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,s_vlan,**param):952 953 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:954 assert misc.config_QinQ(server,param['server_inf'],s_vlan,str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)955 log.info('Successful in configuring vlan in Server')956 with steps.start('Configure Q VLAN in client',continue_=True) as step:957 assert misc.config_Q(client,param['client_inf'],s_vlan,param['client_data_ipv4'])958 log.info('Successful in configuring vlan in client')959 with steps.start('Verifying Traffic',continue_=True) as step:960 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])961 result=((up != 0.0) and (down != 0.0))962 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))963 if s_vlan==int(param['dn1_svlan'])+4:964 if result == False:965 log.info('No traffic due to unallowed vlan')966 else:967 assert False968 else:969 assert result970 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:971 assert misc.config_QinQ(server,param['server_inf'],s_vlan,str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')972 log.info('Successful in Removing vlan in Server')973 with steps.start('Removing Q VLAN in client',continue_=True) as step:974 assert misc.config_Q(client,param['client_inf'],s_vlan,param['client_data_ipv4'],status='disable')975 log.info('Removing Q vlan in client')976 @ aetest.test.loop(s_vlan=lis1)977 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,s_vlan,**param):978 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:979 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],s_vlan,param['server_data_ipv4'],ethertype=etype)980 log.info('Successful in configuring QinQ vlan in Server')981 with steps.start('Configure QinQ VLAN in client',continue_=True) as step:982 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],s_vlan,param['client_data_ipv4'],ethertype=etype)983 log.info('Successful in configuring QinQ vlan in client')984 log.info('Starting iperf client')985 sleep(20)986 with steps.start('Verifying Traffic',continue_=True) as step:987 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])988 result=((up != 0.0) and (down != 0.0))989 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))990 if s_vlan==int(param['dn1_svlan'])+4:991 if result == False:992 log.info('No traffic due to unallowed vlan')993 else:994 assert False995 else:996 assert result997 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:998 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],s_vlan,param['server_data_ipv4'],status='disable')999 log.info('Removing QinQ vlan in Server')1000 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1001 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],s_vlan,param['client_data_ipv4'],status='disable')1002 log.info('Removing QiNQ vlan in client')1003 @aetest.cleanup1004 def VLAN_config_cleanup(self,steps,ctrl,server,client,etype,**param):1005 vlans='{},{}-{}'.format(lis1[0],lis1[1],lis1[3])1006 with steps.start('Remove QinQ VLAN in dn',continue_=True) as step:1007 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan='1',cvlan='1',ethertype=etype,status='disable')1008 log.info('sucessful in Removing Double VLAN on dn')1009 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1010 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='disable')1011 log.info('sucessful in Removing allowed QinQ VLAN on dn')1012@aetest.loop(etype = ['0x8100', '0x88A8'])1013class QinQ_Vlan_Remarking(aetest.Testcase):1014 1015 @aetest.setup1016 def Configure_Q_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1017 remark=int(param['dn1_svlan'])+11018 with steps.start('Verifying links',continue_=True) as step: 1019 log.info('Verify link status')1020 for i in range(0,3):1021 1022 data = fetch_cli.fetch_topology(ctrl)1023 verify = fetch_cli.link_status(data)1024 if verify == True: 1025 break1026 elif i == 2: 1027 assert verify1028 sleep(100)1029 1030 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1031 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=param['dn1_svlan'],cvlan=param['dn1_cvlan'],ethertype=etype,status='enable')1032 log.info('sucessful in Enabling Single VLAN on dn')1033 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1034 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1035 log.info('sucessful in configuring allowed QinQ VLAN on dn')1036 1037 with steps.start('Configuring Remark VLAN',continue_=True) as step:1038 assert cli.config_vlan_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_svlan'],remark)1039 log.info('sucessful in Configuring Single VLAN Remarking on dn')1040 @ aetest.test1041 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1042 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1043 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1044 log.info('Successful in configuring vlan in Server')1045 with steps.start('Configure IP in client',continue_=True) as step:1046 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1047 log.info('Successful in configuring IP in Client')1048 with steps.start('Starting iperf in client',continue_=True) as step:1049 sleep(20)1050 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1051 assert ((up != 0.0) and (down != 0.0))1052 with steps.start('Removing Q VLAN in Server',continue_=True) as step:1053 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1054 log.info('Successful in Removing vlan in Server')1055 with steps.start('Removing IP in client',continue_=True) as step:1056 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1057 log.info('Successful in Removing IP in Client') 1058 @ aetest.test1059 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1060 remark=int(param['dn1_svlan'])+11061 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1062 assert misc.config_QinQ(server,param['server_inf'],remark,param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1063 log.info('Successful in configuring vlan in Server')1064 with steps.start('Configure Q VLAN in client',continue_=True) as step:1065 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1066 log.info('Successful in configuring vlan in client')1067 with steps.start('Verifying Traffic',continue_=True) as step:1068 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1069 assert ((up != 0.0) and (down != 0.0))1070 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1071 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1072 assert misc.config_QinQ(server,param['server_inf'],remark,param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1073 log.info('Successful in Removing vlan in Server')1074 with steps.start('Removing Q VLAN in client',continue_=True) as step:1075 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1076 log.info('Removing Q vlan in client')1077 @ aetest.test1078 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1079 remark=int(param['dn1_svlan'])+11080 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1081 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],remark,param['server_data_ipv4'],ethertype=etype)1082 log.info('Successful in configuring QinQ vlan in Server')1083 with steps.start('Configure Q VLAN in client',continue_=True) as step:1084 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1085 log.info('Successful in configuring QinQ vlan in client')1086 log.info('Starting iperf client')1087 sleep(20)1088 with steps.start('Verifying Traffic',continue_=True) as step:1089 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1090 assert ((up != 0.0) and (down != 0.0))1091 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1092 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1093 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],remark,param['server_data_ipv4'],status='disable')1094 log.info('Removing QinQ vlan in Server')1095 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1096 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1097 log.info('Removing QiNQ vlan in client')1098 1099 @aetest.cleanup1100 def Removing_configs_from_node_and_PCs(self,steps,ctrl,server,client,etype,**param):1101 remark=int(param['dn1_svlan'])+11102 1103 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1104 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1105 log.info('sucessful in Removing QinQ VLAN on dn')1106 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1107 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1108 log.info('sucessful in Removing allowed QinQ VLAN on dn')1109 1110 with steps.start('Removing Remark VLAN',continue_=True) as step:1111 assert cli.config_vlan_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_svlan'],remark,status='disable')1112 log.info('sucessful in Removing Single VLAN Remarking on dn')1113@aetest.loop(etype = ['0x8100', '0x88A8'])1114class QinQ_Vlan_Prio_Remarking(aetest.Testcase):1115 1116 def Capturing_Server_interface(self,server,server_inf,server_file):1117 assert misc.capture_interface(server,server_inf,server_file)1118 def Verify_traffic(self,client,server_data_ipv4):1119 log.info('Starting iperf client')1120 up,down=misc.config_iperf_client(client,server_data_ipv4)1121 assert ((up != 0.0) and (down != 0.0))1122 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1123 1124 @aetest.setup1125 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1126 1127 with steps.start('Verifying links',continue_=True) as step: 1128 log.info('Verify link status')1129 for i in range(0,3):1130 1131 data = fetch_cli.fetch_topology(ctrl)1132 verify = fetch_cli.link_status(data)1133 if verify == True: 1134 break1135 elif i == 2: 1136 assert verify1137 sleep(100)1138 1139 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1140 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1141 log.info('sucessful in Enabling Single VLAN on dn')1142 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1143 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1144 log.info('sucessful in configuring allowed QinQ VLAN on dn')1145 1146 with steps.start('Configuring Remark VLAN Priority',continue_=True) as step:1147 assert cli.config_vlan_prio_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_svlan'],'7')1148 log.info('sucessful in Configuring Single VLAN prirotiy Remarking on dn')1149 @ aetest.test1150 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1151 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1152 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1153 log.info('Successful in configuring vlan in Server')1154 with steps.start('Configure IP in client',continue_=True) as step:1155 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1156 log.info('Successful in configuring IP in Client')1157 sleep(20)1158 with steps.start('Capturing and verifying traffic',continue_=True) as step:1159 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))1160 p1.start()1161 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))1162 p2.start()1163 p1.join()1164 p2.join()1165 with steps.start('Analyse Capture',continue_=True) as step:1166 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1167 if etype == '0x8100':1168 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id== {}&&vlan.priority==0'.format(ip,str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1))1169 1170 else:1171 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==0&&vlan.priority==0'.format(ip,str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1))1172 1173 res=misc.analyse_capture(server,filter,param['server_file'])1174 if res > 0:1175 log.info('Successful in VLAN tagging')1176 else:1177 assert False1178 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1179 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1180 log.info('Successful in Removing vlan in Server')1181 with steps.start('Removing IP in client',continue_=True) as step:1182 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1183 log.info('Successful in Removing IP in Client') 1184 @ aetest.test1185 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1186 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1187 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1188 log.info('Successful in configuring vlan in Server')1189 with steps.start('Configure Q VLAN in client',continue_=True) as step:1190 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1191 log.info('Successful in configuring vlan in client')1192 1193 with steps.start('Capturing and verifying traffic',continue_=True) as step:1194 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))1195 p1.start()1196 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))1197 p2.start()1198 p1.join()1199 p2.join()1200 with steps.start('Analyse Capture',continue_=True) as step:1201 if etype == '0x8100':1202 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1203 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id== {}&&vlan.priority==0'.format(ip,str(int(param['dn1_svlan'])-1),param['dn1_svlan'])1204 1205 else:1206 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1207 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==0&&vlan.priority==7'.format(ip,param['dn1_svlan'],int(param['dn1_svlan'])-1)1208 1209 res=misc.analyse_capture(server,filter,param['server_file'])1210 if res > 0:1211 log.info('Successful in VLAN tagging')1212 else:1213 assert False1214 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1215 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1216 log.info('Successful in Removing vlan in Server')1217 with steps.start('Removing Q VLAN in client',continue_=True) as step:1218 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1219 log.info('Removing Q vlan in client')1220 @ aetest.test1221 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1222 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1223 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1224 log.info('Successful in configuring QinQ vlan in Server')1225 with steps.start('Configure Q VLAN in client',continue_=True) as step:1226 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1227 log.info('Successful in configuring QinQ vlan in client')1228 with steps.start('Capturing and verifying traffic',continue_=True) as step:1229 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))1230 p1.start()1231 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))1232 p2.start()1233 p1.join()1234 p2.join()1235 with steps.start('Analyse Capture',continue_=True) as step:1236 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1237 if etype == '0x8100': 1238 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id== {}&&vlan.priority==7&&vlan.priority==0'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])1239 else:1240 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==7&&vlan.priority==0'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])1241 res=misc.analyse_capture(server,filter,param['server_file'])1242 if res > 0:1243 log.info('Successful in VLAN tagging')1244 else:1245 assert False1246 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1247 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1248 log.info('Removing QinQ vlan in Server')1249 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1250 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype,status='disable')1251 log.info('Removing QiNQ vlan in client')1252 @aetest.cleanup1253 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1254 1255 1256 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1257 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1258 log.info('sucessful in Removing Single VLAN on dn')1259 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1260 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1261 log.info('sucessful in Removing allowed QinQ VLAN on dn')1262 1263 with steps.start('Removing Remark VLAN Priority',continue_=True) as step:1264 assert cli.config_vlan_prio_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_svlan'],'7',status='disable')1265 log.info('sucessful in Removing Single VLAN prirotiy Remarking on dn')1266@aetest.loop(etype = ['0x8100', '0x88A8'])1267class QinQ_Allow_untag_Allow_Singe_Tag(aetest.Testcase):1268 1269 @aetest.setup1270 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1271 1272 with steps.start('Verifying links',continue_=True) as step: 1273 log.info('Verify link status')1274 for i in range(0,3):1275 1276 data = fetch_cli.fetch_topology(ctrl)1277 verify = fetch_cli.link_status(data)1278 if verify == True: 1279 break1280 elif i == 2: 1281 assert verify1282 sleep(100)1283 client.disconnect()1284 client.connect()1285 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1286 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1287 log.info('sucessful in Enabling Single VLAN on dn')1288 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1289 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1290 log.info('sucessful in configuring allowed QinQ VLAN on dn')1291 1292 with steps.start('Configure drop untag packets in QinQ VLAN',continue_=True) as step:1293 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 1294 log.info('sucessful in configuring Drop untag VLAN')1295 1296 1297 1298 @ aetest.test1299 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1300 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1301 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1302 log.info('Successful in configuring vlan in Server')1303 with steps.start('Configure IP in client',continue_=True) as step:1304 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1305 log.info('Successful in configuring IP in Client')1306 1307 with steps.start('Starting client iperf',continue_=True) as step:1308 sleep(20) 1309 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1310 assert ((up != 0) and (down != 0))1311 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1312 1313 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1314 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1315 log.info('Successful in Removing vlan in Server')1316 with steps.start('Removing IP in client',continue_=True) as step:1317 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1318 log.info('Successful in Removing IP in Client') 1319 @ aetest.test1320 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1321 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1322 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1323 log.info('Successful in configuring vlan in Server')1324 with steps.start('Configure Q VLAN in client',continue_=True) as step:1325 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1326 log.info('Successful in configuring vlan in client')1327 1328 with steps.start('Starting client iperf',continue_=True) as step:1329 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1330 assert ((up != 0) and (down != 0))1331 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1332 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1333 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1334 log.info('Successful in Removing vlan in Server')1335 with steps.start('Removing Q VLAN in client',continue_=True) as step:1336 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1337 log.info('Removing Q vlan in client')1338 @ aetest.test1339 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1340 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1341 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1342 log.info('Successful in configuring QinQ vlan in Server')1343 with steps.start('Configure Q VLAN in client',continue_=True) as step:1344 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1345 log.info('Successful in configuring QinQ vlan in client')1346 with steps.start('Starting client iperf',continue_=True) as step:1347 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1348 assert ((up != 0) and (down != 0))1349 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1350 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1351 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1352 log.info('Removing QinQ vlan in Server')1353 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1354 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype,status='disable')1355 log.info('Removing QiNQ vlan in client')1356 1357 @aetest.cleanup1358 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1359 1360 1361 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1362 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1363 log.info('sucessful in Removing Single VLAN on dn')1364 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1365 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1366 log.info('sucessful in Removing allowed QinQ VLAN on dn')1367 1368 client.disconnect()1369 client.connect()1370@aetest.loop(etype = ['0x8100', '0x88A8'])1371class QinQ_Drop_untag_Allow_Singe_Tag(aetest.Testcase):1372 1373 @aetest.setup1374 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1375 1376 with steps.start('Verifying links',continue_=True) as step: 1377 log.info('Verify link status')1378 for i in range(0,3):1379 1380 data = fetch_cli.fetch_topology(ctrl)1381 verify = fetch_cli.link_status(data)1382 if verify == True: 1383 break1384 elif i == 2: 1385 assert verify1386 sleep(100)1387 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1388 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1389 log.info('sucessful in Enabling Single VLAN on dn')1390 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1391 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1392 log.info('sucessful in configuring allowed QinQ VLAN on dn')1393 1394 with steps.start('Configure drop untag packets in QinQ VLAN',continue_=True) as step:1395 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='enable') 1396 log.info('sucessful in configuring Drop untag VLAN')1397 1398 1399 1400 @ aetest.test1401 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1402 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1403 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1404 log.info('Successful in configuring vlan in Server')1405 1406 #Configure IP on client PC1407 with steps.start('Configure IP in client',continue_=True) as step: 1408 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1409 log.info('Successful in configuring IP in Client')1410 1411 with steps.start('Starting iperf in client',continue_=True) as step:1412 sleep(20) 1413 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1414 result=((up != 0.0) and (down != 0.0))1415 log.info(result)1416 if result == False:1417 log.info('Traffic Failed due to drop untag')1418 else:1419 log.info('Failed to drop untagged packets')1420 assert False1421 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1422 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1423 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1424 log.info('Successful in Removing vlan in Server')1425 with steps.start('Removing IP in client',continue_=True) as step:1426 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1427 log.info('Successful in Removing IP in Client') 1428 @ aetest.test1429 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1430 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1431 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1432 log.info('Successful in configuring vlan in Server')1433 with steps.start('Configure Q VLAN in client',continue_=True) as step:1434 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1435 log.info('Successful in configuring vlan in client')1436 1437 with steps.start('Starting client iperf',continue_=True) as step:1438 sleep(20)1439 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1440 assert ((up != 0) and (down != 0))1441 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1442 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1443 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1444 log.info('Successful in Removing vlan in Server')1445 with steps.start('Removing Q VLAN in client',continue_=True) as step:1446 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1447 log.info('Removing Q vlan in client')1448 @ aetest.test1449 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1450 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1451 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1452 log.info('Successful in configuring QinQ vlan in Server')1453 with steps.start('Configure Q VLAN in client',continue_=True) as step:1454 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1455 log.info('Successful in configuring QinQ vlan in client')1456 with steps.start('Starting client iperf',continue_=True) as step:1457 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1458 assert ((up != 0) and (down != 0))1459 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1460 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1461 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],status='disable')1462 log.info('Removing QinQ vlan in Server')1463 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1464 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1465 log.info('Removing QiNQ vlan in client')1466 1467 @aetest.cleanup1468 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1469 1470 1471 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1472 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1473 log.info('sucessful in Removing Single VLAN on dn')1474 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1475 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1476 log.info('sucessful in Removing allowed QinQ VLAN on dn')1477 1478 with steps.start('Removing drop untag packets in QinQ VLAN',continue_=True) as step:1479 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 1480 log.info('sucessful in Removing Drop untag VLAN')1481@aetest.loop(etype = ['0x8100', '0x88A8'])1482class QinQ_Allow_untag_Drop_Singe_Tag(aetest.Testcase):1483 1484 @aetest.setup1485 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1486 1487 1488 with steps.start('Verifying links',continue_=True) as step: 1489 log.info('Verify link status')1490 for i in range(0,3):1491 1492 data = fetch_cli.fetch_topology(ctrl)1493 verify = fetch_cli.link_status(data)1494 if verify == True: 1495 break1496 elif i == 2: 1497 assert verify1498 sleep(100)1499 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1500 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1501 log.info('sucessful in Enabling Single VLAN on dn')1502 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1503 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1504 log.info('sucessful in configuring allowed QinQ VLAN on dn')1505 1506 with steps.start('Configure Allow untag packets in QinQ VLAN',continue_=True) as step:1507 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 1508 log.info('sucessful in configuring Allow untag ')1509 1510 with steps.start('Configure Drop Single packets in QinQ VLAN',continue_=True) as step:1511 assert cli.config_drop_single_tag(ctrl,param['dn1_name'],param['dn1_inf'],status='enable') 1512 log.info('sucessful in configuring Drop Singletag')1513 1514 1515 1516 @ aetest.test1517 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1518 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1519 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1520 log.info('Successful in configuring vlan in Server')1521 with steps.start('Configure IP in client',continue_=True) as step:1522 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1523 log.info('Successful in configuring IP in Client')1524 1525 1526 with steps.start('Starting client iperf',continue_=True) as step:1527 sleep(20)1528 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1529 assert ((up != 0) and (down != 0))1530 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1531 1532 1533 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1534 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1535 log.info('Successful in Removing vlan in Server')1536 with steps.start('Removing IP in client',continue_=True) as step:1537 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1538 log.info('Successful in Removing IP in Client') 1539 @ aetest.test1540 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1541 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1542 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1543 log.info('Successful in configuring vlan in Server')1544 with steps.start('Configure Q VLAN in client',continue_=True) as step:1545 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1546 log.info('Successful in configuring vlan in client')1547 1548 with steps.start('Starting client iperf',continue_=True) as step:1549 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1550 result=((up != 0) and (down != 0))1551 if result == False:1552 log.info('Packets dropped due to drop config')1553 else:1554 assert False1555 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1556 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1557 log.info('Successful in Removing vlan in Server')1558 with steps.start('Removing Q VLAN in client',continue_=True) as step:1559 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1560 log.info('Removing Q vlan in client')1561 @ aetest.test1562 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1563 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1564 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1565 log.info('Successful in configuring QinQ vlan in Server')1566 with steps.start('Configure Q VLAN in client',continue_=True) as step:1567 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1568 log.info('Successful in configuring QinQ vlan in client')1569 with steps.start('Starting client iperf',continue_=True) as step:1570 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1571 assert ((up != 0) and (down != 0))1572 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1573 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1574 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],status='disable')1575 log.info('Removing QinQ vlan in Server')1576 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1577 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1578 log.info('Removing QiNQ vlan in client')1579 1580 @aetest.cleanup1581 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1582 1583 1584 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1585 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1586 log.info('sucessful in Removing Single VLAN on dn')1587 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1588 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1589 log.info('sucessful in Removing allowed QinQ VLAN on dn')1590 1591 with steps.start('Removing drop Single tag packets in QinQ VLAN',continue_=True) as step:1592 assert cli.config_drop_single_tag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 1593 log.info('sucessful in Removing Drop Single tag')1594 1595@aetest.loop(etype = ['0x8100', '0x88A8'])1596class QinQ_Drop_untag_Drop_Singe_Tag(aetest.Testcase):1597 1598 @aetest.setup1599 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1600 1601 with steps.start('Verifying links',continue_=True) as step: 1602 log.info('Verify link status')1603 for i in range(0,3):1604 1605 data = fetch_cli.fetch_topology(ctrl)1606 verify = fetch_cli.link_status(data)1607 if verify == True: 1608 break1609 elif i == 2: 1610 assert verify1611 sleep(100)1612 client.disconnect()1613 client.connect()1614 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1615 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1616 log.info('sucessful in Enabling Single VLAN on dn')1617 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1618 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1619 log.info('sucessful in configuring allowed QinQ VLAN on dn')1620 1621 with steps.start('Configure Drop untag packets in QinQ VLAN',continue_=True) as step:1622 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='enable') 1623 log.info('sucessful in configuring Drop untag ')1624 1625 with steps.start('Configure Drop Single packets in QinQ VLAN',continue_=True) as step:1626 assert cli.config_drop_single_tag(ctrl,param['dn1_name'],param['dn1_inf'],status='enable') 1627 log.info('sucessful in configuring Drop Singletag')1628 1629 1630 1631 @ aetest.test1632 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1633 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1634 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1635 log.info('Successful in configuring vlan in Server')1636 with steps.start('Configure IP in client',continue_=True) as step:1637 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1638 log.info('Successful in configuring IP in Client')1639 1640 1641 with steps.start('Starting client iperf',continue_=True) as step:1642 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1643 result=((up != 0) and (down != 0))1644 if result == False:1645 log.info('Packets dropped due to drop config')1646 else:1647 assert False1648 1649 1650 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1651 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1652 log.info('Successful in Removing vlan in Server')1653 with steps.start('Removing IP in client',continue_=True) as step:1654 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1655 log.info('Successful in Removing IP in Client') 1656 @ aetest.test1657 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1658 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1659 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1660 log.info('Successful in configuring vlan in Server')1661 with steps.start('Configure Q VLAN in client',continue_=True) as step:1662 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1663 log.info('Successful in configuring vlan in client')1664 1665 with steps.start('Starting client iperf',continue_=True) as step:1666 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1667 result=((up != 0) and (down != 0))1668 if result == False:1669 log.info('Packets dropped due to drop config')1670 else:1671 assert False1672 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1673 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1674 log.info('Successful in Removing vlan in Server')1675 with steps.start('Removing Q VLAN in client',continue_=True) as step:1676 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1677 log.info('Removing Q vlan in client')1678 @ aetest.test1679 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1680 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1681 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1682 log.info('Successful in configuring QinQ vlan in Server')1683 with steps.start('Configure Q VLAN in client',continue_=True) as step:1684 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1685 log.info('Successful in configuring QinQ vlan in client')1686 with steps.start('Starting client iperf',continue_=True) as step:1687 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1688 assert ((up != 0) and (down != 0))1689 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1690 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1691 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],status='disable')1692 log.info('Removing QinQ vlan in Server')1693 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1694 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1695 log.info('Removing QiNQ vlan in client')1696 1697 @aetest.cleanup1698 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1699 1700 1701 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1702 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1703 log.info('sucessful in Removing Single VLAN on dn')1704 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1705 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1706 log.info('sucessful in Removing allowed QinQ VLAN on dn')1707 with steps.start('Removing drop untag packets in QinQ VLAN',continue_=True) as step:1708 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 1709 log.info('sucessful in Removing Drop untag') 1710 1711 with steps.start('Removing drop Single tag packets in QinQ VLAN',continue_=True) as step:1712 assert cli.config_drop_single_tag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 1713 log.info('sucessful in Removing Drop Single tag')1714@aetest.loop(etype = ['0x8100', '0x88A8'])1715class Same_S_And_C_QinQ_Vlan(aetest.Testcase):1716 def Capturing_Server_interface(self,server,server_inf,server_file):1717 assert misc.capture_interface(server,server_inf,server_file)1718 def Verify_traffic(self,client,server_data_ipv4):1719 log.info('Starting iperf client')1720 up,down=misc.config_iperf_client(client,server_data_ipv4)1721 assert ((up != 0.0) and (down != 0.0))1722 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1723 1724 @aetest.setup1725 def Configure_QinQ_Vlan(self, etype, steps,ctrl,server,client,**param):1726 1727 with steps.start('Verifying links',continue_=True) as step: 1728 log.info('Verify link status')1729 for i in range(0,3):1730 1731 data = fetch_cli.fetch_topology(ctrl)1732 verify = fetch_cli.link_status(data)1733 if verify == True: 1734 break1735 elif i == 2: 1736 assert verify1737 sleep(100)1738 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1739 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_svlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 1740 log.info('sucessful in Enabling Double VLAN on dn')1741 1742 1743 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1744 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1745 log.info('Successful in configuring vlan in Server')1746 1747 #Configure IP on client PC1748 with steps.start('Configure IP in client',continue_=True) as step: 1749 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1750 log.info('Successful in configuring IP in Client')1751 1752 1753 with steps.start('Capturing and verifying traffic',continue_=True) as step:1754 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))1755 p1.start()1756 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))1757 p2.start()1758 p1.join()1759 p2.join()1760 with steps.start('Analyse Capture',continue_=True) as step:1761 if etype =='0x8100':1762 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1763 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_svlan'],param['dn1_svlan'])1764 else:1765 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1766 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_svlan'],param['dn1_svlan'])1767 res=misc.analyse_capture(server,filter,param['server_file'])1768 if res > 0:1769 log.info('Successful in QinQ VLAN tagging')1770 else:1771 assert False1772 1773 1774 1775 @aetest.cleanup1776 def Disabling_QinQ_VLAN(self,etype,steps,ctrl,server,client,**param):1777 1778 log.info('Disabling Double VLAN in dn')1779 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1780 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1781 log.info('Successful in Removing vlan in Server')1782 with steps.start('Removing vlan configs from server',continue_=True) as step:1783 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_svlan'],svlan=param['dn1_svlan'],ethertype=etype,status='disable') 1784 log.info('sucessful in Removing QinQ VLAN on dn')1785 with steps.start('Configure IP in client',continue_=True) as step:1786 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1787 log.info('Successful in configuring IP in Client')1788@aetest.skip(reason = 'Failure in client3 reachability')1789class POP_Bridge_Q_Vlan(aetest.Testcase):1790 def Capturing_Server_interface(self,server,server_inf,server_file):1791 assert misc.capture_interface(server,server_inf,server_file)1792 1793 def Verify_traffic(self,client,server_data_ipv4):1794 log.info('Starting iperf client')1795 up,down=misc.config_iperf_client(client,server_data_ipv4)1796 assert ((up != 0.0) and (down != 0.0))1797 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1798 1799 @aetest.setup1800 def Setup(self, steps,ctrl,server,client3,**param):1801 with steps.start('Verifying links',continue_=True) as step: 1802 log.info('Verify link status')1803 for i in range(0,3):1804 1805 data = fetch_cli.fetch_topology(ctrl)1806 verify = fetch_cli.link_status(data)1807 if verify == True: 1808 break1809 elif i == 2: 1810 assert verify1811 sleep(100)1812 1813 client3.connect()1814 with steps.start('Configure Q VLAN in POP',continue_=True) as step:1815 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['pop_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 1816 log.info('sucessful in Enabling Single VLAN on POP')1817 1818 1819 with steps.start('Configure Q VLAN in Server',continue_=True) as step:1820 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])1821 log.info('Successful in configuring vlan in Server')1822 1823 #Configure IP on client PC1824 with steps.start('Configure IP in client',continue_=True) as step: 1825 assert misc.config_ip(client3,param['client3_inf'],param['client3_data_ipv4'])1826 log.info('Successful in configuring IP in Client')1827 1828 1829 1830 with steps.start('Capturing and verifying traffic',continue_=True) as step:1831 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))1832 p1.start()1833 p2 = Process(target=self.Verify_traffic,args=(client3,param['server_data_ipv4']))1834 p2.start()1835 p1.join()1836 p2.join()1837 with steps.start('Analyse Capture',continue_=True) as step:1838 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1839 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])1840 res=misc.analyse_capture(server,filter,param['server_file'])1841 if res > 0:1842 log.info('Successful in VLAN tagging')1843 else:1844 assert False1845 @aetest.cleanup1846 def Disabling_Q_VLAN(self,steps,ctrl,server,client3,**param):1847 1848 log.info('Disabling Single VLAN in POP')1849 with steps.start('Configure Q VLAN in Server',continue_=True) as step:1850 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')1851 log.info('Successful in configuring vlan in Server')1852 with steps.start('Removing vlan configs from server',continue_=True) as step:1853 assert cli.config_single_vlan(ctrl,param['pop_name'],param['pop_inf1'],vlan_id=param['dn1_cvlan'],status='disable') 1854 log.info('sucessful in Enabling Single VLAN on POP')1855 with steps.start('Configure IP in client',continue_=True) as step:1856 assert misc.config_ip(client3,param['client_inf'],param['client_data_ipv4'],status='disable')1857 log.info('Successful in configuring IP in Client')1858 client3.disconnect()1859 1860class Transparent_Port(aetest.Testcase):1861 @aetest.setup1862 def Configure_Transparent(self, steps,ctrl,server,client,**param):1863 1864 with steps.start('Verifying links',continue_=True) as step: 1865 log.info('Verify link status')1866 for i in range(0,3):1867 1868 data = fetch_cli.fetch_topology(ctrl)1869 verify = fetch_cli.link_status(data)1870 if verify == True: 1871 break1872 elif i == 2: 1873 assert verify1874 sleep(100)1875 with steps.start('Configure Transparent in dn',continue_=True) as step:1876 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 1877 log.info('sucessful in Enabling Transparent on dn')1878 1879 with steps.start('Configure IP in Server',continue_=True) as step: 1880 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'])1881 log.info('Successful in configuring IP in Server')1882 1883 #Configure IP on client PC1884 with steps.start('Configure IP in client',continue_=True) as step: 1885 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])1886 log.info('Successful in configuring IP in Client')1887 1888 1889 @ aetest.test1890 def verify_traffic(self,steps,ctrl,server,client,**param):1891 sleep(20) 1892 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1893 assert ((up != 0) and (down != 0))1894 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 1895 @aetest.cleanup1896 def Removing_Ips(self,steps,ctrl,server,client,**param):1897 1898 1899 with steps.start('Removing IP in Server',continue_=True) as step: 1900 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'],status='disable')1901 log.info('Successful in Removing IP in Server')1902 1903 #Configure IP on client PC1904 with steps.start('Removing IP in client',continue_=True) as step: 1905 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1906 log.info('Successful in Removing IP in Client')1907class Transparent_Port_With_Q_Packets(aetest.Testcase):1908 @aetest.setup1909 def Configure_Transparent_port(self, steps,ctrl,server,client,**param):1910 with steps.start('Verifying links',continue_=True) as step: 1911 log.info('Verify link status')1912 for i in range(0,3):1913 1914 data = fetch_cli.fetch_topology(ctrl)1915 verify = fetch_cli.link_status(data)1916 if verify == True: 1917 break1918 elif i == 2: 1919 assert verify1920 sleep(100)1921 with steps.start('Configure Transparent port',continue_=True) as step:1922 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 1923 log.info('sucessful in Enabling Transparent port on dn')1924 1925 1926 with steps.start('Configure Q VLAN in Server',continue_=True) as step:1927 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])1928 log.info('Successful in configuring vlan in Server')1929 1930 with steps.start('Configure Q VLAN in client',continue_=True) as step:1931 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'])1932 log.info('Successful in configuring vlan in client')1933 1934 @ aetest.test1935 def verify_traffic(self,steps,ctrl,server,client,**param):1936 sleep(20) 1937 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1938 assert ((up != 0) and (down != 0))1939 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 1940 @aetest.cleanup1941 def Disabling_VLAN_in_Server(self,steps,ctrl,server,client,**param):1942 1943 1944 with steps.start('Removing Q VLAN in Server',continue_=True) as step:1945 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')1946 log.info('Successful in Removing vlan in Server')1947 1948 with steps.start('Removing Q VLAN in client',continue_=True) as step:1949 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'],status='disable')1950 log.info('Successful in Removing vlan in client')1951@aetest.loop(etype = ['0x8100', '0x88A8'])1952class Transparent_Port_With_QinQ_Packets(aetest.Testcase):1953 @aetest.setup1954 def Configure_Transparent_Port(self, etype, steps,ctrl,server,client,**param):1955 1956 with steps.start('Verifying links',continue_=True) as step: 1957 log.info('Verify link status')1958 for i in range(0,3):1959 1960 data = fetch_cli.fetch_topology(ctrl)1961 verify = fetch_cli.link_status(data)1962 if verify == True: 1963 break1964 elif i == 2: 1965 assert verify1966 sleep(100)1967 with steps.start('Configure Transparent port',continue_=True) as step:1968 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 1969 log.info('sucessful in Enabling Transparent port on dn')1970 1971 1972 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1973 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1974 log.info('Successful in configuring vlan in Server')1975 1976 with steps.start('Configure QinQ VLAN in Client',continue_=True) as step:1977 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1978 log.info('Successful in configuring vlan in client') 1979 1980 1981 @ aetest.test1982 def verify_traffic(self,etype,steps,ctrl,server,client,**param):1983 sleep(20) 1984 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1985 assert ((up != 0) and (down != 0))1986 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 1987 1988 @aetest.cleanup1989 def Removing_VLAN(self,etype,steps,ctrl,server,client,**param):1990 1991 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1992 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1993 log.info('Successful in Removing vlan in Server')1994 1995 with steps.start('Removnig QinQ VLAN in Client',continue_=True) as step:1996 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype,status='disable')1997 log.info('Successful in Removing vlan in client')1998class Two_Interface_Transaprent(aetest.Testcase):1999 @aetest.setup2000 def Configure_Transparent(self, steps,ctrl,server,client,client2,**param):2001 client2.connect()2002 misc.execute_command(client2,'sudo ifconfig {} mtu 1492'.format(param['client2_inf']))2003 with steps.start('Verifying links',continue_=True) as step: 2004 log.info('Verify link status')2005 for i in range(0,3):2006 2007 data = fetch_cli.fetch_topology(ctrl)2008 verify = fetch_cli.link_status(data)2009 if verify == True: 2010 break2011 elif i == 2: 2012 assert verify2013 sleep(100)2014 2015 with steps.start('Configure Transparent in dn port1',continue_=True) as step:2016 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2017 log.info('sucessful in Enabling Transparent on dn')2018 with steps.start('Configure Transparent in dn port2',continue_=True) as step:2019 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2020 log.info('sucessful in Enabling Transparent on dn')2021 2022 with steps.start('Configure IP in Server',continue_=True) as step: 2023 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'])2024 log.info('Successful in configuring IP in Server')2025 2026 #Configure IP on client PC2027 with steps.start('Configure IP in client',continue_=True) as step: 2028 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2029 log.info('Successful in configuring IP in Client')2030 with steps.start('Configure IP in client2',continue_=True) as step: 2031 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2032 log.info('Successful in configuring IP in Client')2033 2034 2035 @ aetest.test2036 def verify_traffic(self,steps,ctrl,server,client,client2,**param):2037 sleep(20) 2038 with steps.start('client1 traffic',continue_=True) as step:2039 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2040 assert ((up != 0) and (down != 0))2041 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2042 with steps.start('client2 traffic',continue_=True) as step:2043 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2044 assert ((up != 0) and (down != 0))2045 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2046 @aetest.cleanup2047 def Removing_Ips(self,steps,ctrl,server,client,client2,**param):2048 2049 2050 with steps.start('Removing IP in Server',continue_=True) as step: 2051 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'],status='disable')2052 log.info('Successful in Removing IP in Server')2053 2054 #Configure IP on client PC2055 with steps.start('Removing IP in client',continue_=True) as step: 2056 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2057 log.info('Successful in Removing IP in Client')2058 with steps.start('Removing IP in client2',continue_=True) as step: 2059 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2060 log.info('Successful in Removing IP in Client2')2061 misc.execute_command(client2,'sudo ifconfig {} mtu 1500'.format(param['client2_inf']))2062 client2.disconnect()2063class Two_Interface_Transaprent_Q(aetest.Testcase):2064 @aetest.setup2065 def Configure_Transparent(self, steps,ctrl,server,client,client2,**param):2066 with steps.start('Verifying links',continue_=True) as step: 2067 log.info('Verify link status')2068 for i in range(0,3):2069 2070 data = fetch_cli.fetch_topology(ctrl)2071 verify = fetch_cli.link_status(data)2072 if verify == True: 2073 break2074 elif i == 2: 2075 assert verify2076 sleep(100)2077 client2.connect()2078 with steps.start('Configure Transparent in dn port1',continue_=True) as step:2079 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2080 log.info('sucessful in Enabling Transparent on dn')2081 with steps.start('Configure Qvlan in dn port2',continue_=True) as step:2082 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2083 log.info('sucessful in Enabling Qvlan on dn')2084 2085 2086 2087 #Configure IP on client PC2088 with steps.start('Configure IP in client',continue_=True) as step: 2089 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2090 log.info('Successful in configuring IP in Client')2091 with steps.start('Configure IP in client2',continue_=True) as step: 2092 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2093 log.info('Successful in configuring IP in Client')2094 2095 2096 @ aetest.test2097 def verify_traffic(self,steps,ctrl,server,client,client2,**param):2098 with steps.start('Configure IP in Server',continue_=True) as step: 2099 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'])2100 log.info('Successful in configuring IP in Server')2101 sleep(20) 2102 with steps.start('client1 traffic',continue_=True) as step:2103 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2104 assert ((up != 0) and (down != 0))2105 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2106 with steps.start('Removing IP in Server',continue_=True) as step: 2107 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'],status='disable')2108 log.info('Successful in Removing IP in Server')2109 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2110 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2111 log.info('Successful in configuring vlan in Server')2112 2113 sleep(20)2114 with steps.start('client2 traffic',continue_=True) as step:2115 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2116 assert ((up != 0) and (down != 0))2117 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2118 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2119 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2120 log.info('Successful in Removing vlan in Server')2121 @aetest.cleanup2122 def Removing_Ips(self,steps,ctrl,server,client,client2,**param):2123 2124 2125 with steps.start('Configure Qvlan in dn port2',continue_=True) as step:2126 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2127 log.info('sucessful in Enabling Qvlan on dn')2128 2129 #Configure IP on client PC2130 with steps.start('Removing IP in client',continue_=True) as step: 2131 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2132 log.info('Successful in Removing IP in Client')2133 with steps.start('Removing IP in client2',continue_=True) as step: 2134 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2135 log.info('Successful in Removing IP in Client2')2136 client2.disconnect()2137@aetest.loop(etype = ['0x8100', '0x88A8'])2138class Two_Interface_Transaprent_QinQ(aetest.Testcase):2139 @aetest.setup2140 def Configure_Transparent(self, steps,ctrl,server,client,client2,etype,**param):2141 with steps.start('Verifying links',continue_=True) as step: 2142 log.info('Verify link status')2143 for i in range(0,3):2144 2145 data = fetch_cli.fetch_topology(ctrl)2146 verify = fetch_cli.link_status(data)2147 if verify == True: 2148 break2149 elif i == 2: 2150 assert verify2151 sleep(100)2152 client2.connect()2153 with steps.start('Configure Transparent in dn port1',continue_=True) as step:2154 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2155 log.info('sucessful in Enabling Transparent on dn')2156 with steps.start('Configure QinQ VLAN in dn port2',continue_=True) as step:2157 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2158 log.info('sucessful in Enabling Double VLAN on dn')2159 2160 #Configure IP on client PC2161 with steps.start('Configure IP in client',continue_=True) as step: 2162 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2163 log.info('Successful in configuring IP in Client')2164 with steps.start('Configure IP in client2',continue_=True) as step: 2165 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2166 log.info('Successful in configuring IP in Client')2167 2168 2169 @ aetest.test2170 def verify_traffic(self,steps,ctrl,server,client,client2,etype,**param):2171 with steps.start('Configure IP in Server',continue_=True) as step: 2172 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'])2173 log.info('Successful in configuring IP in Server')2174 sleep(20) 2175 with steps.start('client1 traffic',continue_=True) as step:2176 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2177 assert ((up != 0) and (down != 0))2178 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2179 with steps.start('Removing IP in Server',continue_=True) as step: 2180 assert misc.config_ip(server,param['server_inf'],param['server_data_ipv4'],status='disable')2181 log.info('Successful in Removing IP in Server')2182 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2183 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2184 log.info('Successful in configuring vlan in Server')2185 2186 sleep(20)2187 with steps.start('client2 traffic',continue_=True) as step:2188 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2189 assert ((up != 0) and (down != 0))2190 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2191 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2192 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2193 log.info('Removing vlan in Server')2194 2195 @aetest.cleanup2196 def Removing_Ips(self,steps,ctrl,server,client,client2,etype,**param):2197 2198 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:2199 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 2200 log.info('sucessful in Removing Double VLAN on dn')2201 2202 #Configure IP on client PC2203 with steps.start('Removing IP in client',continue_=True) as step: 2204 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2205 log.info('Successful in Removing IP in Client')2206 with steps.start('Removing IP in client2',continue_=True) as step: 2207 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2208 log.info('Successful in Removing IP in Client2')2209 client2.disconnect()2210class Two_Interface_Same_Q_Vlan(aetest.Testcase):2211 @aetest.setup2212 def Configure_Transparent(self, steps,ctrl,server,client,client2,**param):2213 with steps.start('Verifying links',continue_=True) as step: 2214 log.info('Verify link status')2215 for i in range(0,3):2216 2217 data = fetch_cli.fetch_topology(ctrl)2218 verify = fetch_cli.link_status(data)2219 if verify == True: 2220 break2221 elif i == 2: 2222 assert verify2223 sleep(100)2224 client2.connect()2225 with steps.start('Configure Qvlan in dn port1',continue_=True) as step:2226 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2227 log.info('sucessful in Enabling Qvlan on dn')2228 with steps.start('Configure Qvlan in dn port2',continue_=True) as step:2229 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2230 log.info('sucessful in Enabling Qvlan on dn')2231 2232 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2233 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2234 log.info('Successful in configuring vlan in Server')2235 2236 #Configure IP on client PC2237 with steps.start('Configure IP in client',continue_=True) as step: 2238 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2239 log.info('Successful in configuring IP in Client')2240 with steps.start('Configure IP in client2',continue_=True) as step: 2241 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2242 log.info('Successful in configuring IP in Client')2243 2244 2245 @ aetest.test2246 def verify_traffic(self,steps,ctrl,server,client,client2,**param):2247 2248 sleep(20) 2249 with steps.start('client1 traffic',continue_=True) as step:2250 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2251 assert ((up != 0) and (down != 0))2252 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2253 sleep(20)2254 with steps.start('client2 traffic',continue_=True) as step:2255 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2256 assert ((up != 0) and (down != 0))2257 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2258 2259 @aetest.cleanup2260 def Removing_Ips(self,steps,ctrl,server,client,client2,**param):2261 with steps.start('Removing Qvlan in dn port1',continue_=True) as step:2262 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2263 log.info('sucessful in Removing Qvlan on dn')2264 2265 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2266 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2267 log.info('Successful in Removing vlan in Server')2268 with steps.start('Removing Qvlan in dn port2',continue_=True) as step:2269 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2270 log.info('sucessful in Removing Qvlan on dn')2271 2272 #Configure IP on client PC2273 with steps.start('Removing IP in client',continue_=True) as step: 2274 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2275 log.info('Successful in Removing IP in Client')2276 with steps.start('Removing IP in client2',continue_=True) as step: 2277 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2278 log.info('Successful in Removing IP in Client2')2279 client2.disconnect()2280class Two_Interface_Different_Q_Vlan(aetest.Testcase):2281 2282 @aetest.setup2283 def Configure_Transparent(self, steps,ctrl,server,client,client2,**param):2284 2285 with steps.start('Verifying links',continue_=True) as step: 2286 log.info('Verify link status')2287 for i in range(0,3):2288 2289 data = fetch_cli.fetch_topology(ctrl)2290 verify = fetch_cli.link_status(data)2291 if verify == True: 2292 break2293 elif i == 2: 2294 assert verify2295 sleep(100)2296 client2.connect()2297 with steps.start('Configure Qvlan in dn port1',continue_=True) as step:2298 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2299 log.info('sucessful in Enabling Qvlan on dn')2300 with steps.start('Configure Qvlan in dn port2',continue_=True) as step:2301 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=str(int(param['dn1_cvlan'])+1),vlan_prio='7',status='enable') 2302 log.info('sucessful in Enabling Qvlan on dn')2303 2304 2305 2306 #Configure IP on client PC2307 with steps.start('Configure IP in client',continue_=True) as step: 2308 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2309 log.info('Successful in configuring IP in Client')2310 with steps.start('Configure IP in client2',continue_=True) as step: 2311 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2312 log.info('Successful in configuring IP in Client')2313 2314 2315 @ aetest.test2316 def verify_traffic(self,steps,ctrl,server,client,client2,**param):2317 2318 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2319 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2320 log.info('Successful in configuring vlan in Server')2321 sleep(20) 2322 with steps.start('client1 traffic',continue_=True) as step:2323 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2324 assert ((up != 0) and (down != 0))2325 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2326 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2327 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2328 log.info('Successful in Removing vlan in Server')2329 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2330 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])+1),param['server_data_ipv4'])2331 log.info('Successful in configuring vlan in Server')2332 sleep(20)2333 with steps.start('client2 traffic',continue_=True) as step:2334 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2335 assert ((up != 0) and (down != 0))2336 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2337 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2338 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])+1),param['server_data_ipv4'],status='disable')2339 log.info('Successful in Removing vlan in Server')2340 2341 @aetest.cleanup2342 def Removing_Ips(self,steps,ctrl,server,client,client2,**param):2343 with steps.start('Removing Qvlan in dn port1',continue_=True) as step:2344 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2345 log.info('sucessful in Removing Qvlan on dn')2346 2347 2348 with steps.start('Removing Qvlan in dn port2',continue_=True) as step:2349 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2350 log.info('sucessful in Removing Qvlan on dn')2351 2352 #Configure IP on client PC2353 with steps.start('Removing IP in client',continue_=True) as step: 2354 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2355 log.info('Successful in Removing IP in Client')2356 with steps.start('Removing IP in client2',continue_=True) as step: 2357 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2358 log.info('Successful in Removing IP in Client2')2359 client2.disconnect()2360@aetest.loop(etype = ['0x8100', '0x88A8'])2361class Two_Interface_Q_QinQ(aetest.Testcase):2362 @aetest.setup2363 def Configure_Transparent(self, steps,ctrl,server,client,client2,etype,**param):2364 with steps.start('Verifying links',continue_=True) as step: 2365 log.info('Verify link status')2366 for i in range(0,3):2367 2368 data = fetch_cli.fetch_topology(ctrl)2369 verify = fetch_cli.link_status(data)2370 if verify == True: 2371 break2372 elif i == 2: 2373 assert verify2374 sleep(100)2375 client2.connect()2376 with steps.start('Configure Qvlan in dn port1',continue_=True) as step:2377 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2378 log.info('sucessful in Enabling Qvlan on dn')2379 with steps.start('Configure QinQ VLAN in dn port2',continue_=True) as step:2380 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2381 log.info('sucessful in Enabling Double VLAN on dn')2382 2383 #Configure IP on client PC2384 with steps.start('Configure IP in client',continue_=True) as step: 2385 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2386 log.info('Successful in configuring IP in Client')2387 with steps.start('Configure IP in client2',continue_=True) as step: 2388 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2389 log.info('Successful in configuring IP in Client')2390 2391 2392 @ aetest.test2393 def verify_traffic(self,steps,ctrl,server,client,client2,etype,**param):2394 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2395 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2396 log.info('Successful in configuring vlan in Server')2397 sleep(20) 2398 with steps.start('client1 traffic',continue_=True) as step:2399 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2400 assert ((up != 0) and (down != 0))2401 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2402 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2403 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2404 log.info('Successful in Removing vlan in Server')2405 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2406 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2407 log.info('Successful in configuring vlan in Server')2408 2409 sleep(20)2410 with steps.start('client2 traffic',continue_=True) as step:2411 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2412 assert ((up != 0) and (down != 0))2413 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2414 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2415 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2416 log.info('Removing vlan in Server')2417 2418 @aetest.cleanup2419 def Removing_Ips(self,steps,ctrl,server,client,client2,etype,**param):2420 2421 with steps.start('Removing Qvlan in dn port1',continue_=True) as step:2422 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2423 log.info('sucessful in Removing Qvlan on dn')2424 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:2425 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 2426 log.info('sucessful in Removing Double VLAN on dn')2427 2428 #Configure IP on client PC2429 with steps.start('Removing IP in client',continue_=True) as step: 2430 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2431 log.info('Successful in Removing IP in Client')2432 with steps.start('Removing IP in client2',continue_=True) as step: 2433 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2434 log.info('Successful in Removing IP in Client2')2435 client2.disconnect()2436@aetest.loop(etype = ['0x8100', '0x88A8'])2437class Two_Interface_Same_QinQ(aetest.Testcase):2438 @aetest.setup2439 def Configure_QinQ(self, steps,ctrl,server,client,client2,etype,**param):2440 with steps.start('Verifying links',continue_=True) as step: 2441 log.info('Verify link status')2442 for i in range(0,3):2443 2444 data = fetch_cli.fetch_topology(ctrl)2445 verify = fetch_cli.link_status(data)2446 if verify == True: 2447 break2448 elif i == 2: 2449 assert verify2450 sleep(100)2451 client2.connect()2452 with steps.start('Configure QinQ VLAN in dn port1',continue_=True) as step:2453 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2454 log.info('sucessful in Enabling Double VLAN on dn')2455 with steps.start('Configure QinQ VLAN in dn port2',continue_=True) as step:2456 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2457 log.info('sucessful in Enabling Double VLAN on dn')2458 2459 #Configure IP on client PC2460 with steps.start('Configure IP in client',continue_=True) as step: 2461 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2462 log.info('Successful in configuring IP in Client')2463 with steps.start('Configure IP in client2',continue_=True) as step: 2464 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2465 log.info('Successful in configuring IP in Client')2466 2467 2468 @ aetest.test2469 def verify_traffic(self,steps,ctrl,server,client,client2,etype,**param):2470 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2471 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2472 log.info('Successful in configuring vlan in Server')2473 sleep(20) 2474 with steps.start('client1 traffic',continue_=True) as step:2475 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2476 assert ((up != 0) and (down != 0))2477 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2478 '''with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2479 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2480 log.info('Removing vlan in Server')'''2481 '''with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2482 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2483 log.info('Successful in configuring vlan in Server')'''2484 2485 sleep(20)2486 with steps.start('client2 traffic',continue_=True) as step:2487 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2488 assert ((up != 0) and (down != 0))2489 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2490 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2491 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2492 log.info('Removing vlan in Server')2493 2494 @aetest.cleanup2495 def Removing_Ips(self,steps,ctrl,server,client,client2,etype,**param):2496 2497 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:2498 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 2499 log.info('sucessful in Removing Double VLAN on dn')2500 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:2501 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 2502 log.info('sucessful in Removing Double VLAN on dn')2503 2504 #Configure IP on client PC2505 with steps.start('Removing IP in client',continue_=True) as step: 2506 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2507 log.info('Successful in Removing IP in Client')2508 with steps.start('Removing IP in client2',continue_=True) as step: 2509 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2510 log.info('Successful in Removing IP in Client2')2511 client2.disconnect()2512@aetest.loop(etype = ['0x8100', '0x88A8'])2513class Two_Interface_Different_QinQ(aetest.Testcase):2514 @aetest.setup2515 def Configure_Transparent(self, steps,ctrl,server,client,client2,etype,**param):2516 2517 with steps.start('Verifying links',continue_=True) as step: 2518 log.info('Verify link status')2519 for i in range(0,3):2520 2521 data = fetch_cli.fetch_topology(ctrl)2522 verify = fetch_cli.link_status(data)2523 if verify == True: 2524 break2525 elif i == 2: 2526 assert verify2527 sleep(100)2528 client2.connect()2529 with steps.start('Configure QinQ VLAN in dn port1',continue_=True) as step:2530 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2531 log.info('sucessful in Enabling Double VLAN on dn')2532 with steps.start('Configure QinQ VLAN in dn port2',continue_=True) as step:2533 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=str(int(param['dn1_cvlan'])+1),svlan=str(int(param['dn1_svlan'])+1),ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2534 log.info('sucessful in Enabling Double VLAN on dn')2535 2536 #Configure IP on client PC2537 with steps.start('Configure IP in client',continue_=True) as step: 2538 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2539 log.info('Successful in configuring IP in Client')2540 with steps.start('Configure IP in client2',continue_=True) as step: 2541 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2542 log.info('Successful in configuring IP in Client')2543 2544 2545 @ aetest.test2546 def verify_traffic(self,steps,ctrl,server,client,client2,etype,**param):2547 2548 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2549 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2550 log.info('Successful in configuring vlan in Server')2551 sleep(20) 2552 with steps.start('client1 traffic',continue_=True) as step:2553 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2554 assert ((up != 0) and (down != 0))2555 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2556 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2557 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2558 log.info('Removing vlan in Server')2559 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2560 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])+1),str(int(param['dn1_svlan'])+1),param['server_data_ipv4'],ethertype=etype)2561 log.info('Successful in configuring vlan in Server')2562 2563 sleep(20)2564 with steps.start('client2 traffic',continue_=True) as step:2565 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2566 assert ((up != 0) and (down != 0))2567 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2568 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2569 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])+1),str(int(param['dn1_svlan'])+1),param['server_data_ipv4'],ethertype=etype,status='disable')2570 log.info('Removing vlan in Server')2571 2572 @aetest.cleanup2573 def Removing_Ips(self,steps,ctrl,server,client,client2,etype,**param):2574 2575 2576 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:2577 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 2578 log.info('sucessful in Removing Double VLAN on dn')2579 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:2580 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=str(int(param['dn1_cvlan'])+1),svlan=str(int(param['dn1_svlan'])+1),ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 2581 log.info('sucessful in Removing Double VLAN on dn')2582 2583 #Configure IP on client PC2584 with steps.start('Removing IP in client',continue_=True) as step: 2585 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2586 log.info('Successful in Removing IP in Client')2587 with steps.start('Removing IP in client2',continue_=True) as step: 2588 assert misc.config_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2589 log.info('Successful in Removing IP in Client2')2590 client2.disconnect()2591class Same_Mvlan(aetest.Testcase):2592 @aetest.setup2593 def setup_management_vlan(self,steps,ctrl,server,**param):2594 with steps.start('Verifying links',continue_=True) as step: 2595 log.info('Verify link status')2596 for i in range(0,3):2597 2598 data = fetch_cli.fetch_topology(ctrl)2599 verify = fetch_cli.link_status(data)2600 if verify == True: 2601 break2602 elif i == 2: 2603 assert verify2604 sleep(100)2605 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:2606 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])2607 log.info('Successful in configuring mvlan in DN')2608 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'])2609 log.info('Successful in configuring mvlan in POP')2610 2611 2612 with steps.start('Configuring MVLAN on Server',continue_=True) as step:2613 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])2614 log.info('Successful in configuring vlan in Server')2615 @ aetest.test2616 def verify_gui_page(self,steps,ctrl,server,**param):2617 sleep(10)2618 with steps.start('Verifying GUI page of POP',continue_=True) as step:2619 assert misc.verify_web_page(server,param['pop_management_ip'])2620 log.info('Successful in verifying POP GUI with MVLAN')2621 with steps.start('Verifying GUI page of DN',continue_=True) as step:2622 assert misc.verify_web_page(server,param['dn1_management_ip'])2623 log.info('Successful in verifying DN1 GUI with MVLAN')2624 @aetest.cleanup2625 def removing_vlan_config(self,steps,ctrl,server,**param):2626 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2627 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')2628 log.info('Successful in Removing vlan in Server')2629 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:2630 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')2631 log.info('Successful in Removing mvlan in DN')2632 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],status='disable')2633 log.info('Successful in Removing mvlan in POP')2634class Different_Mvlan(aetest.Testcase):2635 @aetest.setup2636 def setup_management_vlan(self,steps,ctrl,server,**param):2637 with steps.start('Verifying links',continue_=True) as step: 2638 log.info('Verify link status')2639 for i in range(0,3):2640 2641 data = fetch_cli.fetch_topology(ctrl)2642 verify = fetch_cli.link_status(data)2643 if verify == True: 2644 break2645 elif i == 2: 2646 assert verify2647 sleep(100)2648 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:2649 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])2650 log.info('Successful in configuring mvlan in DN')2651 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'])2652 log.info('Successful in configuring mvlan in POP')2653 2654 2655 2656 @ aetest.test2657 def verify_gui_page(self,steps,ctrl,server,**param):2658 with steps.start('Configuring MVLAN on Server',continue_=True) as step:2659 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'])2660 log.info('Successful in configuring vlan in Server')2661 sleep(10)2662 with steps.start('Verifying GUI page of POP',continue_=True) as step:2663 assert misc.verify_web_page(server,param['pop_management_ip'])2664 log.info('Successful in verifying POP GUI with MVLAN')2665 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2666 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'],status='disable')2667 log.info('Successful in Removing vlan in Server')2668 with steps.start('Configuring MVLAN on Server',continue_=True) as step:2669 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])2670 log.info('Successful in configuring vlan in Server')2671 sleep(10)2672 with steps.start('Verifying GUI page of DN',continue_=True) as step:2673 assert misc.verify_web_page(server,param['dn1_management_ip'])2674 log.info('Successful in verifying DN1 GUI with MVLAN')2675 2676 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2677 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')2678 log.info('Successful in Removing vlan in Server')2679 @aetest.cleanup2680 def removing_vlan_config(self,steps,ctrl,server,**param):2681 2682 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:2683 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')2684 log.info('Successful in Removing mvlan in DN')2685 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'],status='disable')2686 log.info('Successful in Removing mvlan in POP') 2687@aetest.loop(etype = ['0x8100', '0x88A8'])2688class Same_Mqinq_Vlan(aetest.Testcase):2689 @aetest.setup2690 def config_qinq_vlan(self,steps,ctrl,server,etype,**param):2691 with steps.start('Verifying links',continue_=True) as step: 2692 log.info('Verify link status')2693 for i in range(0,3):2694 2695 data = fetch_cli.fetch_topology(ctrl)2696 verify = fetch_cli.link_status(data)2697 if verify == True: 2698 break2699 elif i == 2: 2700 assert verify2701 sleep(100)2702 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:2703 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')2704 log.info('Successful in configuring QinQ mvlan on DN1')2705 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')2706 log.info('Successful in configuring QinQ mvlan on POP')2707 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:2708 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')2709 @ aetest.test2710 def test_QinQ_management_vlan(self,steps,ctrl,server,etype,**param):2711 sleep(10)2712 with steps.start('Verifying POP GUI access',continue_=True) as step:2713 assert misc.verify_web_page(server,param['pop_management_ip'])2714 log.info('Successful in verifying POP GUI with MVLAN')2715 with steps.start('Verifying GUI page of DN',continue_=True) as step:2716 assert misc.verify_web_page(server,param['dn1_management_ip'])2717 log.info('Successful in verifying DN1 GUI with MVLAN')2718 @aetest.cleanup2719 def removing_vlan_configs(self,steps,ctrl,server,etype,**param):2720 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:2721 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')2722 log.info('Successful in configuring QinQ mvlan on DN1')2723 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')2724 log.info('Successful in configuring QinQ mvlan on POP')2725 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:2726 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable')2727@aetest.loop(etype = ['0x8100', '0x88A8'])2728class Different_Mqinq_Vlan(aetest.Testcase):2729 @aetest.setup2730 def config_qinq_vlan(self,steps,ctrl,server,etype,**param):2731 with steps.start('Verifying links',continue_=True) as step: 2732 log.info('Verify link status')2733 for i in range(0,3):2734 2735 data = fetch_cli.fetch_topology(ctrl)2736 verify = fetch_cli.link_status(data)2737 if verify == True: 2738 break2739 elif i == 2: 2740 assert verify2741 sleep(100)2742 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:2743 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')2744 log.info('Successful in configuring QinQ mvlan on DN1')2745 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'],param['pop_msvlan'],ethertype=etype,status='enable')2746 log.info('Successful in configuring QinQ mvlan on POP')2747 2748 @ aetest.test2749 def test_QinQ_management_vlan(self,steps,ctrl,server,etype,**param):2750 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:2751 assert misc.config_QinQ(server,param['server_inf'],param['pop_mcvlan'],param['pop_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')2752 sleep(10)2753 with steps.start('Verifying POP GUI access',continue_=True) as step:2754 assert misc.verify_web_page(server,param['pop_management_ip'])2755 log.info('Successful in verifying POP GUI with MVLAN')2756 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:2757 assert misc.config_QinQ(server,param['server_inf'],param['pop_mcvlan'],param['pop_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable')2758 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:2759 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')2760 sleep(10)2761 with steps.start('Verifying GUI page of DN',continue_=True) as step:2762 assert misc.verify_web_page(server,param['dn1_management_ip'])2763 log.info('Successful in verifying DN1 GUI with MVLAN')2764 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:2765 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable')2766 @aetest.cleanup2767 def removing_vlan_configs(self,steps,ctrl,server,etype,**param):2768 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:2769 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')2770 log.info('Successful in configuring QinQ mvlan on DN1')2771 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'],param['pop_msvlan'],ethertype=etype,status='disable')2772 log.info('Successful in configuring QinQ mvlan on POP')2773class Single_Data_Vlan_Single_Same_Management_Vlan(aetest.Testcase):2774 def Capturing_Server_interface(self,server,server_inf,server_file):2775 assert misc.capture_interface(server,server_inf,server_file)2776 2777 def Verify_traffic(self,client,server_data_ipv4):2778 log.info('Starting iperf client')2779 up,down=misc.config_iperf_client(client,server_data_ipv4)2780 assert ((up != 0.0) and (down != 0.0))2781 @aetest.setup2782 def setup_vlan(self,steps,ctrl,server,client,**param):2783 with steps.start('Verifying links',continue_=True) as step: 2784 log.info('Verify link status')2785 for i in range(0,3):2786 2787 data = fetch_cli.fetch_topology(ctrl)2788 verify = fetch_cli.link_status(data)2789 if verify == True: 2790 break2791 elif i == 2: 2792 assert verify2793 sleep(100)2794 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:2795 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])2796 log.info('Successful in configuring mvlan in DN')2797 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'])2798 log.info('Successful in configuring mvlan in POP')2799 2800 with steps.start('Configuring MVLAN on Server',continue_=True) as step:2801 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])2802 log.info('Successful in configuring vlan in Server')2803 with steps.start('Configure Q VLAN in dn',continue_=True) as step:2804 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2805 log.info('sucessful in Enabling Single VLAN on dn')2806 2807 2808 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2809 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2810 log.info('Successful in configuring vlan in Server')2811 2812 #Configure IP on client PC2813 with steps.start('Configure IP in client',continue_=True) as step: 2814 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2815 log.info('Successful in configuring IP in Client')2816 2817 2818 @ aetest.test2819 def verify_gui_page(self,steps,ctrl,server,client,**param):2820 with steps.start('Verifying GUI page of POP',continue_=True) as step:2821 assert misc.verify_web_page(server,param['pop_management_ip'])2822 log.info('Successful in verifying POP GUI with MVLAN')2823 sleep(10)2824 with steps.start('Verifying GUI page of DN',continue_=True) as step:2825 assert misc.verify_web_page(server,param['dn1_management_ip'])2826 log.info('Successful in verifying DN1 GUI with MVLAN')2827 with steps.start('Capturing and verifying traffic',continue_=True) as step:2828 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))2829 p1.start()2830 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))2831 p2.start()2832 p1.join()2833 p2.join()2834 with steps.start('Analyse Capture',continue_=True) as step:2835 ip = param['client_data_ipv4'].rsplit('/', 1)[0]2836 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])2837 res=misc.analyse_capture(server,filter,param['server_file'])2838 if res > 0:2839 log.info('Successful in VLAN tagging')2840 else:2841 assert False2842 @aetest.cleanup2843 def removing_vlan_config(self,steps,ctrl,server,client,**param):2844 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2845 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')2846 log.info('Successful in Removing vlan in Server')2847 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:2848 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')2849 log.info('Successful in Removing mvlan in DN')2850 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],status='disable')2851 log.info('Successful in Removing mvlan in POP') 2852 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2853 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2854 log.info('Successful in configuring vlan in Server')2855 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:2856 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 2857 log.info('sucessful in removing Single VLAN on dn')2858 with steps.start('Removing IP in client',continue_=True) as step:2859 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2860 log.info('Successful in Removing IP in Client')2861class Single_Data_Vlan_Single_Different_Management_Vlan(aetest.Testcase):2862 def Capturing_Server_interface(self,server,server_inf,server_file):2863 assert misc.capture_interface(server,server_inf,server_file)2864 2865 def Verify_traffic(self,client,server_data_ipv4):2866 log.info('Starting iperf client')2867 up,down=misc.config_iperf_client(client,server_data_ipv4)2868 assert ((up != 0.0) and (down != 0.0))2869 @aetest.setup2870 def setup_vlan(self,steps,ctrl,server,client,**param):2871 with steps.start('Verifying links',continue_=True) as step: 2872 log.info('Verify link status')2873 for i in range(0,3):2874 2875 data = fetch_cli.fetch_topology(ctrl)2876 verify = fetch_cli.link_status(data)2877 if verify == True: 2878 break2879 elif i == 2: 2880 assert verify2881 sleep(100)2882 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:2883 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])2884 log.info('Successful in configuring mvlan in DN')2885 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'])2886 log.info('Successful in configuring mvlan in POP')2887 2888 with steps.start('Configuring MVLAN on Server',continue_=True) as step:2889 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])2890 log.info('Successful in configuring vlan in Server')2891 with steps.start('Configure Q VLAN in dn',continue_=True) as step:2892 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2893 log.info('sucessful in Enabling Single VLAN on dn')2894 2895 2896 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2897 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2898 log.info('Successful in configuring vlan in Server')2899 2900 #Configure IP on client PC2901 with steps.start('Configure IP in client',continue_=True) as step: 2902 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])2903 log.info('Successful in configuring IP in Client')2904 2905 2906 @ aetest.test2907 def verification(self,steps,ctrl,server,client,**param):2908 2909 sleep(10)2910 with steps.start('Verifying GUI page of DN',continue_=True) as step:2911 assert misc.verify_web_page(server,param['dn1_management_ip'])2912 log.info('Successful in verifying DN1 GUI with MVLAN')2913 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2914 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')2915 log.info('Successful in Removing vlan in Server')2916 2917 with steps.start('Configuring MVLAN on Server',continue_=True) as step:2918 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'])2919 log.info('Successful in configuring vlan in Server')2920 sleep(10)2921 with steps.start('Verifying GUI page of POP',continue_=True) as step:2922 assert misc.verify_web_page(server,param['pop_management_ip'])2923 log.info('Successful in verifying POP GUI with MVLAN')2924 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2925 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'],status='disable')2926 log.info('Successful in Removing vlan in Server')2927 with steps.start('Capturing and verifying traffic',continue_=True) as step:2928 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))2929 p1.start()2930 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))2931 p2.start()2932 p1.join()2933 p2.join()2934 with steps.start('Analyse Capture',continue_=True) as step:2935 ip = param['client_data_ipv4'].rsplit('/', 1)[0]2936 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])2937 res=misc.analyse_capture(server,filter,param['server_file'])2938 if res > 0:2939 log.info('Successful in VLAN tagging')2940 else:2941 assert False2942 @aetest.cleanup2943 def removing_vlan_config(self,steps,ctrl,server,client,**param):2944 2945 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:2946 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')2947 log.info('Successful in Removing mvlan in DN')2948 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'],status='disable')2949 log.info('Successful in Removing mvlan in POP') 2950 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2951 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2952 log.info('Successful in configuring vlan in Server')2953 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:2954 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 2955 log.info('sucessful in removing Single VLAN on dn')2956 with steps.start('Removing IP in client',continue_=True) as step:2957 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2958 log.info('Successful in Removing IP in Client')2959@aetest.loop(etype = ['0x8100', '0x88A8'])2960class Single_Data_Vlan_Double_Same_Management_Vlan(aetest.Testcase):2961 def Capturing_Server_interface(self,server,server_inf,server_file):2962 assert misc.capture_interface(server,server_inf,server_file)2963 2964 def Verify_traffic(self,client,server_data_ipv4):2965 log.info('Starting iperf client')2966 up,down=misc.config_iperf_client(client,server_data_ipv4)2967 assert ((up != 0.0) and (down != 0.0))2968 @aetest.setup2969 def setup_vlan(self,steps,ctrl,server,client,etype,**param):2970 with steps.start('Verifying links',continue_=True) as step: 2971 log.info('Verify link status')2972 for i in range(0,3):2973 2974 data = fetch_cli.fetch_topology(ctrl)2975 verify = fetch_cli.link_status(data)2976 if verify == True: 2977 break2978 elif i == 2: 2979 assert verify2980 sleep(100)2981 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:2982 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')2983 log.info('Successful in configuring QinQ mvlan on DN1')2984 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')2985 log.info('Successful in configuring QinQ mvlan on POP')2986 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:2987 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')2988 with steps.start('Configure Q VLAN in dn',continue_=True) as step:2989 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2990 log.info('sucessful in Enabling Single VLAN on dn')2991 2992 2993 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2994 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2995 log.info('Successful in configuring vlan in Server')2996 2997 #Configure IP on client PC2998 with steps.start('Configure IP in client',continue_=True) as step: 2999 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])3000 log.info('Successful in configuring IP in Client')3001 3002 3003 @ aetest.test3004 def verify_gui_page(self,steps,ctrl,server,client,etype,**param):3005 sleep(10)3006 with steps.start('Verifying GUI page of POP',continue_=True) as step:3007 assert misc.verify_web_page(server,param['pop_management_ip'])3008 log.info('Successful in verifying POP GUI with MVLAN')3009 with steps.start('Verifying GUI page of DN',continue_=True) as step:3010 assert misc.verify_web_page(server,param['dn1_management_ip'])3011 log.info('Successful in verifying DN1 GUI with MVLAN')3012 with steps.start('Capturing and verifying traffic',continue_=True) as step:3013 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))3014 p1.start()3015 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))3016 p2.start()3017 p1.join()3018 p2.join()3019 with steps.start('Analyse Capture',continue_=True) as step:3020 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3021 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])3022 res=misc.analyse_capture(server,filter,param['server_file'])3023 if res > 0:3024 log.info('Successful in VLAN tagging')3025 else:3026 assert False3027 @aetest.cleanup3028 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):3029 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:3030 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')3031 log.info('Successful in configuring QinQ mvlan on DN1')3032 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')3033 log.info('Successful in configuring QinQ mvlan on POP')3034 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:3035 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable') 3036 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3037 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')3038 log.info('Successful in configuring vlan in Server')3039 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:3040 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 3041 log.info('sucessful in removing Single VLAN on dn')3042 with steps.start('Removing IP in client',continue_=True) as step:3043 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3044 log.info('Successful in Removing IP in Client')3045@aetest.loop(etype = ['0x8100', '0x88A8'])3046class Single_Data_Vlan_Double_Different_Management_Vlan(aetest.Testcase):3047 def Capturing_Server_interface(self,server,server_inf,server_file):3048 assert misc.capture_interface(server,server_inf,server_file)3049 3050 def Verify_traffic(self,client,server_data_ipv4):3051 log.info('Starting iperf client')3052 up,down=misc.config_iperf_client(client,server_data_ipv4)3053 assert ((up != 0.0) and (down != 0.0))3054 @aetest.setup3055 def setup_vlan(self,steps,ctrl,server,client,etype,**param):3056 with steps.start('Verifying links',continue_=True) as step: 3057 log.info('Verify link status')3058 for i in range(0,3):3059 3060 data = fetch_cli.fetch_topology(ctrl)3061 verify = fetch_cli.link_status(data)3062 if verify == True: 3063 break3064 elif i == 2: 3065 assert verify3066 sleep(100)3067 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:3068 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')3069 log.info('Successful in configuring QinQ mvlan on DN1')3070 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'],param['pop_msvlan'],ethertype=etype,status='enable')3071 log.info('Successful in configuring QinQ mvlan on POP')3072 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:3073 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')3074 with steps.start('Configure Q VLAN in dn',continue_=True) as step:3075 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 3076 log.info('sucessful in Enabling Single VLAN on dn')3077 3078 3079 with steps.start('Configure Q VLAN in Server',continue_=True) as step:3080 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])3081 log.info('Successful in configuring vlan in Server')3082 3083 #Configure IP on client PC3084 with steps.start('Configure IP in client',continue_=True) as step: 3085 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])3086 log.info('Successful in configuring IP in Client')3087 3088 3089 @ aetest.test3090 def verify_gui_page(self,steps,ctrl,server,client,etype,**param):3091 sleep(10)3092 with steps.start('Verifying GUI page of DN',continue_=True) as step:3093 assert misc.verify_web_page(server,param['dn1_management_ip'])3094 log.info('Successful in verifying DN1 GUI with MVLAN')3095 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:3096 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable') 3097 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:3098 assert misc.config_QinQ(server,param['server_inf'],param['pop_mcvlan'],param['pop_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')3099 sleep(10)3100 with steps.start('Verifying GUI page of POP',continue_=True) as step:3101 assert misc.verify_web_page(server,param['pop_management_ip'])3102 log.info('Successful in verifying POP GUI with MVLAN')3103 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:3104 assert misc.config_QinQ(server,param['server_inf'],param['pop_mcvlan'],param['pop_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable') 3105 with steps.start('Capturing and verifying traffic',continue_=True) as step:3106 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))3107 p1.start()3108 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))3109 p2.start()3110 p1.join()3111 p2.join()3112 with steps.start('Analyse Capture',continue_=True) as step:3113 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3114 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])3115 res=misc.analyse_capture(server,filter,param['server_file'])3116 if res > 0:3117 log.info('Successful in VLAN tagging')3118 else:3119 assert False3120 @aetest.cleanup3121 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):3122 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:3123 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')3124 log.info('Successful in configuring QinQ mvlan on DN1')3125 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')3126 log.info('Successful in configuring QinQ mvlan on POP')3127 3128 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3129 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')3130 log.info('Successful in configuring vlan in Server')3131 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:3132 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 3133 log.info('sucessful in removing Single VLAN on dn')3134 with steps.start('Removing IP in client',continue_=True) as step:3135 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3136 log.info('Successful in Removing IP in Client')3137class Same_Single_Vlan_On_Data_Management(aetest.Testcase):3138 def Capturing_Server_interface(self,server,server_inf,server_file):3139 assert misc.capture_interface(server,server_inf,server_file)3140 3141 def Verify_traffic(self,client,server_data_ipv4):3142 log.info('Starting iperf client')3143 up,down=misc.config_iperf_client(client,server_data_ipv4)3144 assert ((up != 0.0) and (down != 0.0))3145 @aetest.setup3146 def setup_vlan(self,steps,ctrl,server,**param):3147 with steps.start('Verifying links',continue_=True) as step: 3148 log.info('Verify link status')3149 for i in range(0,3):3150 3151 data = fetch_cli.fetch_topology(ctrl)3152 verify = fetch_cli.link_status(data)3153 if verify == True: 3154 break3155 elif i == 2: 3156 assert verify3157 sleep(100)3158 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:3159 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])3160 log.info('Successful in configuring mvlan in DN')3161 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'])3162 log.info('Successful in configuring mvlan in POP')3163 3164 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3165 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])3166 log.info('Successful in configuring vlan in Server')3167 3168 3169 @ aetest.test3170 def verify_gui_page(self,steps,ctrl,server,client,**param):3171 sleep(10)3172 with steps.start('Verifying GUI page of POP',continue_=True) as step:3173 assert misc.verify_web_page(server,param['pop_management_ip'])3174 log.info('Successful in verifying POP GUI with MVLAN')3175 with steps.start('Verifying GUI page of DN',continue_=True) as step:3176 assert misc.verify_web_page(server,param['dn1_management_ip'])3177 log.info('Successful in verifying DN1 GUI with MVLAN')3178 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3179 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')3180 log.info('Successful in Removing vlan in Server')3181 with steps.start('Configure Q VLAN in dn',continue_=True) as step:3182 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_mcvlan'],vlan_prio='7',status='enable') 3183 log.info('sucessful in Enabling Single VLAN on dn')3184 3185 3186 with steps.start('Configure Q VLAN in Server',continue_=True) as step:3187 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_data_ipv4'])3188 log.info('Successful in configuring vlan in Server')3189 3190 #Configure IP on client PC3191 with steps.start('Configure IP in client',continue_=True) as step: 3192 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])3193 log.info('Successful in configuring IP in Client')3194 3195 with steps.start('Capturing and verifying traffic',continue_=True) as step:3196 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))3197 p1.start()3198 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))3199 p2.start()3200 p1.join()3201 p2.join()3202 with steps.start('Analyse Capture',continue_=True) as step:3203 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3204 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_mcvlan'])3205 res=misc.analyse_capture(server,filter,param['server_file'])3206 if res > 0:3207 log.info('Successful in VLAN tagging')3208 else:3209 assert False3210 @aetest.cleanup3211 def removing_vlan_config(self,steps,ctrl,server,client,**param):3212 3213 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:3214 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')3215 log.info('Successful in Removing mvlan in DN')3216 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],status='disable')3217 log.info('Successful in Removing mvlan in POP') 3218 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3219 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_data_ipv4'],status='disable')3220 log.info('Successful in configuring vlan in Server')3221 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:3222 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_mcvlan'],status='disable') 3223 log.info('sucessful in removing Single VLAN on dn')3224 with steps.start('Removing IP in client',continue_=True) as step:3225 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3226 log.info('Successful in Removing IP in Client')3227@aetest.loop(etype = ['0x8100', '0x88A8'])3228class Double_Data_Vlan_Single_Same_Management_Vlan(aetest.Testcase):3229 def Capturing_Server_interface(self,server,server_inf,server_file):3230 assert misc.capture_interface(server,server_inf,server_file)3231 3232 def Verify_traffic(self,client,server_data_ipv4):3233 log.info('Starting iperf client')3234 up,down=misc.config_iperf_client(client,server_data_ipv4)3235 assert ((up != 0.0) and (down != 0.0))3236 3237 @aetest.setup3238 def setup_vlan(self,steps,ctrl,server,client,etype,**param):3239 with steps.start('Verifying links',continue_=True) as step: 3240 log.info('Verify link status')3241 for i in range(0,3):3242 3243 data = fetch_cli.fetch_topology(ctrl)3244 verify = fetch_cli.link_status(data)3245 if verify == True: 3246 break3247 elif i == 2: 3248 assert verify3249 sleep(100)3250 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:3251 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])3252 log.info('Successful in configuring mvlan in DN')3253 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'])3254 log.info('Successful in configuring mvlan in POP')3255 3256 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3257 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])3258 log.info('Successful in configuring vlan in Server')3259 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:3260 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 3261 log.info('sucessful in Enabling Double VLAN on dn')3262 3263 3264 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:3265 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)3266 log.info('Successful in configuring vlan in Server')3267 3268 #Configure IP on client PC3269 with steps.start('Configure IP in client',continue_=True) as step: 3270 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])3271 log.info('Successful in configuring IP in Client')3272 3273 3274 3275 3276 3277 @ aetest.test3278 def verifyication(self,steps,ctrl,server,client,etype,**param):3279 sleep(10)3280 with steps.start('Verifying GUI page of POP',continue_=True) as step:3281 assert misc.verify_web_page(server,param['pop_management_ip'])3282 log.info('Successful in verifying POP GUI with MVLAN')3283 with steps.start('Verifying GUI page of DN',continue_=True) as step:3284 assert misc.verify_web_page(server,param['dn1_management_ip'])3285 log.info('Successful in verifying DN1 GUI with MVLAN')3286 with steps.start('Capturing and verifying traffic',continue_=True) as step:3287 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))3288 p1.start()3289 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))3290 p2.start()3291 p1.join()3292 p2.join()3293 with steps.start('Analyse Capture',continue_=True) as step:3294 if etype =='0x8100':3295 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3296 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])3297 else:3298 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3299 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])3300 res=misc.analyse_capture(server,filter,param['server_file'])3301 if res > 0:3302 log.info('Successful in QinQ VLAN tagging')3303 else:3304 assert False3305 @aetest.cleanup3306 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):3307 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3308 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')3309 log.info('Successful in Removing vlan in Server')3310 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:3311 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')3312 log.info('Successful in Removing mvlan in DN')3313 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],status='disable')3314 log.info('Successful in Removing mvlan in POP') 3315 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:3316 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')3317 log.info('Successful in Removing vlan in Server')3318 with steps.start('Removing vlan configs from server',continue_=True) as step:3319 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,status='disable') 3320 log.info('sucessful in Removing QinQ VLAN on dn')3321 with steps.start('Configure IP in client',continue_=True) as step:3322 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3323 log.info('Successful in configuring IP in Client')3324@aetest.loop(etype = ['0x8100', '0x88A8'])3325class Double_Data_Vlan_Single_Different_Management_Vlan(aetest.Testcase):3326 def Capturing_Server_interface(self,server,server_inf,server_file):3327 assert misc.capture_interface(server,server_inf,server_file)3328 3329 def Verify_traffic(self,client,server_data_ipv4):3330 log.info('Starting iperf client')3331 up,down=misc.config_iperf_client(client,server_data_ipv4)3332 assert ((up != 0.0) and (down != 0.0))3333 3334 @aetest.setup3335 def setup_vlan(self,steps,ctrl,server,client,etype,**param):3336 with steps.start('Verifying links',continue_=True) as step: 3337 log.info('Verify link status')3338 for i in range(0,3):3339 3340 data = fetch_cli.fetch_topology(ctrl)3341 verify = fetch_cli.link_status(data)3342 if verify == True: 3343 break3344 elif i == 2: 3345 assert verify3346 sleep(100)3347 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:3348 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])3349 log.info('Successful in configuring mvlan in DN')3350 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'])3351 log.info('Successful in configuring mvlan in POP')3352 3353 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3354 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])3355 log.info('Successful in configuring vlan in Server')3356 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:3357 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 3358 log.info('sucessful in Enabling Double VLAN on dn')3359 3360 3361 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:3362 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)3363 log.info('Successful in configuring vlan in Server')3364 3365 #Configure IP on client PC3366 with steps.start('Configure IP in client',continue_=True) as step: 3367 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])3368 log.info('Successful in configuring IP in Client')3369 @ aetest.test3370 def verifyication(self,steps,ctrl,server,client,etype,**param):3371 3372 sleep(10)3373 with steps.start('Verifying GUI page of DN',continue_=True) as step:3374 assert misc.verify_web_page(server,param['dn1_management_ip'])3375 log.info('Successful in verifying DN1 GUI with MVLAN')3376 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3377 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')3378 log.info('Successful in Removing vlan in Server')3379 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3380 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'])3381 log.info('Successful in configuring vlan in Server')3382 sleep(10)3383 with steps.start('Verifying GUI page of POP',continue_=True) as step:3384 assert misc.verify_web_page(server,param['pop_management_ip'])3385 log.info('Successful in verifying POP GUI with MVLAN')3386 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3387 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'],status='disable')3388 log.info('Successful in Removing vlan in Server')3389 3390 with steps.start('Capturing and verifying traffic',continue_=True) as step:3391 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))3392 p1.start()3393 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))3394 p2.start()3395 p1.join()3396 p2.join()3397 with steps.start('Analyse Capture',continue_=True) as step:3398 if etype =='0x8100':3399 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3400 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])3401 else:3402 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3403 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])3404 res=misc.analyse_capture(server,filter,param['server_file'])3405 if res > 0:3406 log.info('Successful in QinQ VLAN tagging')3407 else:3408 assert False3409 @aetest.cleanup3410 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):3411 3412 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:3413 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')3414 log.info('Successful in Removing mvlan in DN')3415 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'],status='disable')3416 log.info('Successful in Removing mvlan in POP') 3417 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:3418 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')3419 log.info('Successful in Removing vlan in Server')3420 with steps.start('Removing vlan configs from server',continue_=True) as step:3421 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,status='disable') 3422 log.info('sucessful in Removing QinQ VLAN on dn')3423 with steps.start('Configure IP in client',continue_=True) as step:3424 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3425 log.info('Successful in configuring IP in Client')3426@aetest.loop(etype = ['0x8100', '0x88A8'])3427class Same_Double_Vlan_On_Data_Management(aetest.Testcase):3428 def Capturing_Server_interface(self,server,server_inf,server_file):3429 assert misc.capture_interface(server,server_inf,server_file)3430 3431 def Verify_traffic(self,client,server_data_ipv4):3432 log.info('Starting iperf client')3433 up,down=misc.config_iperf_client(client,server_data_ipv4)3434 assert ((up != 0.0) and (down != 0.0))3435 3436 @aetest.setup3437 def setup_vlan(self,steps,ctrl,server,client,etype,**param):3438 with steps.start('Verifying links',continue_=True) as step: 3439 log.info('Verify link status')3440 for i in range(0,3):3441 3442 data = fetch_cli.fetch_topology(ctrl)3443 verify = fetch_cli.link_status(data)3444 if verify == True: 3445 break3446 elif i == 2: 3447 assert verify3448 sleep(100)3449 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:3450 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')3451 log.info('Successful in configuring QinQ mvlan on DN1')3452 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')3453 log.info('Successful in configuring QinQ mvlan on POP')3454 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:3455 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')3456 3457 @ aetest.test3458 def verifyication(self,steps,ctrl,server,client,etype,**param):3459 sleep(10)3460 with steps.start('Verifying POP GUI access',continue_=True) as step:3461 assert misc.verify_web_page(server,param['pop_management_ip'])3462 log.info('Successful in verifying POP GUI with MVLAN')3463 with steps.start('Verifying GUI page of DN',continue_=True) as step:3464 assert misc.verify_web_page(server,param['dn1_management_ip'])3465 log.info('Successful in verifying DN1 GUI with MVLAN')3466 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:3467 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable')3468 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:3469 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_mcvlan'],svlan=param['dn1_msvlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 3470 log.info('sucessful in Enabling Double VLAN on dn')3471 3472 3473 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:3474 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_data_ipv4'],ethertype=etype)3475 log.info('Successful in configuring vlan in Server')3476 3477 #Configure IP on client PC3478 with steps.start('Configure IP in client',continue_=True) as step: 3479 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'])3480 log.info('Successful in configuring IP in Client')3481 with steps.start('Capturing and verifying traffic',continue_=True) as step:3482 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))3483 p1.start()3484 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))3485 p2.start()3486 p1.join()3487 p2.join()3488 with steps.start('Analyse Capture',continue_=True) as step:3489 if etype =='0x8100':3490 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3491 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_mcvlan'],param['dn1_msvlan'])3492 else:3493 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3494 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_mcvlan'],param['dn1_msvlan'])3495 res=misc.analyse_capture(server,filter,param['server_file'])3496 if res > 0:3497 log.info('Successful in QinQ VLAN tagging')3498 else:3499 assert False3500 @aetest.cleanup3501 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):3502 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:3503 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')3504 log.info('Successful in configuring QinQ mvlan on DN1')3505 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')3506 log.info('Successful in configuring QinQ mvlan on POP')3507 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:3508 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_data_ipv4'],ethertype=etype,status='disable')3509 log.info('Successful in Removing vlan in Server')3510 with steps.start('Removing vlan configs from server',continue_=True) as step:3511 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_mcvlan'],svlan=param['dn1_msvlan'],ethertype=etype,status='disable') 3512 log.info('sucessful in Removing QinQ VLAN on dn')3513 with steps.start('Configure IP in client',continue_=True) as step:3514 assert misc.config_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3515 log.info('Successful in configuring IP in Client')3516class common_cleanup(aetest.CommonCleanup): 3517 @aetest.subsection3518 def Disabling_L2bridge(self,steps,ctrl,server,client,**param):3519 log.info('configuring l2bridge')3520 with steps.start('Disabling L2 bridge',continue_=True) as step:3521 assert cli.modify_network_l2bridge(ctrl,state='disable')3522 log.info('Successful in configuring l2bridge')3523 sleep(150) 3524 ctrl.disconnect()3525 ctrl.connect()3526 with steps.start('Verify link status',continue_=True) as step:3527 for i in range(0,3):3528 sleep(100)3529 data = fetch_cli.fetch_topology(ctrl)3530 verify = fetch_cli.link_status(data)3531 if verify == True: 3532 break3533 elif i == 2: 3534 assert verify3535 3536 @aetest.subsection3537 def deleting_node(self,steps,ctrl,server,client,**param):3538 assert cli.del_node(ctrl,param['dn1_name']) 3539 log.info('Successful in deleting dn1')3540 3541 @aetest.subsection3542 def deleting_Site(self,steps,ctrl,server,client,**param):3543 assert cli.del_site(ctrl,param['dn1_site'])3544 log.info('Successful in Deleting site')3545 3546 @aetest.subsection3547 def stopping_iperf_server(self,server,ctrl,client,**param):3548 assert misc.config_iperf_server(server,status='disable')3549 log.info('Successful in stopping iperf server')3550 ctrl.disconnect()3551 misc.execute_command(server,'rm index.html*')3552 misc.execute_command(server,'sudo ifconfig {} mtu 1500'.format(param['server_inf']))3553 misc.execute_command(client,'sudo ifconfig {} mtu 1500'.format(param['client_inf']))3554 server.disconnect()3555 client.disconnect()3556 3557 3558 3559if __name__ == '__main__': # pragma: no cover...

Full Screen

Full Screen

lldp.py

Source:lldp.py Github

copy

Full Screen

1# system imports2from os import chdir3from time import sleep4from datetime import datetime5import logging6import yaml7import sys8from pyats import aetest9from pyats.log.utils import banner10from genie import testbed11#from pyats.topology import loader12from multiprocessing import Process13log = logging.getLogger(__name__)14log.setLevel(logging.DEBUG)15#importing custom modules16from Config.config import *17from Fetch.fetch import *18from Misc.misc import misc19#Fetching input values from input.yaml20'''vlan=int(ref_pp['dn1_cvlan'])21ref_pp['lis']=[]22for i in range(0,5):23 ref_pp['lis'].append(vlan+i)24svlan=int(ref_pp['dn1_svlan'])25ref_pp['lis1']=[]26for i in range(0,5):27 ref_pp['lis1'].append(svlan+i)'''28global lis29lis=[]30global lis131lis1=[]32class common_setup(aetest.CommonSetup): 33 @aetest.subsection34 def initial_configs(self,steps, testbed, **param):35 36 ref_pp = self.parent.parameters37 ref_pp['ctrl'] = testbed.devices[param['ctrl_alias']]38 ref_pp['dn'] = testbed.devices[param['dn_alias']]39 ref_pp['server'] = testbed.devices[param['server_alias']]40 ref_pp['client'] = testbed.devices[param['client_alias']]41 ref_pp['client2'] = testbed.devices[param['client2_alias']]42 ref_pp['pop_name'] = ref_pp['ctrl'].custom['name']43 ref_pp['pop_mac'] = ref_pp['ctrl'].custom['mac']44 ref_pp['pop_iface'] = ref_pp['ctrl'].custom['iface']45 ref_pp['pop_iface'] = ref_pp['ctrl'].custom['iface']46 ref_pp['pop_mcvlan'] = ref_pp['ctrl'].custom['mcvlan']47 ref_pp['pop_msvlan'] = ref_pp['ctrl'].custom['msvlan']48 ref_pp['pop_management_ip']=ref_pp['ctrl'].custom['management_ip']49 ref_pp['path']=ref_pp['ctrl'].custom['location']50 51 ref_pp['dn1_name']=ref_pp['dn'].custom['name']52 ref_pp['dn1_site']=ref_pp['dn'].custom['site']53 ref_pp['dn1_lat'] = ref_pp['dn'].custom['lat']54 ref_pp['dn1_lon'] = ref_pp['dn'].custom['lon']55 ref_pp['dn1_alt'] = ref_pp['dn'].custom['alt']56 ref_pp['dn1_acc'] = ref_pp['dn'].custom['acc']57 ref_pp['dn1_inf'] = ref_pp['dn'].custom['inf']58 ref_pp['dn1_inf1'] = ref_pp['dn'].custom['inf1'] 59 ref_pp['dn1_mac'] = ref_pp['dn'].custom['mac']60 ref_pp['dn1_management_ip']=ref_pp['dn'].custom['management_ip']61 ref_pp['dn1_cvlan'] = ref_pp['dn'].custom['cvlan']62 ref_pp['dn1_svlan'] = ref_pp['dn'].custom['svlan']63 ref_pp['dn1_mcvlan'] = ref_pp['dn'].custom['mcvlan']64 ref_pp['dn1_msvlan'] = ref_pp['dn'].custom['msvlan']65 ref_pp['server_inf']=ref_pp['server'].custom['inf']66 ref_pp['server_data_ipv6']=ref_pp['server'].custom['ipv6']67 ref_pp['server_data_ipv4']=ref_pp['server'].custom['ipv4']68 ref_pp['server_mgmt_ipv4']=ref_pp['server'].custom['mgmt_ipv4']69 ref_pp['server_file']=ref_pp['server'].custom['capture_file']70 ref_pp['client_inf']=ref_pp['client'].custom['inf']71 ref_pp['client_data_ipv4']=ref_pp['client'].custom['ipv4']72 ref_pp['client2_inf']=ref_pp['client2'].custom['inf']73 ref_pp['client2_data_ipv4']=ref_pp['client2'].custom['ipv4']74 75 vlan=int(ref_pp['dn1_cvlan'])76 #global lis77 #lis=[]78 for i in range(0,5):79 lis.append(vlan+i)80 81 svlan=int(ref_pp['dn1_svlan'])82 #global lis183 #lis1=[]84 for i in range(0,5):85 lis1.append(svlan+i) 86 87 ref_pp['ctrl'].connect()88 ref_pp['server'].connect()89 ref_pp['client'].connect()90 91 @aetest.subsection92 def create_site(self,steps,ctrl,server,client,**param):93 log.info('Creating Site')94 assert cli.add_site(ctrl,param['dn1_site'],param['dn1_lat'],param['dn1_lon'],param['dn1_alt'],param['dn1_acc'])95 log.info('Successful in adding site')96 97 @aetest.subsection98 def Adding_node(self,steps,ctrl,server,client,**param):99 #Adding dn100 log.info('Adding dn1')101 assert cli.add_dn(ctrl,param['dn1_name'],param['dn1_site'],param['dn1_mac']) 102 log.info('Successful in adding dn1')103 104 @aetest.subsection105 def Adding_link(self,steps,ctrl,server,client,**param):106 #Adding link POP to dn1 link107 log.info('Adding link from controller')108 assert cli.add_link(ctrl,param['pop_name'],param['dn1_name'],param['pop_mac'],param['dn1_mac'],init_radio='radio1',resp_radio='radio1')109 log.info('Successful in Adding link') 110 log.info('Verify link status')111 @aetest.subsection112 def configuring_mgmt_ip(self,steps,ctrl,server,client,**param):113 with steps.start('Configuring Management ip on POP',continue_=True) as step:114 assert cli.config_management_ip(ctrl,param['pop_name'],param['pop_management_ip'])115 log.info('Successful in configuring Mgmt ip on POP')116 with steps.start('Configuring Management ip on DN',continue_=True) as step:117 assert cli.config_management_ip(ctrl,param['dn1_name'],param['dn1_management_ip'])118 log.info('Successful in configuring Mgmt ip on DN1')119 120 @aetest.subsection121 def start_iperf_server(self,steps,ctrl,server,client,**param):122 misc.config_iperf_server(server)123 @aetest.subsection124 def verify_links(self,steps,ctrl,server,client,**param): 125 log.info('Verify link status')126 for i in range(0,3):127 sleep(100)128 data = fetch.fetch_topology(ctrl)129 verify = fetch.link_status(data)130 if verify == True: 131 break132 elif i == 2: 133 assert verify134 135 136 log.info('Successful in bringing up')137 138 @aetest.subsection139 def configure_l2_bridge(self,steps,ctrl,server,client,**param):140 #configuring l2bridge141 log.info('configuring l2bridge')142 143 assert cli.modify_network_l2bridge(ctrl,state='enable')144 log.info('Successful in configuring l2bridge')145 ctrl.disconnect()146 sleep(150)147 ctrl.connect()148 @aetest.subsection149 def verify_links(self,steps,ctrl,server,client,**param):150 log.info('Verify link status')151 for i in range(0,3):152 sleep(100)153 data = fetch.fetch_topology(ctrl)154 verify = fetch.link_status(data)155 if verify == True:156 break157 elif i == 2:158 assert verify159 log.info('Successful in bringing up') 160 161 162 163class Q_Vlan(aetest.Testcase):164 def Capturing_Server_interface(self,server,server_inf,server_file):165 assert misc.capture_interface(server,server_inf,server_file)166 167 def Verify_traffic(self,client,server_data_ipv4):168 log.info('Starting iperf client')169 up,down=misc.config_iperf_client(client,server_data_ipv4)170 assert ((up != 0.0) and (down != 0.0))171 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))172 173 @aetest.setup174 def Setup(self, steps,ctrl,server,client,**param):175 with steps.start('Verifying links',continue_=True) as step: 176 log.info('Verify link status')177 for i in range(0,3):178 179 data = fetch.fetch_topology(ctrl)180 verify = fetch.link_status(data)181 if verify == True: 182 break183 elif i == 2: 184 assert verify185 sleep(100)186 187 with steps.start('Configure Q VLAN in dn',continue_=True) as step:188 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 189 log.info('sucessful in Enabling Single VLAN on dn')190 191 192 with steps.start('Configure Q VLAN in Server',continue_=True) as step:193 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])194 log.info('Successful in configuring vlan in Server')195 196 #Configure IP on client PC197 with steps.start('Configure IP in client',continue_=True) as step: 198 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])199 log.info('Successful in configuring IP in Client')200 201 202 203 with steps.start('Capturing and verifying traffic',continue_=True) as step:204 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))205 p1.start()206 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))207 p2.start()208 p1.join()209 p2.join()210 with steps.start('Analyse Capture',continue_=True) as step:211 ip = param['client_data_ipv4'].rsplit('/', 1)[0]212 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])213 res=misc.analyse_capture(server,filter,param['server_file'])214 if res > 0:215 log.info('Successful in VLAN tagging')216 else:217 assert False218 @aetest.cleanup219 def Disabling_Q_VLAN(self,steps,ctrl,server,client,**param):220 221 log.info('Disabling Single VLAN in dn')222 with steps.start('Configure Q VLAN in Server',continue_=True) as step:223 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')224 log.info('Successful in configuring vlan in Server')225 with steps.start('Removing vlan configs from server',continue_=True) as step:226 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 227 log.info('sucessful in Enabling Single VLAN on dn')228 with steps.start('Configure IP in client',continue_=True) as step:229 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')230 log.info('Successful in configuring IP in Client')231@aetest.loop(etype = ['0x8100', '0x88A8'])232class QinQ_Vlan(aetest.Testcase):233 def Capturing_Server_interface(self,server,server_inf,server_file):234 assert misc.capture_interface(server,server_inf,server_file)235 def Verify_traffic(self,client,server_data_ipv4):236 log.info('Starting iperf client')237 up,down=misc.config_iperf_client(client,server_data_ipv4)238 assert ((up != 0.0) and (down != 0.0))239 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))240 241 @aetest.setup242 def Configure_QinQ_Vlan(self, etype, steps,ctrl,server,client,**param):243 with steps.start('Verifying links',continue_=True) as step: 244 log.info('Verify link status')245 for i in range(0,3):246 247 data = fetch.fetch_topology(ctrl)248 verify = fetch.link_status(data)249 if verify == True: 250 break251 elif i == 2: 252 assert verify253 sleep(100)254 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:255 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 256 log.info('sucessful in Enabling Double VLAN on dn')257 258 259 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:260 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)261 log.info('Successful in configuring vlan in Server')262 263 #Configure IP on client PC264 with steps.start('Configure IP in client',continue_=True) as step: 265 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])266 log.info('Successful in configuring IP in Client')267 268 269 with steps.start('Capturing and verifying traffic',continue_=True) as step:270 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))271 p1.start()272 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))273 p2.start()274 p1.join()275 p2.join()276 with steps.start('Analyse Capture',continue_=True) as step:277 if etype =='0x8100':278 ip = param['client_data_ipv4'].rsplit('/', 1)[0]279 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])280 else:281 ip = param['client_data_ipv4'].rsplit('/', 1)[0]282 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])283 res=misc.analyse_capture(server,filter,param['server_file'])284 if res > 0:285 log.info('Successful in QinQ VLAN tagging')286 else:287 assert False288 289 290 291 @aetest.cleanup292 def Disabling_QinQ_VLAN(self,etype,steps,ctrl,server,client,**param):293 294 log.info('Disabling Double VLAN in dn')295 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:296 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')297 log.info('Successful in Removing vlan in Server')298 with steps.start('Removing vlan configs from server',continue_=True) as step:299 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,status='disable') 300 log.info('sucessful in Removing QinQ VLAN on dn')301 with steps.start('Configure IP in client',continue_=True) as step:302 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')303 log.info('Successful in configuring IP in Client')304class Allowed_Q_Vlan(aetest.Testcase):305 306 @aetest.setup307 def Configure_Q_Vlan_allowed_list(self, steps,ctrl,server,client,**param):308 vlans='{},{}-{}'.format(lis[0],lis[1],lis[3])309 with steps.start('Verifying links',continue_=True) as step: 310 log.info('Verify link status')311 for i in range(0,3):312 313 data = fetch.fetch_topology(ctrl)314 verify = fetch.link_status(data)315 if verify == True: 316 break317 elif i == 2: 318 assert verify319 sleep(100)320 321 with steps.start('Configure Q VLAN in dn',continue_=True) as step:322 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=str(int(param['dn1_cvlan'])-1),status='enable') 323 log.info('sucessful in Enabling Single VLAN on dn')324 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:325 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='enable') 326 log.info('sucessful in configuring allowed q VLAN on dn')327 328 329 def test_untagged_packets(self,steps,ctrl,server,client,**param):330 with steps.start('Configure Q VLAN in Server',continue_=True) as step:331 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'])332 log.info('Successful in configuring vlan in Server')333 with steps.start('Configure IP in client',continue_=True) as step:334 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])335 log.info('Successful in configuring IP in Client')336 log.info('Starting iperf client')337 #sleep(20)338 with steps.start('Verifying Traffic',continue_=True) as step:339 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])340 assert ((up != 0.0) and (down != 0.0))341 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))342 with steps.start('Removing Q VLAN in Server',continue_=True) as step:343 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'],status='disable')344 log.info('Removing Q vlan in Server')345 with steps.start('Removing IP in client',continue_=True) as step:346 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')347 log.info('Successful in Removing IP in Client')348 @ aetest.test.loop(c_vlan=lis)349 def test_single_tagged_packets(self,c_vlan,steps,ctrl,server,client,**param):350 351 with steps.start('Configure Q VLAN in Server',continue_=True) as step:352 assert misc.config_Q(server,param['server_inf'],c_vlan,param['server_data_ipv4'])353 log.info('Successful in configuring vlan in Server')354 355 with steps.start('Configure Q VLAN in client',continue_=True) as step:356 assert misc.config_Q(client,param['client_inf'],c_vlan,param['client_data_ipv4'])357 log.info('Successful in configuring vlan in client')358 359 log.info('Starting iperf client')360 sleep(20) 361 with steps.start('Verifying Traffic',continue_=True) as step:362 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])363 result=((up != 0.0) and (down != 0.0))364 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))365 if c_vlan==int(param['dn1_cvlan'])+4:366 if result == False:367 log.info('No traffic due to unallowed vlan')368 else:369 assert False370 else:371 assert result372 373 with steps.start('Removing Q VLAN in Server',continue_=True) as step:374 assert misc.config_Q(server,param['server_inf'],c_vlan,param['server_data_ipv4'],status='disable')375 log.info('Removing Q vlan in Server')376 377 with steps.start('Removing Q VLAN in client',continue_=True) as step:378 assert misc.config_Q(client,param['client_inf'],c_vlan,param['client_data_ipv4'],status='disable')379 log.info('Removing Q vlan in client')380 381 382 383 384 385 386 @aetest.cleanup387 def VLAN_config_cleanup(self,steps,ctrl,server,client,**param):388 vlans='{},{}-{}'.format(lis[0],lis[1],lis[3])389 390 with steps.start('Remove Q VLAN in dn',continue_=True) as step:391 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id='1',status='disable') 392 log.info('sucessful in Removing Single VLAN on dn')393 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:394 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='disable') 395 log.info('sucessful in Removing allowed q VLAN on dn')396class Q_Vlan_Remarking(aetest.Testcase):397 398 @aetest.setup399 def Configure_Q_Vlan_allowed_list(self, steps,ctrl,server,client,**param):400 remark=int(param['dn1_cvlan'])+1401 with steps.start('Verifying links',continue_=True) as step: 402 log.info('Verify link status')403 for i in range(0,3):404 405 data = fetch.fetch_topology(ctrl)406 verify = fetch.link_status(data)407 if verify == True: 408 break409 elif i == 2: 410 assert verify411 sleep(100)412 413 with steps.start('Configure Q VLAN in dn',continue_=True) as step:414 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=str(int(param['dn1_cvlan'])-1),status='enable') 415 log.info('sucessful in Enabling Single VLAN on dn')416 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:417 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='enable') 418 log.info('sucessful in configuring allowed q VLAN on dn')419 420 with steps.start('Configuring Remark VLAN',continue_=True) as step:421 assert cli.config_vlan_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_cvlan'],remark)422 log.info('sucessful in Configuring Single VLAN Remarking on dn')423 @ aetest.test424 def test_untagged_packets(self,steps,ctrl,server,client,**param):425 with steps.start('Configure Q VLAN in Server',continue_=True) as step:426 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'])427 log.info('Successful in configuring vlan in Server')428 with steps.start('Configure IP in client',continue_=True) as step:429 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])430 log.info('Successful in configuring IP in Client') 431 with steps.start('Starting client iperf',continue_=True) as step:432 sleep(20) 433 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])434 assert ((up != 0) and (down != 0))435 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))436 437 438 with steps.start('Removing Q VLAN in Server',continue_=True) as step:439 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'],status='disable')440 log.info('Removing Q vlan in Server')441 with steps.start('Removing IP in client',continue_=True) as step:442 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')443 log.info('Successful in Removing IP in Client')444 @ aetest.test445 def test_single_tagged_packets(self,steps,ctrl,server,client,**param):446 remark=int(param['dn1_cvlan'])+1447 with steps.start('Configure Q VLAN in Server',continue_=True) as step:448 assert misc.config_Q(server,param['server_inf'],remark,param['server_data_ipv4'])449 log.info('Successful in configuring vlan in Server')450 with steps.start('Configure Q VLAN in client',continue_=True) as step:451 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'])452 log.info('Successful in configuring vlan in client')453 with steps.start('Starting client iperf',continue_=True) as step:454 sleep(20) 455 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])456 assert ((up != 0) and (down != 0))457 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))458 with steps.start('Removing Q VLAN in Server',continue_=True) as step:459 assert misc.config_Q(server,param['server_inf'],remark,param['server_data_ipv4'],status='disable')460 log.info('Removing Q vlan in Server')461 with steps.start('Removing Q VLAN in client',continue_=True) as step:462 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'],status='disable')463 log.info('Removing Q vlan in client') 464 @aetest.cleanup465 def Removing_configs_from_node_and_PCs(self,steps,ctrl,server,client,**param):466 remark=int(param['dn1_cvlan'])+1467 with steps.start('Removing Q VLAN in dn',continue_=True) as step:468 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id='1',status='disable') 469 log.info('sucessful in Removing Single VLAN on dn')470 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:471 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='disable') 472 log.info('sucessful in Removing allowed q VLAN on dn')473 474 with steps.start('Removing Remark VLAN',continue_=True) as step:475 assert cli.config_vlan_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_cvlan'],remark,status='disable')476 log.info('sucessful in Removing Single VLAN Remarking on dn')477class Q_Vlan_Drop_Untag(aetest.Testcase):478 479 @aetest.setup480 def Configure_Q_Vlan(self, steps,ctrl,server,client,**param):481 with steps.start('Verifying links',continue_=True) as step: 482 log.info('Verify link status')483 for i in range(0,3):484 485 data = fetch.fetch_topology(ctrl)486 verify = fetch.link_status(data)487 if verify == True: 488 break489 elif i == 2: 490 assert verify491 sleep(100)492 with steps.start('Configure Q VLAN in dn',continue_=True) as step:493 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=str(int(param['dn1_cvlan'])-1),status='enable') 494 log.info('sucessful in Enabling Single VLAN on dn')495 496 with steps.start('Configure drop untag packets in Q VLAN',continue_=True) as step:497 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='enable') 498 log.info('sucessful in configuring Drop untag VLAN')499 500 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:501 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='enable') 502 log.info('sucessful in configuring allowed q VLAN on dn') 503 504 @ aetest.test505 def test_untagged_packets(self,steps,ctrl,server,client,**param):506 with steps.start('Configure Q VLAN in Server',continue_=True) as step:507 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'])508 log.info('Successful in configuring vlan in Server')509 510 #Configure IP on client PC511 with steps.start('Configure IP in client',continue_=True) as step: 512 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])513 log.info('Successful in configuring IP in Client')514 515 516 with steps.start('Starting iperf in client',continue_=True) as step:517 sleep(20) 518 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])519 result=((up != 0.0) and (down != 0.0))520 if result == False:521 log.info('Traffic Failed due to drop untag')522 else:523 log.info('Failed to drop untagged packets')524 assert False525 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 526 527 528 with steps.start('Configure Q VLAN in Server',continue_=True) as step:529 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'],status='disable')530 log.info('Successful in configuring vlan in Server')531 with steps.start('Removing IP in client',continue_=True) as step:532 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')533 log.info('Successful in Removing IP in Client')534 535 @ aetest.test536 def test_single_tagged_packets(self,steps,ctrl,server,client,**param):537 with steps.start('Configure Q VLAN in Server',continue_=True) as step:538 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])539 log.info('Successful in configuring vlan in Server')540 541 with steps.start('Configure Q VLAN in client',continue_=True) as step:542 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'])543 log.info('Successful in configuring vlan in client')544 545 with steps.start('Starting iperf in client',continue_=True) as step:546 sleep(20) 547 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])548 assert ((up != 0.0) and (down != 0.0))549 log.info('througput numbers up={} down={}'.format(up,down)) 550 with steps.start('Removing Q VLAN in Server',continue_=True) as step:551 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')552 log.info('Successful in Removing vlan in Server')553 554 with steps.start('Removing Q VLAN in client',continue_=True) as step:555 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'],status='disable')556 log.info('Removing Q vlan in client')557 @aetest.cleanup558 def Disabling_Q_VLAN_configs(self,steps,ctrl,server,client,**param):559 560 log.info('Disabling Single VLAN in dn')561 with steps.start('Removing drop untag packets in Q VLAN',continue_=True) as step:562 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 563 log.info('sucessful in Removing Drop untag VLAN')564 with steps.start('Removing vlan configs from dn',continue_=True) as step:565 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 566 log.info('sucessful in Enabling Single VLAN on dn')567 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:568 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='disable') 569 log.info('sucessful in Removing allowed q VLAN on dn')570class Q_Vlan_Priority_Remarking(aetest.Testcase):571 572 def Capturing_Server_interface(self,server,server_inf,server_file):573 assert misc.capture_interface(server,server_inf,server_file)574 def Verify_traffic(self,client,server_data_ipv4):575 log.info('Starting iperf client')576 up,down=misc.config_iperf_client(client,server_data_ipv4)577 assert ((up != 0.0) and (down != 0.0))578 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))579 580 @aetest.setup581 def Configure_Q_Vlan(self, steps,ctrl,server,client,**param):582 583 with steps.start('Verifying links',continue_=True) as step: 584 log.info('Verify link status')585 for i in range(0,3):586 587 data = fetch.fetch_topology(ctrl)588 verify = fetch.link_status(data)589 if verify == True: 590 break591 elif i == 2: 592 assert verify593 sleep(100)594 595 with steps.start('Configure Q VLAN in dn',continue_=True) as step:596 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=str(int(param['dn1_cvlan'])-1),status='enable') 597 log.info('sucessful in Enabling Single VLAN on dn')598 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:599 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='enable') 600 log.info('sucessful in configuring allowed q VLAN on dn')601 602 with steps.start('Configuring Remark VLAN priority',continue_=True) as step:603 assert cli.config_vlan_prio_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_cvlan'],'7')604 log.info('sucessful in Configuring Single VLAN priority Remarking on dn')605 @ aetest.test606 def test_untagged_packets(self,steps,ctrl,server,client,**param):607 with steps.start('Configure Q VLAN in Server',continue_=True) as step:608 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'])609 log.info('Successful in configuring vlan in Server')610 611 with steps.start('Configure IP in client',continue_=True) as step:612 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])613 log.info('Successful in configuring IP in Client')614 with steps.start('Capturing and verifying traffic',continue_=True) as step:615 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))616 p1.start()617 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))618 p2.start()619 p1.join()620 p2.join()621 622 with steps.start('Analyse Capture',continue_=True) as step:623 ip = param['client_data_ipv4'].rsplit('/', 1)[0]624 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==0'.format(ip,str(int(param['dn1_cvlan'])-1)) 625 res=misc.analyse_capture(server,filter,param['server_file'])626 if res > 0:627 log.info('Successful in priority remarking')628 else:629 assert False630 631 with steps.start('Removing Q VLAN in Server',continue_=True) as step:632 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),param['server_data_ipv4'],status='disable')633 log.info('Removing Q vlan in Server')634 with steps.start('Removing IP in client',continue_=True) as step:635 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')636 log.info('Successful in Removing IP in Client') 637 638 @ aetest.test639 def test_single_tagged_packets(self,steps,ctrl,server,client,**param):640 641 with steps.start('Configure Q VLAN in Server',continue_=True) as step:642 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])643 log.info('Successful in configuring vlan in Server')644 with steps.start('Configure Q VLAN in client',continue_=True) as step:645 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'])646 log.info('Successful in configuring vlan in client')647 sleep(20)648 649 with steps.start('Capturing and verifying traffic',continue_=True) as step:650 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))651 p1.start()652 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))653 p2.start()654 p1.join()655 p2.join()656 with steps.start('Analyse Capture',continue_=True) as step:657 ip = param['client_data_ipv4'].rsplit('/', 1)[0]658 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])659 res=misc.analyse_capture(server,filter,param['server_file'])660 if res > 0:661 log.info('Successful in priority remarking')662 else:663 assert False664 with steps.start('Removing Q VLAN in Server',continue_=True) as step:665 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')666 log.info('Removing Q vlan in Server')667 668 with steps.start('Removing Q VLAN in client',continue_=True) as step:669 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'],status='disable')670 log.info('Removing Q vlan in client')671 @aetest.cleanup672 def Removing_configs_from_node_and_PCs(self,steps,ctrl,server,client,**param):673 with steps.start('Removing Q VLAN in dn',continue_=True) as step:674 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id='1',status='disable') 675 log.info('sucessful in Removing Single VLAN on dn')676 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:677 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_cvlan'],status='enable') 678 log.info('sucessful in Removing allowed q VLAN on dn')679 680 with steps.start('Removing Remark VLAN prio',continue_=True) as step:681 assert cli.config_vlan_prio_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_cvlan'],'7',status='disable')682 log.info('sucessful in Removing Single VLAN priority Remarking on dn')683@aetest.loop(etype = ['0x8100', '0x88A8'])684class Q_port_Behaviour_When_QinQ_Ingress(aetest.Testcase):685 @aetest.setup686 def Configure_Q_Vlan(self, steps,ctrl,server,client,etype,**param):687 with steps.start('Verifying links',continue_=True) as step: 688 log.info('Verify link status')689 for i in range(0,3):690 691 data = fetch.fetch_topology(ctrl)692 verify = fetch.link_status(data)693 if verify == True: 694 break695 elif i == 2: 696 assert verify697 sleep(100)698 with steps.start('Configure Q VLAN in dn',continue_=True) as step:699 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id='1',status='enable')700 log.info('sucessful in Enabling Single VLAN on dn')701 with steps.start('Configure Allowed Q VLAN in dn',continue_=True) as step:702 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')703 log.info('sucessful in configuring allowed q VLAN on dn')704 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:705 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)706 log.info('Successful in configuring vlan in Server')707 with steps.start('Configure QinQ VLAN in client',continue_=True) as step:708 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)709 log.info('Successful in configuring vlan in Server')710 @ aetest.test711 def Verify_traffic(self,steps,ctrl,server,client,**param):712 log.info('Starting iperf client')713 sleep(20)714 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])715 result=((up != 0.0) and (down != 0.0))716 if result == False:717 log.info('Traffic dropped due to double tagged packets')718 else:719 log.info('Failed to drop double tagged packets')720 assert False721 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))722 @aetest.cleanup723 def Removing_Vlan_configs(self, steps,ctrl,server,client,etype,**param):724 with steps.start('Removing Q VLAN in dn',continue_=True) as step:725 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id='1',status='disable')726 log.info('sucessful in Removing Single VLAN on dn')727 with steps.start('Removing Allowed Q VLAN in dn',continue_=True) as step:728 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')729 log.info('sucessful in Removing allowed q VLAN on dn')730 with steps.start('Remonving QinQ VLAN in Server',continue_=True) as step:731 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')732 log.info('Successful in Removing vlan in Server')733 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:734 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')735 log.info('Successful in Removing vlan in Server')736@aetest.loop(etype = ['0x8100', '0x88A8'])737class Allowed_QinQ_Vlan(aetest.Testcase):738 @aetest.setup739 def Configure_QinQ_Vlan_allowed_list(self, steps,ctrl,server,client,etype,**param):740 vlans='{},{}-{}'.format(lis1[0],lis1[1],lis1[3])741 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:742 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')743 log.info('sucessful in Enabling Single VLAN on dn')744 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:745 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='enable')746 log.info('sucessful in configuring allowed QinQ VLAN on dn')747 @ aetest.test748 def test_untagged_packets(self,steps,ctrl,server,client,etype,**parm):749 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:750 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)751 log.info('Successful in configuring vlan in Server')752 with steps.start('Configure IP in client',continue_=True) as step:753 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])754 log.info('Successful in configuring IP in Client')755 with steps.start('Starting iperf in client',continue_=True) as step:756 sleep(20)757 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])758 assert ((up != 0.0) and (down != 0.0))759 with steps.start('Removing Q VLAN in Server',continue_=True) as step:760 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')761 log.info('Successful in Removing vlan in Server')762 with steps.start('Removing IP in client',continue_=True) as step:763 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')764 log.info('Successful in Removing IP in Client') 765 @ aetest.test.loop(s_vlan=lis1)766 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,s_vlan,**param):767 768 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:769 assert misc.config_QinQ(server,param['server_inf'],s_vlan,str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)770 log.info('Successful in configuring vlan in Server')771 with steps.start('Configure Q VLAN in client',continue_=True) as step:772 assert misc.config_Q(client,param['client_inf'],s_vlan,param['client_data_ipv4'])773 log.info('Successful in configuring vlan in client')774 with steps.start('Verifying Traffic',continue_=True) as step:775 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])776 result=((up != 0.0) and (down != 0.0))777 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))778 if s_vlan==int(param['dn1_svlan'])+4:779 if result == False:780 log.info('No traffic due to unallowed vlan')781 else:782 assert False783 else:784 assert result785 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:786 assert misc.config_QinQ(server,param['server_inf'],s_vlan,str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')787 log.info('Successful in Removing vlan in Server')788 with steps.start('Removing Q VLAN in client',continue_=True) as step:789 assert misc.config_Q(client,param['client_inf'],s_vlan,param['client_data_ipv4'],status='disable')790 log.info('Removing Q vlan in client')791 @ aetest.test.loop(s_vlan=lis1)792 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,s_vlan,**param):793 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:794 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],s_vlan,param['server_data_ipv4'],ethertype=etype)795 log.info('Successful in configuring QinQ vlan in Server')796 with steps.start('Configure Q VLAN in client',continue_=True) as step:797 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],s_vlan,param['client_data_ipv4'],ethertype=etype)798 log.info('Successful in configuring QinQ vlan in client')799 log.info('Starting iperf client')800 sleep(20)801 with steps.start('Verifying Traffic',continue_=True) as step:802 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])803 result=((up != 0.0) and (down != 0.0))804 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))805 if s_vlan==int(param['dn1_svlan'])+4:806 if result == False:807 log.info('No traffic due to unallowed vlan')808 else:809 assert False810 else:811 assert result812 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:813 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],s_vlan,param['server_data_ipv4'],status='disable')814 log.info('Removing QinQ vlan in Server')815 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:816 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],s_vlan,param['client_data_ipv4'],status='disable')817 log.info('Removing QiNQ vlan in client')818 @aetest.cleanup819 def VLAN_config_cleanup(self,steps,ctrl,server,client,etype,**param):820 vlans='{},{}-{}'.format(lis1[0],lis1[1],lis1[3])821 with steps.start('Remove QinQ VLAN in dn',continue_=True) as step:822 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan='1',cvlan='1',ethertype=etype,status='disable')823 log.info('sucessful in Removing Double VLAN on dn')824 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:825 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='disable')826 log.info('sucessful in Removing allowed QinQ VLAN on dn')827@aetest.loop(etype = ['0x8100', '0x88A8'])828class Allowed_QinQ_Vlan(aetest.Testcase):829 @aetest.setup830 def Configure_QinQ_Vlan_allowed_list(self, steps,ctrl,server,client,etype,**param):831 vlans='{},{}-{}'.format(lis1[0],lis1[1],lis1[3])832 with steps.start('Verifying links',continue_=True) as step: 833 log.info('Verify link status')834 for i in range(0,3):835 836 data = fetch.fetch_topology(ctrl)837 verify = fetch.link_status(data)838 if verify == True: 839 break840 elif i == 2: 841 assert verify842 sleep(100)843 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:844 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')845 log.info('sucessful in Enabling Single VLAN on dn')846 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:847 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='enable')848 log.info('sucessful in configuring allowed QinQ VLAN on dn')849 @ aetest.test850 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):851 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:852 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)853 log.info('Successful in configuring vlan in Server')854 with steps.start('Configure IP in client',continue_=True) as step:855 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])856 log.info('Successful in configuring IP in Client')857 with steps.start('Starting iperf in client',continue_=True) as step:858 sleep(20)859 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])860 assert ((up != 0.0) and (down != 0.0))861 with steps.start('Removing Q VLAN in Server',continue_=True) as step:862 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')863 log.info('Successful in Removing vlan in Server')864 with steps.start('Removing IP in client',continue_=True) as step:865 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')866 log.info('Successful in Removing IP in Client') 867 @ aetest.test.loop(s_vlan=lis1)868 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,s_vlan,**param):869 870 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:871 assert misc.config_QinQ(server,param['server_inf'],s_vlan,str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)872 log.info('Successful in configuring vlan in Server')873 with steps.start('Configure Q VLAN in client',continue_=True) as step:874 assert misc.config_Q(client,param['client_inf'],s_vlan,param['client_data_ipv4'])875 log.info('Successful in configuring vlan in client')876 with steps.start('Verifying Traffic',continue_=True) as step:877 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])878 result=((up != 0.0) and (down != 0.0))879 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))880 if s_vlan==int(param['dn1_svlan'])+4:881 if result == False:882 log.info('No traffic due to unallowed vlan')883 else:884 assert False885 else:886 assert result887 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:888 assert misc.config_QinQ(server,param['server_inf'],s_vlan,str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')889 log.info('Successful in Removing vlan in Server')890 with steps.start('Removing Q VLAN in client',continue_=True) as step:891 assert misc.config_Q(client,param['client_inf'],s_vlan,param['client_data_ipv4'],status='disable')892 log.info('Removing Q vlan in client')893 @ aetest.test.loop(s_vlan=lis1)894 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,s_vlan,**param):895 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:896 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],s_vlan,param['server_data_ipv4'],ethertype=etype)897 log.info('Successful in configuring QinQ vlan in Server')898 with steps.start('Configure Q VLAN in client',continue_=True) as step:899 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],s_vlan,param['client_data_ipv4'],ethertype=etype)900 log.info('Successful in configuring QinQ vlan in client')901 log.info('Starting iperf client')902 sleep(20)903 with steps.start('Verifying Traffic',continue_=True) as step:904 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])905 result=((up != 0.0) and (down != 0.0))906 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))907 if s_vlan==int(param['dn1_svlan'])+4:908 if result == False:909 log.info('No traffic due to unallowed vlan')910 else:911 assert False912 else:913 assert result914 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:915 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],s_vlan,param['server_data_ipv4'],status='disable')916 log.info('Removing QinQ vlan in Server')917 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:918 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],s_vlan,param['client_data_ipv4'],status='disable')919 log.info('Removing QiNQ vlan in client')920 @aetest.cleanup921 def VLAN_config_cleanup(self,steps,ctrl,server,client,etype,**param):922 vlans='{},{}-{}'.format(lis1[0],lis1[1],lis1[3])923 with steps.start('Remove QinQ VLAN in dn',continue_=True) as step:924 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan='1',cvlan='1',ethertype=etype,status='disable')925 log.info('sucessful in Removing Double VLAN on dn')926 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:927 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=vlans,status='disable')928 log.info('sucessful in Removing allowed QinQ VLAN on dn')929@aetest.loop(etype = ['0x8100', '0x88A8'])930class QinQ_Vlan_Remarking(aetest.Testcase):931 932 @aetest.setup933 def Configure_Q_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):934 remark=int(param['dn1_svlan'])+1935 with steps.start('Verifying links',continue_=True) as step: 936 log.info('Verify link status')937 for i in range(0,3):938 939 data = fetch.fetch_topology(ctrl)940 verify = fetch.link_status(data)941 if verify == True: 942 break943 elif i == 2: 944 assert verify945 sleep(100)946 947 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:948 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=param['dn1_svlan'],cvlan=param['dn1_cvlan'],ethertype=etype,status='enable')949 log.info('sucessful in Enabling Single VLAN on dn')950 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:951 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')952 log.info('sucessful in configuring allowed QinQ VLAN on dn')953 954 with steps.start('Configuring Remark VLAN',continue_=True) as step:955 assert cli.config_vlan_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_svlan'],remark)956 log.info('sucessful in Configuring Single VLAN Remarking on dn')957 @ aetest.test958 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):959 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:960 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)961 log.info('Successful in configuring vlan in Server')962 with steps.start('Configure IP in client',continue_=True) as step:963 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])964 log.info('Successful in configuring IP in Client')965 with steps.start('Starting iperf in client',continue_=True) as step:966 sleep(20)967 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])968 assert ((up != 0.0) and (down != 0.0))969 with steps.start('Removing Q VLAN in Server',continue_=True) as step:970 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')971 log.info('Successful in Removing vlan in Server')972 with steps.start('Removing IP in client',continue_=True) as step:973 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')974 log.info('Successful in Removing IP in Client') 975 @ aetest.test976 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):977 remark=int(param['dn1_svlan'])+1978 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:979 assert misc.config_QinQ(server,param['server_inf'],remark,param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)980 log.info('Successful in configuring vlan in Server')981 with steps.start('Configure Q VLAN in client',continue_=True) as step:982 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])983 log.info('Successful in configuring vlan in client')984 with steps.start('Verifying Traffic',continue_=True) as step:985 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])986 assert ((up != 0.0) and (down != 0.0))987 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))988 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:989 assert misc.config_QinQ(server,param['server_inf'],remark,param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')990 log.info('Successful in Removing vlan in Server')991 with steps.start('Removing Q VLAN in client',continue_=True) as step:992 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')993 log.info('Removing Q vlan in client')994 @ aetest.test995 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):996 remark=int(param['dn1_svlan'])+1997 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:998 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],remark,param['server_data_ipv4'],ethertype=etype)999 log.info('Successful in configuring QinQ vlan in Server')1000 with steps.start('Configure Q VLAN in client',continue_=True) as step:1001 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1002 log.info('Successful in configuring QinQ vlan in client')1003 log.info('Starting iperf client')1004 sleep(20)1005 with steps.start('Verifying Traffic',continue_=True) as step:1006 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1007 assert ((up != 0.0) and (down != 0.0))1008 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1009 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1010 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],remark,param['server_data_ipv4'],status='disable')1011 log.info('Removing QinQ vlan in Server')1012 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1013 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1014 log.info('Removing QiNQ vlan in client')1015 1016 @aetest.cleanup1017 def Removing_configs_from_node_and_PCs(self,steps,ctrl,server,client,etype,**param):1018 remark=int(param['dn1_svlan'])+11019 1020 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1021 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1022 log.info('sucessful in Removing QinQ VLAN on dn')1023 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1024 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1025 log.info('sucessful in Removing allowed QinQ VLAN on dn')1026 1027 with steps.start('Removing Remark VLAN',continue_=True) as step:1028 assert cli.config_vlan_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_svlan'],remark,status='disable')1029 log.info('sucessful in Removing Single VLAN Remarking on dn')1030@aetest.loop(etype = ['0x8100', '0x88A8'])1031class QinQ_Vlan_Prio_Remarking(aetest.Testcase):1032 1033 def Capturing_Server_interface(self,server,server_inf,server_file):1034 assert misc.capture_interface(server,server_inf,server_file)1035 def Verify_traffic(self,client,server_data_ipv4):1036 log.info('Starting iperf client')1037 up,down=misc.config_iperf_client(client,server_data_ipv4)1038 assert ((up != 0.0) and (down != 0.0))1039 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1040 1041 @aetest.setup1042 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1043 1044 with steps.start('Verifying links',continue_=True) as step: 1045 log.info('Verify link status')1046 for i in range(0,3):1047 1048 data = fetch.fetch_topology(ctrl)1049 verify = fetch.link_status(data)1050 if verify == True: 1051 break1052 elif i == 2: 1053 assert verify1054 sleep(100)1055 1056 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1057 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1058 log.info('sucessful in Enabling Single VLAN on dn')1059 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1060 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1061 log.info('sucessful in configuring allowed QinQ VLAN on dn')1062 1063 with steps.start('Configuring Remark VLAN Priority',continue_=True) as step:1064 assert cli.config_vlan_prio_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_svlan'],'7')1065 log.info('sucessful in Configuring Single VLAN prirotiy Remarking on dn')1066 @ aetest.test1067 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1068 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1069 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1070 log.info('Successful in configuring vlan in Server')1071 with steps.start('Configure IP in client',continue_=True) as step:1072 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])1073 log.info('Successful in configuring IP in Client')1074 sleep(20)1075 with steps.start('Capturing and verifying traffic',continue_=True) as step:1076 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))1077 p1.start()1078 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))1079 p2.start()1080 p1.join()1081 p2.join()1082 with steps.start('Analyse Capture',continue_=True) as step:1083 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1084 if etype == '0x8100':1085 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id== {}&&vlan.priority==0'.format(ip,str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1))1086 1087 else:1088 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==0&&vlan.priority==0'.format(ip,str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1))1089 1090 res=misc.analyse_capture(server,filter,param['server_file'])1091 if res > 0:1092 log.info('Successful in VLAN tagging')1093 else:1094 assert False1095 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1096 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1097 log.info('Successful in Removing vlan in Server')1098 with steps.start('Removing IP in client',continue_=True) as step:1099 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1100 log.info('Successful in Removing IP in Client') 1101 @ aetest.test1102 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1103 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1104 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1105 log.info('Successful in configuring vlan in Server')1106 with steps.start('Configure Q VLAN in client',continue_=True) as step:1107 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1108 log.info('Successful in configuring vlan in client')1109 1110 with steps.start('Capturing and verifying traffic',continue_=True) as step:1111 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))1112 p1.start()1113 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))1114 p2.start()1115 p1.join()1116 p2.join()1117 with steps.start('Analyse Capture',continue_=True) as step:1118 if etype == '0x8100':1119 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1120 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id== {}&&vlan.priority==0'.format(ip,str(int(param['dn1_svlan'])-1),param['dn1_svlan'])1121 1122 else:1123 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1124 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==0&&vlan.priority==7'.format(ip,param['dn1_svlan'],int(param['dn1_svlan'])-1)1125 1126 res=misc.analyse_capture(server,filter,param['server_file'])1127 if res > 0:1128 log.info('Successful in VLAN tagging')1129 else:1130 assert False1131 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1132 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1133 log.info('Successful in Removing vlan in Server')1134 with steps.start('Removing Q VLAN in client',continue_=True) as step:1135 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1136 log.info('Removing Q vlan in client')1137 @ aetest.test1138 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1139 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1140 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1141 log.info('Successful in configuring QinQ vlan in Server')1142 with steps.start('Configure Q VLAN in client',continue_=True) as step:1143 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1144 log.info('Successful in configuring QinQ vlan in client')1145 with steps.start('Capturing and verifying traffic',continue_=True) as step:1146 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))1147 p1.start()1148 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))1149 p2.start()1150 p1.join()1151 p2.join()1152 with steps.start('Analyse Capture',continue_=True) as step:1153 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1154 if etype == '0x8100': 1155 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id== {}&&vlan.priority==7&&vlan.priority==0'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])1156 else:1157 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==7&&vlan.priority==0'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])1158 res=misc.analyse_capture(server,filter,param['server_file'])1159 if res > 0:1160 log.info('Successful in VLAN tagging')1161 else:1162 assert False1163 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1164 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1165 log.info('Removing QinQ vlan in Server')1166 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1167 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype,status='disable')1168 log.info('Removing QiNQ vlan in client')1169 @aetest.cleanup1170 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1171 1172 1173 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1174 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1175 log.info('sucessful in Removing Single VLAN on dn')1176 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1177 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1178 log.info('sucessful in Removing allowed QinQ VLAN on dn')1179 1180 with steps.start('Removing Remark VLAN Priority',continue_=True) as step:1181 assert cli.config_vlan_prio_remarking(ctrl,param['dn1_name'],param['dn1_inf'],param['dn1_svlan'],'7',status='disable')1182 log.info('sucessful in Removing Single VLAN prirotiy Remarking on dn')1183@aetest.loop(etype = ['0x8100', '0x88A8'])1184class QinQ_Allow_untag_Allow_Singe_Tag(aetest.Testcase):1185 1186 @aetest.setup1187 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1188 1189 with steps.start('Verifying links',continue_=True) as step: 1190 log.info('Verify link status')1191 for i in range(0,3):1192 1193 data = fetch.fetch_topology(ctrl)1194 verify = fetch.link_status(data)1195 if verify == True: 1196 break1197 elif i == 2: 1198 assert verify1199 sleep(100)1200 client.disconnect()1201 client.connect()1202 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1203 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1204 log.info('sucessful in Enabling Single VLAN on dn')1205 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1206 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1207 log.info('sucessful in configuring allowed QinQ VLAN on dn')1208 1209 with steps.start('Configure drop untag packets in QinQ VLAN',continue_=True) as step:1210 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 1211 log.info('sucessful in configuring Drop untag VLAN')1212 1213 1214 1215 @ aetest.test1216 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1217 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1218 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1219 log.info('Successful in configuring vlan in Server')1220 with steps.start('Configure IP in client',continue_=True) as step:1221 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])1222 log.info('Successful in configuring IP in Client')1223 1224 with steps.start('Starting client iperf',continue_=True) as step:1225 sleep(20) 1226 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1227 assert ((up != 0) and (down != 0))1228 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1229 1230 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1231 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1232 log.info('Successful in Removing vlan in Server')1233 with steps.start('Removing IP in client',continue_=True) as step:1234 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1235 log.info('Successful in Removing IP in Client') 1236 @ aetest.test1237 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1238 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1239 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1240 log.info('Successful in configuring vlan in Server')1241 with steps.start('Configure Q VLAN in client',continue_=True) as step:1242 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1243 log.info('Successful in configuring vlan in client')1244 1245 with steps.start('Starting client iperf',continue_=True) as step:1246 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1247 assert ((up != 0) and (down != 0))1248 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1249 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1250 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1251 log.info('Successful in Removing vlan in Server')1252 with steps.start('Removing Q VLAN in client',continue_=True) as step:1253 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1254 log.info('Removing Q vlan in client')1255 @ aetest.test1256 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1257 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1258 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1259 log.info('Successful in configuring QinQ vlan in Server')1260 with steps.start('Configure Q VLAN in client',continue_=True) as step:1261 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1262 log.info('Successful in configuring QinQ vlan in client')1263 with steps.start('Starting client iperf',continue_=True) as step:1264 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1265 assert ((up != 0) and (down != 0))1266 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1267 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1268 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1269 log.info('Removing QinQ vlan in Server')1270 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1271 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype,status='disable')1272 log.info('Removing QiNQ vlan in client')1273 1274 @aetest.cleanup1275 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1276 1277 1278 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1279 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1280 log.info('sucessful in Removing Single VLAN on dn')1281 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1282 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1283 log.info('sucessful in Removing allowed QinQ VLAN on dn')1284 1285 client.disconnect()1286 client.connect()1287@aetest.loop(etype = ['0x8100', '0x88A8'])1288class QinQ_Drop_untag_Allow_Singe_Tag(aetest.Testcase):1289 1290 @aetest.setup1291 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1292 1293 with steps.start('Verifying links',continue_=True) as step: 1294 log.info('Verify link status')1295 for i in range(0,3):1296 1297 data = fetch.fetch_topology(ctrl)1298 verify = fetch.link_status(data)1299 if verify == True: 1300 break1301 elif i == 2: 1302 assert verify1303 sleep(100)1304 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1305 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1306 log.info('sucessful in Enabling Single VLAN on dn')1307 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1308 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1309 log.info('sucessful in configuring allowed QinQ VLAN on dn')1310 1311 with steps.start('Configure drop untag packets in QinQ VLAN',continue_=True) as step:1312 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='enable') 1313 log.info('sucessful in configuring Drop untag VLAN')1314 1315 1316 1317 @ aetest.test1318 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1319 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1320 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1321 log.info('Successful in configuring vlan in Server')1322 1323 #Configure IP on client PC1324 with steps.start('Configure IP in client',continue_=True) as step: 1325 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])1326 log.info('Successful in configuring IP in Client')1327 1328 with steps.start('Starting iperf in client',continue_=True) as step:1329 sleep(20) 1330 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1331 result=((up != 0.0) and (down != 0.0))1332 log.info(result)1333 if result == False:1334 log.info('Traffic Failed due to drop untag')1335 else:1336 log.info('Failed to drop untagged packets')1337 assert False1338 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1339 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1340 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1341 log.info('Successful in Removing vlan in Server')1342 with steps.start('Removing IP in client',continue_=True) as step:1343 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1344 log.info('Successful in Removing IP in Client') 1345 @ aetest.test1346 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1347 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1348 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1349 log.info('Successful in configuring vlan in Server')1350 with steps.start('Configure Q VLAN in client',continue_=True) as step:1351 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1352 log.info('Successful in configuring vlan in client')1353 1354 with steps.start('Starting client iperf',continue_=True) as step:1355 sleep(20)1356 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1357 assert ((up != 0) and (down != 0))1358 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1359 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1360 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1361 log.info('Successful in Removing vlan in Server')1362 with steps.start('Removing Q VLAN in client',continue_=True) as step:1363 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1364 log.info('Removing Q vlan in client')1365 @ aetest.test1366 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1367 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1368 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1369 log.info('Successful in configuring QinQ vlan in Server')1370 with steps.start('Configure Q VLAN in client',continue_=True) as step:1371 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1372 log.info('Successful in configuring QinQ vlan in client')1373 with steps.start('Starting client iperf',continue_=True) as step:1374 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1375 assert ((up != 0) and (down != 0))1376 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1377 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1378 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],status='disable')1379 log.info('Removing QinQ vlan in Server')1380 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1381 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1382 log.info('Removing QiNQ vlan in client')1383 1384 @aetest.cleanup1385 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1386 1387 1388 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1389 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1390 log.info('sucessful in Removing Single VLAN on dn')1391 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1392 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1393 log.info('sucessful in Removing allowed QinQ VLAN on dn')1394 1395 with steps.start('Removing drop untag packets in QinQ VLAN',continue_=True) as step:1396 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 1397 log.info('sucessful in Removing Drop untag VLAN')1398@aetest.loop(etype = ['0x8100', '0x88A8'])1399class QinQ_Allow_untag_Drop_Singe_Tag(aetest.Testcase):1400 1401 @aetest.setup1402 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1403 1404 1405 with steps.start('Verifying links',continue_=True) as step: 1406 log.info('Verify link status')1407 for i in range(0,3):1408 1409 data = fetch.fetch_topology(ctrl)1410 verify = fetch.link_status(data)1411 if verify == True: 1412 break1413 elif i == 2: 1414 assert verify1415 sleep(100)1416 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1417 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1418 log.info('sucessful in Enabling Single VLAN on dn')1419 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1420 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1421 log.info('sucessful in configuring allowed QinQ VLAN on dn')1422 1423 with steps.start('Configure Allow untag packets in QinQ VLAN',continue_=True) as step:1424 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 1425 log.info('sucessful in configuring Allow untag ')1426 1427 with steps.start('Configure Drop Single packets in QinQ VLAN',continue_=True) as step:1428 assert cli.config_drop_single_tag(ctrl,param['dn1_name'],param['dn1_inf'],status='enable') 1429 log.info('sucessful in configuring Drop Singletag')1430 1431 1432 1433 @ aetest.test1434 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1435 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1436 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1437 log.info('Successful in configuring vlan in Server')1438 with steps.start('Configure IP in client',continue_=True) as step:1439 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])1440 log.info('Successful in configuring IP in Client')1441 1442 1443 with steps.start('Starting client iperf',continue_=True) as step:1444 sleep(20)1445 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1446 assert ((up != 0) and (down != 0))1447 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1448 1449 1450 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1451 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1452 log.info('Successful in Removing vlan in Server')1453 with steps.start('Removing IP in client',continue_=True) as step:1454 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1455 log.info('Successful in Removing IP in Client') 1456 @ aetest.test1457 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1458 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1459 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1460 log.info('Successful in configuring vlan in Server')1461 with steps.start('Configure Q VLAN in client',continue_=True) as step:1462 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1463 log.info('Successful in configuring vlan in client')1464 1465 with steps.start('Starting client iperf',continue_=True) as step:1466 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1467 result=((up != 0) and (down != 0))1468 if result == False:1469 log.info('Packets dropped due to drop config')1470 else:1471 assert False1472 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1473 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1474 log.info('Successful in Removing vlan in Server')1475 with steps.start('Removing Q VLAN in client',continue_=True) as step:1476 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1477 log.info('Removing Q vlan in client')1478 @ aetest.test1479 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1480 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1481 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1482 log.info('Successful in configuring QinQ vlan in Server')1483 with steps.start('Configure Q VLAN in client',continue_=True) as step:1484 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1485 log.info('Successful in configuring QinQ vlan in client')1486 with steps.start('Starting client iperf',continue_=True) as step:1487 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1488 assert ((up != 0) and (down != 0))1489 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1490 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1491 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],status='disable')1492 log.info('Removing QinQ vlan in Server')1493 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1494 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1495 log.info('Removing QiNQ vlan in client')1496 1497 @aetest.cleanup1498 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1499 1500 1501 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1502 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1503 log.info('sucessful in Removing Single VLAN on dn')1504 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1505 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1506 log.info('sucessful in Removing allowed QinQ VLAN on dn')1507 1508 with steps.start('Removing drop Single tag packets in QinQ VLAN',continue_=True) as step:1509 assert cli.config_drop_single_tag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 1510 log.info('sucessful in Removing Drop Single tag')1511 1512@aetest.loop(etype = ['0x8100', '0x88A8'])1513class QinQ_Drop_untag_Drop_Singe_Tag(aetest.Testcase):1514 1515 @aetest.setup1516 def Configure_QinQ_Vlan_allowed_list(self,etype, steps,ctrl,server,client,**param):1517 1518 with steps.start('Verifying links',continue_=True) as step: 1519 log.info('Verify link status')1520 for i in range(0,3):1521 1522 data = fetch.fetch_topology(ctrl)1523 verify = fetch.link_status(data)1524 if verify == True: 1525 break1526 elif i == 2: 1527 assert verify1528 sleep(100)1529 client.disconnect()1530 client.connect()1531 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1532 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='enable')1533 log.info('sucessful in Enabling Single VLAN on dn')1534 with steps.start('Configure Allowed QinQ VLAN in dn',continue_=True) as step:1535 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='enable')1536 log.info('sucessful in configuring allowed QinQ VLAN on dn')1537 1538 with steps.start('Configure Drop untag packets in QinQ VLAN',continue_=True) as step:1539 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='enable') 1540 log.info('sucessful in configuring Drop untag ')1541 1542 with steps.start('Configure Drop Single packets in QinQ VLAN',continue_=True) as step:1543 assert cli.config_drop_single_tag(ctrl,param['dn1_name'],param['dn1_inf'],status='enable') 1544 log.info('sucessful in configuring Drop Singletag')1545 1546 1547 1548 @ aetest.test1549 def test_untagged_packets(self,steps,ctrl,server,client,etype,**param):1550 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1551 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1552 log.info('Successful in configuring vlan in Server')1553 with steps.start('Configure IP in client',continue_=True) as step:1554 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])1555 log.info('Successful in configuring IP in Client')1556 1557 1558 with steps.start('Starting client iperf',continue_=True) as step:1559 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1560 result=((up != 0) and (down != 0))1561 if result == False:1562 log.info('Packets dropped due to drop config')1563 else:1564 assert False1565 1566 1567 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1568 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])-1),str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1569 log.info('Successful in Removing vlan in Server')1570 with steps.start('Removing IP in client',continue_=True) as step:1571 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1572 log.info('Successful in Removing IP in Client') 1573 @ aetest.test1574 def test_single_tagged_packets(self,steps,ctrl,server,client,etype,**param):1575 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1576 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype)1577 log.info('Successful in configuring vlan in Server')1578 with steps.start('Configure Q VLAN in client',continue_=True) as step:1579 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'])1580 log.info('Successful in configuring vlan in client')1581 1582 with steps.start('Starting client iperf',continue_=True) as step:1583 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1584 result=((up != 0) and (down != 0))1585 if result == False:1586 log.info('Packets dropped due to drop config')1587 else:1588 assert False1589 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1590 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],str(int(param['dn1_svlan'])-1),param['server_data_ipv4'],ethertype=etype,status='disable')1591 log.info('Successful in Removing vlan in Server')1592 with steps.start('Removing Q VLAN in client',continue_=True) as step:1593 assert misc.config_Q(client,param['client_inf'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1594 log.info('Removing Q vlan in client')1595 @ aetest.test1596 def test_double_tagged_packets(self,steps,ctrl,server,client,etype,**param):1597 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1598 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1599 log.info('Successful in configuring QinQ vlan in Server')1600 with steps.start('Configure Q VLAN in client',continue_=True) as step:1601 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1602 log.info('Successful in configuring QinQ vlan in client')1603 with steps.start('Starting client iperf',continue_=True) as step:1604 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1605 assert ((up != 0) and (down != 0))1606 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1607 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1608 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],status='disable')1609 log.info('Removing QinQ vlan in Server')1610 with steps.start('Removing QinQ VLAN in client',continue_=True) as step:1611 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],status='disable')1612 log.info('Removing QiNQ vlan in client')1613 1614 @aetest.cleanup1615 def Removing_configs_from_node(self,steps,ctrl,server,client,etype,**param):1616 1617 1618 with steps.start('Removing QinQ VLAN in dn',continue_=True) as step:1619 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],svlan=str(int(param['dn1_svlan'])-1),cvlan=str(int(param['dn1_cvlan'])-1),ethertype=etype,status='disable')1620 log.info('sucessful in Removing Single VLAN on dn')1621 with steps.start('Removing Allowed QinQ VLAN in dn',continue_=True) as step:1622 assert cli.config_vlan_allowed_list(ctrl,param['dn1_name'],param['dn1_inf'],vlan_list=param['dn1_svlan'],status='disable')1623 log.info('sucessful in Removing allowed QinQ VLAN on dn')1624 with steps.start('Removing drop untag packets in QinQ VLAN',continue_=True) as step:1625 assert cli.config_vlan_drop_untag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 1626 log.info('sucessful in Removing Drop untag') 1627 1628 with steps.start('Removing drop Single tag packets in QinQ VLAN',continue_=True) as step:1629 assert cli.config_drop_single_tag(ctrl,param['dn1_name'],param['dn1_inf'],status='disable') 1630 log.info('sucessful in Removing Drop Single tag')1631@aetest.loop(etype = ['0x8100', '0x88A8'])1632class Same_S_And_C_QinQ_Vlan(aetest.Testcase):1633 def Capturing_Server_interface(self,server,server_inf,server_file):1634 assert misc.capture_interface(server,server_inf,server_file)1635 def Verify_traffic(self,client,server_data_ipv4):1636 log.info('Starting iperf client')1637 up,down=misc.config_iperf_client(client,server_data_ipv4)1638 assert ((up != 0.0) and (down != 0.0))1639 #log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1640 1641 @aetest.setup1642 def Configure_QinQ_Vlan(self, etype, steps,ctrl,server,client,**param):1643 1644 with steps.start('Verifying links',continue_=True) as step: 1645 log.info('Verify link status')1646 for i in range(0,3):1647 1648 data = fetch.fetch_topology(ctrl)1649 verify = fetch.link_status(data)1650 if verify == True: 1651 break1652 elif i == 2: 1653 assert verify1654 sleep(100)1655 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:1656 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_svlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 1657 log.info('sucessful in Enabling Double VLAN on dn')1658 1659 1660 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1661 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1662 log.info('Successful in configuring vlan in Server')1663 1664 #Configure IP on client PC1665 with steps.start('Configure IP in client',continue_=True) as step: 1666 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])1667 log.info('Successful in configuring IP in Client')1668 1669 1670 with steps.start('Capturing and verifying traffic',continue_=True) as step:1671 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))1672 p1.start()1673 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))1674 p2.start()1675 p1.join()1676 p2.join()1677 with steps.start('Analyse Capture',continue_=True) as step:1678 if etype =='0x8100':1679 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1680 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_svlan'],param['dn1_svlan'])1681 else:1682 ip = param['client_data_ipv4'].rsplit('/', 1)[0]1683 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_svlan'],param['dn1_svlan'])1684 res=misc.analyse_capture(server,filter,param['server_file'])1685 if res > 0:1686 log.info('Successful in QinQ VLAN tagging')1687 else:1688 assert False1689 1690 1691 1692 @aetest.cleanup1693 def Disabling_QinQ_VLAN(self,etype,steps,ctrl,server,client,**param):1694 1695 log.info('Disabling Double VLAN in dn')1696 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1697 assert misc.config_QinQ(server,param['server_inf'],param['dn1_svlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1698 log.info('Successful in Removing vlan in Server')1699 with steps.start('Removing vlan configs from server',continue_=True) as step:1700 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_svlan'],svlan=param['dn1_svlan'],ethertype=etype,status='disable') 1701 log.info('sucessful in Removing QinQ VLAN on dn')1702 with steps.start('Configure IP in client',continue_=True) as step:1703 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1704 log.info('Successful in configuring IP in Client')1705 1706class Transparent_Port(aetest.Testcase):1707 @aetest.setup1708 def Configure_Transparent(self, steps,ctrl,server,client,**param):1709 1710 with steps.start('Verifying links',continue_=True) as step: 1711 log.info('Verify link status')1712 for i in range(0,3):1713 1714 data = fetch.fetch_topology(ctrl)1715 verify = fetch.link_status(data)1716 if verify == True: 1717 break1718 elif i == 2: 1719 assert verify1720 sleep(100)1721 with steps.start('Configure Transparent in dn',continue_=True) as step:1722 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 1723 log.info('sucessful in Enabling Transparent on dn')1724 1725 with steps.start('Configure IP in Server',continue_=True) as step: 1726 assert misc.config_client_ip(server,param['server_inf'],param['server_data_ipv4'])1727 log.info('Successful in configuring IP in Server')1728 1729 #Configure IP on client PC1730 with steps.start('Configure IP in client',continue_=True) as step: 1731 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])1732 log.info('Successful in configuring IP in Client')1733 1734 1735 @ aetest.test1736 def verify_traffic(self,steps,ctrl,server,client,**param):1737 sleep(20) 1738 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1739 assert ((up != 0) and (down != 0))1740 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 1741 @aetest.cleanup1742 def Removing_Ips(self,steps,ctrl,server,client,**param):1743 1744 1745 with steps.start('Removing IP in Server',continue_=True) as step: 1746 assert misc.config_client_ip(server,param['server_inf'],param['server_data_ipv4'],status='disable')1747 log.info('Successful in Removing IP in Server')1748 1749 #Configure IP on client PC1750 with steps.start('Removing IP in client',continue_=True) as step: 1751 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1752 log.info('Successful in Removing IP in Client')1753class Transparent_Port_With_Q_Packets(aetest.Testcase):1754 @aetest.setup1755 def Configure_Transparent_port(self, steps,ctrl,server,client,**param):1756 with steps.start('Verifying links',continue_=True) as step: 1757 log.info('Verify link status')1758 for i in range(0,3):1759 1760 data = fetch.fetch_topology(ctrl)1761 verify = fetch.link_status(data)1762 if verify == True: 1763 break1764 elif i == 2: 1765 assert verify1766 sleep(100)1767 with steps.start('Configure Transparent port',continue_=True) as step:1768 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 1769 log.info('sucessful in Enabling Transparent port on dn')1770 1771 1772 with steps.start('Configure Q VLAN in Server',continue_=True) as step:1773 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])1774 log.info('Successful in configuring vlan in Server')1775 1776 with steps.start('Configure Q VLAN in client',continue_=True) as step:1777 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'])1778 log.info('Successful in configuring vlan in client')1779 1780 @ aetest.test1781 def verify_traffic(self,steps,ctrl,server,client,**param):1782 sleep(20) 1783 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1784 assert ((up != 0) and (down != 0))1785 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 1786 @aetest.cleanup1787 def Disabling_VLAN_in_Server(self,steps,ctrl,server,client,**param):1788 1789 1790 with steps.start('Removing Q VLAN in Server',continue_=True) as step:1791 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')1792 log.info('Successful in Removing vlan in Server')1793 1794 with steps.start('Removing Q VLAN in client',continue_=True) as step:1795 assert misc.config_Q(client,param['client_inf'],param['dn1_cvlan'],param['client_data_ipv4'],status='disable')1796 log.info('Successful in Removing vlan in client')1797@aetest.loop(etype = ['0x8100', '0x88A8'])1798class Transparent_Port_With_QinQ_Packets(aetest.Testcase):1799 @aetest.setup1800 def Configure_Transparent_Port(self, etype, steps,ctrl,server,client,**param):1801 1802 with steps.start('Verifying links',continue_=True) as step: 1803 log.info('Verify link status')1804 for i in range(0,3):1805 1806 data = fetch.fetch_topology(ctrl)1807 verify = fetch.link_status(data)1808 if verify == True: 1809 break1810 elif i == 2: 1811 assert verify1812 sleep(100)1813 with steps.start('Configure Transparent port',continue_=True) as step:1814 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 1815 log.info('sucessful in Enabling Transparent port on dn')1816 1817 1818 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:1819 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)1820 log.info('Successful in configuring vlan in Server')1821 1822 with steps.start('Configure QinQ VLAN in Client',continue_=True) as step:1823 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype)1824 log.info('Successful in configuring vlan in client') 1825 1826 1827 @ aetest.test1828 def verify_traffic(self,etype,steps,ctrl,server,client,**param):1829 sleep(20) 1830 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1831 assert ((up != 0) and (down != 0))1832 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 1833 1834 @aetest.cleanup1835 def Removing_VLAN(self,etype,steps,ctrl,server,client,**param):1836 1837 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:1838 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')1839 log.info('Successful in Removing vlan in Server')1840 1841 with steps.start('Removnig QinQ VLAN in Client',continue_=True) as step:1842 assert misc.config_QinQ(client,param['client_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['client_data_ipv4'],ethertype=etype,status='disable')1843 log.info('Successful in Removing vlan in client')1844class Two_Interface_Transaprent(aetest.Testcase):1845 @aetest.setup1846 def Configure_Transparent(self, steps,ctrl,server,client,client2,**param):1847 with steps.start('Verifying links',continue_=True) as step: 1848 log.info('Verify link status')1849 for i in range(0,3):1850 1851 data = fetch.fetch_topology(ctrl)1852 verify = fetch.link_status(data)1853 if verify == True: 1854 break1855 elif i == 2: 1856 assert verify1857 sleep(100)1858 client2.connect()1859 with steps.start('Configure Transparent in dn port1',continue_=True) as step:1860 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 1861 log.info('sucessful in Enabling Transparent on dn')1862 with steps.start('Configure Transparent in dn port2',continue_=True) as step:1863 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 1864 log.info('sucessful in Enabling Transparent on dn')1865 1866 with steps.start('Configure IP in Server',continue_=True) as step: 1867 assert misc.config_client_ip(server,param['server_inf'],param['server_data_ipv4'])1868 log.info('Successful in configuring IP in Server')1869 1870 #Configure IP on client PC1871 with steps.start('Configure IP in client',continue_=True) as step: 1872 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])1873 log.info('Successful in configuring IP in Client')1874 with steps.start('Configure IP in client2',continue_=True) as step: 1875 assert misc.config_client_ip(client2,param['client2_inf'],param['client2_data_ipv4'])1876 log.info('Successful in configuring IP in Client')1877 1878 1879 @ aetest.test1880 def verify_traffic(self,steps,ctrl,server,client,client2,**param):1881 sleep(20) 1882 with steps.start('client1 traffic',continue_=True) as step:1883 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1884 assert ((up != 0) and (down != 0))1885 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 1886 with steps.start('client2 traffic',continue_=True) as step:1887 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])1888 assert ((up != 0) and (down != 0))1889 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1890 @aetest.cleanup1891 def Removing_Ips(self,steps,ctrl,server,client,client2,**param):1892 1893 1894 with steps.start('Removing IP in Server',continue_=True) as step: 1895 assert misc.config_client_ip(server,param['server_inf'],param['server_data_ipv4'],status='disable')1896 log.info('Successful in Removing IP in Server')1897 1898 #Configure IP on client PC1899 with steps.start('Removing IP in client',continue_=True) as step: 1900 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1901 log.info('Successful in Removing IP in Client')1902 with steps.start('Removing IP in client2',continue_=True) as step: 1903 assert misc.config_client_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')1904 log.info('Successful in Removing IP in Client2')1905 client2.disconnect()1906class Two_Interface_Transaprent_Q(aetest.Testcase):1907 @aetest.setup1908 def Configure_Transparent(self, steps,ctrl,server,client,client2,**param):1909 with steps.start('Verifying links',continue_=True) as step: 1910 log.info('Verify link status')1911 for i in range(0,3):1912 1913 data = fetch.fetch_topology(ctrl)1914 verify = fetch.link_status(data)1915 if verify == True: 1916 break1917 elif i == 2: 1918 assert verify1919 sleep(100)1920 client2.connect()1921 with steps.start('Configure Transparent in dn port1',continue_=True) as step:1922 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 1923 log.info('sucessful in Enabling Transparent on dn')1924 with steps.start('Configure Qvlan in dn port2',continue_=True) as step:1925 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 1926 log.info('sucessful in Enabling Qvlan on dn')1927 1928 1929 1930 #Configure IP on client PC1931 with steps.start('Configure IP in client',continue_=True) as step: 1932 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])1933 log.info('Successful in configuring IP in Client')1934 with steps.start('Configure IP in client2',continue_=True) as step: 1935 assert misc.config_client_ip(client2,param['client2_inf'],param['client2_data_ipv4'])1936 log.info('Successful in configuring IP in Client')1937 1938 1939 @ aetest.test1940 def verify_traffic(self,steps,ctrl,server,client,client2,**param):1941 with steps.start('Configure IP in Server',continue_=True) as step: 1942 assert misc.config_client_ip(server,param['server_inf'],param['server_data_ipv4'])1943 log.info('Successful in configuring IP in Server')1944 sleep(20) 1945 with steps.start('client1 traffic',continue_=True) as step:1946 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])1947 assert ((up != 0) and (down != 0))1948 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 1949 with steps.start('Removing IP in Server',continue_=True) as step: 1950 assert misc.config_client_ip(server,param['server_inf'],param['server_data_ipv4'],status='disable')1951 log.info('Successful in Removing IP in Server')1952 with steps.start('Configure Q VLAN in Server',continue_=True) as step:1953 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])1954 log.info('Successful in configuring vlan in Server')1955 1956 sleep(20)1957 with steps.start('client2 traffic',continue_=True) as step:1958 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])1959 assert ((up != 0) and (down != 0))1960 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))1961 with steps.start('Removing Q VLAN in Server',continue_=True) as step:1962 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')1963 log.info('Successful in Removing vlan in Server')1964 @aetest.cleanup1965 def Removing_Ips(self,steps,ctrl,server,client,client2,**param):1966 1967 1968 with steps.start('Configure Qvlan in dn port2',continue_=True) as step:1969 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 1970 log.info('sucessful in Enabling Qvlan on dn')1971 1972 #Configure IP on client PC1973 with steps.start('Removing IP in client',continue_=True) as step: 1974 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')1975 log.info('Successful in Removing IP in Client')1976 with steps.start('Removing IP in client2',continue_=True) as step: 1977 assert misc.config_client_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')1978 log.info('Successful in Removing IP in Client2')1979 client2.disconnect()1980@aetest.loop(etype = ['0x8100', '0x88A8'])1981class Two_Interface_Transaprent_QinQ(aetest.Testcase):1982 @aetest.setup1983 def Configure_Transparent(self, steps,ctrl,server,client,client2,etype,**param):1984 with steps.start('Verifying links',continue_=True) as step: 1985 log.info('Verify link status')1986 for i in range(0,3):1987 1988 data = fetch.fetch_topology(ctrl)1989 verify = fetch.link_status(data)1990 if verify == True: 1991 break1992 elif i == 2: 1993 assert verify1994 sleep(100)1995 client2.connect()1996 with steps.start('Configure Transparent in dn port1',continue_=True) as step:1997 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 1998 log.info('sucessful in Enabling Transparent on dn')1999 with steps.start('Configure QinQ VLAN in dn port2',continue_=True) as step:2000 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2001 log.info('sucessful in Enabling Double VLAN on dn')2002 2003 #Configure IP on client PC2004 with steps.start('Configure IP in client',continue_=True) as step: 2005 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])2006 log.info('Successful in configuring IP in Client')2007 with steps.start('Configure IP in client2',continue_=True) as step: 2008 assert misc.config_client_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2009 log.info('Successful in configuring IP in Client')2010 2011 2012 @ aetest.test2013 def verify_traffic(self,steps,ctrl,server,client,client2,etype,**param):2014 with steps.start('Configure IP in Server',continue_=True) as step: 2015 assert misc.config_client_ip(server,param['server_inf'],param['server_data_ipv4'])2016 log.info('Successful in configuring IP in Server')2017 sleep(20) 2018 with steps.start('client1 traffic',continue_=True) as step:2019 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2020 assert ((up != 0) and (down != 0))2021 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2022 with steps.start('Removing IP in Server',continue_=True) as step: 2023 assert misc.config_client_ip(server,param['server_inf'],param['server_data_ipv4'],status='disable')2024 log.info('Successful in Removing IP in Server')2025 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2026 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2027 log.info('Successful in configuring vlan in Server')2028 2029 sleep(20)2030 with steps.start('client2 traffic',continue_=True) as step:2031 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2032 assert ((up != 0) and (down != 0))2033 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2034 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2035 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2036 log.info('Removing vlan in Server')2037 2038 @aetest.cleanup2039 def Removing_Ips(self,steps,ctrl,server,client,client2,etype,**param):2040 2041 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:2042 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 2043 log.info('sucessful in Removing Double VLAN on dn')2044 2045 #Configure IP on client PC2046 with steps.start('Removing IP in client',continue_=True) as step: 2047 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2048 log.info('Successful in Removing IP in Client')2049 with steps.start('Removing IP in client2',continue_=True) as step: 2050 assert misc.config_client_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2051 log.info('Successful in Removing IP in Client2')2052 client2.disconnect()2053class Two_Interface_Same_Q_Vlan(aetest.Testcase):2054 @aetest.setup2055 def Configure_Transparent(self, steps,ctrl,server,client,client2,**param):2056 with steps.start('Verifying links',continue_=True) as step: 2057 log.info('Verify link status')2058 for i in range(0,3):2059 2060 data = fetch.fetch_topology(ctrl)2061 verify = fetch.link_status(data)2062 if verify == True: 2063 break2064 elif i == 2: 2065 assert verify2066 sleep(100)2067 client2.connect()2068 with steps.start('Configure Qvlan in dn port1',continue_=True) as step:2069 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2070 log.info('sucessful in Enabling Qvlan on dn')2071 with steps.start('Configure Qvlan in dn port2',continue_=True) as step:2072 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2073 log.info('sucessful in Enabling Qvlan on dn')2074 2075 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2076 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2077 log.info('Successful in configuring vlan in Server')2078 2079 #Configure IP on client PC2080 with steps.start('Configure IP in client',continue_=True) as step: 2081 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])2082 log.info('Successful in configuring IP in Client')2083 with steps.start('Configure IP in client2',continue_=True) as step: 2084 assert misc.config_client_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2085 log.info('Successful in configuring IP in Client')2086 2087 2088 @ aetest.test2089 def verify_traffic(self,steps,ctrl,server,client,client2,**param):2090 2091 sleep(20) 2092 with steps.start('client1 traffic',continue_=True) as step:2093 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2094 assert ((up != 0) and (down != 0))2095 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2096 sleep(20)2097 with steps.start('client2 traffic',continue_=True) as step:2098 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2099 assert ((up != 0) and (down != 0))2100 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2101 2102 @aetest.cleanup2103 def Removing_Ips(self,steps,ctrl,server,client,client2,**param):2104 with steps.start('Removing Qvlan in dn port1',continue_=True) as step:2105 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2106 log.info('sucessful in Removing Qvlan on dn')2107 2108 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2109 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2110 log.info('Successful in Removing vlan in Server')2111 with steps.start('Removing Qvlan in dn port2',continue_=True) as step:2112 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2113 log.info('sucessful in Removing Qvlan on dn')2114 2115 #Configure IP on client PC2116 with steps.start('Removing IP in client',continue_=True) as step: 2117 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2118 log.info('Successful in Removing IP in Client')2119 with steps.start('Removing IP in client2',continue_=True) as step: 2120 assert misc.config_client_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2121 log.info('Successful in Removing IP in Client2')2122 client2.disconnect()2123class Two_Interface_Different_Q_Vlan(aetest.Testcase):2124 2125 @aetest.setup2126 def Configure_Transparent(self, steps,ctrl,server,client,client2,**param):2127 2128 with steps.start('Verifying links',continue_=True) as step: 2129 log.info('Verify link status')2130 for i in range(0,3):2131 2132 data = fetch.fetch_topology(ctrl)2133 verify = fetch.link_status(data)2134 if verify == True: 2135 break2136 elif i == 2: 2137 assert verify2138 sleep(100)2139 client2.connect()2140 with steps.start('Configure Qvlan in dn port1',continue_=True) as step:2141 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2142 log.info('sucessful in Enabling Qvlan on dn')2143 with steps.start('Configure Qvlan in dn port2',continue_=True) as step:2144 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=str(int(param['dn1_cvlan'])+1),vlan_prio='7',status='enable') 2145 log.info('sucessful in Enabling Qvlan on dn')2146 2147 2148 2149 #Configure IP on client PC2150 with steps.start('Configure IP in client',continue_=True) as step: 2151 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])2152 log.info('Successful in configuring IP in Client')2153 with steps.start('Configure IP in client2',continue_=True) as step: 2154 assert misc.config_client_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2155 log.info('Successful in configuring IP in Client')2156 2157 2158 @ aetest.test2159 def verify_traffic(self,steps,ctrl,server,client,client2,**param):2160 2161 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2162 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2163 log.info('Successful in configuring vlan in Server')2164 sleep(20) 2165 with steps.start('client1 traffic',continue_=True) as step:2166 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2167 assert ((up != 0) and (down != 0))2168 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2169 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2170 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2171 log.info('Successful in Removing vlan in Server')2172 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2173 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])+1),param['server_data_ipv4'])2174 log.info('Successful in configuring vlan in Server')2175 sleep(20)2176 with steps.start('client2 traffic',continue_=True) as step:2177 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2178 assert ((up != 0) and (down != 0))2179 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2180 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2181 assert misc.config_Q(server,param['server_inf'],str(int(param['dn1_cvlan'])+1),param['server_data_ipv4'],status='disable')2182 log.info('Successful in Removing vlan in Server')2183 2184 @aetest.cleanup2185 def Removing_Ips(self,steps,ctrl,server,client,client2,**param):2186 with steps.start('Removing Qvlan in dn port1',continue_=True) as step:2187 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2188 log.info('sucessful in Removing Qvlan on dn')2189 2190 2191 with steps.start('Removing Qvlan in dn port2',continue_=True) as step:2192 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2193 log.info('sucessful in Removing Qvlan on dn')2194 2195 #Configure IP on client PC2196 with steps.start('Removing IP in client',continue_=True) as step: 2197 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2198 log.info('Successful in Removing IP in Client')2199 with steps.start('Removing IP in client2',continue_=True) as step: 2200 assert misc.config_client_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2201 log.info('Successful in Removing IP in Client2')2202 client2.disconnect()2203@aetest.loop(etype = ['0x8100', '0x88A8'])2204class Two_Interface_Q_QinQ(aetest.Testcase):2205 @aetest.setup2206 def Configure_Transparent(self, steps,ctrl,server,client,client2,etype,**param):2207 with steps.start('Verifying links',continue_=True) as step: 2208 log.info('Verify link status')2209 for i in range(0,3):2210 2211 data = fetch.fetch_topology(ctrl)2212 verify = fetch.link_status(data)2213 if verify == True: 2214 break2215 elif i == 2: 2216 assert verify2217 sleep(100)2218 client2.connect()2219 with steps.start('Configure Qvlan in dn port1',continue_=True) as step:2220 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2221 log.info('sucessful in Enabling Qvlan on dn')2222 with steps.start('Configure QinQ VLAN in dn port2',continue_=True) as step:2223 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2224 log.info('sucessful in Enabling Double VLAN on dn')2225 2226 #Configure IP on client PC2227 with steps.start('Configure IP in client',continue_=True) as step: 2228 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])2229 log.info('Successful in configuring IP in Client')2230 with steps.start('Configure IP in client2',continue_=True) as step: 2231 assert misc.config_client_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2232 log.info('Successful in configuring IP in Client')2233 2234 2235 @ aetest.test2236 def verify_traffic(self,steps,ctrl,server,client,client2,etype,**param):2237 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2238 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2239 log.info('Successful in configuring vlan in Server')2240 sleep(20) 2241 with steps.start('client1 traffic',continue_=True) as step:2242 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2243 assert ((up != 0) and (down != 0))2244 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2245 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2246 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2247 log.info('Successful in Removing vlan in Server')2248 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2249 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2250 log.info('Successful in configuring vlan in Server')2251 2252 sleep(20)2253 with steps.start('client2 traffic',continue_=True) as step:2254 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2255 assert ((up != 0) and (down != 0))2256 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2257 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2258 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2259 log.info('Removing vlan in Server')2260 2261 @aetest.cleanup2262 def Removing_Ips(self,steps,ctrl,server,client,client2,etype,**param):2263 2264 with steps.start('Removing Qvlan in dn port1',continue_=True) as step:2265 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='disable') 2266 log.info('sucessful in Removing Qvlan on dn')2267 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:2268 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 2269 log.info('sucessful in Removing Double VLAN on dn')2270 2271 #Configure IP on client PC2272 with steps.start('Removing IP in client',continue_=True) as step: 2273 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2274 log.info('Successful in Removing IP in Client')2275 with steps.start('Removing IP in client2',continue_=True) as step: 2276 assert misc.config_client_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2277 log.info('Successful in Removing IP in Client2')2278 client2.disconnect()2279@aetest.loop(etype = ['0x8100', '0x88A8'])2280class Two_Interface_Same_QinQ(aetest.Testcase):2281 @aetest.setup2282 def Configure_Transparent(self, steps,ctrl,server,client,client2,etype,**param):2283 with steps.start('Verifying links',continue_=True) as step: 2284 log.info('Verify link status')2285 for i in range(0,3):2286 2287 data = fetch.fetch_topology(ctrl)2288 verify = fetch.link_status(data)2289 if verify == True: 2290 break2291 elif i == 2: 2292 assert verify2293 sleep(100)2294 client2.connect()2295 with steps.start('Configure QinQ VLAN in dn port1',continue_=True) as step:2296 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2297 log.info('sucessful in Enabling Double VLAN on dn')2298 with steps.start('Configure QinQ VLAN in dn port2',continue_=True) as step:2299 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2300 log.info('sucessful in Enabling Double VLAN on dn')2301 2302 #Configure IP on client PC2303 with steps.start('Configure IP in client',continue_=True) as step: 2304 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])2305 log.info('Successful in configuring IP in Client')2306 with steps.start('Configure IP in client2',continue_=True) as step: 2307 assert misc.config_client_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2308 log.info('Successful in configuring IP in Client')2309 2310 2311 @ aetest.test2312 def verify_traffic(self,steps,ctrl,server,client,client2,etype,**param):2313 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2314 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2315 log.info('Successful in configuring vlan in Server')2316 sleep(20) 2317 with steps.start('client1 traffic',continue_=True) as step:2318 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2319 assert ((up != 0) and (down != 0))2320 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2321 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2322 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2323 log.info('Removing vlan in Server')2324 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2325 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2326 log.info('Successful in configuring vlan in Server')2327 2328 sleep(20)2329 with steps.start('client2 traffic',continue_=True) as step:2330 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2331 assert ((up != 0) and (down != 0))2332 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2333 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2334 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2335 log.info('Removing vlan in Server')2336 2337 @aetest.cleanup2338 def Removing_Ips(self,steps,ctrl,server,client,client2,etype,**param):2339 2340 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:2341 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 2342 log.info('sucessful in Removing Double VLAN on dn')2343 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:2344 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 2345 log.info('sucessful in Removing Double VLAN on dn')2346 2347 #Configure IP on client PC2348 with steps.start('Removing IP in client',continue_=True) as step: 2349 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2350 log.info('Successful in Removing IP in Client')2351 with steps.start('Removing IP in client2',continue_=True) as step: 2352 assert misc.config_client_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2353 log.info('Successful in Removing IP in Client2')2354 client2.disconnect()2355@aetest.loop(etype = ['0x8100', '0x88A8'])2356class Two_Interface_Different_QinQ(aetest.Testcase):2357 @aetest.setup2358 def Configure_Transparent(self, steps,ctrl,server,client,client2,etype,**param):2359 2360 with steps.start('Verifying links',continue_=True) as step: 2361 log.info('Verify link status')2362 for i in range(0,3):2363 2364 data = fetch.fetch_topology(ctrl)2365 verify = fetch.link_status(data)2366 if verify == True: 2367 break2368 elif i == 2: 2369 assert verify2370 sleep(100)2371 client2.connect()2372 with steps.start('Configure QinQ VLAN in dn port1',continue_=True) as step:2373 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2374 log.info('sucessful in Enabling Double VLAN on dn')2375 with steps.start('Configure QinQ VLAN in dn port2',continue_=True) as step:2376 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=str(int(param['dn1_cvlan'])+1),svlan=str(int(param['dn1_svlan'])+1),ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 2377 log.info('sucessful in Enabling Double VLAN on dn')2378 2379 #Configure IP on client PC2380 with steps.start('Configure IP in client',continue_=True) as step: 2381 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])2382 log.info('Successful in configuring IP in Client')2383 with steps.start('Configure IP in client2',continue_=True) as step: 2384 assert misc.config_client_ip(client2,param['client2_inf'],param['client2_data_ipv4'])2385 log.info('Successful in configuring IP in Client')2386 2387 2388 @ aetest.test2389 def verify_traffic(self,steps,ctrl,server,client,client2,etype,**param):2390 2391 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2392 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)2393 log.info('Successful in configuring vlan in Server')2394 sleep(20) 2395 with steps.start('client1 traffic',continue_=True) as step:2396 up,down=misc.config_iperf_client(client,param['server_data_ipv4'])2397 assert ((up != 0) and (down != 0))2398 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down)) 2399 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2400 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')2401 log.info('Removing vlan in Server')2402 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:2403 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])+1),str(int(param['dn1_svlan'])+1),param['server_data_ipv4'],ethertype=etype)2404 log.info('Successful in configuring vlan in Server')2405 2406 sleep(20)2407 with steps.start('client2 traffic',continue_=True) as step:2408 up,down=misc.config_iperf_client(client2,param['server_data_ipv4'])2409 assert ((up != 0) and (down != 0))2410 log.info('Successful in Running Bidirectional traffic up {}, down {}'.format(up,down))2411 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:2412 assert misc.config_QinQ(server,param['server_inf'],str(int(param['dn1_cvlan'])+1),str(int(param['dn1_svlan'])+1),param['server_data_ipv4'],ethertype=etype,status='disable')2413 log.info('Removing vlan in Server')2414 2415 @aetest.cleanup2416 def Removing_Ips(self,steps,ctrl,server,client,client2,etype,**param):2417 2418 2419 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:2420 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 2421 log.info('sucessful in Removing Double VLAN on dn')2422 with steps.start('Removing QinQ VLAN in dn port2',continue_=True) as step:2423 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf1'],cvlan=str(int(param['dn1_cvlan'])+1),svlan=str(int(param['dn1_svlan'])+1),ethertype=etype,svlan_prio='5',cvlan_prio='3',status='disable') 2424 log.info('sucessful in Removing Double VLAN on dn')2425 2426 #Configure IP on client PC2427 with steps.start('Removing IP in client',continue_=True) as step: 2428 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2429 log.info('Successful in Removing IP in Client')2430 with steps.start('Removing IP in client2',continue_=True) as step: 2431 assert misc.config_client_ip(client2,param['client2_inf'],param['client2_data_ipv4'],status='disable')2432 log.info('Successful in Removing IP in Client2')2433 client2.disconnect()2434class Same_Mvlan(aetest.Testcase):2435 @aetest.setup2436 def setup_management_vlan(self,steps,ctrl,server,**param):2437 with steps.start('Verifying links',continue_=True) as step: 2438 log.info('Verify link status')2439 for i in range(0,3):2440 2441 data = fetch.fetch_topology(ctrl)2442 verify = fetch.link_status(data)2443 if verify == True: 2444 break2445 elif i == 2: 2446 assert verify2447 sleep(100)2448 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:2449 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])2450 log.info('Successful in configuring mvlan in DN')2451 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'])2452 log.info('Successful in configuring mvlan in POP')2453 2454 2455 with steps.start('Configuring MVLAN on Server',continue_=True) as step:2456 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])2457 log.info('Successful in configuring vlan in Server')2458 @ aetest.test2459 def verify_gui_page(self,steps,ctrl,server,**param):2460 sleep(10)2461 with steps.start('Verifying GUI page of POP',continue_=True) as step:2462 assert misc.verify_web_page(server,param['pop_management_ip'])2463 log.info('Successful in verifying POP GUI with MVLAN')2464 with steps.start('Verifying GUI page of DN',continue_=True) as step:2465 assert misc.verify_web_page(server,param['dn1_management_ip'])2466 log.info('Successful in verifying DN1 GUI with MVLAN')2467 @aetest.cleanup2468 def removing_vlan_config(self,steps,ctrl,server,**param):2469 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2470 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')2471 log.info('Successful in Removing vlan in Server')2472 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:2473 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')2474 log.info('Successful in Removing mvlan in DN')2475 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],status='disable')2476 log.info('Successful in Removing mvlan in POP')2477class Different_Mvlan(aetest.Testcase):2478 @aetest.setup2479 def setup_management_vlan(self,steps,ctrl,server,**param):2480 with steps.start('Verifying links',continue_=True) as step: 2481 log.info('Verify link status')2482 for i in range(0,3):2483 2484 data = fetch.fetch_topology(ctrl)2485 verify = fetch.link_status(data)2486 if verify == True: 2487 break2488 elif i == 2: 2489 assert verify2490 sleep(100)2491 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:2492 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])2493 log.info('Successful in configuring mvlan in DN')2494 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'])2495 log.info('Successful in configuring mvlan in POP')2496 2497 2498 2499 @ aetest.test2500 def verify_gui_page(self,steps,ctrl,server,**param):2501 with steps.start('Configuring MVLAN on Server',continue_=True) as step:2502 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'])2503 log.info('Successful in configuring vlan in Server')2504 sleep(10)2505 with steps.start('Verifying GUI page of POP',continue_=True) as step:2506 assert misc.verify_web_page(server,param['pop_management_ip'])2507 log.info('Successful in verifying POP GUI with MVLAN')2508 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2509 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'],status='disable')2510 log.info('Successful in Removing vlan in Server')2511 with steps.start('Configuring MVLAN on Server',continue_=True) as step:2512 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])2513 log.info('Successful in configuring vlan in Server')2514 sleep(10)2515 with steps.start('Verifying GUI page of DN',continue_=True) as step:2516 assert misc.verify_web_page(server,param['dn1_management_ip'])2517 log.info('Successful in verifying DN1 GUI with MVLAN')2518 2519 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2520 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')2521 log.info('Successful in Removing vlan in Server')2522 @aetest.cleanup2523 def removing_vlan_config(self,steps,ctrl,server,**param):2524 2525 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:2526 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')2527 log.info('Successful in Removing mvlan in DN')2528 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'],status='disable')2529 log.info('Successful in Removing mvlan in POP') 2530@aetest.loop(etype = ['0x8100', '0x88A8'])2531class Same_Mqinq_Vlan(aetest.Testcase):2532 @aetest.setup2533 def config_qinq_vlan(self,steps,ctrl,server,etype,**param):2534 with steps.start('Verifying links',continue_=True) as step: 2535 log.info('Verify link status')2536 for i in range(0,3):2537 2538 data = fetch.fetch_topology(ctrl)2539 verify = fetch.link_status(data)2540 if verify == True: 2541 break2542 elif i == 2: 2543 assert verify2544 sleep(100)2545 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:2546 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')2547 log.info('Successful in configuring QinQ mvlan on DN1')2548 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')2549 log.info('Successful in configuring QinQ mvlan on POP')2550 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:2551 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')2552 @ aetest.test2553 def test_QinQ_management_vlan(self,steps,ctrl,server,etype,**param):2554 sleep(10)2555 with steps.start('Verifying POP GUI access',continue_=True) as step:2556 assert misc.verify_web_page(server,param['pop_management_ip'])2557 log.info('Successful in verifying POP GUI with MVLAN')2558 with steps.start('Verifying GUI page of DN',continue_=True) as step:2559 assert misc.verify_web_page(server,param['dn1_management_ip'])2560 log.info('Successful in verifying DN1 GUI with MVLAN')2561 @aetest.cleanup2562 def removing_vlan_configs(self,steps,ctrl,server,etype,**param):2563 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:2564 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')2565 log.info('Successful in configuring QinQ mvlan on DN1')2566 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')2567 log.info('Successful in configuring QinQ mvlan on POP')2568 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:2569 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable')2570@aetest.loop(etype = ['0x8100', '0x88A8'])2571class Different_Mqinq_Vlan(aetest.Testcase):2572 @aetest.setup2573 def config_qinq_vlan(self,steps,ctrl,server,etype,**param):2574 with steps.start('Verifying links',continue_=True) as step: 2575 log.info('Verify link status')2576 for i in range(0,3):2577 2578 data = fetch.fetch_topology(ctrl)2579 verify = fetch.link_status(data)2580 if verify == True: 2581 break2582 elif i == 2: 2583 assert verify2584 sleep(100)2585 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:2586 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')2587 log.info('Successful in configuring QinQ mvlan on DN1')2588 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'],param['pop_msvlan'],ethertype=etype,status='enable')2589 log.info('Successful in configuring QinQ mvlan on POP')2590 2591 @ aetest.test2592 def test_QinQ_management_vlan(self,steps,ctrl,server,etype,**param):2593 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:2594 assert misc.config_QinQ(server,param['server_inf'],param['pop_mcvlan'],param['pop_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')2595 sleep(10)2596 with steps.start('Verifying POP GUI access',continue_=True) as step:2597 assert misc.verify_web_page(server,param['pop_management_ip'])2598 log.info('Successful in verifying POP GUI with MVLAN')2599 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:2600 assert misc.config_QinQ(server,param['server_inf'],param['pop_mcvlan'],param['pop_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable')2601 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:2602 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')2603 sleep(10)2604 with steps.start('Verifying GUI page of DN',continue_=True) as step:2605 assert misc.verify_web_page(server,param['dn1_management_ip'])2606 log.info('Successful in verifying DN1 GUI with MVLAN')2607 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:2608 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable')2609 @aetest.cleanup2610 def removing_vlan_configs(self,steps,ctrl,server,etype,**param):2611 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:2612 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')2613 log.info('Successful in configuring QinQ mvlan on DN1')2614 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'],param['pop_msvlan'],ethertype=etype,status='disable')2615 log.info('Successful in configuring QinQ mvlan on POP')2616class Single_Data_Vlan_Single_Same_Management_Vlan(aetest.Testcase):2617 def Capturing_Server_interface(self,server,server_inf,server_file):2618 assert misc.capture_interface(server,server_inf,server_file)2619 2620 def Verify_traffic(self,client,server_data_ipv4):2621 log.info('Starting iperf client')2622 up,down=misc.config_iperf_client(client,server_data_ipv4)2623 assert ((up != 0.0) and (down != 0.0))2624 @aetest.setup2625 def setup_vlan(self,steps,ctrl,server,client,**param):2626 with steps.start('Verifying links',continue_=True) as step: 2627 log.info('Verify link status')2628 for i in range(0,3):2629 2630 data = fetch.fetch_topology(ctrl)2631 verify = fetch.link_status(data)2632 if verify == True: 2633 break2634 elif i == 2: 2635 assert verify2636 sleep(100)2637 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:2638 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])2639 log.info('Successful in configuring mvlan in DN')2640 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'])2641 log.info('Successful in configuring mvlan in POP')2642 2643 with steps.start('Configuring MVLAN on Server',continue_=True) as step:2644 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])2645 log.info('Successful in configuring vlan in Server')2646 with steps.start('Configure Q VLAN in dn',continue_=True) as step:2647 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2648 log.info('sucessful in Enabling Single VLAN on dn')2649 2650 2651 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2652 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2653 log.info('Successful in configuring vlan in Server')2654 2655 #Configure IP on client PC2656 with steps.start('Configure IP in client',continue_=True) as step: 2657 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])2658 log.info('Successful in configuring IP in Client')2659 2660 2661 @ aetest.test2662 def verify_gui_page(self,steps,ctrl,server,client,**param):2663 with steps.start('Verifying GUI page of POP',continue_=True) as step:2664 assert misc.verify_web_page(server,param['pop_management_ip'])2665 log.info('Successful in verifying POP GUI with MVLAN')2666 sleep(10)2667 with steps.start('Verifying GUI page of DN',continue_=True) as step:2668 assert misc.verify_web_page(server,param['dn1_management_ip'])2669 log.info('Successful in verifying DN1 GUI with MVLAN')2670 with steps.start('Capturing and verifying traffic',continue_=True) as step:2671 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))2672 p1.start()2673 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))2674 p2.start()2675 p1.join()2676 p2.join()2677 with steps.start('Analyse Capture',continue_=True) as step:2678 ip = param['client_data_ipv4'].rsplit('/', 1)[0]2679 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])2680 res=misc.analyse_capture(server,filter,param['server_file'])2681 if res > 0:2682 log.info('Successful in VLAN tagging')2683 else:2684 assert False2685 @aetest.cleanup2686 def removing_vlan_config(self,steps,ctrl,server,client,**param):2687 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2688 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')2689 log.info('Successful in Removing vlan in Server')2690 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:2691 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')2692 log.info('Successful in Removing mvlan in DN')2693 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],status='disable')2694 log.info('Successful in Removing mvlan in POP') 2695 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2696 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2697 log.info('Successful in configuring vlan in Server')2698 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:2699 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 2700 log.info('sucessful in removing Single VLAN on dn')2701 with steps.start('Removing IP in client',continue_=True) as step:2702 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2703 log.info('Successful in Removing IP in Client')2704class Single_Data_Vlan_Single_Different_Management_Vlan(aetest.Testcase):2705 def Capturing_Server_interface(self,server,server_inf,server_file):2706 assert misc.capture_interface(server,server_inf,server_file)2707 2708 def Verify_traffic(self,client,server_data_ipv4):2709 log.info('Starting iperf client')2710 up,down=misc.config_iperf_client(client,server_data_ipv4)2711 assert ((up != 0.0) and (down != 0.0))2712 @aetest.setup2713 def setup_vlan(self,steps,ctrl,server,client,**param):2714 with steps.start('Verifying links',continue_=True) as step: 2715 log.info('Verify link status')2716 for i in range(0,3):2717 2718 data = fetch.fetch_topology(ctrl)2719 verify = fetch.link_status(data)2720 if verify == True: 2721 break2722 elif i == 2: 2723 assert verify2724 sleep(100)2725 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:2726 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])2727 log.info('Successful in configuring mvlan in DN')2728 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'])2729 log.info('Successful in configuring mvlan in POP')2730 2731 with steps.start('Configuring MVLAN on Server',continue_=True) as step:2732 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])2733 log.info('Successful in configuring vlan in Server')2734 with steps.start('Configure Q VLAN in dn',continue_=True) as step:2735 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2736 log.info('sucessful in Enabling Single VLAN on dn')2737 2738 2739 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2740 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2741 log.info('Successful in configuring vlan in Server')2742 2743 #Configure IP on client PC2744 with steps.start('Configure IP in client',continue_=True) as step: 2745 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])2746 log.info('Successful in configuring IP in Client')2747 2748 2749 @ aetest.test2750 def verification(self,steps,ctrl,server,client,**param):2751 2752 sleep(10)2753 with steps.start('Verifying GUI page of DN',continue_=True) as step:2754 assert misc.verify_web_page(server,param['dn1_management_ip'])2755 log.info('Successful in verifying DN1 GUI with MVLAN')2756 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2757 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')2758 log.info('Successful in Removing vlan in Server')2759 2760 with steps.start('Configuring MVLAN on Server',continue_=True) as step:2761 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'])2762 log.info('Successful in configuring vlan in Server')2763 sleep(10)2764 with steps.start('Verifying GUI page of POP',continue_=True) as step:2765 assert misc.verify_web_page(server,param['pop_management_ip'])2766 log.info('Successful in verifying POP GUI with MVLAN')2767 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2768 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'],status='disable')2769 log.info('Successful in Removing vlan in Server')2770 with steps.start('Capturing and verifying traffic',continue_=True) as step:2771 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))2772 p1.start()2773 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))2774 p2.start()2775 p1.join()2776 p2.join()2777 with steps.start('Analyse Capture',continue_=True) as step:2778 ip = param['client_data_ipv4'].rsplit('/', 1)[0]2779 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])2780 res=misc.analyse_capture(server,filter,param['server_file'])2781 if res > 0:2782 log.info('Successful in VLAN tagging')2783 else:2784 assert False2785 @aetest.cleanup2786 def removing_vlan_config(self,steps,ctrl,server,client,**param):2787 2788 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:2789 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')2790 log.info('Successful in Removing mvlan in DN')2791 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'],status='disable')2792 log.info('Successful in Removing mvlan in POP') 2793 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2794 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2795 log.info('Successful in configuring vlan in Server')2796 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:2797 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 2798 log.info('sucessful in removing Single VLAN on dn')2799 with steps.start('Removing IP in client',continue_=True) as step:2800 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2801 log.info('Successful in Removing IP in Client')2802@aetest.loop(etype = ['0x8100', '0x88A8'])2803class Single_Data_Vlan_Double_Same_Management_Vlan(aetest.Testcase):2804 def Capturing_Server_interface(self,server,server_inf,server_file):2805 assert misc.capture_interface(server,server_inf,server_file)2806 2807 def Verify_traffic(self,client,server_data_ipv4):2808 log.info('Starting iperf client')2809 up,down=misc.config_iperf_client(client,server_data_ipv4)2810 assert ((up != 0.0) and (down != 0.0))2811 @aetest.setup2812 def setup_vlan(self,steps,ctrl,server,client,etype,**param):2813 with steps.start('Verifying links',continue_=True) as step: 2814 log.info('Verify link status')2815 for i in range(0,3):2816 2817 data = fetch.fetch_topology(ctrl)2818 verify = fetch.link_status(data)2819 if verify == True: 2820 break2821 elif i == 2: 2822 assert verify2823 sleep(100)2824 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:2825 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')2826 log.info('Successful in configuring QinQ mvlan on DN1')2827 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')2828 log.info('Successful in configuring QinQ mvlan on POP')2829 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:2830 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')2831 with steps.start('Configure Q VLAN in dn',continue_=True) as step:2832 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2833 log.info('sucessful in Enabling Single VLAN on dn')2834 2835 2836 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2837 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2838 log.info('Successful in configuring vlan in Server')2839 2840 #Configure IP on client PC2841 with steps.start('Configure IP in client',continue_=True) as step: 2842 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])2843 log.info('Successful in configuring IP in Client')2844 2845 2846 @ aetest.test2847 def verify_gui_page(self,steps,ctrl,server,client,etype,**param):2848 sleep(10)2849 with steps.start('Verifying GUI page of POP',continue_=True) as step:2850 assert misc.verify_web_page(server,param['pop_management_ip'])2851 log.info('Successful in verifying POP GUI with MVLAN')2852 with steps.start('Verifying GUI page of DN',continue_=True) as step:2853 assert misc.verify_web_page(server,param['dn1_management_ip'])2854 log.info('Successful in verifying DN1 GUI with MVLAN')2855 with steps.start('Capturing and verifying traffic',continue_=True) as step:2856 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))2857 p1.start()2858 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))2859 p2.start()2860 p1.join()2861 p2.join()2862 with steps.start('Analyse Capture',continue_=True) as step:2863 ip = param['client_data_ipv4'].rsplit('/', 1)[0]2864 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])2865 res=misc.analyse_capture(server,filter,param['server_file'])2866 if res > 0:2867 log.info('Successful in VLAN tagging')2868 else:2869 assert False2870 @aetest.cleanup2871 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):2872 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:2873 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')2874 log.info('Successful in configuring QinQ mvlan on DN1')2875 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')2876 log.info('Successful in configuring QinQ mvlan on POP')2877 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:2878 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable') 2879 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2880 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2881 log.info('Successful in configuring vlan in Server')2882 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:2883 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 2884 log.info('sucessful in removing Single VLAN on dn')2885 with steps.start('Removing IP in client',continue_=True) as step:2886 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2887 log.info('Successful in Removing IP in Client')2888@aetest.loop(etype = ['0x8100', '0x88A8'])2889class Single_Data_Vlan_Double_Different_Management_Vlan(aetest.Testcase):2890 def Capturing_Server_interface(self,server,server_inf,server_file):2891 assert misc.capture_interface(server,server_inf,server_file)2892 2893 def Verify_traffic(self,client,server_data_ipv4):2894 log.info('Starting iperf client')2895 up,down=misc.config_iperf_client(client,server_data_ipv4)2896 assert ((up != 0.0) and (down != 0.0))2897 @aetest.setup2898 def setup_vlan(self,steps,ctrl,server,client,etype,**param):2899 with steps.start('Verifying links',continue_=True) as step: 2900 log.info('Verify link status')2901 for i in range(0,3):2902 2903 data = fetch.fetch_topology(ctrl)2904 verify = fetch.link_status(data)2905 if verify == True: 2906 break2907 elif i == 2: 2908 assert verify2909 sleep(100)2910 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:2911 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')2912 log.info('Successful in configuring QinQ mvlan on DN1')2913 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'],param['pop_msvlan'],ethertype=etype,status='enable')2914 log.info('Successful in configuring QinQ mvlan on POP')2915 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:2916 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')2917 with steps.start('Configure Q VLAN in dn',continue_=True) as step:2918 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],vlan_prio='7',status='enable') 2919 log.info('sucessful in Enabling Single VLAN on dn')2920 2921 2922 with steps.start('Configure Q VLAN in Server',continue_=True) as step:2923 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'])2924 log.info('Successful in configuring vlan in Server')2925 2926 #Configure IP on client PC2927 with steps.start('Configure IP in client',continue_=True) as step: 2928 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])2929 log.info('Successful in configuring IP in Client')2930 2931 2932 @ aetest.test2933 def verify_gui_page(self,steps,ctrl,server,client,etype,**param):2934 sleep(10)2935 with steps.start('Verifying GUI page of DN',continue_=True) as step:2936 assert misc.verify_web_page(server,param['dn1_management_ip'])2937 log.info('Successful in verifying DN1 GUI with MVLAN')2938 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:2939 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable') 2940 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:2941 assert misc.config_QinQ(server,param['server_inf'],param['pop_mcvlan'],param['pop_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')2942 sleep(10)2943 with steps.start('Verifying GUI page of POP',continue_=True) as step:2944 assert misc.verify_web_page(server,param['pop_management_ip'])2945 log.info('Successful in verifying POP GUI with MVLAN')2946 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:2947 assert misc.config_QinQ(server,param['server_inf'],param['pop_mcvlan'],param['pop_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable') 2948 with steps.start('Capturing and verifying traffic',continue_=True) as step:2949 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))2950 p1.start()2951 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))2952 p2.start()2953 p1.join()2954 p2.join()2955 with steps.start('Analyse Capture',continue_=True) as step:2956 ip = param['client_data_ipv4'].rsplit('/', 1)[0]2957 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_cvlan'])2958 res=misc.analyse_capture(server,filter,param['server_file'])2959 if res > 0:2960 log.info('Successful in VLAN tagging')2961 else:2962 assert False2963 @aetest.cleanup2964 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):2965 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:2966 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')2967 log.info('Successful in configuring QinQ mvlan on DN1')2968 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')2969 log.info('Successful in configuring QinQ mvlan on POP')2970 2971 with steps.start('Removing Q VLAN in Server',continue_=True) as step:2972 assert misc.config_Q(server,param['server_inf'],param['dn1_cvlan'],param['server_data_ipv4'],status='disable')2973 log.info('Successful in configuring vlan in Server')2974 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:2975 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_cvlan'],status='disable') 2976 log.info('sucessful in removing Single VLAN on dn')2977 with steps.start('Removing IP in client',continue_=True) as step:2978 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')2979 log.info('Successful in Removing IP in Client')2980class Same_Single_Vlan_On_Data_Management(aetest.Testcase):2981 def Capturing_Server_interface(self,server,server_inf,server_file):2982 assert misc.capture_interface(server,server_inf,server_file)2983 2984 def Verify_traffic(self,client,server_data_ipv4):2985 log.info('Starting iperf client')2986 up,down=misc.config_iperf_client(client,server_data_ipv4)2987 assert ((up != 0.0) and (down != 0.0))2988 @aetest.setup2989 def setup_vlan(self,steps,ctrl,server,**param):2990 with steps.start('Verifying links',continue_=True) as step: 2991 log.info('Verify link status')2992 for i in range(0,3):2993 2994 data = fetch.fetch_topology(ctrl)2995 verify = fetch.link_status(data)2996 if verify == True: 2997 break2998 elif i == 2: 2999 assert verify3000 sleep(100)3001 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:3002 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])3003 log.info('Successful in configuring mvlan in DN')3004 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'])3005 log.info('Successful in configuring mvlan in POP')3006 3007 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3008 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])3009 log.info('Successful in configuring vlan in Server')3010 3011 3012 @ aetest.test3013 def verify_gui_page(self,steps,ctrl,server,client,**param):3014 sleep(10)3015 with steps.start('Verifying GUI page of POP',continue_=True) as step:3016 assert misc.verify_web_page(server,param['pop_management_ip'])3017 log.info('Successful in verifying POP GUI with MVLAN')3018 with steps.start('Verifying GUI page of DN',continue_=True) as step:3019 assert misc.verify_web_page(server,param['dn1_management_ip'])3020 log.info('Successful in verifying DN1 GUI with MVLAN')3021 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3022 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')3023 log.info('Successful in Removing vlan in Server')3024 with steps.start('Configure Q VLAN in dn',continue_=True) as step:3025 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_mcvlan'],vlan_prio='7',status='enable') 3026 log.info('sucessful in Enabling Single VLAN on dn')3027 3028 3029 with steps.start('Configure Q VLAN in Server',continue_=True) as step:3030 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_data_ipv4'])3031 log.info('Successful in configuring vlan in Server')3032 3033 #Configure IP on client PC3034 with steps.start('Configure IP in client',continue_=True) as step: 3035 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])3036 log.info('Successful in configuring IP in Client')3037 3038 with steps.start('Capturing and verifying traffic',continue_=True) as step:3039 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))3040 p1.start()3041 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))3042 p2.start()3043 p1.join()3044 p2.join()3045 with steps.start('Analyse Capture',continue_=True) as step:3046 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3047 filter = 'ip.src == {}&&vlan.id == {}&&vlan.priority==7'.format(ip,param['dn1_mcvlan'])3048 res=misc.analyse_capture(server,filter,param['server_file'])3049 if res > 0:3050 log.info('Successful in VLAN tagging')3051 else:3052 assert False3053 @aetest.cleanup3054 def removing_vlan_config(self,steps,ctrl,server,client,**param):3055 3056 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:3057 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')3058 log.info('Successful in Removing mvlan in DN')3059 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],status='disable')3060 log.info('Successful in Removing mvlan in POP') 3061 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3062 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_data_ipv4'],status='disable')3063 log.info('Successful in configuring vlan in Server')3064 with steps.start('Removing vlan configs from ctrl',continue_=True) as step:3065 assert cli.config_single_vlan(ctrl,param['dn1_name'],param['dn1_inf'],vlan_id=param['dn1_mcvlan'],status='disable') 3066 log.info('sucessful in removing Single VLAN on dn')3067 with steps.start('Removing IP in client',continue_=True) as step:3068 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3069 log.info('Successful in Removing IP in Client')3070@aetest.loop(etype = ['0x8100', '0x88A8'])3071class Double_Data_Vlan_Single_Same_Management_Vlan(aetest.Testcase):3072 def Capturing_Server_interface(self,server,server_inf,server_file):3073 assert misc.capture_interface(server,server_inf,server_file)3074 3075 def Verify_traffic(self,client,server_data_ipv4):3076 log.info('Starting iperf client')3077 up,down=misc.config_iperf_client(client,server_data_ipv4)3078 assert ((up != 0.0) and (down != 0.0))3079 3080 @aetest.setup3081 def setup_vlan(self,steps,ctrl,server,client,etype,**param):3082 with steps.start('Verifying links',continue_=True) as step: 3083 log.info('Verify link status')3084 for i in range(0,3):3085 3086 data = fetch.fetch_topology(ctrl)3087 verify = fetch.link_status(data)3088 if verify == True: 3089 break3090 elif i == 2: 3091 assert verify3092 sleep(100)3093 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:3094 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])3095 log.info('Successful in configuring mvlan in DN')3096 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'])3097 log.info('Successful in configuring mvlan in POP')3098 3099 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3100 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])3101 log.info('Successful in configuring vlan in Server')3102 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:3103 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 3104 log.info('sucessful in Enabling Double VLAN on dn')3105 3106 3107 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:3108 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)3109 log.info('Successful in configuring vlan in Server')3110 3111 #Configure IP on client PC3112 with steps.start('Configure IP in client',continue_=True) as step: 3113 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])3114 log.info('Successful in configuring IP in Client')3115 3116 3117 3118 3119 3120 @ aetest.test3121 def verifyication(self,steps,ctrl,server,client,etype,**param):3122 sleep(10)3123 with steps.start('Verifying GUI page of POP',continue_=True) as step:3124 assert misc.verify_web_page(server,param['pop_management_ip'])3125 log.info('Successful in verifying POP GUI with MVLAN')3126 with steps.start('Verifying GUI page of DN',continue_=True) as step:3127 assert misc.verify_web_page(server,param['dn1_management_ip'])3128 log.info('Successful in verifying DN1 GUI with MVLAN')3129 with steps.start('Capturing and verifying traffic',continue_=True) as step:3130 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))3131 p1.start()3132 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))3133 p2.start()3134 p1.join()3135 p2.join()3136 with steps.start('Analyse Capture',continue_=True) as step:3137 if etype =='0x8100':3138 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3139 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])3140 else:3141 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3142 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])3143 res=misc.analyse_capture(server,filter,param['server_file'])3144 if res > 0:3145 log.info('Successful in QinQ VLAN tagging')3146 else:3147 assert False3148 @aetest.cleanup3149 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):3150 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3151 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')3152 log.info('Successful in Removing vlan in Server')3153 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:3154 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')3155 log.info('Successful in Removing mvlan in DN')3156 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],status='disable')3157 log.info('Successful in Removing mvlan in POP') 3158 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:3159 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')3160 log.info('Successful in Removing vlan in Server')3161 with steps.start('Removing vlan configs from server',continue_=True) as step:3162 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,status='disable') 3163 log.info('sucessful in Removing QinQ VLAN on dn')3164 with steps.start('Configure IP in client',continue_=True) as step:3165 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3166 log.info('Successful in configuring IP in Client')3167@aetest.loop(etype = ['0x8100', '0x88A8'])3168class Double_Data_Vlan_Single_Different_Management_Vlan(aetest.Testcase):3169 def Capturing_Server_interface(self,server,server_inf,server_file):3170 assert misc.capture_interface(server,server_inf,server_file)3171 3172 def Verify_traffic(self,client,server_data_ipv4):3173 log.info('Starting iperf client')3174 up,down=misc.config_iperf_client(client,server_data_ipv4)3175 assert ((up != 0.0) and (down != 0.0))3176 3177 @aetest.setup3178 def setup_vlan(self,steps,ctrl,server,client,etype,**param):3179 with steps.start('Verifying links',continue_=True) as step: 3180 log.info('Verify link status')3181 for i in range(0,3):3182 3183 data = fetch.fetch_topology(ctrl)3184 verify = fetch.link_status(data)3185 if verify == True: 3186 break3187 elif i == 2: 3188 assert verify3189 sleep(100)3190 with steps.start('Configuring MVLAN on POP and DN',continue_=True) as step:3191 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'])3192 log.info('Successful in configuring mvlan in DN')3193 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'])3194 log.info('Successful in configuring mvlan in POP')3195 3196 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3197 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'])3198 log.info('Successful in configuring vlan in Server')3199 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:3200 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 3201 log.info('sucessful in Enabling Double VLAN on dn')3202 3203 3204 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:3205 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype)3206 log.info('Successful in configuring vlan in Server')3207 3208 #Configure IP on client PC3209 with steps.start('Configure IP in client',continue_=True) as step: 3210 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])3211 log.info('Successful in configuring IP in Client')3212 @ aetest.test3213 def verifyication(self,steps,ctrl,server,client,etype,**param):3214 3215 sleep(10)3216 with steps.start('Verifying GUI page of DN',continue_=True) as step:3217 assert misc.verify_web_page(server,param['dn1_management_ip'])3218 log.info('Successful in verifying DN1 GUI with MVLAN')3219 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3220 assert misc.config_Q(server,param['server_inf'],param['dn1_mcvlan'],param['server_mgmt_ipv4'],status='disable')3221 log.info('Successful in Removing vlan in Server')3222 with steps.start('Configuring MVLAN on Server',continue_=True) as step:3223 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'])3224 log.info('Successful in configuring vlan in Server')3225 sleep(10)3226 with steps.start('Verifying GUI page of POP',continue_=True) as step:3227 assert misc.verify_web_page(server,param['pop_management_ip'])3228 log.info('Successful in verifying POP GUI with MVLAN')3229 with steps.start('Removing Q VLAN in Server',continue_=True) as step:3230 assert misc.config_Q(server,param['server_inf'],param['pop_mcvlan'],param['server_mgmt_ipv4'],status='disable')3231 log.info('Successful in Removing vlan in Server')3232 3233 with steps.start('Capturing and verifying traffic',continue_=True) as step:3234 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))3235 p1.start()3236 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))3237 p2.start()3238 p1.join()3239 p2.join()3240 with steps.start('Analyse Capture',continue_=True) as step:3241 if etype =='0x8100':3242 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3243 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])3244 else:3245 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3246 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_cvlan'],param['dn1_svlan'])3247 res=misc.analyse_capture(server,filter,param['server_file'])3248 if res > 0:3249 log.info('Successful in QinQ VLAN tagging')3250 else:3251 assert False3252 @aetest.cleanup3253 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):3254 3255 with steps.start('Removing MVLAN on POP and DN',continue_=True) as step:3256 assert cli.config_single_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],status='disable')3257 log.info('Successful in Removing mvlan in DN')3258 assert cli.config_single_mvlan(ctrl,param['pop_name'],param['pop_mcvlan'],status='disable')3259 log.info('Successful in Removing mvlan in POP') 3260 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:3261 assert misc.config_QinQ(server,param['server_inf'],param['dn1_cvlan'],param['dn1_svlan'],param['server_data_ipv4'],ethertype=etype,status='disable')3262 log.info('Successful in Removing vlan in Server')3263 with steps.start('Removing vlan configs from server',continue_=True) as step:3264 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_cvlan'],svlan=param['dn1_svlan'],ethertype=etype,status='disable') 3265 log.info('sucessful in Removing QinQ VLAN on dn')3266 with steps.start('Configure IP in client',continue_=True) as step:3267 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3268 log.info('Successful in configuring IP in Client')3269@aetest.loop(etype = ['0x8100', '0x88A8'])3270class Same_Double_Vlan_On_Data_Management(aetest.Testcase):3271 def Capturing_Server_interface(self,server,server_inf,server_file):3272 assert misc.capture_interface(server,server_inf,server_file)3273 3274 def Verify_traffic(self,client,server_data_ipv4):3275 log.info('Starting iperf client')3276 up,down=misc.config_iperf_client(client,server_data_ipv4)3277 assert ((up != 0.0) and (down != 0.0))3278 3279 @aetest.setup3280 def setup_vlan(self,steps,ctrl,server,client,etype,**param):3281 with steps.start('Verifying links',continue_=True) as step: 3282 log.info('Verify link status')3283 for i in range(0,3):3284 3285 data = fetch.fetch_topology(ctrl)3286 verify = fetch.link_status(data)3287 if verify == True: 3288 break3289 elif i == 2: 3290 assert verify3291 sleep(100)3292 with steps.start('Configuring QinQ Management VLAN on POP and DN',continue_=True) as step:3293 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')3294 log.info('Successful in configuring QinQ mvlan on DN1')3295 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='enable')3296 log.info('Successful in configuring QinQ mvlan on POP')3297 with steps.start('Configuring QinQ Vlan in Server',continue_=True) as step:3298 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='enable')3299 3300 @ aetest.test3301 def verifyication(self,steps,ctrl,server,client,etype,**param):3302 sleep(10)3303 with steps.start('Verifying POP GUI access',continue_=True) as step:3304 assert misc.verify_web_page(server,param['pop_management_ip'])3305 log.info('Successful in verifying POP GUI with MVLAN')3306 with steps.start('Verifying GUI page of DN',continue_=True) as step:3307 assert misc.verify_web_page(server,param['dn1_management_ip'])3308 log.info('Successful in verifying DN1 GUI with MVLAN')3309 with steps.start('Removing QinQ Vlan in Server',continue_=True) as step:3310 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_mgmt_ipv4'],ethertype=etype,status='disable')3311 with steps.start('Configure QinQ VLAN in dn',continue_=True) as step:3312 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_mcvlan'],svlan=param['dn1_msvlan'],ethertype=etype,svlan_prio='5',cvlan_prio='3',status='enable') 3313 log.info('sucessful in Enabling Double VLAN on dn')3314 3315 3316 with steps.start('Configure QinQ VLAN in Server',continue_=True) as step:3317 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_data_ipv4'],ethertype=etype)3318 log.info('Successful in configuring vlan in Server')3319 3320 #Configure IP on client PC3321 with steps.start('Configure IP in client',continue_=True) as step: 3322 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'])3323 log.info('Successful in configuring IP in Client')3324 with steps.start('Capturing and verifying traffic',continue_=True) as step:3325 p1 = Process(target=self.Capturing_Server_interface,args=(server,param['server_inf'],param['server_file']))3326 p1.start()3327 p2 = Process(target=self.Verify_traffic,args=(client,param['server_data_ipv4']))3328 p2.start()3329 p1.join()3330 p2.join()3331 with steps.start('Analyse Capture',continue_=True) as step:3332 if etype =='0x8100':3333 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3334 filter = 'ip.src == {}&&vlan.id == {}&&vlan.id == {}&&vlan.priority==5&&vlan.priority==3'.format(ip,param['dn1_mcvlan'],param['dn1_msvlan'])3335 else:3336 ip = param['client_data_ipv4'].rsplit('/', 1)[0]3337 filter = 'ip.src == {}&&vlan.id == {}&&ieee8021ad.id == {}&&ieee8021ad.priority==5&&vlan.priority==3'.format(ip,param['dn1_mcvlan'],param['dn1_msvlan'])3338 res=misc.analyse_capture(server,filter,param['server_file'])3339 if res > 0:3340 log.info('Successful in QinQ VLAN tagging')3341 else:3342 assert False3343 @aetest.cleanup3344 def removing_vlan_config(self,steps,ctrl,server,client,etype,**param):3345 with steps.start('Removing QinQ Management VLAN on POP and DN',continue_=True) as step:3346 assert cli.config_QinQ_mvlan(ctrl,param['dn1_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')3347 log.info('Successful in configuring QinQ mvlan on DN1')3348 assert cli.config_QinQ_mvlan(ctrl,param['pop_name'],param['dn1_mcvlan'],param['dn1_msvlan'],ethertype=etype,status='disable')3349 log.info('Successful in configuring QinQ mvlan on POP')3350 with steps.start('Removing QinQ VLAN in Server',continue_=True) as step:3351 assert misc.config_QinQ(server,param['server_inf'],param['dn1_mcvlan'],param['dn1_msvlan'],param['server_data_ipv4'],ethertype=etype,status='disable')3352 log.info('Successful in Removing vlan in Server')3353 with steps.start('Removing vlan configs from server',continue_=True) as step:3354 assert cli.config_double_vlan(ctrl,param['dn1_name'],param['dn1_inf'],cvlan=param['dn1_mcvlan'],svlan=param['dn1_msvlan'],ethertype=etype,status='disable') 3355 log.info('sucessful in Removing QinQ VLAN on dn')3356 with steps.start('Configure IP in client',continue_=True) as step:3357 assert misc.config_client_ip(client,param['client_inf'],param['client_data_ipv4'],status='disable')3358 log.info('Successful in configuring IP in Client')3359class common_cleanup(aetest.CommonCleanup): 3360 @aetest.subsection3361 def Disabling_L2bridge(self,steps,ctrl,server,client,**param):3362 log.info('configuring l2bridge')3363 with steps.start('Disabling L2 bridge',continue_=True) as step:3364 assert cli.modify_network_l2bridge(ctrl,state='disable')3365 log.info('Successful in configuring l2bridge')3366 sleep(150) 3367 ctrl.disconnect()3368 ctrl.connect()3369 with steps.start('Verify link status',continue_=True) as step:3370 for i in range(0,3):3371 sleep(100)3372 data = fetch.fetch_topology(ctrl)3373 verify = fetch.link_status(data)3374 if verify == True: 3375 break3376 elif i == 2: 3377 assert verify3378 3379 @aetest.subsection3380 def deleting_node(self,steps,ctrl,server,client,**param):3381 assert cli.del_node(ctrl,param['dn1_name']) 3382 log.info('Successful in deleting dn1')3383 3384 @aetest.subsection3385 def deleting_Site(self,steps,ctrl,server,client,**param):3386 assert cli.del_site(ctrl,param['dn1_site'])3387 log.info('Successful in Deleting site')3388 3389 @aetest.subsection3390 def stopping_iperf_server(self,server,ctrl,client,**param):3391 assert misc.config_iperf_server(server,status='disable')3392 log.info('Successful in stopping iperf server')3393 ctrl.disconnect()3394 server.disconnect()3395 client.disconnect()3396 3397 3398 3399if __name__ == '__main__': # pragma: no cover...

Full Screen

Full Screen

Playwright tutorial

LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.

Chapters:

  1. What is Playwright : Playwright is comparatively new but has gained good popularity. Get to know some history of the Playwright with some interesting facts connected with it.
  2. How To Install Playwright : Learn in detail about what basic configuration and dependencies are required for installing Playwright and run a test. Get a step-by-step direction for installing the Playwright automation framework.
  3. Playwright Futuristic Features: Launched in 2020, Playwright gained huge popularity quickly because of some obliging features such as Playwright Test Generator and Inspector, Playwright Reporter, Playwright auto-waiting mechanism and etc. Read up on those features to master Playwright testing.
  4. What is Component Testing: Component testing in Playwright is a unique feature that allows a tester to test a single component of a web application without integrating them with other elements. Learn how to perform Component testing on the Playwright automation framework.
  5. Inputs And Buttons In Playwright: Every website has Input boxes and buttons; learn about testing inputs and buttons with different scenarios and examples.
  6. Functions and Selectors in Playwright: Learn how to launch the Chromium browser with Playwright. Also, gain a better understanding of some important functions like “BrowserContext,” which allows you to run multiple browser sessions, and “newPage” which interacts with a page.
  7. Handling Alerts and Dropdowns in Playwright : Playwright interact with different types of alerts and pop-ups, such as simple, confirmation, and prompt, and different types of dropdowns, such as single selector and multi-selector get your hands-on with handling alerts and dropdown in Playright testing.
  8. Playwright vs Puppeteer: Get to know about the difference between two testing frameworks and how they are different than one another, which browsers they support, and what features they provide.
  9. Run Playwright Tests on LambdaTest: Playwright testing with LambdaTest leverages test performance to the utmost. You can run multiple Playwright tests in Parallel with the LammbdaTest test cloud. Get a step-by-step guide to run your Playwright test on the LambdaTest platform.
  10. Playwright Python Tutorial: Playwright automation framework support all major languages such as Python, JavaScript, TypeScript, .NET and etc. However, there are various advantages to Python end-to-end testing with Playwright because of its versatile utility. Get the hang of Playwright python testing with this chapter.
  11. Playwright End To End Testing Tutorial: Get your hands on with Playwright end-to-end testing and learn to use some exciting features such as TraceViewer, Debugging, Networking, Component testing, Visual testing, and many more.
  12. Playwright Video Tutorial: Watch the video tutorials on Playwright testing from experts and get a consecutive in-depth explanation of Playwright automation testing.

Run Playwright Python automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful