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

[pfcwd] Fix test_pfcwd_mmu_change IndexError #4465

Merged
merged 1 commit into from
Oct 25, 2021

Conversation

AndriiLozovyi
Copy link
Contributor

Signed-off-by: Andrii-Yosafat Lozovyi andrii-yosafatx.lozovyi@intel.com

Description of PR

Summary: test_pfcwd_mmu_change fails with IndexError

        asic = dut.get_port_asic_instance(port)
        if PfcCmd.isBufferInApplDb(asic):
            db = "0"
            pg_pattern = "BUFFER_PG_TABLE:{}:3-4"
        else:
            db = "4"
            pg_pattern = "BUFFER_PG|{}|3-4"
    
        pg_profile = asic.run_redis_cmd(
            argv = [
                "redis-cli", "-n", db, "HGET",
                pg_pattern.format(port), "profile"
            ]
        )[0].encode("utf-8")[1:-1]
    
        alpha = asic.run_redis_cmd(
            argv = [
                "redis-cli", "-n", db, "HGET", pg_profile, "dynamic_th"
            ]
>       )[0].encode("utf-8")
E       IndexError: list index out of range

Looks like after PR - 1626 values in DB for QOS has changed.
Example of change on different Sonic images below:

redis-cli -n 4 hget 'BUFFER_PG|Ethernet24|3-4' 'profile'
"[BUFFER_PROFILE|pg_lossless_100000_300m_profile]" - on SONiC.master.31701-dirty-20210827.084520
"pg_lossless_100000_300m_profile" - on  SONiC.master.42584-dirty-20211011.014318

This PR should solve this issue.

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?

Update test_pfcwd_mmu_change due to latest changes in PR - 1626

How did you do it?

How did you verify/test it?

Run TC on SONiC.master.42584-dirty-20211011.014318 and SONiC.master.31701-dirty-20210827.084520

pfcwd/test_pfcwd_function.py::TestPfcwdFunc::test_pfcwd_actions[None] PASSED                                                                                     
pfcwd/test_pfcwd_function.py::TestPfcwdFunc::test_pfcwd_mmu_change[None] PASSED                                                                                  
pfcwd/test_pfcwd_function.py::TestPfcwdFunc::test_pfcwd_port_toggle[None] PASSED    

Any platform specific information?

SONiC Software Version: SONiC.master.42584-dirty-20211011.014318
Distribution: Debian 10.11
Kernel: 4.19.0-12-2-amd64
Build commit: 32e73b087
Build date: Mon Oct 11 08:05:15 UTC 2021
Built by: AzDevOps@sonic-build-workers-000S2C
Platform: x86_64-arista_7170_64c
HwSKU: Arista-7170-64C

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

Documentation

Signed-off-by: Andrii-Yosafat Lozovyi <andrii-yosafatx.lozovyi@intel.com>
@AndriiLozovyi AndriiLozovyi requested a review from a team as a code owner October 12, 2021 12:46
@AndriiLozovyi
Copy link
Contributor Author

@neethajohn
Could you please take a look ?

@neethajohn neethajohn merged commit f0d96bc into sonic-net:master Oct 25, 2021
praveen-li pushed a commit to praveen-li/sonic-mgmt that referenced this pull request Jun 14, 2022
Signed-off-by: Andrii-Yosafat Lozovyi <andrii-yosafatx.lozovyi@intel.com>

Summary: test_pfcwd_mmu_change fails with IndexError

        asic = dut.get_port_asic_instance(port)
        if PfcCmd.isBufferInApplDb(asic):
            db = "0"
            pg_pattern = "BUFFER_PG_TABLE:{}:3-4"
        else:
            db = "4"
            pg_pattern = "BUFFER_PG|{}|3-4"

        pg_profile = asic.run_redis_cmd(
            argv = [
                "redis-cli", "-n", db, "HGET",
                pg_pattern.format(port), "profile"
            ]
        )[0].encode("utf-8")[1:-1]

        alpha = asic.run_redis_cmd(
            argv = [
                "redis-cli", "-n", db, "HGET", pg_profile, "dynamic_th"
            ]
>       )[0].encode("utf-8")
E       IndexError: list index out of range

Looks like after PR - 1626 values in DB for QOS has changed.
Example of change on different Sonic images below:

redis-cli -n 4 hget 'BUFFER_PG|Ethernet24|3-4' 'profile'
"[BUFFER_PROFILE|pg_lossless_100000_300m_profile]" - on SONiC.master.31701-dirty-20210827.084520
"pg_lossless_100000_300m_profile" - on  SONiC.master.42584-dirty-20211011.014318
This PR should solve this issue.

How did you verify/test it?
Run TC on SONiC.master.42584-dirty-20211011.014318 and SONiC.master.31701-dirty-20210827.084520

pfcwd/test_pfcwd_function.py::TestPfcwdFunc::test_pfcwd_actions[None] PASSED
pfcwd/test_pfcwd_function.py::TestPfcwdFunc::test_pfcwd_mmu_change[None] PASSED
pfcwd/test_pfcwd_function.py::TestPfcwdFunc::test_pfcwd_port_toggle[None] PASSED
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.

2 participants