From 5324ce8a4d9d2e8462b6c5a0ad23e63f2ff55c57 Mon Sep 17 00:00:00 2001 From: SuvarnaMeenakshi <50386592+SuvarnaMeenakshi@users.noreply.github.com> Date: Fri, 24 Sep 2021 11:14:43 -0700 Subject: [PATCH] [azure-pipeline][multi-asic]: Add azure pipeline script to generate multi asic vs image (#8215) Why I did it To be able to run VS test on official multi asic VS image. How I did it Add a new script to build multi-asic VS image by passing NUM_ASIC build parameter. Rung multi-asic t1-lag test cases with the built image. --- .../official-build-multi-asic.yml | 51 +++++++++++++++++++ .azure-pipelines/run-test-template.yml | 9 +++- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 .azure-pipelines/official-build-multi-asic.yml diff --git a/.azure-pipelines/official-build-multi-asic.yml b/.azure-pipelines/official-build-multi-asic.yml new file mode 100644 index 0000000000..d220ecc347 --- /dev/null +++ b/.azure-pipelines/official-build-multi-asic.yml @@ -0,0 +1,51 @@ +# 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 + +schedules: +- cron: "0 18 * * Sun,Wed,Fri" + displayName: "Alternate day build" + branches: + include: + - master + always: true + +trigger: none +pr: none + +stages: +- stage: Build + pool: sonicbld + variables: + CACHE_MODE: wcache + ${{ if eq(variables['Build.SourceBranchName'], '202012') }}: + VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web' + jobs: + - template: azure-pipelines-build.yml + parameters: + buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) BUILD_MULTIASIC_KVM=y ${{ variables.VERSION_CONTROL_OPTIONS }}' + jobGroups: + - name: vs + +- stage: Test + variables: + - name: inventory + value: veos_vtb + - name: testbed_file + value: vtestbed.csv + + jobs: + - job: + pool: sonictest + displayName: "kvmtest-multi-asic-t1-lag" + timeoutInMinutes: 240 + + steps: + - template: run-test-template.yml + parameters: + dut: vlab-08 + tbname: vms-kvm-four-asic-t1-lag + ptf_name: ptf_vms6-4 + tbtype: multi-asic-t1-lag + image: sonic-4asic-vs.img.gz diff --git a/.azure-pipelines/run-test-template.yml b/.azure-pipelines/run-test-template.yml index 071286d0fb..d490873d15 100644 --- a/.azure-pipelines/run-test-template.yml +++ b/.azure-pipelines/run-test-template.yml @@ -7,6 +7,13 @@ parameters: type: string - name: ptf_name type: string +- name: image + type: string + default: sonic-vs.img.gz + values: + - sonic-vs.img.gz + - sonic-4asic-vs.img.gz + - sonic-6asic-vs.img.gz steps: - checkout: self @@ -21,7 +28,7 @@ steps: - script: | set -x sudo mkdir -p /data/sonic-vm/images - sudo cp -v ../target/sonic-vs.img.gz /data/sonic-vm/images/sonic-vs.img.gz + sudo cp -v ../target/${{ parameters.image}} /data/sonic-vm/images/sonic-vs.img.gz sudo gzip -fd /data/sonic-vm/images/sonic-vs.img.gz username=$(id -un) sudo chown -R $username.$username /data/sonic-vm