Skip to content

Commit

Permalink
Fix enabld/disable rsyslog rate limitation. (#3279)
Browse files Browse the repository at this point in the history
This PR is to fix test failure of test_disable_rsyslog_rate_limit and test_recover_rsyslog_rate_limit in pretest and posttest.
The state of feature may be always_enabled or always_disabled. Therefore, we have to update the logic to check if a feature is enabled.

Signed-off-by: bingwang <[email protected]>
  • Loading branch information
bingwang-ms authored Apr 6, 2021
1 parent 0f45e23 commit 18dce2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/test_posttest.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_recover_rsyslog_rate_limit(duthosts, enum_dut_hostname):
cmd_enable_rate_limit = r"docker exec -i {} sed -i 's/^#\$SystemLogRateLimit/\$SystemLogRateLimit/g' /etc/rsyslog.conf"
cmd_reload = r"docker exec -i {} supervisorctl restart rsyslogd"
for feature_name, state in features_dict.items():
if state == "disabled":
if 'enabled' not in state:
continue
cmds = []
cmds.append(cmd_enable_rate_limit.format(feature_name))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pretest.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def test_disable_rsyslog_rate_limit(duthosts, enum_dut_hostname):
cmd_disable_rate_limit = r"docker exec -i {} sed -i 's/^\$SystemLogRateLimit/#\$SystemLogRateLimit/g' /etc/rsyslog.conf"
cmd_reload = r"docker exec -i {} supervisorctl restart rsyslogd"
for feature_name, state in features_dict.items():
if state == "disabled":
if 'enabled' not in state:
continue
cmds = []
cmds.append(cmd_disable_rate_limit.format(feature_name))
Expand Down

0 comments on commit 18dce2d

Please sign in to comment.