@@ -407,12 +407,16 @@ def test_MirrorToLagAddRemove(self, dvs, testlog):
407407 self .setup_db (dvs )
408408
409409 session = "TEST_SESSION"
410+ src_ip = "10.10.10.10"
411+ dst_ip = "11.11.11.11"
412+ # dst ip in directly connected subnet
413+ intf_addr = "11.11.11.0/24"
410414
411415 marker = dvs .add_log_marker ()
412416 # create mirror session
413- self .create_mirror_session (session , "10.10.10.10" , "11.11.11.11" , "0x6558" , "8" , "100" , "0" )
417+ self .create_mirror_session (session , src_ip , dst_ip , "0x6558" , "8" , "100" , "0" )
414418 assert self .get_mirror_session_state (session )["status" ] == "inactive"
415- self .check_syslog (dvs , marker , "Attached next hop observer .* for destination IP 11.11.11.11" , 1 )
419+ self .check_syslog (dvs , marker , "Attached next hop observer .* for destination IP {}" . format ( dst_ip ) , 1 )
416420
417421 # create port channel; create port channel member
418422 self .create_port_channel (dvs , "008" )
@@ -423,11 +427,11 @@ def test_MirrorToLagAddRemove(self, dvs, testlog):
423427 self .set_interface_status (dvs , "Ethernet88" , "up" )
424428
425429 # add ip address to port channel 008
426- self .add_ip_address ("PortChannel008" , "11.11.11.0/24" )
430+ self .add_ip_address ("PortChannel008" , intf_addr )
427431 assert self .get_mirror_session_state (session )["status" ] == "inactive"
428432
429433 # create neighbor to port channel 008
430- self .add_neighbor ("PortChannel008" , "11.11.11.11" , "88:88:88:88:88:88" )
434+ self .add_neighbor ("PortChannel008" , dst_ip , "88:88:88:88:88:88" )
431435 assert self .get_mirror_session_state (session )["status" ] == "active"
432436
433437 # check asic database
@@ -443,11 +447,11 @@ def test_MirrorToLagAddRemove(self, dvs, testlog):
443447 assert fv [1 ] == "88:88:88:88:88:88"
444448
445449 # remove neighbor
446- self .remove_neighbor ("PortChannel008" , "11.11.11.11" )
450+ self .remove_neighbor ("PortChannel008" , dst_ip )
447451 assert self .get_mirror_session_state (session )["status" ] == "inactive"
448452
449453 # remove ip address
450- self .remove_ip_address ("PortChannel008" , "11.11.11.0/24" )
454+ self .remove_ip_address ("PortChannel008" , intf_addr )
451455 assert self .get_mirror_session_state (session )["status" ] == "inactive"
452456
453457 # bring down port channel and port channel member
@@ -461,7 +465,7 @@ def test_MirrorToLagAddRemove(self, dvs, testlog):
461465 marker = dvs .add_log_marker ()
462466 # remove mirror session
463467 self .remove_mirror_session (session )
464- self .check_syslog (dvs , marker , "Detached next hop observer for destination IP 11.11.11.11" , 1 )
468+ self .check_syslog (dvs , marker , "Detached next hop observer for destination IP {}" . format ( dst_ip ) , 1 )
465469
466470
467471 # Ignore testcase in Debian Jessie
0 commit comments