Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 50 additions & 25 deletions .azure-pipelines/baseline_test/baseline.test.mgmt.public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,53 +11,78 @@ schedules:
- master
always: true

stages:
parameters:
- name: BUILD_REASON
type: string
default: "BaselineTest"

- stage: Test_round_1
variables:
- name: TEST_PLAN_NUM
type: string
default: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM)

- name: RETRY_TIMES
type: string
default: "0"

- name: TEST_PLAN_STOP_ON_FAILURE
type: string
default: "False"

variables:
- group: SONiC-Elastictest
- name: inventory
value: veos_vtb
- name: testbed_file
value: vtestbed.yaml
- name: BUILD_BRANCH
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
value: $(System.PullRequest.TargetBranch)
${{ else }}:
value: $(Build.SourceBranchName)

stages:

- stage: Test_round_1
jobs:
- template: baseline.test.template.yml
- template: ../pr_test_template.yml
- parameters:
BUILD_REASON: ${{ parameters.BUILD_REASON }}
TEST_PLAN_NUM: ${{ parameters.TEST_PLAN_NUM }}
RETRY_TIMES: ${{ parameters.RETRY_TIMES }}
TEST_PLAN_STOP_ON_FAILURE: ${{ parameters.TEST_PLAN_STOP_ON_FAILURE }}

- stage: Test_round_2
dependsOn:
- Test_round_1
condition: succeededOrFailed('Test_round_1')
variables:
- group: SONiC-Elastictest
- name: inventory
value: veos_vtb
- name: testbed_file
value: vtestbed.yaml
jobs:
- template: baseline.test.template.yml
- template: ../pr_test_template.yml
- parameters:
BUILD_REASON: ${{ parameters.BUILD_REASON }}
TEST_PLAN_NUM: ${{ parameters.TEST_PLAN_NUM }}
RETRY_TIMES: ${{ parameters.RETRY_TIMES }}
TEST_PLAN_STOP_ON_FAILURE: ${{ parameters.TEST_PLAN_STOP_ON_FAILURE }}

- stage: Test_round_3
dependsOn:
- Test_round_2
condition: succeededOrFailed('Test_round_2')
variables:
- group: SONiC-Elastictest
- name: inventory
value: veos_vtb
- name: testbed_file
value: vtestbed.yaml
jobs:
- template: baseline.test.template.yml
- template: ../pr_test_template.yml
- parameters:
BUILD_REASON: ${{ parameters.BUILD_REASON }}
TEST_PLAN_NUM: ${{ parameters.TEST_PLAN_NUM }}
RETRY_TIMES: ${{ parameters.RETRY_TIMES }}
TEST_PLAN_STOP_ON_FAILURE: ${{ parameters.TEST_PLAN_STOP_ON_FAILURE }}

- stage: Test_round_4
dependsOn:
- Test_round_3
condition: succeededOrFailed('Test_round_3')
variables:
- group: SONiC-Elastictest
- name: inventory
value: veos_vtb
- name: testbed_file
value: vtestbed.yaml
jobs:
- template: baseline.test.template.yml
- template: ../pr_test_template.yml
- parameters:
BUILD_REASON: ${{ parameters.BUILD_REASON }}
TEST_PLAN_NUM: ${{ parameters.TEST_PLAN_NUM }}
RETRY_TIMES: ${{ parameters.RETRY_TIMES }}
TEST_PLAN_STOP_ON_FAILURE: ${{ parameters.TEST_PLAN_STOP_ON_FAILURE }}
129 changes: 129 additions & 0 deletions .azure-pipelines/pr_test_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
parameters:
- name: BUILD_REASON
type: string
default: "PullRequest"

- name: TIMEOUT_IN_MINUTES_PR_TEST
type: number
default: 480

- name: MAX_RUN_TEST_MINUTES
type: number
default: 240

- name: TEST_PLAN_NUM
type: string
default: "1"

- name: TEST_PLAN_STOP_ON_FAILURE
type: string
default: "True"

- name: RETRY_TIMES
type: string
default: "2"

jobs:
- job: get_impacted_area
cancelTimeoutInMinutes: 10
displayName: "Get impacted area"
timeoutInMinutes: 240
continueOnError: false
pool: sonic-ubuntu-1c
steps:
- template: impacted_area_testing/get-impacted-area.yml

