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

Disable proxy for POST requests to PTF #15067

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

AkeelAli
Copy link
Contributor

Description of PR

Summary: Ensures no proxy is used when sending HTTP POST requests to PTF in bgp tests even if proxy variables are set in the environment.

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?

Tests that make HTTP POST requests to PTFIP:exabgpPort for bgp updates were failing when proxy variables were set in the environment (gateway timeout 504). Workaround had been to unset these variables before starting the tests. This PR fixes the test scripts such that they don't use the env proxy when making such HTTP requests.

How did you do it?

Explicitly set the proxies to None when making post requests to ignore the corresponding environment variables.

Precedent for this change exists: https://github.com/sonic-net/sonic-mgmt/blob/master/ansible/library/announce_routes.py#L163

How did you verify/test it?

Following tests passed with the change despite the presence of proxy variables in the sonic-mgmt container environment (tested on DUT Cisco 8101):

  • test_bgp_update_timer.py
  • test_bgp_sentinel.py
  • test_bgp_bbr.py
  • test_bgp_speaker.py
  • test_route_flap.py
  • test_bgp_dual_asn.py

Any platform specific information?

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

Documentation

Copy link
Contributor

@bpar9 bpar9 left a comment

Choose a reason for hiding this comment

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

lgtm

@kevinskwang
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AkeelAli
Copy link
Contributor Author

AkeelAli commented Nov 5, 2024

Hi @kevinskwang @StormLiangMS, do we need anything else to get this merged and backported to 202405?

@StormLiangMS StormLiangMS merged commit e5df7c9 into sonic-net:master Nov 15, 2024
16 checks passed
sreejithsreekumaran pushed a commit to sreejithsreekumaran/sonic-mgmt that referenced this pull request Nov 15, 2024
What is the motivation for this PR?
Tests that make HTTP POST requests to PTFIP:exabgpPort for bgp updates were failing when proxy variables were set in the environment (gateway timeout 504). Workaround had been to unset these variables before starting the tests. This PR fixes the test scripts such that they don't use the env proxy when making such HTTP requests.

How did you do it?
Explicitly set the proxies to None when making post requests to ignore the corresponding environment variables.

Precedent for this change exists: https://github.com/sonic-net/sonic-mgmt/blob/master/ansible/library/announce_routes.py#L163

How did you verify/test it?
Following tests passed with the change despite the presence of proxy variables in the sonic-mgmt container environment (tested on DUT Cisco 8101):

test_bgp_update_timer.py
test_bgp_sentinel.py
test_bgp_bbr.py
test_bgp_speaker.py
test_route_flap.py
test_bgp_dual_asn.py
@mssonicbld
Copy link
Collaborator

@AkeelAli PR conflicts with 202405 branch

yejianquan pushed a commit that referenced this pull request Nov 21, 2024
Description of PR
Summary: Resolves conflict for #15067 into 202405

co-authorized by: [email protected]
yutongzhang-microsoft pushed a commit to yutongzhang-microsoft/sonic-mgmt that referenced this pull request Nov 21, 2024
What is the motivation for this PR?
Tests that make HTTP POST requests to PTFIP:exabgpPort for bgp updates were failing when proxy variables were set in the environment (gateway timeout 504). Workaround had been to unset these variables before starting the tests. This PR fixes the test scripts such that they don't use the env proxy when making such HTTP requests.

How did you do it?
Explicitly set the proxies to None when making post requests to ignore the corresponding environment variables.

Precedent for this change exists: https://github.com/sonic-net/sonic-mgmt/blob/master/ansible/library/announce_routes.py#L163

How did you verify/test it?
Following tests passed with the change despite the presence of proxy variables in the sonic-mgmt container environment (tested on DUT Cisco 8101):

test_bgp_update_timer.py
test_bgp_sentinel.py
test_bgp_bbr.py
test_bgp_speaker.py
test_route_flap.py
test_bgp_dual_asn.py
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.

7 participants