diff options
| author | Adam Schultz <adam.schultz@live.com> | 2026-01-24 09:55:14 -0500 |
|---|---|---|
| committer | Adam Schultz <adam.schultz@live.com> | 2026-02-09 22:59:37 -0500 |
| commit | 696df602557dd7b70b353c3b9cfb110c0908a2fe (patch) | |
| tree | d7ec98633981069f21b0af09575bf1e53cf79f56 /smoketest/scripts/cli/test_system_logs.py | |
| parent | 9707b90b9ddacd27b74ef235a6f5a8f585c2bc50 (diff) | |
| download | vyos-1x-696df602557dd7b70b353c3b9cfb110c0908a2fe.tar.gz vyos-1x-696df602557dd7b70b353c3b9cfb110c0908a2fe.zip | |
T7756: Fix rsyslog configuration generation
1.) Fix both syslog and logrotate writing /etc/logrotate.d/vyos-rsyslog
- system_syslog.py generates /etc/logrotate.d/vyos-rsyslog-user for user file
logrotate
- system_logs.py generates /etc/logrotate.d/vyos-rsyslog using configured
rotation parameters
2.) Fix /run/rsyslog/rsyslog.conf ignoring configured size for /var/log/messages
- system_syslog.py retrieves "system logs" config to set rotation limits
- default rotation size is now based on configuration defaults
3.) prifilt strings for rsyslog are modified to use override syntax
(e.g. ";facility.none") when all is combined with other facilities to honor
per facility user intent
Smoke test changes:
Commonize configuration of syslog facilities
Check that prifilt is sane based on configured facilities (i.e. overides only
present when required)
Test wildcard (all) only, specific facility only, and wildcard + specific facility
Diffstat (limited to 'smoketest/scripts/cli/test_system_logs.py')
| -rwxr-xr-x | smoketest/scripts/cli/test_system_logs.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/smoketest/scripts/cli/test_system_logs.py b/smoketest/scripts/cli/test_system_logs.py index 81fbf8048..ccddcdec6 100755 --- a/smoketest/scripts/cli/test_system_logs.py +++ b/smoketest/scripts/cli/test_system_logs.py @@ -18,18 +18,20 @@ import re import unittest from base_vyostest_shim import VyOSUnitTestSHIM from vyos.utils.file import read_file +from vyos.xml_ref import default_value # path to logrotate configs logrotate_atop_file = '/etc/logrotate.d/vyos-atop' logrotate_rsyslog_file = '/etc/logrotate.d/vyos-rsyslog' -# default values -default_atop_maxsize = '10M' -default_atop_rotate = '10' -default_rsyslog_size = '1M' -default_rsyslog_rotate = '10' base_path = ['system', 'logs'] +# default values +default_atop_maxsize = f"{default_value(base_path + ['logrotate', 'atop', 'max-size'])}M" +default_atop_rotate = default_value(base_path + ['logrotate', 'atop', 'rotate']) +default_rsyslog_size = f"{default_value(base_path + ['logrotate', 'messages', 'max-size'])}M" +default_rsyslog_rotate = default_value(base_path + ['logrotate', 'messages', 'rotate']) + def logrotate_config_parse(file_path): # read the file |