- job: impacted_area_kvmtest
displayName: " "
cancelTimeoutInMinutes: 10
dependsOn: get_impacted_area
strategy:
matrix:
impacted-area-kvmtest-t0_by_Elastictest:
TESTBED_PREP_TOPOLOGY: t0
CHECKER: t0_checker
TOPOLOGY: t0
impacted-area-kvmtest-t0-2vlans_by_Elastictest:
TESTBED_PREP_TOPOLOGY: t0-2vlans
CHECKER: t0-2vlans_checker
DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a "
TOPOLOGY: t0
impacted-area-kvmtest-t1-lag_by_Elastictest:
TESTBED_PREP_TOPOLOGY: t1
CHECKER: t1_checker
TOPOLOGY: t1-lag
impacted-area-kvmtest-dualtor_by_Elastictest:
TESTBED_PREP_TOPOLOGY: dualtor
CHECKER: dualtor_checker
COMMON_EXTRA_PARAMS: "--disable_loganalyzer --disable_sai_validation "
TOPOLOGY: dualtor
impacted-area-kvmtest-multi-asic-t1_by_Elastictest:
TESTBED_PREP_TOPOLOGY: t1-multi-asic
CHECKER: t1-multi-asic_checker
TOPOLOGY: t1-8-lag
NUM_ASIC: 4
impacted-area-kvmtest-multi-asic-t1_by_Elastictest_optional:
TESTBED_PREP_TOPOLOGY: t1
CHECKER: t1_checker
TOPOLOGY: t1-8-lag
NUM_ASIC: 4
STOP_ON_FAILURE: "False"
impacted-area-kvmtest-t0-sonic_by_Elastictest:
TESTBED_PREP_TOPOLOGY: t0-sonic
CHECKER: t0-sonic_checker
COMMON_EXTRA_PARAMS: "--neighbor_type=sonic --disable_sai_validation "
TOPOLOGY: t0-64-32
VM_TYPE: vsonic
SPECIFIC_PARAM: '[
{"name": "bgp/test_bgp_fact.py", "param": "--neighbor_type=sonic --enable_macsec --macsec_profile=128_SCI,256_XPN_SCI"},
{"name": "macsec", "param": "--neighbor_type=sonic --enable_macsec --macsec_profile=128_SCI,256_XPN_SCI"}
]'
impacted-area-kvmtest-dpu_by_Elastictest:
TESTBED_PREP_TOPOLOGY: dpu
CHECKER: dpu_checker
TOPOLOGY: dpu
SPECIFIC_PARAM: '[
{"name": "dash/test_dash_vnet.py", "param": "--skip_dataplane_checking"}
]'
impacted-area-kvmtest-t2_by_Elastictest_optional:
TESTBED_PREP_TOPOLOGY: t2
CHECKER: t2_checker
TOPOLOGY: t2
STOP_ON_FAILURE: "False"

condition: contains(dependencies.get_impacted_area.outputs['SetVariableTask.PR_CHECKERS'], variables['CHECKER'])
variables:
TEST_SCRIPTS: $[ dependencies.get_impacted_area.outputs['SetVariableTask.TEST_SCRIPTS'] ]
NUM_ASIC: 1
VM_TYPE: ceos
STOP_ON_FAILURE: ${{ parameters.TEST_PLAN_STOP_ON_FAILURE }}
COMMON_EXTRA_PARAMS: "--disable_sai_validation "
DEPLOY_MG_EXTRA_PARAMS: ""
SPECIFIC_PARAM: "[]"
timeoutInMinutes: ${{ parameters.TIMEOUT_IN_MINUTES_PR_TEST }}
continueOnError: false
pool: sonic-ubuntu-1c
steps:
- template: impacted_area_testing/calculate-instance-numbers.yml
parameters:
TOPOLOGY: $(TESTBED_PREP_TOPOLOGY)
BUILD_BRANCH: $(BUILD_BRANCH)

- template: run-test-elastictest-template.yml
parameters:
TOPOLOGY: $(TOPOLOGY)
SCRIPTS: $(SCRIPTS)
MIN_WORKER: $(INSTANCE_NUMBER)
MAX_WORKER: $(INSTANCE_NUMBER)
DEPLOY_MG_EXTRA_PARAMS: $(DEPLOY_MG_EXTRA_PARAMS)
COMMON_EXTRA_PARAMS: $(COMMON_EXTRA_PARAMS)
KVM_IMAGE_BRANCH: $(BUILD_BRANCH)
MGMT_BRANCH: $(BUILD_BRANCH)
BUILD_REASON: ${{ parameters.BUILD_REASON }}
RETRY_TIMES: ${{ parameters.RETRY_TIMES }}
STOP_ON_FAILURE: $(STOP_ON_FAILURE)
TEST_PLAN_NUM: ${{ parameters.TEST_PLAN_NUM }}
NUM_ASIC: $(NUM_ASIC)
VM_TYPE: $(VM_TYPE)
SPECIFIC_PARAM: $(SPECIFIC_PARAM)
MAX_RUN_TEST_MINUTES: ${{ parameters.MAX_RUN_TEST_MINUTES }}
Loading
Loading