Skip to content

Commit 4832ead

Browse files
Merge master
2 parents e45042d + c03aec5 commit 4832ead

File tree

274 files changed

+18583
-2808
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+18583
-2808
lines changed

.azure-pipelines/baseline_test/baseline.test.mgmt.public.master.yml

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,73 +12,52 @@ schedules:
1212
always: true
1313

1414
stages:
15-
- stage: Pre_test
16-
variables:
17-
- group: GIT_SECRETS
18-
jobs:
19-
- job: validate_test_cases
20-
displayName: "Validate Test Cases"
21-
timeoutInMinutes: 20
22-
continueOnError: false
23-
pool: ubuntu-20.04
24-
steps:
25-
- template: ../pytest-collect-only.yml
2615

2716
- stage: Test_round_1
28-
dependsOn:
29-
- Pre_test
30-
condition: succeeded('Pre_test')
3117
variables:
3218
- group: SONiC-Elastictest
3319
- name: inventory
3420
value: veos_vtb
3521
- name: testbed_file
3622
value: vtestbed.yaml
37-
- group: GIT_SECRETS
3823
jobs:
3924
- template: baseline.test.template.yml
4025

4126
- stage: Test_round_2
4227
dependsOn:
43-
- Pre_test
4428
- Test_round_1
45-
condition: and(succeeded('Pre_test'), succeededOrFailed('Test_round_1'))
29+
condition: succeededOrFailed('Test_round_1')
4630
variables:
4731
- group: SONiC-Elastictest
4832
- name: inventory
4933
value: veos_vtb
5034
- name: testbed_file
5135
value: vtestbed.yaml
52-
- group: GIT_SECRETS
5336
jobs:
5437
- template: baseline.test.template.yml
5538

5639
- stage: Test_round_3
5740
dependsOn:
58-
- Pre_test
5941
- Test_round_2
60-
condition: and(succeeded('Pre_test'), succeededOrFailed('Test_round_2'))
42+
condition: succeededOrFailed('Test_round_2')
6143
variables:
6244
- group: SONiC-Elastictest
6345
- name: inventory
6446
value: veos_vtb
6547
- name: testbed_file
6648
value: vtestbed.yaml
67-
- group: GIT_SECRETS
6849
jobs:
6950
- template: baseline.test.template.yml
7051

7152
- stage: Test_round_4
7253
dependsOn:
73-
- Pre_test
7454
- Test_round_3
75-
condition: and(succeeded('Pre_test'), succeededOrFailed('Test_round_3'))
55+
condition: succeededOrFailed('Test_round_3')
7656
variables:
7757
- group: SONiC-Elastictest
7858
- name: inventory
7959
value: veos_vtb
8060
- name: testbed_file
8161
value: vtestbed.yaml
82-
- group: GIT_SECRETS
8362
jobs:
8463
- template: baseline.test.template.yml

.azure-pipelines/pr_test_scripts.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,9 @@ dpu:
269269

270270
onboarding_t0:
271271
- console/test_console_availability.py
272+
- platform_tests/test_power_off_reboot.py
273+
- platform_tests/test_sequential_restart.py
274+
- platform_tests/test_xcvr_info_in_db.py
272275

273276

274277
specific_param:

