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

[TACACS+] Add TACACS per-command accounting test case. #4674

Merged
merged 49 commits into from
Jan 4, 2022
Merged

[TACACS+] Add TACACS per-command accounting test case. #4674

merged 49 commits into from
Jan 4, 2022

Conversation

liuh-80
Copy link
Contributor

@liuh-80 liuh-80 commented Nov 11, 2021

Description of PR

Add new E2E test cases for TACACS per-command accounting.
    These UT depends on the per-command accounting feature in sonic-buildimage repo and AAA accounting config command in sonic-utility repo.

Type of change

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

Back port request

Approach

What is the motivation for this PR?

Add E2E test case coverage for the per-command accounting feature.

How did you do it?

Add new E2E test case to cover user scenarios.

How did you verify/test it?

Run new UT make sure they are all pass.
Make sure all current UT not break during merge validation.

Any platform specific information?

N/A

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

Documentation

https://github.com/Azure/SONiC/blob/master/doc/aaa/TACACS%2B%20Design.md

@liuh-80 liuh-80 marked this pull request as ready for review November 16, 2021 09:01
@liuh-80 liuh-80 requested a review from a team as a code owner November 16, 2021 09:01
@@ -39,6 +38,22 @@ def skip_release(duthost, release_list):
if any(release == duthost.sonic_release for release in release_list):
pytest.skip("DUT is release {} and test does not support {}".format(duthost.sonic_release, ", ".join(release_list)))

def check_skip_release(duthost, release_list):
Copy link
Contributor

@qiluo-msft qiluo-msft Dec 9, 2021

Choose a reason for hiding this comment

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

check_skip_release

The function body is similar to skip_release. Could you reuse code between the 2 functions? #Closed

@liuh-80
Copy link
Contributor Author

liuh-80 commented Dec 10, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80
Copy link
Contributor Author

liuh-80 commented Dec 10, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

duthost.shell("sudo config tacacs default passkey")
duthost.shell("sudo config aaa authentication login default")
duthost.shell("sudo config aaa authentication failthrough default")

(skip, reason) = check_skip_release(duthost, per_command_check_skip_versions)
if skip:
Copy link
Contributor

@qiluo-msft qiluo-msft Dec 11, 2021

Choose a reason for hiding this comment

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

skip

Wondering if you intent to not skip ? #Closed

tests/tacacs/utils.py Outdated Show resolved Hide resolved
qiluo-msft
qiluo-msft previously approved these changes Dec 13, 2021
@wangxin
Copy link
Collaborator

wangxin commented Dec 23, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80
Copy link
Contributor Author

liuh-80 commented Jan 4, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80 liuh-80 merged commit 057d137 into sonic-net:master Jan 4, 2022
yutongzhang-microsoft added a commit that referenced this pull request Aug 31, 2022
…running. (#6246)

Description of PR
During the module test_accounting.py running, it sets tacacs accounting in config db, which will add the key AAA and TACPLUS in config db. This cause the inconsistent in config db before and after the test case running. In this pr, we delete the key AAA and TACPLUS in config db after the module running.

Summary:
Fixes # (#4674)

What is the motivation for this PR?
During the module test_accounting.py running, it sets tacacs accounting in config db, which will add the key AAA and TACPLUS in config db. This cause the inconsistent in config db before and after the test case running. In this pr, we delete the key AAA and TACPLUS in config db after the module running.

How did you do it?
Use configlet to delete the config after test case running.

How did you verify/test it?
Check the config db before and after the test case running.

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
wangxin pushed a commit that referenced this pull request Sep 6, 2022
…running. (#6246)

Description of PR
During the module test_accounting.py running, it sets tacacs accounting in config db, which will add the key AAA and TACPLUS in config db. This cause the inconsistent in config db before and after the test case running. In this pr, we delete the key AAA and TACPLUS in config db after the module running.

Summary:
Fixes # (#4674)

What is the motivation for this PR?
During the module test_accounting.py running, it sets tacacs accounting in config db, which will add the key AAA and TACPLUS in config db. This cause the inconsistent in config db before and after the test case running. In this pr, we delete the key AAA and TACPLUS in config db after the module running.

How did you do it?
Use configlet to delete the config after test case running.

How did you verify/test it?
Check the config db before and after the test case running.

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
Azarack pushed a commit to Azarack/sonic-mgmt that referenced this pull request Oct 17, 2022
…running. (sonic-net#6246)

Description of PR
During the module test_accounting.py running, it sets tacacs accounting in config db, which will add the key AAA and TACPLUS in config db. This cause the inconsistent in config db before and after the test case running. In this pr, we delete the key AAA and TACPLUS in config db after the module running.

Summary:
Fixes # (sonic-net#4674)

What is the motivation for this PR?
During the module test_accounting.py running, it sets tacacs accounting in config db, which will add the key AAA and TACPLUS in config db. This cause the inconsistent in config db before and after the test case running. In this pr, we delete the key AAA and TACPLUS in config db after the module running.

How did you do it?
Use configlet to delete the config after test case running.

How did you verify/test it?
Check the config db before and after the test case running.

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
allen-xf pushed a commit to allen-xf/sonic-mgmt that referenced this pull request Oct 28, 2022
…running. (sonic-net#6246)

Description of PR
During the module test_accounting.py running, it sets tacacs accounting in config db, which will add the key AAA and TACPLUS in config db. This cause the inconsistent in config db before and after the test case running. In this pr, we delete the key AAA and TACPLUS in config db after the module running.

Summary:
Fixes # (sonic-net#4674)

What is the motivation for this PR?
During the module test_accounting.py running, it sets tacacs accounting in config db, which will add the key AAA and TACPLUS in config db. This cause the inconsistent in config db before and after the test case running. In this pr, we delete the key AAA and TACPLUS in config db after the module running.

How did you do it?
Use configlet to delete the config after test case running.

How did you verify/test it?
Check the config db before and after the test case running.

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
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