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

Fix conftest rand_one_dut_hostname IndexError #14830

Merged

Conversation

dayouliu1
Copy link
Contributor

@dayouliu1 dayouliu1 commented Oct 2, 2024

Description of PR

Summary:
Fixes #14829

Type of change

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

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405

Approach

What is the motivation for this PR?

Fix issue where rand_one_dut_hostname fixture was not being properly set when the fixture is loaded dynamically, like in the case for ecmp/test_ecmp_hash_seed_value. The custom_fixture plugin will dynamically add rand_one_dut_hostname, but the current method of setting rand_one_dut_hostname_var does not account for this and so it is not set.

How did you do it?

Set the global variable within the rand_one_dut_hostname fixture directly.

How did you verify/test it?

Ran and verified test suite

Any platform specific information?

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

Documentation

Updated the rand_one_dut_hostname and selected_rand_dut fixtures to
set rand_one_dut_hostname_var whenever needed, specifically in the case
the fixture is dynamically loaded. Removed old method of setting
rand_one_dut_hostname_var.
@dayouliu1 dayouliu1 force-pushed the fix-conftest-rand-one-dut-hostname branch from bca7793 to ef073b7 Compare October 2, 2024 18:31
@dayouliu1
Copy link
Contributor Author

@yejianquan

@StormLiangMS StormLiangMS requested a review from ZhaohuiS October 10, 2024 04:44
@StormLiangMS
Copy link
Collaborator

hi @ZhaohuiS Would you help to take a look?

@ZhaohuiS
Copy link
Contributor

Duplicated with #14935
Can we close this one?

@dayouliu1
Copy link
Contributor Author

dayouliu1 commented Oct 23, 2024

@ZhaohuiS I see that #14935 changed the fixture dependencies in check_dut_asic_type, but the underlying problem is still present and will pop up again if there is another instance where rand_one_dut_hostname or selected_rand_dut is added dynamically.

@ZhaohuiS
Copy link
Contributor

@dayouliu1 did you verify your changes by running nightly test? What's test results for tests/ecmp/test_ecmp_sai_value.py and tacacs?

@dayouliu1
Copy link
Contributor Author

dayouliu1 commented Oct 25, 2024

@ZhaohuiS Yes, the above tests passes from the results I see

@yejianquan
Copy link
Collaborator

@ZhaohuiS Yes, the above tests passes from the results I see

@dayouliu1 please paste the test result, thanks.

Copy link
Collaborator

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

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

LGTM

@StormLiangMS StormLiangMS merged commit 11dd4b7 into sonic-net:master Nov 13, 2024
16 checks passed
sreejithsreekumaran pushed a commit to sreejithsreekumaran/sonic-mgmt that referenced this pull request Nov 15, 2024
Updated the rand_one_dut_hostname and selected_rand_dut fixtures to
set rand_one_dut_hostname_var whenever needed, specifically in the case
the fixture is dynamically loaded. Removed old method of setting
rand_one_dut_hostname_var.
yutongzhang-microsoft pushed a commit to yutongzhang-microsoft/sonic-mgmt that referenced this pull request Nov 21, 2024
Updated the rand_one_dut_hostname and selected_rand_dut fixtures to
set rand_one_dut_hostname_var whenever needed, specifically in the case
the fixture is dynamically loaded. Removed old method of setting
rand_one_dut_hostname_var.
@dayouliu1
Copy link
Contributor Author

dayouliu1 commented Dec 5, 2024

Can this PR be backported to 202405 please? Just for consistency.

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Dec 12, 2024
Updated the rand_one_dut_hostname and selected_rand_dut fixtures to
set rand_one_dut_hostname_var whenever needed, specifically in the case
the fixture is dynamically loaded. Removed old method of setting
rand_one_dut_hostname_var.
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #16047

mssonicbld pushed a commit that referenced this pull request Dec 12, 2024
Updated the rand_one_dut_hostname and selected_rand_dut fixtures to
set rand_one_dut_hostname_var whenever needed, specifically in the case
the fixture is dynamically loaded. Removed old method of setting
rand_one_dut_hostname_var.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: test_ecmp_hash_seed_value test fails with IndexError
6 participants