.azure-pipelines/run-test-elastictest-template.yml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,11 @@ steps:
159159
160160
# Else, internal build image repo, download from internal sonic-mgmt repo
161161
else
162-
curl -u $(AZP_REPO_ACCESS_TOKEN) "${{ parameters.MGMT_URL }}&commitOrBranch=${{ parameters.MGMT_BRANCH }}&api-version=5.0-preview.1&path=.azure-pipelines%2Fpr_test_scripts.yaml" -o ./.azure-pipelines/pr_test_scripts.yaml
162+
if [ -z "$(MSSONIC-TOKEN)" ]; then
163+
curl -u $(AZP_REPO_ACCESS_TOKEN) "${{ parameters.MGMT_URL }}&commitOrBranch=${{ parameters.MGMT_BRANCH }}&api-version=5.0-preview.1&path=.azure-pipelines%2Fpr_test_scripts.yaml" -o ./.azure-pipelines/pr_test_scripts.yaml
164+
else
165+
curl -u :$(MSSONIC-TOKEN) "${{ parameters.MGMT_URL }}&commitOrBranch=${{ parameters.MGMT_BRANCH }}&api-version=5.0-preview.1&path=.azure-pipelines%2Fpr_test_scripts.yaml" -o ./.azure-pipelines/pr_test_scripts.yaml
166+
fi
163167
fi
164168
displayName: "Download pr script"
165169
- ${{ else }}:
@@ -227,11 +231,12 @@ steps:
227231
displayName: "Trigger test"
228232
229233
- script: |
230-
set -e
234+
set -o
231235
echo "Lock testbed"
232236
233237
echo -e "\033[33mSONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com \033[0m"
234238
IFS=',' read -ra TEST_PLAN_ID_LIST <<< "$TEST_PLAN_ID_LIST_STRING"
239+
failure_count=0
235240
for TEST_PLAN_ID in "${TEST_PLAN_ID_LIST[@]}"
236241
do
237242
echo -e -n "\033[33mPlease visit Elastictest page \033[0m"
@@ -240,17 +245,27 @@ steps:
240245
# When "LOCK_TESTBED" finish, it changes into "PREPARE_TESTBED"
241246
echo "[test_plan.py] poll LOCK_TESTBED status"
242247
python ./.azure-pipelines/test_plan.py poll -i $TEST_PLAN_ID --expected-state LOCK_TESTBED
248+
RET=$?
249+
if [ $RET -ne 0 ]; then
250+
((failure_count++))
251+
fi
243252
done
244253
254+
if [ $failure_count -eq ${#TEST_PLAN_ID_LIST[@]} ]; then
255+
echo "All testplan failed, cancel following steps"
256+
exit 3
257+
fi
258+
245259
displayName: "Lock testbed"
246260
247261
- script: |
248-
set -e
262+
set -o
249263
echo "Prepare testbed"
250264
echo "Preparing the testbed(add-topo, deploy-mg) may take 15-30 minutes. Before the testbed is ready, the progress of the test plan keeps displayed as 0, please be patient"
251265
252266
echo -e "\033[33mSONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com \033[0m"
253267
IFS=',' read -ra TEST_PLAN_ID_LIST <<< "$TEST_PLAN_ID_LIST_STRING"
268+
failure_count=0
254269
for TEST_PLAN_ID in "${TEST_PLAN_ID_LIST[@]}"
255270
do
256271
echo -e -n "\033[33mPlease visit Elastictest page \033[0m"
@@ -259,16 +274,26 @@ steps:
259274
# When "PREPARE_TESTBED" finish, it changes into "EXECUTING"
260275
echo "[test_plan.py] poll PREPARE_TESTBED status"
261276
python ./.azure-pipelines/test_plan.py poll -i $TEST_PLAN_ID --expected-state PREPARE_TESTBED
277+
RET=$?
278+
if [ $RET -ne 0 ]; then
279+
((failure_count++))
280+
fi
262281
done
263282
283+
if [ "$failure_count" -eq ${#TEST_PLAN_ID_LIST[@]} ]; then
284+
echo "All testplan failed, cancel following steps"
285+
exit 3
286+
fi
287+
264288
displayName: "Prepare testbed"
265289
266290
- script: |
267-
set -e
291+
set -o
268292
echo "Run test"
269293
270294
echo -e "\033[33mSONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com \033[0m"
271295
IFS=',' read -ra TEST_PLAN_ID_LIST <<< "$TEST_PLAN_ID_LIST_STRING"
296+
failure_count=0
272297
for TEST_PLAN_ID in "${TEST_PLAN_ID_LIST[@]}"
273298
do
274299
echo -e -n "\033[33mPlease visit Elastictest page \033[0m"
@@ -277,8 +302,17 @@ steps:
277302
# When "EXECUTING" finish, it changes into "KVMDUMP", "FAILED", "CANCELLED" or "FINISHED"
278303
echo "[test_plan.py] poll EXECUTING status"
279304
python ./.azure-pipelines/test_plan.py poll -i $TEST_PLAN_ID --expected-state EXECUTING --expected-result ${{ parameters.EXPECTED_RESULT }}
305+
RET=$?
306+
if [ $RET -ne 0 ]; then
307+
((failure_count++))
308+
fi
280309
done
281310
311+
if [ $failure_count -eq ${#TEST_PLAN_ID_LIST[@]} ]; then
312+
echo "All testplan failed, cancel following steps"
313+
exit 3
314+
fi
315+
282316
displayName: "Run test"
283317
timeoutInMinutes: ${{ parameters.MAX_RUN_TEST_MINUTES }}
284318

0 commit comments

Comments
 (0)