Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCU test for Monitor Config #5116

Merged
merged 6 commits into from
Mar 21, 2022
Merged

GCU test for Monitor Config #5116

merged 6 commits into from
Mar 21, 2022

Conversation

wen587
Copy link
Contributor

@wen587 wen587 commented Feb 10, 2022

Description of PR

Note:
[Done]sonic-net/sonic-utilities#2068 need to be fix first
[Done] sonic-net/sonic-buildimage#9948 need to be merged
[Done]sonic-net/sonic-buildimage#9929
Summary: Testcase of monitor config for generic updater apply-patch
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 201911

Approach

What is the motivation for this PR?

End to End test support for Generic Updater apply-patch
This PR is to verify the usage of 'config apply-patch' works on monitor config
This PR also remove the ignored yang table as they has been fixed

How did you do it?

Add monitor config to dut and check if config change as expected

How did you verify/test it?

Run test of sonic-mgmt/tests/generic_config_updater/test_monitor_config.py on KVM

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

@wen587 wen587 marked this pull request as ready for review February 11, 2022 02:56
@wen587 wen587 requested a review from a team as a code owner February 11, 2022 02:56
finally:
delete_checkpoint(duthost)

def test_monitor_config_tc1_add_config(duthost):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_monitor_config_tc1_add_config

We also need to test the reverse operation, ie. disabling EverflowAlways on.

@wen587 wen587 requested a review from bingwang-ms February 14, 2022 06:25
logger.info("tmpfile {}".format(tmpfile))

try:
output = apply_patch(duthost, json_data=json_patch, dest_file=tmpfile)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some dependency among ACL, mirror and policer. So, the order for applying different configs is required to respect the dependency. The correct order is supposed to be

Policer->mirror_session->ACL_TABLE->ACL_RULE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Yang schema will make sure the configs are added with the correct order.

Copy link
Contributor

@qiluo-msft qiluo-msft Feb 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's assume the order for applying different configs is wrong. What happens to the orchagent/syncd? Will they tolerate or complain, or crash?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The config has its dependency. For example, ACL_RULE is based on ACL_TABLE, which means ACL_TABLE has to be applied first before ACL_RULE. The dependency is defined in yang(leafref specificly).
So if order is wrong, the apply-patch operation will fail and no further impact on orchagent/syncd.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bingwang-ms Could you check my question above?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

orchagent will complain some ERROR or WARNING logs if the referenced object is not found. It will not crash.


mirror_session = duthost.shell("show mirror_session {}".format(MONITOR_CONFIG_MIRROR_SESSION))
expect_res_success(duthost, mirror_session, [
MONITOR_CONFIG_MIRROR_SESSION, MONITOR_CONFIG_POLICER], [])
Copy link
Collaborator

@bingwang-ms bingwang-ms Feb 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking are we able to do more check besides CLI level checking, such as check syslog to ensure that ACL_RULE is created successfully. #plan for future

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding validation, there are multiple things we can check:

  1. final status, like check policers, acls are there,
  2. check the right order of applying (Log analyzer is useful here)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark the extra level checking as plan for future.

mirror_session = duthost.shell("show mirror_session {}".format(MONITOR_CONFIG_MIRROR_SESSION))
expect_res_success(duthost, mirror_session, [], [
MONITOR_CONFIG_MIRROR_SESSION, MONITOR_CONFIG_POLICER])

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same above. It would be better if we are able to do more check besides CLI level.

@wen587 wen587 merged commit 98b8464 into sonic-net:master Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants