2020-11-26 06:18:25 -06:00
|
|
|
# Starter pipeline
|
|
|
|
# Start with a minimal pipeline that you can customize to build and deploy your code.
|
|
|
|
# Add steps that build, run tests, deploy, and more:
|
|
|
|
# https://aka.ms/yaml
|
|
|
|
|
|
|
|
trigger:
|
2021-01-26 17:42:04 -06:00
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- master
|
|
|
|
- 202012
|
2021-02-03 12:17:13 -06:00
|
|
|
paths:
|
|
|
|
exclude:
|
|
|
|
- .github
|
2020-11-26 06:18:25 -06:00
|
|
|
|
2021-01-07 21:50:11 -06:00
|
|
|
pr:
|
2021-02-03 12:17:13 -06:00
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- master
|
2021-04-22 10:36:25 -05:00
|
|
|
- 202012
|
2021-02-03 12:17:13 -06:00
|
|
|
paths:
|
|
|
|
exclude:
|
|
|
|
- .github
|
2020-11-26 06:18:25 -06:00
|
|
|
|
2021-01-07 21:50:11 -06:00
|
|
|
name: $(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
|
2020-11-26 06:18:25 -06:00
|
|
|
|
2021-01-07 21:50:11 -06:00
|
|
|
resources:
|
|
|
|
repositories:
|
|
|
|
- repository: sonic-mgmt
|
|
|
|
type: github
|
|
|
|
name: Azure/sonic-mgmt
|
|
|
|
endpoint: build
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- stage: Build
|
|
|
|
pool: sonicbld
|
2021-04-19 20:15:00 -05:00
|
|
|
variables:
|
|
|
|
CACHE_MODE: rcache
|
|
|
|
${{ if eq(variables['Build.SourceBranchName'], '202012') }}:
|
|
|
|
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web'
|
2021-01-07 21:50:11 -06:00
|
|
|
jobs:
|
2021-04-19 20:15:00 -05:00
|
|
|
- template: .azure-pipelines/azure-pipelines-build.yml
|
2021-02-12 01:34:05 -06:00
|
|
|
parameters:
|
2021-04-19 20:15:00 -05:00
|
|
|
buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) ${{ variables.VERSION_CONTROL_OPTIONS }}'
|
|
|
|
jobFilters:
|
|
|
|
- vs
|
|
|
|
- broadcom
|
|
|
|
- mellanox
|
2021-01-07 21:50:11 -06:00
|
|
|
|
|
|
|
- stage: Test
|
|
|
|
variables:
|
|
|
|
- name: inventory
|
|
|
|
value: veos_vtb
|
|
|
|
- name: testbed_file
|
|
|
|
value: vtestbed.csv
|
|
|
|
|
|
|
|
jobs:
|
2021-01-24 23:01:19 -06:00
|
|
|
- job:
|
2021-01-31 21:47:10 -06:00
|
|
|
pool: sonictest
|
2021-01-24 23:01:19 -06:00
|
|
|
displayName: "vstest"
|
|
|
|
timeoutInMinutes: 60
|
|
|
|
steps:
|
|
|
|
- checkout: self
|
2021-01-31 21:47:10 -06:00
|
|
|
clean: true
|
2021-01-24 23:01:19 -06:00
|
|
|
submodules: recursive
|
|
|
|
displayName: 'Checkout code'
|
|
|
|
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
inputs:
|
|
|
|
source: specific
|
|
|
|
project: build
|
|
|
|
pipeline: 9
|
|
|
|
artifacts: sonic-swss-common.amd64.ubuntu20_04
|
|
|
|
runVersion: 'latestFromBranch'
|
|
|
|
runBranch: 'refs/heads/master'
|
|
|
|
displayName: "Download sonic swss common deb packages"
|
|
|
|
|
2021-01-27 21:58:58 -06:00
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
inputs:
|
2021-02-12 01:34:05 -06:00
|
|
|
artifact: sonic-buildimage.vs
|
|
|
|
displayName: "Download sonic-buildimage.vs artifact"
|
2021-01-27 21:58:58 -06:00
|
|
|
|
2021-01-24 23:01:19 -06:00
|
|
|
- script: |
|
2021-01-27 21:58:58 -06:00
|
|
|
set -x
|
2021-01-24 23:01:19 -06:00
|
|
|
sudo dpkg -i --force-confask,confnew ../sonic-swss-common.amd64.ubuntu20_04/libswsscommon_1.0.0_amd64.deb
|
|
|
|
sudo dpkg -i ../sonic-swss-common.amd64.ubuntu20_04/python3-swsscommon_1.0.0_amd64.deb
|
2021-01-27 21:58:58 -06:00
|
|
|
sudo docker load -i ../target/docker-sonic-vs.gz
|
2021-01-24 23:01:19 -06:00
|
|
|
docker tag docker-sonic-vs:latest docker-sonic-vs:$(Build.BuildNumber)
|
|
|
|
username=$(id -un)
|
|
|
|
|
|
|
|
trap "docker ps; docker images; ip netns list; \
|
|
|
|
docker rmi docker-sonic-vs:$(Build.BuildNumber); \
|
|
|
|
ip netns list | grep -E [-]srv[0-9]+ | awk '{print $1}' | xargs -I {} sudo ip netns delete {}; \
|
2021-01-25 21:05:01 -06:00
|
|
|
sudo chown -R ${username}.${username} .; \
|
|
|
|
sudo chown -R ${username}.${username} $(System.DefaultWorkingDirectory)" EXIT
|
2021-01-24 23:01:19 -06:00
|
|
|
pushd platform/vs/tests
|
2021-01-27 21:58:58 -06:00
|
|
|
sudo py.test -v --junitxml=tr.xml --imgname=docker-sonic-vs:$(Build.BuildNumber)
|
2021-01-24 23:01:19 -06:00
|
|
|
displayName: "Run vs tests"
|
|
|
|
|
|
|
|
- task: PublishTestResults@2
|
|
|
|
inputs:
|
|
|
|
testResultsFiles: '**/tr.xml'
|
|
|
|
testRunTitle: vstest
|
|
|
|
|
2021-01-07 21:50:11 -06:00
|
|
|
- job:
|
2021-01-31 21:47:10 -06:00
|
|
|
pool: sonictest
|
|
|
|
displayName: "kvmtest-t0"
|
2021-01-07 21:50:11 -06:00
|
|
|
timeoutInMinutes: 240
|
2021-01-31 21:47:10 -06:00
|
|
|
|
2021-01-07 21:50:11 -06:00
|
|
|
steps:
|
2021-01-31 21:47:10 -06:00
|
|
|
- template: .azure-pipelines/run-test-template.yml
|
|
|
|
parameters:
|
|
|
|
dut: vlab-01
|
|
|
|
tbname: vms-kvm-t0
|
|
|
|
ptf_name: ptf_vms6-1
|
|
|
|
tbtype: t0
|
2021-01-27 21:58:58 -06:00
|
|
|
|
2021-01-31 21:47:10 -06:00
|
|
|
- job:
|
|
|
|
pool: sonictest-t1-lag
|
|
|
|
displayName: "kvmtest-t1-lag"
|
|
|
|
timeoutInMinutes: 240
|
2021-01-07 21:50:11 -06:00
|
|
|
|
2021-01-31 21:47:10 -06:00
|
|
|
steps:
|
|
|
|
- template: .azure-pipelines/run-test-template.yml
|
|
|
|
parameters:
|
|
|
|
dut: vlab-03
|
|
|
|
tbname: vms-kvm-t1-lag
|
|
|
|
ptf_name: ptf_vms6-2
|
|
|
|
tbtype: t1-lag
|