From 13c68f487f0d758f3e403794fbfbd1b503c44b75 Mon Sep 17 00:00:00 2001 From: Grant Meyerhoff Date: Sat, 30 Mar 2024 07:01:44 -0500 Subject: ci: use fpga pipeline artifacts for streaming testing --- .ci/templates/job-uhd-streaming-tests-beauty.yml | 6 ++++ .ci/templates/job-uhd-streaming-tests-x440.yml | 6 ++++ .ci/templates/job-uhd-streaming-tests.yml | 41 +++++++++++++++++++++++- .ci/templates/stages-uhd-pipeline.yml | 4 +++ .ci/uhd-hardware-test-dev.yml | 4 +++ 5 files changed, 60 insertions(+), 1 deletion(-) diff --git a/.ci/templates/job-uhd-streaming-tests-beauty.yml b/.ci/templates/job-uhd-streaming-tests-beauty.yml index b2de2d4a2..4c4fb3466 100644 --- a/.ci/templates/job-uhd-streaming-tests-beauty.yml +++ b/.ci/templates/job-uhd-streaming-tests-beauty.yml @@ -8,6 +8,10 @@ parameters: - name: uhdArtifactSource type: string default: current +- name: uhdFpgaArtifactSource + type: string +- name: fpga_imgs_source + type: string - name: testLength type: string @@ -20,6 +24,8 @@ jobs: toolset: 'make' uhdSrcDir: '${{ parameters.uhdSrcDir }}' uhdArtifactSource: ${{ parameters.uhdArtifactSource }} + uhdFpgaArtifactSource: ${{ parameters.uhdFpgaArtifactSource }} + fpga_imgs_source: ${{ parameters.fpga_imgs_source }} xilinxLocation: /opt/Xilinx/Vivado_Lab/2019.1 dutMatrix: # beauty-N320-0 XG: diff --git a/.ci/templates/job-uhd-streaming-tests-x440.yml b/.ci/templates/job-uhd-streaming-tests-x440.yml index bdcc67f08..265386b26 100644 --- a/.ci/templates/job-uhd-streaming-tests-x440.yml +++ b/.ci/templates/job-uhd-streaming-tests-x440.yml @@ -8,6 +8,10 @@ parameters: - name: uhdArtifactSource type: string default: current +- name: uhdFpgaArtifactSource + type: string +- name: fpga_imgs_source + type: string - name: testLength type: string @@ -21,6 +25,8 @@ jobs: nicType: '100gbe' uhdSrcDir: '${{ parameters.uhdSrcDir }}' uhdArtifactSource: ${{ parameters.uhdArtifactSource }} + uhdFpgaArtifactSource: ${{ parameters.uhdFpgaArtifactSource }} + fpga_imgs_source: ${{ parameters.fpga_imgs_source }} xilinxLocation: /opt/Xilinx/Vivado_Lab/2023.2 dutMatrix: X440-0 CG_400: diff --git a/.ci/templates/job-uhd-streaming-tests.yml b/.ci/templates/job-uhd-streaming-tests.yml index cf8d838bc..f30d55b2e 100644 --- a/.ci/templates/job-uhd-streaming-tests.yml +++ b/.ci/templates/job-uhd-streaming-tests.yml @@ -26,6 +26,10 @@ parameters: - name: uhdArtifactSource type: string default: current +- name: uhdFpgaArtifactSource + type: string +- name: fpga_imgs_source + type: string - name: xilinxLocation type: string @@ -56,17 +60,40 @@ jobs: fi displayName: Set uhddev pipeline artifact location + - script: | + if [ "${{ parameters.uhdFpgaArtifactSource }}" = "current" ]; then + echo '##vso[task.setvariable variable=uhd_fpga_artifact_directory]'$(Agent.BuildDirectory) + else + echo '##vso[task.setvariable variable=uhd_fpga_artifact_directory]'$(Agent.BuildDirectory)/${{ parameters.uhdFpgaArtifactSource }} + fi + displayName: Set uhddev FPGA pipeline artifact location + - script: | rm -rf $(uhd_artifact_directory)/$(dutEmbeddedImagesArtifact) rm -rf $(uhd_artifact_directory)/uhddev-${{ parameters.testOS }}-${{ parameters.toolset }} displayName: Cleanup from prior run condition: and(succeeded(), eq(variables.dutFamily, 'x4xx')) + - script: | + if [ ! -z "${{ parameters.uhdFpgaArtifactSource }}" ]; then + rm -rf $(Agent.BuildDirectory)/${{ parameters.uhdFpgaArtifactSource }} + fi + displayName: Cleanup from prior run + condition: eq('${{ parameters.fpga_imgs_source }}', 'FPGA Pipeline') + - download: ${{ parameters.uhdArtifactSource }} artifact: $(dutEmbeddedImagesArtifact) displayName: Download $(dutEmbeddedImagesArtifact) condition: and(succeeded(), eq(variables.dutFamily, 'x4xx')) + - download: ${{ parameters.uhdFpgaArtifactSource }} + patterns: | + usrp_$(dutType)*.bit + usrp_$(dutType)*.dts + usrp_$(dutType)*.rpt + displayName: Download FPGA artifacts + condition: eq('${{ parameters.fpga_imgs_source }}', 'FPGA Pipeline') + - task: ExtractFiles@1 inputs: archiveFilePatterns: $(uhd_artifact_directory)/$(dutEmbeddedImagesArtifact)/u-boot-jtag-files.zip @@ -129,6 +156,14 @@ jobs: displayName: Wait for device to finish booting condition: and(succeeded(), eq(variables.dutFamily, 'x4xx')) + - script: | + ssh-keygen -f ~/.ssh/known_hosts -R $USRP_EMB_TARGET_IP + scp -o StrictHostKeyChecking=no $(uhd_fpga_artifact_directory)/*/usrp_$(dutType)_* root@$USRP_EMB_TARGET_IP:/usr/share/uhd/images/ + ssh -o StrictHostKeyChecking=no -tt root@$USRP_EMB_TARGET_IP "md5sum /usr/share/uhd/images/usrp_$(dutType)_fpga_$(dutFPGA).bit > /usr/share/uhd/images/usrp_$(dutType)_fpga_$(dutFPGA).bit.md5" + ssh -o StrictHostKeyChecking=no -tt root@$USRP_EMB_TARGET_IP "md5sum /usr/share/uhd/images/usrp_$(dutType)_fpga_$(dutFPGA).dts > /usr/share/uhd/images/usrp_$(dutType)_fpga_$(dutFPGA).dts.md5" + displayName: Copy FPGA pipeline images to device + condition: and(succeeded(), eq(variables.dutFamily, 'x4xx'), eq('${{ parameters.fpga_imgs_source }}', 'FPGA Pipeline')) + - script: | ssh-keygen -f ~/.ssh/known_hosts -R $USRP_EMB_TARGET_IP ssh -o StrictHostKeyChecking=no -tt root@$USRP_EMB_TARGET_IP "uhd_image_loader --args addr=localhost,type=$(dutFamily),fpga=$(dutFPGA)" @@ -147,7 +182,11 @@ jobs: - script: | export UHD_IMAGES_DIR=$(Build.BinariesDirectory)/uhddev/build-installed/share/uhd/images - $(Build.BinariesDirectory)/uhddev/build-installed/bin/uhd_images_downloader -t x310 + if [ "${{ parameters.fpga_imgs_source }}" = "FPGA Pipeline" ]; then + cp $(uhd_fpga_artifact_directory)/*/* $(Build.BinariesDirectory)/uhddev/build-installed/share/uhd/images/ + else + $(Build.BinariesDirectory)/uhddev/build-installed/bin/uhd_images_downloader -t x310 + fi openFPGALoader -c digilent --ftdi-serial $(jtagSerial) --ftdi-channel 0 $UHD_IMAGES_DIR/usrp_x310_fpga_$(dutFPGA).bit EXITCODE=$? echo "Waiting for device to boot" diff --git a/.ci/templates/stages-uhd-pipeline.yml b/.ci/templates/stages-uhd-pipeline.yml index de47c4310..933491970 100644 --- a/.ci/templates/stages-uhd-pipeline.yml +++ b/.ci/templates/stages-uhd-pipeline.yml @@ -518,9 +518,13 @@ stages: parameters: testOS: ubuntu2004 uhdSrcDir: $(Build.SourcesDirectory)/uhddev + uhdFpgaArtifactSource: uhd_fpga_pipeline + fpga_imgs_source: ${{ parameters.fpga_imgs_source }} testLength: ${{ parameters.testLength }} - template: job-uhd-streaming-tests-x440.yml parameters: testOS: ubuntu2204 uhdSrcDir: $(Build.SourcesDirectory)/uhddev + uhdFpgaArtifactSource: uhd_fpga_pipeline + fpga_imgs_source: ${{ parameters.fpga_imgs_source }} testLength: ${{ parameters.testLength }} diff --git a/.ci/uhd-hardware-test-dev.yml b/.ci/uhd-hardware-test-dev.yml index deba1a674..1883745b1 100644 --- a/.ci/uhd-hardware-test-dev.yml +++ b/.ci/uhd-hardware-test-dev.yml @@ -120,6 +120,8 @@ stages: testOS: ubuntu2004 uhdSrcDir: $(Build.SourcesDirectory)/uhddev uhdArtifactSource: uhd_mono_pipeline + uhdFpgaArtifactSource: uhd_fpga_pipeline + fpga_imgs_source: ${{ parameters.fpga_imgs_source }} testLength: ${{ parameters.testLength }} - stage: test_x440_streaming_stage @@ -132,6 +134,8 @@ stages: testOS: ubuntu2204 uhdSrcDir: $(Build.SourcesDirectory)/uhddev uhdArtifactSource: uhd_mono_pipeline + uhdFpgaArtifactSource: uhd_fpga_pipeline + fpga_imgs_source: ${{ parameters.fpga_imgs_source }} testLength: ${{ parameters.testLength }} - stage: test_uhd_devtest -- cgit v1.2.3-59-g8ed1b