Skip to content

Add IPv6 TC to queue mapping test#10941

Merged
abdosi merged 1 commit intosonic-net:masterfrom
bktsim-arista:ipv6-test
Mar 7, 2024
Merged

Add IPv6 TC to queue mapping test#10941
abdosi merged 1 commit intosonic-net:masterfrom
bktsim-arista:ipv6-test

Conversation

@bktsim-arista
Copy link
Copy Markdown
Contributor

@bktsim-arista bktsim-arista commented Dec 4, 2023

Summary:
This change introduces an IPv6 test for TC to queue mapping in the QoS suite alongside the infrastructure needed to construct this test. Resolves #10939

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205
  • 202305

Approach

What is the motivation for this PR?

There is a missing test gap for IPv6 DSCP to TC queue mapping. This change introduces a test to fill this test gap by modifying an existing test DscpToQueueMapping which previously tested DSCP to TC queue mapping on IPv4 to also test it for IPv6.

How did you do it?

Modified existing testQosSaiDscpQueueMapping to also test for IPv6, and added changes to active_ip_interfaces to also fetch IPv6 addresses to be used in this test.

How did you verify/test it?

Ran the test manually and it passed.

Any platform specific information?

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

Documentation

@mssonicbld
Copy link
Copy Markdown
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/qos/qos_sai_base.py:771:121: E501 line too long (127 > 120 characters)
tests/qos/qos_sai_base.py:876:121: E501 line too long (132 > 120 characters)
tests/qos/qos_sai_base.py:991:121: E501 line too long (123 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:366:28: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:369:29: E128 continuation line under-indented for visual indent

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

@mssonicbld
Copy link
Copy Markdown
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/qos/qos_sai_base.py

fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/qos/qos_sai_base.py:877:121: E501 line too long (132 > 120 characters)

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

@mssonicbld
Copy link
Copy Markdown
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/qos/qos_sai_base.py

fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Passed
flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

@mssonicbld
Copy link
Copy Markdown
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/qos/qos_sai_base.py

fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Passed
flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

@rlhui
Copy link
Copy Markdown

rlhui commented Jan 24, 2024

@vmittal-msft will review

@abdosi
Copy link
Copy Markdown
Contributor

abdosi commented Feb 9, 2024

@alpeshspatel / @rraghav-cisco for viz

@judyjoseph
Copy link
Copy Markdown
Contributor

@saksarav-nokia to review

@mssonicbld
Copy link
Copy Markdown
Collaborator

@bktsim-arista PR conflicts with 202205 branch

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Mar 22, 2024
This change introduces an IPv6 test for TC to queue mapping in the QoS suite alongside the infrastructure needed to construct this test. Resolves sonic-net#10939
@mssonicbld
Copy link
Copy Markdown
Collaborator

@bktsim-arista PR conflicts with 202305 branch

@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202311: #12088

mssonicbld pushed a commit that referenced this pull request Mar 22, 2024
This change introduces an IPv6 test for TC to queue mapping in the QoS suite alongside the infrastructure needed to construct this test. Resolves #10939
@bingwang-ms
Copy link
Copy Markdown
Collaborator

@bktsim-arista The change caused some regression for other test cases in test_qos_sai. Can you please fix it or revert this change?

14:44:01 __init__._fixture_generator_decorator    L0088 ERROR  | 
KeyError('peer_addr_ipv6')
Traceback (most recent call last):
  File "/var/src/sonic-mgmt_vms21-t0-2700_646f1402735219c3e5444094/tests/common/plugins/log_section_start/__init__.py", line 84, in _fixture_generator_decorator
    res = next(it)
  File "/var/src/sonic-mgmt_vms21-t0-2700_646f1402735219c3e5444094/tests/qos/qos_sai_base.py", line 1089, in dutConfig
    testPorts = self.__buildTestPorts(request, testPortIds, testPortIps,
  File "/var/src/sonic-mgmt_vms21-t0-2700_646f1402735219c3e5444094/tests/qos/qos_sai_base.py", line 766, in __buildTestPorts
    "dst_port_ipv6": dst_test_port_ips[dstPort]['peer_addr_ipv6'],
KeyError: 'peer_addr_ipv6'

vivekverma-arista added a commit to vivekverma-arista/sonic-mgmt that referenced this pull request Apr 8, 2024
Downlink ports don't have BGP neighbors in case of T0, hence the above change is
causing the key error.

The proposed fix is to modify the testPorts dictionary with peer_addr_ipv6 only if
it is defined.
@vivekverma-arista
Copy link
Copy Markdown
Contributor

vivekverma-arista commented Apr 8, 2024

@bktsim-arista The change caused some regression for other test cases in test_qos_sai. Can you please fix it or revert this change?

14:44:01 __init__._fixture_generator_decorator    L0088 ERROR  | 
KeyError('peer_addr_ipv6')
Traceback (most recent call last):
  File "/var/src/sonic-mgmt_vms21-t0-2700_646f1402735219c3e5444094/tests/common/plugins/log_section_start/__init__.py", line 84, in _fixture_generator_decorator
    res = next(it)
  File "/var/src/sonic-mgmt_vms21-t0-2700_646f1402735219c3e5444094/tests/qos/qos_sai_base.py", line 1089, in dutConfig
    testPorts = self.__buildTestPorts(request, testPortIds, testPortIps,
  File "/var/src/sonic-mgmt_vms21-t0-2700_646f1402735219c3e5444094/tests/qos/qos_sai_base.py", line 766, in __buildTestPorts
    "dst_port_ipv6": dst_test_port_ips[dstPort]['peer_addr_ipv6'],
KeyError: 'peer_addr_ipv6'

Hi @bingwang-ms, this was fixed in #12334.

yxieca pushed a commit that referenced this pull request Apr 11, 2024
* Regression introduced by: #10941

Downlink ports don't have BGP neighbors in case of T0, hence the above change is
causing the key error.

The proposed fix is to modify the testPorts dictionary with peer_addr_ipv6 only if
it is defined.
@vivekverma-arista vivekverma-arista mentioned this pull request Apr 12, 2024
8 tasks
@rraghav-cisco
Copy link
Copy Markdown
Contributor

@vivekverma-arista :
The qos-sai explicitly disables IPv6 as shown by below code in qos/qos_sai_base.py:

1738     @pytest.fixture(scope='class', autouse=True)
1739     def dut_disable_ipv6(self, duthosts, get_src_dst_asic_and_duts, tbinfo, lower_tor_host, # noqa F811
1740                          swapSyncd_on_selected_duts):
1741         for duthost in get_src_dst_asic_and_duts['all_duts']:
1742             docker0_ipv6_addr = \
1743                 duthost.shell("sudo ip -6  addr show dev docker0 | grep global" + " | awk '{print $2}'")[
1744                     "stdout_lines"][0]
1745             duthost.shell("sysctl -w net.ipv6.conf.all.disable_ipv6=1")
1746 
1747         yield
1748 
1749         for duthost in get_src_dst_asic_and_duts['all_duts']:
1750             duthost.shell("sysctl -w net.ipv6.conf.all.disable_ipv6=0")
1751             logger.info("Adding docker0's IPv6 address since it was removed when disabing IPv6")
1752             duthost.shell("ip -6 addr add {} dev docker0".format(docker0_ipv6_addr))
1753             config_reload(duthost, config_source='config_db', safe_reload=True, check_intf_up_ports=True)

So even if minigraph has ipv6 addresses, the new test will fail. Can you pls attach a passing log for this ?

@vivekverma-arista
Copy link
Copy Markdown
Contributor

@vivekverma-arista : The qos-sai explicitly disables IPv6 as shown by below code in qos/qos_sai_base.py:

1738     @pytest.fixture(scope='class', autouse=True)
1739     def dut_disable_ipv6(self, duthosts, get_src_dst_asic_and_duts, tbinfo, lower_tor_host, # noqa F811
1740                          swapSyncd_on_selected_duts):
1741         for duthost in get_src_dst_asic_and_duts['all_duts']:
1742             docker0_ipv6_addr = \
1743                 duthost.shell("sudo ip -6  addr show dev docker0 | grep global" + " | awk '{print $2}'")[
1744                     "stdout_lines"][0]
1745             duthost.shell("sysctl -w net.ipv6.conf.all.disable_ipv6=1")
1746 
1747         yield
1748 
1749         for duthost in get_src_dst_asic_and_duts['all_duts']:
1750             duthost.shell("sysctl -w net.ipv6.conf.all.disable_ipv6=0")
1751             logger.info("Adding docker0's IPv6 address since it was removed when disabing IPv6")
1752             duthost.shell("ip -6 addr add {} dev docker0".format(docker0_ipv6_addr))
1753             config_reload(duthost, config_source='config_db', safe_reload=True, check_intf_up_ports=True)

So even if minigraph has ipv6 addresses, the new test will fail. Can you pls attach a passing log for this ?

Hi @rraghav-cisco, we are skipping the test in master and 202311 #12834

yxieca pushed a commit that referenced this pull request May 23, 2024
What is the motivation for this PR?
The new test is a poorly written IPV6 variant of testQosSaiDscpQueueMapping. It is expected to fail across all platforms/topolgies because qos/test_qos_sai.py cannot support IPV6 variant of any of it's testcase because IPV6 is disabled on the DUT by qos_sai_base.py: https://github.com/sonic-net/sonic-mgmt/blob/master/tests/qos/qos_sai_base.py#L1811-L1826 Also the changes made for this test touch class scoped fixtures which causes all the other testcases to error out as well.

How did you do it?
Revert #10941 as well as the following fixes that were made to get around the issue

Fix qos/test_qos_sai.py #12334
Skip IPV6 variant of testQosSaiDscpQueueMapping if IPV6 is not config… #12834

How did you verify/test it?
Verfied on T0, T1 and T0-dualTor, #126 was not seen.
yxieca pushed a commit that referenced this pull request May 28, 2024
* Revert PR10941 from master

* Removed redundant statment and fixed other pylint errors
mrkcmo pushed a commit to Azarack/sonic-mgmt that referenced this pull request Jul 17, 2024
sonic-net#12980)

* Revert PR10941 from master

* Removed redundant statment and fixed other pylint errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Missing coverage for IPv6 TC to queue mapping

9 participants