69
69
"vrf_set_source_set_800" ]
70
70
SYSLOG_DEFAULT_PORT = 514
71
71
TEST_FORWARD_FLAGS_AND_MSGS = {
72
- "default" : ('' , '' ),
73
- "teamd_" : ("-t teamd_" , "teamd_" ),
74
- "bgp0#frr" : ("-t bgp0#frr" , "bgp0#frr" ),
75
- "bgp0#zebra" : ("-t bgp0#zebra" , "bgp0#zebra" ),
76
- "bgp0#staticd" : ("-t bgp0#staticd" , "bgp0#staticd" ),
77
- "bgp0#watchfrr" : ("-t bgp0#watchfrr" , "bgp0#watchfrr" ),
78
- "bgp0#bgpd" : ("-t bgp0#bgpd" , "bgp0#bgpd" ),
79
- "gnmi-native" : ("-t gnmi-native" , "gnmi-native" ),
80
- "telemetry" : ("-t telemetry" , "telemetry" ),
72
+ "default" : ('' , '' ),
73
+ "teamd_" : ("-t teamd_" , "teamd_" ),
74
+ "bgp0#frr" : ("-t bgp0#frr" , "bgp0#frr" ),
75
+ "bgp0#zebra" : ("-t bgp0#zebra" , "bgp0#zebra" ),
76
+ "bgp0#staticd" : ("-t bgp0#staticd" , "bgp0#staticd" ),
77
+ "bgp0#watchfrr" : ("-t bgp0#watchfrr" , "bgp0#watchfrr" ),
78
+ "bgp0#bgpd" : ("-t bgp0#bgpd" , "bgp0#bgpd" ),
79
+ "gnmi-native" : ("-t gnmi-native" , "gnmi-native" ),
80
+ "telemetry" : ("-t telemetry" , "telemetry" ),
81
81
"dialout" : ("-t dialout" , "dialout" )}
82
82
83
83
SYSLOG_THREAD_TIMEOUT = 50
@@ -592,7 +592,10 @@ def gen_tcpdump_cmd_and_capture_syslog_packets(self, routed_interfaces, port, vr
592
592
else :
593
593
tcpdump_interface = vrf
594
594
tcpdump_file_name = syslogUtilsConst .DUT_PCAP_FILEPATH .format (vrf = vrf + '_neg' if neg else vrf )
595
- tcpdump_cmd = f"sudo timeout { syslogUtilsConst .TCPDUMP_CAPTURE_TIME } tcpdump -i { tcpdump_interface } port { port if port else SYSLOG_DEFAULT_PORT } -w { tcpdump_file_name } "
595
+ tcpdump_cmd = (
596
+ f"sudo timeout { syslogUtilsConst .TCPDUMP_CAPTURE_TIME } tcpdump -i { tcpdump_interface } "
597
+ f"port { port if port else SYSLOG_DEFAULT_PORT } -w { tcpdump_file_name } "
598
+ )
596
599
tcpdump_file = capture_syslog_packets (self .duthost , tcpdump_cmd , logging_data )
597
600
return tcpdump_file
598
601
@@ -835,8 +838,11 @@ def test_syslog_protocol_filter_severity(self, duthosts, enum_rand_one_per_hwsku
835
838
with allure .step ("Configure include filter and verify" ):
836
839
filter_regex = 'sonic'
837
840
logging_data = [(logger_flags , filter_regex )]
838
- self .duthost .shell ('sonic-db-cli CONFIG_DB hset "SYSLOG_SERVER|{0}" '
839
- '"filter_type" "include" "filter_regex" {1}' .format (default_vrf_rsyslog_ip , filter_regex ))
841
+ self .duthost .shell (
842
+ 'sonic-db-cli CONFIG_DB hset "SYSLOG_SERVER|{0}" '
843
+ '"filter_type" "include" "filter_regex" {1}'
844
+ .format (default_vrf_rsyslog_ip , filter_regex )
845
+ )
840
846
841
847
with allure .step ("Check interface of {} send syslog msg with include regex" .format (routed_interfaces [0 ])):
842
848
self .check_syslog_msg_is_sent (routed_interfaces , mgmt_interface , port , vrf_list = vrf_list ,
@@ -853,8 +859,11 @@ def test_syslog_protocol_filter_severity(self, duthosts, enum_rand_one_per_hwsku
853
859
854
860
with allure .step ("Configure exclude filter and verify" ):
855
861
filter_regex = 'aa'
856
- self .duthost .shell ('sonic-db-cli CONFIG_DB hset'
857
- ' "SYSLOG_SERVER|{0}" "filter_type" "exclude" "filter_regex" {1}' .format (default_vrf_rsyslog_ip , filter_regex ))
862
+ self .duthost .shell (
863
+ 'sonic-db-cli CONFIG_DB hset'
864
+ ' "SYSLOG_SERVER|{0}" "filter_type" "exclude" "filter_regex" {1}'
865
+ .format (default_vrf_rsyslog_ip , filter_regex )
866
+ )
858
867
859
868
with allure .step ("Check interface of {} will not send syslog msg with exclude" .format (routed_interfaces [0 ])):
860
869
logging_data = [(logger_flags , filter_regex )]
0 commit comments