-
Notifications
You must be signed in to change notification settings - Fork 763
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[QOS - Test PFC Pause] Multi VLAN Support #16725
[QOS - Test PFC Pause] Multi VLAN Support #16725
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@matthew-soulsby This PR almost refactors the qos_pause related scripts, could you please also verify if this change will not fail the test result on single vlan testbed? |
Sure, sounds good, I'll run on a single VLAN testbed and add a comment with the results. |
@ZhaohuiS Running on a single VLAN testbed results in expected pass: How does that look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with comments.
Hi @matthew-soulsby could you update test results with sonic-mgmt 202405 and 202411 branches before cherry pick? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi @StormLiangMS, just updated the results section with the requested results - how does it look now? |
What is the motivation for this PR? As new testbeds are being created with more VLANs, the assumption that a device should only contain 1 VLAN no longer holds. As such, certain helpers/parts of the framework need to be modified to allow for multiple VLANs to be present and tested. How did you do it? Added a get_all_vlans function to extract all vlans from the duthost object The functions which get information related to vlans (get_active_vlan_members and get_vlan_subnet) now take a vlan configuration dictionary (which itself is taken from the get_all_vlans function) pfc_test_setup now returns a list of VLAN configurations, instead of just one The run_test wrapper now runs the relevant test for each VLAN supplied Also removed gen_testbed_t0, which is not used anywhere (validated with grep) How did you verify/test it? Before this change, running the qos/test_pfc_pause.py on a testbed with multiple VLANs produced the following output: @pytest.fixture(scope="module", autouse=True) def pfc_test_setup(duthosts, rand_one_dut_hostname, tbinfo, ptfhost): """ Generate configurations for the tests Args: duthosts(AnsibleHost) : multi dut instance rand_one_dut_hostname(string) : one of the dut instances from the multi dut Yields: setup(dict): DUT interfaces, PTF interfaces, PTF IP addresses, and PTF MAC addresses """ """ Get all the active physical interfaces enslaved to the Vlan """ """ These interfaces are actually server-faced interfaces at T0 """ duthost = duthosts[rand_one_dut_hostname] > vlan_members, vlan_id = get_active_vlan_members(duthost) E TypeError: cannot unpack non-iterable NoneType object With these changes, it is now successfully running: image Any platform specific information? Any platform with only one VLAN - as each of the new lists/dicts will only contain one VLAN, iterating through them will cause the same behaviour as before.
Cherry-pick PR to 202411: #17021 |
What is the motivation for this PR? As new testbeds are being created with more VLANs, the assumption that a device should only contain 1 VLAN no longer holds. As such, certain helpers/parts of the framework need to be modified to allow for multiple VLANs to be present and tested. How did you do it? Added a get_all_vlans function to extract all vlans from the duthost object The functions which get information related to vlans (get_active_vlan_members and get_vlan_subnet) now take a vlan configuration dictionary (which itself is taken from the get_all_vlans function) pfc_test_setup now returns a list of VLAN configurations, instead of just one The run_test wrapper now runs the relevant test for each VLAN supplied Also removed gen_testbed_t0, which is not used anywhere (validated with grep) How did you verify/test it? Before this change, running the qos/test_pfc_pause.py on a testbed with multiple VLANs produced the following output: @pytest.fixture(scope="module", autouse=True) def pfc_test_setup(duthosts, rand_one_dut_hostname, tbinfo, ptfhost): """ Generate configurations for the tests Args: duthosts(AnsibleHost) : multi dut instance rand_one_dut_hostname(string) : one of the dut instances from the multi dut Yields: setup(dict): DUT interfaces, PTF interfaces, PTF IP addresses, and PTF MAC addresses """ """ Get all the active physical interfaces enslaved to the Vlan """ """ These interfaces are actually server-faced interfaces at T0 """ duthost = duthosts[rand_one_dut_hostname] > vlan_members, vlan_id = get_active_vlan_members(duthost) E TypeError: cannot unpack non-iterable NoneType object With these changes, it is now successfully running: image Any platform specific information? Any platform with only one VLAN - as each of the new lists/dicts will only contain one VLAN, iterating through them will cause the same behaviour as before.
Cherry-pick PR to 202405: #17022 |
What is the motivation for this PR? As new testbeds are being created with more VLANs, the assumption that a device should only contain 1 VLAN no longer holds. As such, certain helpers/parts of the framework need to be modified to allow for multiple VLANs to be present and tested. How did you do it? Added a get_all_vlans function to extract all vlans from the duthost object The functions which get information related to vlans (get_active_vlan_members and get_vlan_subnet) now take a vlan configuration dictionary (which itself is taken from the get_all_vlans function) pfc_test_setup now returns a list of VLAN configurations, instead of just one The run_test wrapper now runs the relevant test for each VLAN supplied Also removed gen_testbed_t0, which is not used anywhere (validated with grep) How did you verify/test it? Before this change, running the qos/test_pfc_pause.py on a testbed with multiple VLANs produced the following output: @pytest.fixture(scope="module", autouse=True) def pfc_test_setup(duthosts, rand_one_dut_hostname, tbinfo, ptfhost): """ Generate configurations for the tests Args: duthosts(AnsibleHost) : multi dut instance rand_one_dut_hostname(string) : one of the dut instances from the multi dut Yields: setup(dict): DUT interfaces, PTF interfaces, PTF IP addresses, and PTF MAC addresses """ """ Get all the active physical interfaces enslaved to the Vlan """ """ These interfaces are actually server-faced interfaces at T0 """ duthost = duthosts[rand_one_dut_hostname] > vlan_members, vlan_id = get_active_vlan_members(duthost) E TypeError: cannot unpack non-iterable NoneType object With these changes, it is now successfully running: image Any platform specific information? Any platform with only one VLAN - as each of the new lists/dicts will only contain one VLAN, iterating through them will cause the same behaviour as before.
What is the motivation for this PR? As new testbeds are being created with more VLANs, the assumption that a device should only contain 1 VLAN no longer holds. As such, certain helpers/parts of the framework need to be modified to allow for multiple VLANs to be present and tested. How did you do it? Added a get_all_vlans function to extract all vlans from the duthost object The functions which get information related to vlans (get_active_vlan_members and get_vlan_subnet) now take a vlan configuration dictionary (which itself is taken from the get_all_vlans function) pfc_test_setup now returns a list of VLAN configurations, instead of just one The run_test wrapper now runs the relevant test for each VLAN supplied Also removed gen_testbed_t0, which is not used anywhere (validated with grep) How did you verify/test it? Before this change, running the qos/test_pfc_pause.py on a testbed with multiple VLANs produced the following output: @pytest.fixture(scope="module", autouse=True) def pfc_test_setup(duthosts, rand_one_dut_hostname, tbinfo, ptfhost): """ Generate configurations for the tests Args: duthosts(AnsibleHost) : multi dut instance rand_one_dut_hostname(string) : one of the dut instances from the multi dut Yields: setup(dict): DUT interfaces, PTF interfaces, PTF IP addresses, and PTF MAC addresses """ """ Get all the active physical interfaces enslaved to the Vlan """ """ These interfaces are actually server-faced interfaces at T0 """ duthost = duthosts[rand_one_dut_hostname] > vlan_members, vlan_id = get_active_vlan_members(duthost) E TypeError: cannot unpack non-iterable NoneType object With these changes, it is now successfully running: image Any platform specific information? Any platform with only one VLAN - as each of the new lists/dicts will only contain one VLAN, iterating through them will cause the same behaviour as before.
Description of PR
Summary:
Type of change
Back port request
Approach
What is the motivation for this PR?
As new testbeds are being created with more VLANs, the assumption that a device should only contain 1 VLAN no longer holds. As such, certain helpers/parts of the framework need to be modified to allow for multiple VLANs to be present and tested.
How did you do it?
get_all_vlans
function to extract all vlans from the duthost objectget_active_vlan_members
andget_vlan_subnet
) now take a vlan configuration dictionary (which itself is taken from the get_all_vlans function)pfc_test_setup
now returns a list of VLAN configurations, instead of just onerun_test
wrapper now runs the relevant test for each VLAN suppliedgen_testbed_t0
, which is not used anywhere (validated with grep)How did you verify/test it?
Before this change, running the
qos/test_pfc_pause.py
on a testbed with multiple VLANs produced the following output:With these changes, it is now successfully running:

202405 Evidence:

202411 Evidence:

Any platform specific information?
Any platform with only one VLAN - as each of the new lists/dicts will only contain one VLAN, iterating through them will cause the same behaviour as before.
Supported testbed topology if it's a new test case?
N/A
Documentation