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

Add new test for vlan subnet decap #14720

Merged
merged 2 commits into from
Sep 26, 2024

Conversation

xwjiang-ms
Copy link
Contributor

Description of PR

Summary:
Fixes # (issue)

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?

In Azure network, Netscan uses IP-decap to check for route blackholes, but servers do not support decapsulation, making it impossible to perform server-to-server checks. To address this, we developed the subnet decap feature to detect if the link between the server and T0 is functioning properly. Additionally, new test cases are required to ensure the functionality of subnet decap is working as expected.

How did you do it?

Add new test to verify IPinIP packet targeting at VLAN subnet is decapsulated (T0 only)
Ref test gap issue: #13120
Ref test plan: #12990

How did you verify/test it?

Test on broadcom td3 asic and KVM

Any platform specific information?

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

Documentation

"status" "enable" "src_ip" "{}" "src_ip_v6" "{}"'
.format(SUBNET_DECAP_SRC_IP_V4, SUBNET_DECAP_SRC_IP_V6))
rand_selected_dut.shell('sudo config save -y')
rand_selected_dut.shell('sudo config reload -y')
Copy link
Contributor

Choose a reason for hiding this comment

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

better to use config_reload

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

yield
rand_selected_dut.shell('sonic-db-cli CONFIG_DB del "SUBNET_DECAP|subnet_type"')
rand_selected_dut.shell('sudo config save -y')
rand_selected_dut.shell('sudo config reload -y')
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above, use

def config_reload(sonic_host, config_source='config_db', wait=120, start_bgp=True, start_dynamic_buffer=True,
with golden config

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

exp_pkt = build_expected_vlan_subnet_packet(encapsulated_packet, ip_version, stage, decrease_ttl=True)

ptf_target_port = random.choice(downstream_port_ids)
setup_arp_responder(ptfhost, ip_version, stage, ptf_target_port)
Copy link
Contributor

Choose a reason for hiding this comment

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

better to put the arp responder setup/teardown into a fixture.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed


SUBNET_DECAP_SRC_IP_V4 = "20.20.20.0/24"
SUBNET_DECAP_SRC_IP_V6 = "fc01::/120"
OUTER_DST_IP_V4 = "192.168.0.10"
Copy link
Contributor

Choose a reason for hiding this comment

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

This IP is already occupied by the mux server on dualtor testbed, better to use a larger one, like 192.168.0.200

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

logger = logging.getLogger(__name__)

pytestmark = [
pytest.mark.topology('t0', 't1')
Copy link
Contributor

@lolyu lolyu Sep 25, 2024

Choose a reason for hiding this comment

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

this testcase is supposed to run on t0 and dualtor

Copy link
Contributor Author

@xwjiang-ms xwjiang-ms Sep 25, 2024

Choose a reason for hiding this comment

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

Maybe we can add dualtor and do not remove t1, because once we add Verify IPinIP packet targeting at vnet route is decapsulated to this script, it should be run on t1, I have used conditional mark to skip vlan subnet decap test in t1

@xwjiang-ms xwjiang-ms requested a review from lolyu September 25, 2024 07:53
Copy link
Contributor

@lolyu lolyu left a comment

Choose a reason for hiding this comment

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

LGTM

@wangxin wangxin merged commit b1dfa03 into sonic-net:master Sep 26, 2024
16 checks passed
@xwjiang-ms xwjiang-ms deleted the add_subnet_decap_test branch September 26, 2024 05:37
arista-hpandya pushed a commit to arista-hpandya/sonic-mgmt that referenced this pull request Oct 2, 2024
What is the motivation for this PR?
In Azure network, Netscan uses IP-decap to check for route blackholes, but servers do not support decapsulation, making it impossible to perform server-to-server checks. To address this, we developed the subnet decap feature to detect if the link between the server and T0 is functioning properly. Additionally, new test cases are required to ensure the functionality of subnet decap is working as expected.

How did you do it?
Add new test to verify IPinIP packet targeting at VLAN subnet is decapsulated (T0 only)
Ref test gap issue: sonic-net#13120
Ref test plan: sonic-net#12990

How did you verify/test it?
Test on broadcom td3 asic and KVM
hdwhdw pushed a commit to hdwhdw/sonic-mgmt that referenced this pull request Oct 10, 2024
What is the motivation for this PR?
In Azure network, Netscan uses IP-decap to check for route blackholes, but servers do not support decapsulation, making it impossible to perform server-to-server checks. To address this, we developed the subnet decap feature to detect if the link between the server and T0 is functioning properly. Additionally, new test cases are required to ensure the functionality of subnet decap is working as expected.

How did you do it?
Add new test to verify IPinIP packet targeting at VLAN subnet is decapsulated (T0 only)
Ref test gap issue: sonic-net#13120
Ref test plan: sonic-net#12990

How did you verify/test it?
Test on broadcom td3 asic and KVM
vikshaw-Nokia pushed a commit to vikshaw-Nokia/sonic-mgmt that referenced this pull request Oct 23, 2024
What is the motivation for this PR?
In Azure network, Netscan uses IP-decap to check for route blackholes, but servers do not support decapsulation, making it impossible to perform server-to-server checks. To address this, we developed the subnet decap feature to detect if the link between the server and T0 is functioning properly. Additionally, new test cases are required to ensure the functionality of subnet decap is working as expected.

How did you do it?
Add new test to verify IPinIP packet targeting at VLAN subnet is decapsulated (T0 only)
Ref test gap issue: sonic-net#13120
Ref test plan: sonic-net#12990

How did you verify/test it?
Test on broadcom td3 asic and KVM
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.

3 participants