Skip to content

Commit eb6da83

Browse files
committed
[rsyslog]: Update UTs
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
1 parent f8f9f96 commit eb6da83

File tree

4 files changed

+29
-24
lines changed

4 files changed

+29
-24
lines changed

files/image_config/rsyslog/rsyslog.conf.j2

+5
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ template(name="WelfRemoteFormat" type="string" string="%TIMESTAMP% id=firewall t
6767
#
6868
# Remote syslog logging
6969
#
70+
71+
# The omfwd plug-in provides the core functionality of traditional message
72+
# forwarding via UDP and plain TCP. It is a built-in module that does not need
73+
# to be loaded.
74+
7075
{% set servers = SYSLOG_SERVER | d({}) -%}
7176
{% for server in servers %}
7277
{% set conf = servers[server] | d({}) -%}

src/sonic-config-engine/setup.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[aliases]
2+
test=pytest

src/sonic-config-engine/tests/sample_output/py3/rsyslog.conf

+11-12
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ template(name="WelfRemoteFormat" type="string" string="%TIMESTAMP% id=firewall t
4949
:::date-year%-%timereported:::date-month%-%timereported:::date-day% %timereported:::date-hour%:%timereported:::date-minute%:%timereported\
5050
:::date-second%\" fw=\"kvm-host\" pri=%syslogpriority% msg=\"%syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\"\n")
5151

52+
#
53+
# Remote syslog logging
54+
#
55+
56+
# The omfwd plug-in provides the core functionality of traditional message
57+
# forwarding via UDP and plain TCP. It is a built-in module that does not need
58+
# to be loaded.
59+
60+
*.*
61+
action(type="omfwd" Target="3.3.3.3" Port="514" Protocol="udp" Template="SONiCForwardFormat")
62+
5263
#
5364
# Set the default permissions for all log files.
5465
#
@@ -76,15 +87,3 @@ $RepeatedMsgReduction on
7687
###############
7788
#### RULES ####
7889
###############
79-
80-
#
81-
# Remote syslog logging
82-
#
83-
84-
# The omfwd plug-in provides the core functionality of traditional message
85-
# forwarding via UDP and plain TCP. It is a built-in module that does not need
86-
# to be loaded.
87-
88-
*.*
89-
action(type="omfwd" Target="3.3.3.3" Port="514" Protocol="udp" Template="SONiCForwardFormat")
90-

src/sonic-config-engine/tests/sample_output/py3/rsyslog_with_docker0.conf

+11-12
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ template(name="WelfRemoteFormat" type="string" string="%TIMESTAMP% id=firewall t
5151
:::date-year%-%timereported:::date-month%-%timereported:::date-day% %timereported:::date-hour%:%timereported:::date-minute%:%timereported\
5252
:::date-second%\" fw=\"kvm-host\" pri=%syslogpriority% msg=\"%syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\"\n")
5353

54+
#
55+
# Remote syslog logging
56+
#
57+
58+
# The omfwd plug-in provides the core functionality of traditional message
59+
# forwarding via UDP and plain TCP. It is a built-in module that does not need
60+
# to be loaded.
61+
62+
*.*
63+
action(type="omfwd" Target="3.3.3.3" Port="514" Protocol="udp" Template="SONiCForwardFormat")
64+
5465
#
5566
# Set the default permissions for all log files.
5667
#
@@ -78,15 +89,3 @@ $RepeatedMsgReduction on
7889
###############
7990
#### RULES ####
8091
###############
81-
82-
#
83-
# Remote syslog logging
84-
#
85-
86-
# The omfwd plug-in provides the core functionality of traditional message
87-
# forwarding via UDP and plain TCP. It is a built-in module that does not need
88-
# to be loaded.
89-
90-
*.*
91-
action(type="omfwd" Target="3.3.3.3" Port="514" Protocol="udp" Template="SONiCForwardFormat")
92-

0 commit comments

Comments
 (0)