@@ -930,26 +930,36 @@ def test_chassis_add_remove_ports(self, vct):
930930 asic_db = dvs .get_asic_db ()
931931 metatbl = config_db .get_entry ("DEVICE_METADATA" , "localhost" )
932932 cfg_switch_type = metatbl .get ("switch_type" )
933+ cfg_hostname = metatbl .get ("hostname" )
934+ cfg_asic_name = metatbl .get ("asic_name" )
933935
934936 if cfg_switch_type == "voq" :
935937 num_ports = len (asic_db .get_keys ("ASIC_STATE:SAI_OBJECT_TYPE_PORT" ))
936938 # Get the port info we'll flap
937939 port = config_db .get_keys ('PORT' )[0 ]
938940 port_info = config_db .get_entry ("PORT" , port )
941+ system_port = cfg_hostname + "|" + cfg_asic_name + "|" + port
939942
940943 # Remove port's other configs
941944 pgs = config_db .get_keys ('BUFFER_PG' )
942- queues = config_db .get_keys ('BUFFER_QUEUE' )
945+ buf_queues = config_db .get_keys ('BUFFER_QUEUE' )
946+ queues = config_db .get_keys ('QUEUE' )
947+
943948 for key in pgs :
944949 if port in key :
945950 config_db .delete_entry ('BUFFER_PG' , key )
946951 app_db .wait_for_deleted_entry ('BUFFER_PG_TABLE' , key )
947952
948- for key in queues :
953+ for key in buf_queues :
949954 if port in key :
950955 config_db .delete_entry ('BUFFER_QUEUE' , key )
951956 app_db .wait_for_deleted_entry ('BUFFER_QUEUE_TABLE' , key )
952957
958+ for key in queues :
959+ if system_port in key :
960+ config_db .delete_entry ('QUEUE' , key )
961+ app_db .wait_for_deleted_entry ('QUEUE_TABLE' , key )
962+
953963 # Remove port
954964 config_db .delete_entry ('PORT' , port )
955965 app_db .wait_for_deleted_entry ('PORT_TABLE' , port )
0 commit comments