Skip to content

[CI] Enhance elastictest template and test_plan.py#15618

Merged
wangxin merged 11 commits intosonic-net:masterfrom
lerry-lee:chunangli/enhance_test_template
Dec 6, 2024
Merged

[CI] Enhance elastictest template and test_plan.py#15618
wangxin merged 11 commits intosonic-net:masterfrom
lerry-lee:chunangli/enhance_test_template

Conversation

@lerry-lee
Copy link
Copy Markdown
Contributor

@lerry-lee lerry-lee commented Nov 19, 2024

Description of PR

[CI] Enhance elastictest template and test_plan.py, fix az token issue

  • Use bash script instead azcli task for safe and stable triggerring.
  • Enhance azlogin and get token logic to fix token expiration issue.
  • Remove dump-kvm param since it was deprecated so long and other code readability optimization.

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?

[CI] Enhance elastictest template and test_plan.py, fix az token issue

How did you do it?

  • Use bash script instead azcli task for safe and stable triggerring.
  • Enhance azlogin and get token logic to fix token expiration issue.
  • Remove dump-kvm param since it was deprecated so long and other code readability optimization.

How did you verify/test it?

PR test passed.

Any platform specific information?

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

Documentation

…improve and fix azlogin and get token when requesting APIs

Signed-off-by: Chun'ang Li <[email protected]>
Signed-off-by: Chun'ang Li <[email protected]>
Signed-off-by: Chun'ang Li <[email protected]>
Signed-off-by: Chun'ang Li <[email protected]>
Signed-off-by: Chun'ang Li <[email protected]>
…assignment does not take effect immediately for the conditional statement of pipeline yaml, the expected value of MGMT_BRANCH cannot be obtained, and the locally updated testplan.py cannot be used.

Signed-off-by: Chun'ang Li <[email protected]>
Signed-off-by: Chun'ang Li <[email protected]>
Signed-off-by: Chun'ang Li <[email protected]>
@lerry-lee lerry-lee requested a review from wangxin December 5, 2024 09:00
@lerry-lee lerry-lee marked this pull request as ready for review December 5, 2024 09:00
@wangxin
Copy link
Copy Markdown
Collaborator

wangxin commented Dec 5, 2024

LGTM. Can you improve the PR description to have full information like motivation and hows? Maybe also some background about the resubmission.

@lerry-lee
Copy link
Copy Markdown
Contributor Author

LGTM. Can you improve the PR description to have full information like motivation and hows? Maybe also some background about the resubmission.

Sure, will update.

@wangxin wangxin merged commit f18a81c into sonic-net:master Dec 6, 2024
yejianquan pushed a commit that referenced this pull request Dec 9, 2024
…est_plan.py (#15950)

Description of PR
[CI]Fix retry_cases_include and retry_cases_exclude not passing down. It was caused by my another PR: [CI] Enhance elastictest template and test_plan.py #15618
Remove unused param.

Signed-off-by: Chun'ang Li <[email protected]>
StormLiangMS pushed a commit that referenced this pull request Oct 31, 2025
What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by #12978 using set -o and failure counter, but set -o was changed back by #15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image
dcaugher pushed a commit to dcaugher/sonic-mgmt that referenced this pull request Nov 12, 2025
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image
dcaugher pushed a commit to dcaugher/sonic-mgmt that referenced this pull request Nov 12, 2025
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image
vikumarks pushed a commit to vikumarks/sonic-mgmt that referenced this pull request Dec 1, 2025
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image

Signed-off-by: vikumarks <[email protected]>
albertovillarreal-keys pushed a commit to albertovillarreal-keys/sonic-mgmt that referenced this pull request Dec 2, 2025
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image

Signed-off-by: Alberto Villarreal <[email protected]>
opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 2025
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image

Signed-off-by: opcoder0 <[email protected]>
selldinesh pushed a commit to selldinesh/sonic-mgmt that referenced this pull request Dec 11, 2025
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image

Signed-off-by: selldinesh <[email protected]>
echuawu pushed a commit to echuawu/sonic-mgmt that referenced this pull request Dec 12, 2025
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image
saravanan-nexthop pushed a commit to saravanan-nexthop/sonic-mgmt that referenced this pull request Dec 15, 2025
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image

Signed-off-by: Saravanan <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 16, 2025
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image

Signed-off-by: Guy Shemesh <[email protected]>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Dec 16, 2025
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image

Signed-off-by: Aharon Malkin <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 2025
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image

Signed-off-by: Guy Shemesh <[email protected]>
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Jan 13, 2026
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image
yifan-nexthop pushed a commit to nexthop-ai/sonic-mgmt that referenced this pull request Jan 14, 2026
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image

Signed-off-by: YiFan Wang <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image

Signed-off-by: Guy Shemesh <[email protected]>
lakshmi-nexthop pushed a commit to lakshmi-nexthop/sonic-mgmt that referenced this pull request Jan 28, 2026
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image

Signed-off-by: Lakshmi Yarramaneni <[email protected]>
ytzur1 pushed a commit to ytzur1/sonic-mgmt that referenced this pull request Jan 29, 2026
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image
ytzur1 pushed a commit to ytzur1/sonic-mgmt that referenced this pull request Feb 2, 2026
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image

Signed-off-by: Yael Tzur <[email protected]>
abhishek-nexthop pushed a commit to nexthop-ai/sonic-mgmt that referenced this pull request Feb 6, 2026
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image
rraghav-cisco pushed a commit to rraghav-cisco/sonic-mgmt that referenced this pull request Feb 13, 2026
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image

Signed-off-by: Raghavendran Ramanathan <[email protected]>
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Mar 27, 2026
…#21138)

What is the motivation for this PR?
When we use TEST_PLAN_NUM and .azure-pipelines/run-test-elastictest-template.yml to create a batch of test plans, if 1 test plan fails, the others will be cancelled because test_plan.py will raise exception then run sys.exit. Previously this issue was fixed by sonic-net#12978 using set -o and failure counter, but set -o was changed back by sonic-net#15618.

How did you do it?
Change set -e back to set -o to make failure counter work again.

How did you verify/test it?
Verified in pipeline https://dev.azure.com/mssonic/build/_build/results?buildId=971751&view=logs&j=9657d7a6-3fe9-53eb-d67f-701685efa9c8&t=316819a7-603a-55dc-2941-0b950b5989c2
image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants