From efab53130dd569c92c0b0cc6adeb36a150902624 Mon Sep 17 00:00:00 2001 From: Matthew Crymble Date: Mon, 2 May 2022 10:48:50 -0500 Subject: tests: streaming: pass the correct LD_LIBRARY_PATH to pytest We need to run the DPDK streaming tests with elevated permissions, but using sudo clears the environment before running. This prevented the streaming tests from accessing the libuhd binaries. --- .ci/templates/job-uhd-streaming-tests.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.ci/templates/job-uhd-streaming-tests.yml b/.ci/templates/job-uhd-streaming-tests.yml index 8d5d72b3e..d0caf5a7a 100644 --- a/.ci/templates/job-uhd-streaming-tests.yml +++ b/.ci/templates/job-uhd-streaming-tests.yml @@ -154,9 +154,14 @@ jobs: 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 --preserve-env=PYTHONPATH python3 -B -m pytest -s test_streaming.py -m "dpdk" --dut_type $(dutType) --test_length ${{ parameters.testLength }} \ - --addr $(dutAddr) --second_addr $(dutSecondAddr) --mgmt_addr $USRP_EMB_TARGET_IP \ - --uhd_build_dir $(Build.BinariesDirectory)/uhddev/build --junitxml $(Common.TestResultsDirectory)/TEST-$(dutName)-dpdk.xml + 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) + env: + 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) - task: PublishTestResults@2 -- cgit v1.2.3