parameters: - name: suiteName type: string - name: testOS type: string values: - ubuntu2004 - name: toolset type: string values: - make - name: uhdSrcDir type: string - name: dutMatrix type: object - name: testLength type: string values: - 'smoke' - 'full' - 'stress' - name: uhdArtifactSource type: string default: current - name: xilinxLocation type: string jobs: - job: uhd_streaming_tests_${{ parameters.suiteName }} displayName: uhd streaming tests ${{ parameters.suiteName }} timeoutInMinutes: 300 pool: name: de-dre-lab demands: - suiteName -equals ${{ parameters.suiteName }} strategy: matrix: ${{ parameters.dutMatrix }} workspace: clean: outputs steps: - checkout: self clean: true - checkout: meta-ettus clean: true - script: | if [ "${{ parameters.uhdArtifactSource }}" = "current" ]; then echo '##vso[task.setvariable variable=uhd_artifact_directory]'$(Agent.BuildDirectory) else echo '##vso[task.setvariable variable=uhd_artifact_directory]'$(Agent.BuildDirectory)/${{ parameters.uhdArtifactSource }} fi displayName: Set uhddev 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.dutType, 'x4xx')) - download: ${{ parameters.uhdArtifactSource }} artifact: $(dutEmbeddedImagesArtifact) displayName: Download $(dutEmbeddedImagesArtifact) condition: and(succeeded(), eq(variables.dutType, 'x4xx')) - task: ExtractFiles@1 inputs: archiveFilePatterns: $(uhd_artifact_directory)/$(dutEmbeddedImagesArtifact)/u-boot-jtag-files.zip destinationFolder: $(uhd_artifact_directory)/$(dutEmbeddedImagesArtifact) cleanDestinationFolder: false overwriteExistingFiles: true displayName: Extract JTAG artifact condition: and(succeeded(), eq(variables.dutType, 'x4xx')) - download: ${{ parameters.uhdArtifactSource }} artifact: uhddev-${{ parameters.testOS }}-${{ parameters.toolset }} displayName: Download uhddev-${{ parameters.testOS }}-${{ parameters.toolset }} artifact - task: ExtractFiles@1 inputs: archiveFilePatterns: $(uhd_artifact_directory)/uhddev-${{ parameters.testOS }}-${{ parameters.toolset }}/uhddev-${{ parameters.testOS }}-${{ parameters.toolset }}.tar.gz destinationFolder: $(Build.BinariesDirectory) cleanDestinationFolder: true displayName: Extract uhddev-${{ parameters.testOS }}-${{ parameters.toolset }} artifact - script: | cd $(Agent.TempDirectory) python3 -m venv venv source venv/bin/activate echo '##vso[task.setvariable variable=USRP_EMB_VENV]'$(realpath venv) echo '##vso[task.setvariable variable=USRP_EMB_IMAGE_PATH]'$(uhd_artifact_directory)/$(dutEmbeddedImagesArtifact) echo '##vso[task.setvariable variable=USRP_EMB_FTDI_SERIAL]'$(uartSerial) python3 -m pip install -U pip pip3 install wheel pip3 install --upgrade $(Build.SourcesDirectory)/meta-ettus-dev/contrib/test/usrp_emb displayName: Create usrp_emb venv condition: and(succeeded(), eq(variables.dutType, 'x4xx')) - script: | source ${{ parameters.xilinxLocation }}/settings64.sh source $USRP_EMB_VENV/bin/activate usrp_emb_x4xx_mender_update displayName: Update device using Mender condition: and(succeeded(), eq(variables.dutType, 'x4xx')) - script: | source $USRP_EMB_VENV/bin/activate USRP_EMB_TARGET_IP=$(usrp_emb_x4xx_boot_linux) echo Target IP is $USRP_EMB_TARGET_IP echo '##vso[task.setvariable variable=USRP_EMB_TARGET_IP]'$USRP_EMB_TARGET_IP displayName: Boot target, get mgmt IP condition: and(succeeded(), eq(variables.dutType, 'x4xx')) # Setting the timezone on the embedded device is # required to make the test runtimes to look sane. - script: | export HOST_TIME_ZONE=$(cat /etc/timezone) ssh-keygen -f ~/.ssh/known_hosts -R $USRP_EMB_TARGET_IP ssh -o StrictHostKeyChecking=no -tt root@$USRP_EMB_TARGET_IP "timedatectl set-timezone $HOST_TIME_ZONE" displayName: Set timezone to Host condition: and(succeeded(), eq(variables.dutType, 'x4xx')) - script: | sleep 60 displayName: Wait for device to finish booting condition: and(succeeded(), eq(variables.dutType, 'x4xx')) - 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=$(dutType),fpga=$(dutFPGA)" sleep 60 displayName: Flash FPGA $(dutFPGA) condition: and(succeeded(), eq(variables.dutType, 'x4xx')) - script: | export UHD_IMAGES_DIR=$(Build.BinariesDirectory)/uhddev/build-installed/share/uhd/images $(Build.BinariesDirectory)/uhddev/build-installed/bin/uhd_images_downloader -t b2xx -t fw $(Build.BinariesDirectory)/uhddev/build-installed/bin/uhd_images_downloader -t b210 -t fpga displayName: Download B210 images condition: and(succeeded(), eq(variables.dutType, 'B210')) - script: | export UHD_IMAGES_DIR=$(Build.BinariesDirectory)/uhddev/build-installed/share/uhd/images $(Build.BinariesDirectory)/uhddev/build-installed/bin/uhd_images_downloader -t x310 openFPGALoader -c digilent --ftdi-serial $(jtagSerial) --ftdi-channel 0 $UHD_IMAGES_DIR/usrp_x310_fpga_$(dutFPGA).bit EXITCODE=$? echo "Waiting for device to boot" sleep 30 exit $EXITCODE displayName: Download and update X310 fpga condition: and(succeeded(), eq(variables.dutType, 'X310')) - script: | ssh-keygen -f ~/.ssh/known_hosts -R $USRP_EMB_TARGET_IP ssh -o StrictHostKeyChecking=no -tt root@$USRP_EMB_TARGET_IP "ethtool -A sfp0 tx on" ssh -o StrictHostKeyChecking=no -tt root@$USRP_EMB_TARGET_IP "ethtool -A sfp1 tx on" displayName: Enable Tx Pause Frames on sfp0 and sfp1 condition: and(succeeded(), eq(variables.dutType, 'x4xx'), eq(variables.dutFPGA, 'CG_400')) - script: | cd ${{ parameters.uhdSrcDir }}/host/tests/streaming_performance sudo ./setup.sh --auto sleep 5 displayName: setup interfaces for use without DPDK condition: and(succeeded(), not(eq(variables.dutType, 'x4xx'))) - script: | echo "##[group]Printing Environment" printenv echo "##[endgroup]" set -x cd ${{ parameters.uhdSrcDir }}/host/tests/pytests # Disable creation of __pycache__ files using -B to avoid errors on clean up during next run # as using sudo below creates them with root priveleges. sudo -E LD_LIBRARY_PATH=$LD_LIBRARY_PATH PYTHONPATH=$PYTHONPATH python3 -B -m pytest -s test_streaming.py -m "not dpdk" \ --dut_type $(dutType) --test_length ${{ parameters.testLength }} \ --uhd_build_dir $(Build.BinariesDirectory)/uhddev/build --junitxml $(Common.TestResultsDirectory)/TEST-$(dutName).xml \ --addr $(dutAddr) --second_addr $(dutSecondAddr) --mgmt_addr $(dutMgmtAddr) --name $(dutNameId) \ --num_recv_frames $(dutNumRecvFrames) --num_send_frames $(dutNumSendFrames) env: UHD_CONFIG_FILE: $(config_file) PYTHONPATH: ${{ parameters.uhdSrcDir }}/host/tests/streaming_performance LD_LIBRARY_PATH: $(Build.BinariesDirectory)/uhddev/build-installed/lib UHD_IMAGES_DIR: $(Build.BinariesDirectory)/uhddev/build-installed/share/uhd/images continueOnError: true displayName: Run streaming tests on $(dutName) condition: and(succeeded(), not(eq(variables.dutType, 'x4xx'))) - script: | cd ${{ parameters.uhdSrcDir }}/host/tests/streaming_performance sudo ./setup.sh --auto --dpdk sleep 5 displayName: setup interfaces for use with DPDK condition: and(succeeded(), not(eq(variables.dutType, 'B210'))) - script: | if [ "$(dutFPGA)" = "CG_400" ]; then echo "##vso[task.setvariable variable=config_file]${{ parameters.uhdSrcDir }}/host/tests/pytests/uhd_configs/uhd_dpdk_100GbE.conf" echo "Using 100 GbE UHD Config File" else echo "##vso[task.setvariable variable=config_file]${{ parameters.uhdSrcDir }}/host/tests/pytests/uhd_configs/uhd_dpdk_10GbE.conf" echo "Using 10 GbE UHD Config File" fi displayName: select UHD config file for DPDK - script: | echo "##[group]Printing Environment" printenv echo "##[endgroup]" set -x cd ${{ parameters.uhdSrcDir }}/host/tests/pytests # Disable creation of __pycache__ files using -B to avoid errors on clean up during next run # as using sudo below creates them with root priveleges. sudo -E LD_LIBRARY_PATH=$LD_LIBRARY_PATH PYTHONPATH=$PYTHONPATH python3 -B -m pytest -s test_streaming.py -m "dpdk" \ --dut_type $(dutType) --test_length ${{ parameters.testLength }} \ --uhd_build_dir $(Build.BinariesDirectory)/uhddev/build --junitxml $(Common.TestResultsDirectory)/TEST-$(dutName)-dpdk.xml \ --addr $(dutAddr) --second_addr $(dutSecondAddr) --mgmt_addr $(dutMgmtAddr) --name $(dutNameId) env: UHD_CONFIG_FILE: $(config_file) PYTHONPATH: ${{ parameters.uhdSrcDir }}/host/tests/streaming_performance LD_LIBRARY_PATH: $(Build.BinariesDirectory)/uhddev/build-installed/lib UHD_IMAGES_DIR: $(Build.BinariesDirectory)/uhddev/build-installed/share/uhd/images continueOnError: true displayName: Run streaming tests with DPDK on $(dutName) condition: and(succeeded(), not(eq(variables.dutType, 'B210'))) - task: PublishTestResults@2 inputs: testResultsFormat: 'JUnit' testResultsFiles: '$(Common.TestResultsDirectory)/TEST-*.xml' testRunTitle: $(dutName) streaming tests buildConfiguration: 'Release' mergeTestResults: true failTaskOnFailedTests: false displayName: Upload streaming test results - script: | echo "A previous step failed. See steps with warnings." echo "Marking the overall build status as a failure." exit 1 condition: in(variables['Agent.JobStatus'], 'SucceededWithIssues') displayName: Mark build as failure