Test: Fix PF pci address in InterfaceSetup collecion list #932
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: smoke-tests-bare-metal | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - 'maint-**' | |
| pull_request: | |
| branches: | |
| - main | |
| - 'maint-**' | |
| permissions: | |
| contents: read | |
| jobs: | |
| smoke-check-for-changes: | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| pull-requests: read | |
| outputs: | |
| changed: ${{ steps.filter.outputs.linux_tests == 'true' }} | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v2 | |
| id: filter | |
| with: | |
| filters: .github/path_filters.yml | |
| run-smoke-tests: | |
| needs: smoke-check-for-changes | |
| if: ${{ github.repository == 'OpenVisualCloud/Media-Transport-Library' }} | |
| strategy: | |
| matrix: | |
| nic: | |
| - e810 | |
| - e810-dell | |
| - e830 | |
| fail-fast: false | |
| runs-on: ${{ matrix.nic }} | |
| timeout-minutes: 720 | |
| steps: | |
| - name: 'preparation: Harden Runner' | |
| if: ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }} | |
| uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2 | |
| with: | |
| egress-policy: audit | |
| - name: 'preparation: Checkout MTL' | |
| if: ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }} | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| ref: '${{ github.ref }}' | |
| - uses: ./.github/actions/build | |
| - name: 'installation: Install pipenv environment' | |
| if: ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }} | |
| working-directory: tests/validation | |
| id: pipenv-install | |
| run: | | |
| python3 -m venv .venv | |
| source .venv/bin/activate | |
| pip install -r requirements.txt | |
| - name: Create session ID | |
| if: ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }} | |
| run: | | |
| runner_name=${{ runner.name }} | |
| echo "SESSION_ID=${runner_name##*-}" >> "$GITHUB_ENV" | |
| - name: Set PCI device env variable | |
| if: ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }} | |
| run: | | |
| if [ "${{ matrix.nic }}" = "e810" ]; then | |
| echo "PCI_DEVICE=8086:1592" >> "$GITHUB_ENV" | |
| elif [ "${{ matrix.nic }}" = "e810-dell" ]; then | |
| echo "PCI_DEVICE=8086:1592" >> "$GITHUB_ENV" | |
| elif [ "${{ matrix.nic }}" = "e830" ]; then | |
| echo "PCI_DEVICE=8086:12d2" >> "$GITHUB_ENV" | |
| fi | |
| - name: Generate test framework config files | |
| if: ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }} | |
| working-directory: tests/validation/configs | |
| run: | | |
| python3 gen_config.py \ | |
| --session_id ${{ env.SESSION_ID }} \ | |
| --build ${{ secrets.RUNNER_BUILD }} \ | |
| --mtl_path ${{ secrets.RUNNER_MTL_PATH }} \ | |
| --pci_device ${{ env.PCI_DEVICE }} \ | |
| --ip_address 127.0.0.1 \ | |
| --username ${{ secrets.RUNNER_USERNAME }} \ | |
| --key_path ${{ secrets.RUNNER_KEY_PATH }} | |
| - name: 'preparation: Evaluate choosen validation-test-port-p and validation-test-port-r' | |
| if: ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }} | |
| run: | | |
| eval "export TEST_PORT_P=TEST_VF_PORT_P_0" | |
| eval "export TEST_PORT_R=TEST_VF_PORT_P_1" | |
| echo "TEST_PORT_P=${TEST_PORT_P}" >> "$GITHUB_ENV" | |
| echo "TEST_PORT_R=${TEST_PORT_R}" >> "$GITHUB_ENV" | |
| echo "TEST_PORT_P=${TEST_PORT_P}" | |
| echo "TEST_PORT_R=${TEST_PORT_R}" | |
| - name: 'preparation: Kill MtlManager and pytest routines' | |
| if: ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }} | |
| run: | | |
| sudo killall -SIGINT pipenv || true | |
| sudo killall -SIGINT pytest || true | |
| sudo killall -SIGINT MtlManager || true | |
| - name: 'preparation: Create VFs' | |
| if: ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }} | |
| run: | | |
| sudo rmmod irdma || true | |
| sudo ./script/nicctl.sh create_vf "${TEST_PF_PORT_P}" || true | |
| sudo ./script/nicctl.sh create_vf "${TEST_PF_PORT_R}" || true | |
| - name: 'preparation: Start MtlManager at background' | |
| if: ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }} | |
| run: | | |
| sudo MtlManager & | |
| - name: 'execution: Run validation-bare-metal tests in virtual environment' | |
| if: ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }} | |
| run: | | |
| tests/validation/.venv/bin/python3 -m pytest --topology_config=tests/validation/configs/topology_config.yaml --test_config=tests/validation/configs/test_config.yaml -m smoke --template=html/index.html --report=report.html | |
| - name: "upload report" | |
| if: ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }} | |
| id: upload-report | |
| uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
| with: | |
| name: smoke-test-report-${{ matrix.nic }} | |
| path: | | |
| report.html | |
| - name: "Add report to summary" | |
| if: ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }} | |
| run: | | |
| { | |
| echo "## Smoke Tests Report" | |
| echo "" | |
| # Check if JSON report exists | |
| if [ -f "report.json" ]; then | |
| # Parse JSON report | |
| PASSED=$(jq '.summary.passed // 0' report.json) | |
| FAILED=$(jq '.summary.failed // 0' report.json) | |
| SKIPPED=$(jq '.summary.skipped // 0' report.json) | |
| ERROR=$(jq '.summary.errors // 0' report.json) | |
| # Add summary stats | |
| echo "| Status | Count |" | |
| echo "| ------ | ----- |" | |
| echo "| ✅ Passed | ${PASSED:-0} |" | |
| echo "| ❌ Failed | ${FAILED:-0} |" | |
| echo "| ⚠️ Error | ${ERROR:-0} |" | |
| echo "| ⏭️ Skipped | ${SKIPPED:-0} |" | |
| echo "" | |
| # Add test result details if available | |
| TOTAL=$((${PASSED:-0} + ${FAILED:-0} + ${ERROR:-0} + ${SKIPPED:-0})) | |
| echo "**Total Tests:** $TOTAL" | |
| echo "" | |
| if [ "${FAILED:-0}" -gt 0 ] || [ "${ERROR:-0}" -gt 0 ]; then | |
| echo "❌ **Some tests failed!** Please check the detailed report." | |
| else | |
| echo "✅ **All tests passed!**" | |
| fi | |
| echo "" | |
| # Add link to full report artifact | |
| echo "📄 [Download Full HTML Report](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/artifacts/${{ steps.upload-report.outputs.artifact-id }})" | |
| else | |
| echo "❌ No report.json file was generated" | |
| fi | |
| } >> "$GITHUB_STEP_SUMMARY" |