From a05fbb0522921c80ea2b11533017c980ed77f067 Mon Sep 17 00:00:00 2001 From: Grant Meyerhoff Date: Thu, 4 Jan 2024 11:51:45 -0600 Subject: ci: refactor streaming steps This change removes several hardcoded values from the code and separates x410 from x4xx as dut type --- .ci/templates/job-uhd-streaming-tests-beauty.yml | 19 ++++++- .ci/templates/job-uhd-streaming-tests.yml | 59 +++++++++++++------ host/tests/pytests/conftest.py | 12 +++- host/tests/pytests/test_raw_udp_streaming.py | 72 ++++++++++++------------ host/tests/pytests/test_streaming.py | 9 ++- 5 files changed, 109 insertions(+), 62 deletions(-) diff --git a/.ci/templates/job-uhd-streaming-tests-beauty.yml b/.ci/templates/job-uhd-streaming-tests-beauty.yml index 86958b19a..b2de2d4a2 100644 --- a/.ci/templates/job-uhd-streaming-tests-beauty.yml +++ b/.ci/templates/job-uhd-streaming-tests-beauty.yml @@ -43,9 +43,12 @@ jobs: dutNumRecvFrames: '' dutNumSendFrames: '' jtagSerial: '251635138E94' + sfpInt0: 'ens4f0' + sfpInt1: 'ens4f1' # beauty-X410-0 X4_200: # dutName: 'beauty-X410-0' - # dutType: 'x4xx' + # dutFamily: 'x4xx' + # dutType: 'x410' # dutAddr: '192.168.10.2' # dutSecondAddr: '192.168.20.2' # dutMgmtAddr: '10.0.57.29' @@ -53,9 +56,12 @@ jobs: # dutNameId: '' # dutNumRecvFrames: '' # dutNumSendFrames: '' + # sfpInt0: 'ens6f0' + # sfpInt1: 'ens6f1' beauty-X410-0 CG_400: dutName: 'beauty-X410-0' - dutType: 'x4xx' + dutFamily: 'x4xx' + dutType: 'x410' dutAddr: '192.168.110.2' dutSecondAddr: '192.168.120.2' dutMgmtAddr: '10.0.57.29' @@ -65,9 +71,12 @@ jobs: uartSerial: '2516351E2C9A' dutNumRecvFrames: '' dutNumSendFrames: '' + sfpInt0: 'ens6f0' + sfpInt1: 'ens6f1' beauty-X410-0 UC_200: dutName: 'beauty-X410-0' - dutType: 'x4xx' + dutFamily: 'x4xx' + dutType: 'x410' dutAddr: '192.168.120.2' dutSecondAddr: '192.168.120.2' dutMgmtAddr: '10.0.57.29' @@ -77,6 +86,8 @@ jobs: uartSerial: '2516351E2C9A' dutNumRecvFrames: '' dutNumSendFrames: '' + sfpInt0: 'ens6f0' + sfpInt1: 'ens6f1' # beauty-E320-0: # dutName: 'beauty-E320-0' # dutType: 'E320' @@ -107,6 +118,8 @@ jobs: # dutNameId: '' # dutNumRecvFrames: '' # dutNumSendFrames: '' + # sfpInt0: 'ens4f0' + # sfpInt1: 'ens4f1' beauty-B210-0: dutName: 'beauty-B210-0' dutType: 'B210' diff --git a/.ci/templates/job-uhd-streaming-tests.yml b/.ci/templates/job-uhd-streaming-tests.yml index 507c59a03..858cd3277 100644 --- a/.ci/templates/job-uhd-streaming-tests.yml +++ b/.ci/templates/job-uhd-streaming-tests.yml @@ -5,6 +5,7 @@ parameters: type: string values: - ubuntu2004 + - ubuntu2204 - name: toolset type: string values: @@ -56,12 +57,12 @@ jobs: 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')) + condition: and(succeeded(), eq(variables.dutFamily, 'x4xx')) - download: ${{ parameters.uhdArtifactSource }} artifact: $(dutEmbeddedImagesArtifact) displayName: Download $(dutEmbeddedImagesArtifact) - condition: and(succeeded(), eq(variables.dutType, 'x4xx')) + condition: and(succeeded(), eq(variables.dutFamily, 'x4xx')) - task: ExtractFiles@1 inputs: @@ -70,7 +71,7 @@ jobs: cleanDestinationFolder: false overwriteExistingFiles: true displayName: Extract JTAG artifact - condition: and(succeeded(), eq(variables.dutType, 'x4xx')) + condition: and(succeeded(), eq(variables.dutFamily, 'x4xx')) - download: ${{ parameters.uhdArtifactSource }} artifact: uhddev-${{ parameters.testOS }}-${{ parameters.toolset }} @@ -94,14 +95,14 @@ jobs: 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')) + condition: and(succeeded(), eq(variables.dutFamily, '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')) + condition: and(succeeded(), eq(variables.dutFamily, 'x4xx')) - script: | source $USRP_EMB_VENV/bin/activate @@ -109,7 +110,7 @@ jobs: 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')) + condition: and(succeeded(), eq(variables.dutFamily, 'x4xx')) # Setting the timezone on the embedded device is # required to make the test runtimes to look sane. @@ -118,21 +119,21 @@ jobs: 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')) + condition: and(succeeded(), eq(variables.dutFamily, 'x4xx')) - script: | sleep 60 displayName: Wait for device to finish booting - condition: and(succeeded(), eq(variables.dutType, 'x4xx')) + condition: and(succeeded(), eq(variables.dutFamily, '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)" + ssh -o StrictHostKeyChecking=no -tt root@$USRP_EMB_TARGET_IP "uhd_image_loader --args addr=localhost,type=$(dutFamily),fpga=$(dutFPGA)" EXITCODE=$? sleep 60 exit $EXITCODE displayName: Flash FPGA $(dutFPGA) - condition: and(succeeded(), eq(variables.dutType, 'x4xx')) + condition: and(succeeded(), eq(variables.dutFamily, 'x4xx')) - script: | export UHD_IMAGES_DIR=$(Build.BinariesDirectory)/uhddev/build-installed/share/uhd/images @@ -156,23 +157,27 @@ jobs: 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" displayName: Enable Tx Pause Frames on sfp0 - condition: and(succeeded(), eq(variables.dutType, 'x4xx'), eq(variables.dutFPGA, 'CG_400')) + condition: and(succeeded(), eq(variables.dutFamily, 'x4xx'), eq(variables.dutFPGA, 'CG_400')) + - script: | ssh-keygen -f ~/.ssh/known_hosts -R $USRP_EMB_TARGET_IP ssh -o StrictHostKeyChecking=no -tt root@$USRP_EMB_TARGET_IP "ethtool -A sfp1 tx on" displayName: Enable Tx Pause Frames on sfp1 - condition: and(succeeded(), eq(variables.dutType, 'x4xx'), in(variables.dutFPGA, 'CG_400', 'UC_200')) + condition: and(succeeded(), eq(variables.dutFamily, 'x4xx'), in(variables.dutFPGA, 'CG_400', 'UC_200')) + - script: | ssh-keygen -f ~/.ssh/known_hosts -R $USRP_EMB_TARGET_IP ssh -o StrictHostKeyChecking=no -tt root@$USRP_EMB_TARGET_IP "ip addr add $(dutAddr)/24 dev sfp0" ssh -o StrictHostKeyChecking=no -tt root@$USRP_EMB_TARGET_IP "ip addr del 192.168.10.2/24 dev sfp0" displayName: Setup IP addresses on sfp0 - condition: and(succeeded(), eq(variables.dutType, 'x4xx'), eq(variables.dutFPGA, 'CG_400')) + condition: and(succeeded(), eq(variables.dutFamily, 'x4xx'), eq(variables.dutFPGA, 'CG_400')) + - script: | ssh -o StrictHostKeyChecking=no -tt root@$USRP_EMB_TARGET_IP "ip addr add $(dutSecondAddr)/24 dev sfp1" ssh -o StrictHostKeyChecking=no -tt root@$USRP_EMB_TARGET_IP "ip addr del 192.168.20.2/24 dev sfp1" displayName: Setup IP addresses on sfp1 - condition: and(succeeded(), eq(variables.dutType, 'x4xx'), in(variables.dutFPGA, 'CG_400', 'UC_200')) + condition: and(succeeded(), eq(variables.dutFamily, 'x4xx'), in(variables.dutFPGA, 'CG_400', 'UC_200')) + - script: | cd ${{ parameters.uhdSrcDir }}/host/tests/streaming_performance sudo ./setup.sh --auto @@ -180,6 +185,7 @@ jobs: sleep 5 exit $EXITCODE displayName: setup interfaces for use without DPDK + - script: | echo "##[group]Printing Environment" printenv @@ -200,12 +206,14 @@ jobs: 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'))) + condition: and(succeeded(), not(eq(variables.dutFamily, 'x4xx'))) + - script: | cd ${{ parameters.uhdSrcDir }}/host/tests/streaming_performance sudo ./setup.sh --auto --ramdisk sleep 5 displayName: setup interfaces for use raw udp streaming + - script: | export PYTHON_VERSION=$(python3 -c "import sys; print('python'+str(sys.version_info.major) + '.' + str(sys.version_info.minor))") export PYTHONPATH=$(Build.BinariesDirectory)/uhddev/build-installed/lib/$PYTHON_VERSION/site-packages:${{ parameters.uhdSrcDir }}/host/tests/streaming_performance @@ -220,14 +228,15 @@ jobs: --dut_type $(dutType) --dut_fpga $(dutFPGA) --test_length ${{ parameters.testLength }} \ --uhd_build_dir $(Build.BinariesDirectory)/uhddev/build-installed/lib/uhd --junitxml $(Common.TestResultsDirectory)/TEST-$(dutName).xml \ --addr $(dutAddr) --second_addr $(dutSecondAddr) --mgmt_addr $(dutMgmtAddr) --name $(dutNameId) \ - --num_recv_frames $(dutNumRecvFrames) --num_send_frames $(dutNumSendFrames) + --num_recv_frames $(dutNumRecvFrames) --num_send_frames $(dutNumSendFrames) --sfp_int0 $(sfpInt0) --sfp_int1 $(sfpInt1) env: UHD_CONFIG_FILE: $(config_file) LD_LIBRARY_PATH: $(Build.BinariesDirectory)/uhddev/build-installed/lib UHD_IMAGES_DIR: $(Build.BinariesDirectory)/uhddev/build-installed/share/uhd/images continueOnError: true displayName: Run raw udp streaming tests on $(dutName) - condition: and(succeeded(), or(eq(variables.dutType, 'x4xx'), eq(variables.dutType, 'X310'))) + condition: and(succeeded(), or(eq(variables.dutFamily, 'x4xx'), eq(variables.dutType, 'X310'))) + - script: | cd ${{ parameters.uhdSrcDir }}/host/tests/streaming_performance sudo ./setup.sh --auto --dpdk @@ -236,6 +245,18 @@ jobs: exit $EXITCODE displayName: setup interfaces for use with DPDK condition: and(succeeded(), not(eq(variables.dutType, 'B210'))) + + # This step is needed because the agent used to build UHD that gets installed may have a slightly different dpdk setup. + # For example, if the streaming system uses a Mellanox NIC and thus needs Mellanox drivers installed but the agent used to build UHD doesn't + # then you can get an access violation when using that version of UHD with dpdk on the streaming system + - script: | + mkdir ${{ parameters.uhdSrcDir }}/host/build + cd ${{ parameters.uhdSrcDir }}/host/build + cmake -DCMAKE_INSTALL_PREFIX=$(Build.BinariesDirectory)/uhddev/build-installed .. + make -j8 install + displayName: build UHD for dpdk installed on test machine + condition: succeeded() + - script: | if [ "$(dutFPGA)" = "CG_400" ]; then echo "##vso[task.setvariable variable=config_file]${{ parameters.uhdSrcDir }}/host/tests/pytests/uhd_configs/uhd_dpdk_100GbE.conf" @@ -248,6 +269,7 @@ jobs: echo "Using 10 GbE UHD Config File" fi displayName: select UHD config file for DPDK + - script: | echo "##[group]Printing Environment" printenv @@ -268,6 +290,7 @@ jobs: continueOnError: true displayName: Run streaming tests with DPDK on $(dutName) condition: and(succeeded(), not(eq(variables.dutType, 'B210'))) + - task: PublishTestResults@2 inputs: testResultsFormat: 'JUnit' @@ -277,10 +300,10 @@ jobs: 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 - diff --git a/host/tests/pytests/conftest.py b/host/tests/pytests/conftest.py index 5099c7cbe..cf05d5320 100644 --- a/host/tests/pytests/conftest.py +++ b/host/tests/pytests/conftest.py @@ -7,7 +7,7 @@ dut_type_list = [ "E320", "X310", "X310_TwinRx", - "x4xx" + "x410" ] @@ -71,6 +71,16 @@ def pytest_addoption(parser): type=str, nargs='?', help="configures num_send_frames parameter") + parser.addoption( + "--sfp_int0", + type=str, + required=False, + help="configures name of sfp0 interface") + parser.addoption( + "--sfp_int1", + type=str, + required=False, + help="configures name of sfp1 interface") def pytest_configure(config): # register additional markers diff --git a/host/tests/pytests/test_raw_udp_streaming.py b/host/tests/pytests/test_raw_udp_streaming.py index 9198afa64..e9619be10 100644 --- a/host/tests/pytests/test_raw_udp_streaming.py +++ b/host/tests/pytests/test_raw_udp_streaming.py @@ -27,18 +27,18 @@ def parametrize_test_length(metafunc, test_length, fast_params, stress_params): metafunc.parametrize(argnames, argvalues) -def generate_x4xx_10GbE_test_cases(metafunc, test_length): +def generate_x410_10GbE_test_cases(metafunc, test_length, sfp_int0, sfp_int1): test_cases = [ # Test Lengths dual_SFP rate rx_rate rx_channels dest_addr dest_port adapter host_interface keep_hdr test case ID # -------------------------------------------------------------------------------------------------------------------------------------------------------- - [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 245.76e6, 122.88e6, "0", "192.168.110.1", 1234, "sfp0", "enp1s0f0", True, id="SFP0_FULL_PACKET_1x10GbE-1xRX@122.88e6")], - [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 245.76e6, 122.88e6, "1", "192.168.110.1", 1234, "sfp0", "enp1s0f0", False, id="SFP0_RAW_PAYLOAD_1x10GbE-1xRX@122.88e6")], - [{}, pytest.param(False, 245.76e6, 122.88e6, "2", "192.168.110.1", 1234, "sfp0", "enp1s0f0", True, id="SFP0_FULL_PACKET_1x10GbE-1xRX@122.88e6")], - [{}, pytest.param(False, 245.76e6, 122.88e6, "3", "192.168.110.1", 1234, "sfp0", "enp1s0f0", False, id="SFP0_RAW_PAYLOAD_1x10GbE-1xRX@122.88e6")], - [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 245.76e6, 122.88e6, "0", "192.168.111.1", 1234, "sfp0_1", "enp1s0f1", True, id="SFP0_1_FULL_PACKET_1x10GbE-1xRX@122.88e6")], - [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 245.76e6, 122.88e6, "1", "192.168.111.1", 1234, "sfp0_1", "enp1s0f1", False, id="SFP0_1_RAW_PAYLOAD_1x10GbE-1xRX@122.88e6")], - [{}, pytest.param(False, 245.76e6, 122.88e6, "2", "192.168.111.1", 1234, "sfp0_1", "enp1s0f1", True, id="SFP0_1_FULL_PACKET_1x10GbE-1xRX@122.88e6")], - [{}, pytest.param(False, 245.76e6, 122.88e6, "3", "192.168.111.1", 1234, "sfp0_1", "enp1s0f1", False, id="SFP0_1_RAW_PAYLOAD_1x10GbE-1xRX@122.88e6")], + [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 245.76e6, 122.88e6, "0", "192.168.110.1", 1234, "sfp0", sfp_int0, True, id="SFP0_FULL_PACKET_1x10GbE-1xRX@122.88e6")], + [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 245.76e6, 122.88e6, "1", "192.168.110.1", 1234, "sfp0", sfp_int0, False, id="SFP0_RAW_PAYLOAD_1x10GbE-1xRX@122.88e6")], + [{}, pytest.param(False, 245.76e6, 122.88e6, "2", "192.168.110.1", 1234, "sfp0", sfp_int0, True, id="SFP0_FULL_PACKET_1x10GbE-1xRX@122.88e6")], + [{}, pytest.param(False, 245.76e6, 122.88e6, "3", "192.168.110.1", 1234, "sfp0", sfp_int0, False, id="SFP0_RAW_PAYLOAD_1x10GbE-1xRX@122.88e6")], + [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 245.76e6, 122.88e6, "0", "192.168.111.1", 1234, "sfp0_1", sfp_int1, True, id="SFP0_1_FULL_PACKET_1x10GbE-1xRX@122.88e6")], + [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 245.76e6, 122.88e6, "1", "192.168.111.1", 1234, "sfp0_1", sfp_int1, False, id="SFP0_1_RAW_PAYLOAD_1x10GbE-1xRX@122.88e6")], + [{}, pytest.param(False, 245.76e6, 122.88e6, "2", "192.168.111.1", 1234, "sfp0_1", sfp_int1, True, id="SFP0_1_FULL_PACKET_1x10GbE-1xRX@122.88e6")], + [{}, pytest.param(False, 245.76e6, 122.88e6, "3", "192.168.111.1", 1234, "sfp0_1", sfp_int1, False, id="SFP0_1_RAW_PAYLOAD_1x10GbE-1xRX@122.88e6")], ] argvalues = test_length_utils.select_test_cases_by_length(test_length, test_cases) @@ -48,29 +48,29 @@ def generate_x4xx_10GbE_test_cases(metafunc, test_length): stress_params = test_length_utils.test_length_params(iterations=2, duration=600) parametrize_test_length(metafunc, test_length, fast_params, stress_params) -def generate_x4xx_100GbE_test_cases(metafunc, test_length, dut_fpga): +def generate_x410_100GbE_test_cases(metafunc, test_length, dut_fpga, sfp_int0, sfp_int1): if dut_fpga.upper() == 'CG_400': test_cases = [ - # Test Lengths dual_SFP rate rx_rate rx_channels dest_addr dest_port adapter host_interface keep_hdr test case ID + # Test Lengths dual_SFP rate rx_rate rx_channels dest_addr dest_port adapter host_interface keep_hdr test case ID # -------------------------------------------------------------------------------------------------------------------------------------------------------- - [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 491.52e6, 491.52e6, "0", "192.168.110.1", 1234, "sfp0", "ens6f0", True, id="SFP0_FULL_PACKET_1x100GbE-1xRX@491.52e6")], - [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 491.52e6, 491.52e6, "1", "192.168.110.1", 1234, "sfp0", "ens6f0", False, id="SFP0_RAW_PAYLOAD_1x100GbE-1xRX@491.52e6")], - [{}, pytest.param(False, 491.52e6, 491.52e6, "2", "192.168.110.1", 1234, "sfp0", "ens6f0", True, id="SFP0_FULL_PACKET_1x100GbE-1xRX@491.52e6")], - [{}, pytest.param(False, 491.52e6, 491.52e6, "3", "192.168.110.1", 1234, "sfp0", "ens6f0", False, id="SFP0_RAW_PAYLOAD_1x100GbE-1xRX@491.52e6")], - [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 491.52e6, 491.52e6, "0", "192.168.120.1", 1234, "sfp1", "ens6f1", True, id="SFP1_FULL_PACKET_1x100GbE-1xRX@491.52e6")], - [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 491.52e6, 491.52e6, "1", "192.168.120.1", 1234, "sfp1", "ens6f1", False, id="SFP1_RAW_PAYLOAD_1x100GbE-1xRX@491.52e6")], - [{}, pytest.param(False, 491.52e6, 491.52e6, "2", "192.168.120.1", 1234, "sfp1", "ens6f1", True, id="SFP1_FULL_PACKET_1x100GbE-1xRX@491.52e6")], - [{}, pytest.param(False, 491.52e6, 491.52e6, "3", "192.168.120.1", 1234, "sfp1", "ens6f1", False, id="SFP1_RAW_PAYLOAD_1x100GbE-1xRX@491.52e6")], + [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 491.52e6, 491.52e6, "0", "192.168.110.1", 1234, "sfp0", sfp_int0, True, id="SFP0_FULL_PACKET_1x100GbE-1xRX@491.52e6")], + [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 491.52e6, 491.52e6, "1", "192.168.110.1", 1234, "sfp0", sfp_int0, False, id="SFP0_RAW_PAYLOAD_1x100GbE-1xRX@491.52e6")], + [{}, pytest.param(False, 491.52e6, 491.52e6, "2", "192.168.110.1", 1234, "sfp0", sfp_int0, True, id="SFP0_FULL_PACKET_1x100GbE-1xRX@491.52e6")], + [{}, pytest.param(False, 491.52e6, 491.52e6, "3", "192.168.110.1", 1234, "sfp0", sfp_int0, False, id="SFP0_RAW_PAYLOAD_1x100GbE-1xRX@491.52e6")], + [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 491.52e6, 491.52e6, "0", "192.168.120.1", 1234, "sfp1", sfp_int1, True, id="SFP1_FULL_PACKET_1x100GbE-1xRX@491.52e6")], + [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 491.52e6, 491.52e6, "1", "192.168.120.1", 1234, "sfp1", sfp_int1, False, id="SFP1_RAW_PAYLOAD_1x100GbE-1xRX@491.52e6")], + [{}, pytest.param(False, 491.52e6, 491.52e6, "2", "192.168.120.1", 1234, "sfp1", sfp_int1, True, id="SFP1_FULL_PACKET_1x100GbE-1xRX@491.52e6")], + [{}, pytest.param(False, 491.52e6, 491.52e6, "3", "192.168.120.1", 1234, "sfp1", sfp_int1, False, id="SFP1_RAW_PAYLOAD_1x100GbE-1xRX@491.52e6")], ] if dut_fpga.upper() == 'UC_200': test_cases = [ - # Test Lengths dual_SFP rate rx_rate rx_channels dest_addr dest_port adapter host_interface keep_hdr test case ID + # Test Lengths dual_SFP rate rx_rate rx_channels dest_addr dest_port adapter host_interface keep_hdr test case ID # -------------------------------------------------------------------------------------------------------------------------------------------------------- - [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 250e6, 250e6, "0", "192.168.120.1", 1234, "sfp1", "ens6f1", True, id="SFP1_FULL_PACKET_1x100GbE-1xRX@250e6")], - [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 250e6, 250e6, "1", "192.168.120.1", 1234, "sfp1", "ens6f1", False, id="SFP1_RAW_PAYLOAD_1x100GbE-1xRX@250e6")], - [{}, pytest.param(False, 250e6, 250e6, "2", "192.168.120.1", 1234, "sfp1", "ens6f1", True, id="SFP1_FULL_PACKET_1x100GbE-1xRX@250e6")], - [{}, pytest.param(False, 250e6, 250e6, "3", "192.168.120.1", 1234, "sfp1", "ens6f1", False, id="SFP1_RAW_PAYLOAD_1x100GbE-1xRX@250e6")], + [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 250e6, 250e6, "0", "192.168.120.1", 1234, "sfp1", sfp_int1, True, id="SFP1_FULL_PACKET_1x100GbE-1xRX@250e6")], + [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 250e6, 250e6, "1", "192.168.120.1", 1234, "sfp1", sfp_int1, False, id="SFP1_RAW_PAYLOAD_1x100GbE-1xRX@250e6")], + [{}, pytest.param(False, 250e6, 250e6, "2", "192.168.120.1", 1234, "sfp1", sfp_int1, True, id="SFP1_FULL_PACKET_1x100GbE-1xRX@250e6")], + [{}, pytest.param(False, 250e6, 250e6, "3", "192.168.120.1", 1234, "sfp1", sfp_int1, False, id="SFP1_RAW_PAYLOAD_1x100GbE-1xRX@250e6")], ] argvalues = test_length_utils.select_test_cases_by_length(test_length, test_cases) @@ -80,14 +80,14 @@ def generate_x4xx_100GbE_test_cases(metafunc, test_length, dut_fpga): stress_params = test_length_utils.test_length_params(iterations=2, duration=600) parametrize_test_length(metafunc, test_length, fast_params, stress_params) -def generate_X310_10GbE_test_cases(metafunc, test_length): +def generate_X310_10GbE_test_cases(metafunc, test_length, sfp_int0, sfp_int1): test_cases = [ # Test Lengths dual_SFP rate rx_rate rx_channels dest_addr dest_port adapter host_interface keep_hdr test case ID # -------------------------------------------------------------------------------------------------------------------------------------------------------- - [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 200e6, 200e6, "0", "192.168.10.1", 1234, "sfp0", "ens4f0", True, id="SFP0_FULL_PACKET_1x10GbE-1xRX@200e6")], - [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 200e6, 200e6, "1", "192.168.10.1", 1234, "sfp0", "ens4f0", False, id="SFP0_RAW_PAYLOAD_1x10GbE-1xRX@200e6")], - [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 200e6, 200e6, "0", "192.168.20.1", 1234, "sfp1", "ens4f1", True, id="SFP1_FULL_PACKET_1x10GbE-1xRX@200e6")], - [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 200e6, 200e6, "1", "192.168.20.1", 1234, "sfp1", "ens4f1", False, id="SFP1_RAW_PAYLOAD_1x10GbE-1xRX@200e6")], + [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 200e6, 200e6, "0", "192.168.10.1", 1234, "sfp0", sfp_int0, True, id="SFP0_FULL_PACKET_1x10GbE-1xRX@200e6")], + [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 200e6, 200e6, "1", "192.168.10.1", 1234, "sfp0", sfp_int0, False, id="SFP0_RAW_PAYLOAD_1x10GbE-1xRX@200e6")], + [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 200e6, 200e6, "0", "192.168.20.1", 1234, "sfp1", sfp_int1, True, id="SFP1_FULL_PACKET_1x10GbE-1xRX@200e6")], + [{Test_Length_Stress, Test_Length_Smoke}, pytest.param(False, 200e6, 200e6, "1", "192.168.20.1", 1234, "sfp1", sfp_int1, False, id="SFP1_RAW_PAYLOAD_1x10GbE-1xRX@200e6")], ] argvalues = test_length_utils.select_test_cases_by_length(test_length, test_cases) @@ -101,15 +101,17 @@ def pytest_generate_tests(metafunc): dut_type = metafunc.config.getoption("dut_type") dut_fpga = metafunc.config.getoption("dut_fpga") test_length = metafunc.config.getoption("test_length") + sfp_int0 = metafunc.config.getoption("sfp_int0") + sfp_int1 = metafunc.config.getoption("sfp_int1") metafunc.parametrize("dut_type", [dut_type]) - if dut_type.lower() == 'x4xx' and dut_fpga.upper() == 'X4_200': - generate_x4xx_10GbE_test_cases(metafunc, test_length) - if dut_type.lower() == 'x4xx' and dut_fpga.upper() in {'CG_400', 'UC_200'}: - generate_x4xx_100GbE_test_cases(metafunc, test_length, dut_fpga) + if dut_type.lower() == 'x410' and dut_fpga.upper() == 'X4_200': + generate_x410_10GbE_test_cases(metafunc, test_length, sfp_int0, sfp_int1) + if dut_type.lower() == 'x410' and dut_fpga.upper() in {'CG_400', 'UC_200'}: + generate_x410_100GbE_test_cases(metafunc, test_length, dut_fpga, sfp_int0, sfp_int1) if dut_type.lower() == 'x310' and dut_fpga.upper() == 'XG': - generate_X310_10GbE_test_cases(metafunc, test_length) + generate_X310_10GbE_test_cases(metafunc, test_length, sfp_int0, sfp_int1) def test_raw_udp_streaming(pytestconfig, dut_type, dual_SFP, rate, rx_rate, rx_channels, @@ -120,7 +122,7 @@ def test_raw_udp_streaming(pytestconfig, dut_type, dual_SFP, rate, rx_rate, rx_c device_args = "" # construct device args string - if dut_type.lower() in ['n310', 'n320', 'e320', 'x4xx', 'x310']: + if dut_type.lower() in ['n310', 'n320', 'e320', 'x310', 'x410']: device_args += f"master_clock_rate={rate}," addr = pytestconfig.getoption('addr') diff --git a/host/tests/pytests/test_streaming.py b/host/tests/pytests/test_streaming.py index f8725663c..5f06945f8 100644 --- a/host/tests/pytests/test_streaming.py +++ b/host/tests/pytests/test_streaming.py @@ -156,7 +156,7 @@ def generate_X310_TwinRx_test_cases(metafunc, test_length): stress_params = test_length_utils.test_length_params(iterations=2, duration=600) parametrize_test_length(metafunc, test_length, fast_params, stress_params) -def generate_x4xx_test_cases(metafunc, test_length, dut_fpga): +def generate_x410_test_cases(metafunc, test_length, dut_fpga): if dut_fpga.upper() == 'CG_400': test_cases = [ # Test Lengths dual_SFP rate rx_rate rx_channels tx_rate tx_channels test case ID @@ -193,7 +193,6 @@ def generate_x4xx_test_cases(metafunc, test_length, dut_fpga): stress_params = test_length_utils.test_length_params(iterations=2, duration=600) parametrize_test_length(metafunc, test_length, fast_params, stress_params) - def pytest_generate_tests(metafunc): dut_type = metafunc.config.getoption("dut_type") dut_fpga = metafunc.config.getoption("dut_fpga") @@ -226,8 +225,8 @@ def pytest_generate_tests(metafunc): generate_X310_test_cases(metafunc, test_length) elif dut_type.lower() == 'x310_twinrx': generate_X310_TwinRx_test_cases(metafunc, test_length) - elif dut_type.lower() == 'x4xx': - generate_x4xx_test_cases(metafunc, test_length, dut_fpga) + elif dut_type.lower() == 'x410': + generate_x410_test_cases(metafunc, test_length, dut_fpga) def test_streaming(pytestconfig, dut_type, use_dpdk, dual_SFP, rate, rx_rate, rx_channels, @@ -291,7 +290,7 @@ def test_streaming(pytestconfig, dut_type, use_dpdk, dual_SFP, rate, rx_rate, rx # Run X410 streaming tests in multi_streamer mode and high thread priority # since those settings allow for best performance. - if dut_type.lower() == "x4xx": + if dut_type.lower() == "x410": benchmark_rate_params["multi_streamer"] = 1 benchmark_rate_params["priority"] = "high" dut_fpga = pytestconfig.getoption('dut_fpga') -- cgit v1.2.3-59-g8ed1b