This guide will help you get started with the BBSim Tests GitHub Action in under 5 minutes.
Create .github/workflows/bbsim-test.yaml in your repository:
name: BBSim Tests on: push: branches: [master] jobs: test: runs-on: ubuntu-latest steps: - name: Run BBSim Tests uses: opencord/shared-workflows/.github/actions/bbsim-tests@main with: branch: master test-targets: | - target: functional-single-kind-dt workflow: dt flags: "" teardown: true logging: true vgcEnabled: false
That's it! Commit and push this file to trigger your first BBSim test.
Note: This action is designed as a shared/reusable action. You don't need to check out the shared-workflows repository - just reference it directly with uses:. All dependencies and scripts are handled automatically.
- target: functional-single-kind-dt workflow: dt flags: "" teardown: true logging: true vgcEnabled: false
- target: functional-single-kind-att workflow: att flags: "" teardown: true logging: true vgcEnabled: false
- target: functional-single-kind-tt workflow: tt flags: "" teardown: true logging: true vgcEnabled: false
- target: sanity-single-kind workflow: dt flags: "" teardown: true logging: true vgcEnabled: false
Just add more entries to the test-targets list:
test-targets: | - target: sanity-single-kind workflow: dt flags: "" teardown: true logging: true vgcEnabled: false - target: functional-single-kind-dt workflow: dt flags: "" teardown: true logging: true vgcEnabled: false
Set log-level to DEBUG:
- name: Run BBSim Tests uses: opencord/shared-workflows/.github/actions/bbsim-tests@main with: branch: master log-level: DEBUG test-targets: | ...
Add with-monitoring: true to collect memory consumption metrics:
- name: Run BBSim Tests uses: opencord/shared-workflows/.github/actions/bbsim-tests@main with: branch: master with-monitoring: true test-targets: | ...
Set the olts parameter:
- name: Run BBSim Tests uses: opencord/shared-workflows/.github/actions/bbsim-tests@main with: branch: master olts: "2" test-targets: | ...
After the workflow completes:
report.html in a browser to see the Robot Framework reportAdd workflow_dispatch to trigger tests manually:
name: BBSim Tests on: workflow_dispatch: inputs: branch: description: 'Branch to test' required: true default: 'master' log_level: description: 'Log level' required: false default: 'WARN' type: choice options: - DEBUG - INFO - WARN - ERROR jobs: test: runs-on: ubuntu-latest steps: - name: Run BBSim Tests uses: opencord/shared-workflows/.github/actions/bbsim-tests@main with: branch: ${{ inputs.branch }} log-level: ${{ inputs.log_level }} test-targets: | - target: functional-single-kind-dt workflow: dt flags: "" teardown: true logging: true vgcEnabled: false
Now you can trigger tests from the GitHub UI!
Check that your runner has enough resources:
Free up disk space before running:
- name: Free disk space run: | sudo rm -rf /usr/share/dotnet sudo rm -rf /opt/ghc sudo rm -rf /usr/local/share/boost sudo rm -rf "$AGENT_TOOLSDIRECTORY"
The kind cluster name might conflict. Try a unique name:
with: cluster-name: "my-test-cluster"
Increase the job timeout:
jobs: test: timeout-minutes: 480 # 8 hours
This action is designed to be called from external repositories. You don't need to:
shared-workflows repositoryThe action is fully self-contained and handles everything automatically.
For production use, pin to a specific version:
uses: opencord/shared-workflows/.github/actions/bbsim-tests@v1.0.0 # Recommended uses: opencord/shared-workflows/.github/actions/bbsim-tests@abc123 # Most secure uses: opencord/shared-workflows/.github/actions/bbsim-tests@main # Development only
schedule triggers for nightly testsname: Complete BBSim Tests on: push: branches: [master] pull_request: schedule: - cron: '0 2 * * *' workflow_dispatch: jobs: bbsim-tests: runs-on: ubuntu-latest timeout-minutes: 360 steps: - name: Free up disk space run: | sudo rm -rf /usr/share/dotnet sudo rm -rf /opt/ghc sudo rm -rf /usr/local/share/boost sudo rm -rf "$AGENT_TOOLSDIRECTORY" - name: Run BBSim Tests uses: opencord/shared-workflows/.github/actions/bbsim-tests@main with: branch: master log-level: INFO cluster-name: kind-ci docker-registry: linuxfoundation.jfrog.io/voltha-docker olts: "2" with-monitoring: true enable-mac-learning: false extra-helm-flags: "--set global.some_option=value" extra-robot-args: "-v some_var:some_value" test-targets: | - target: sanity-single-kind workflow: dt flags: "" teardown: true logging: true vgcEnabled: false - target: functional-single-kind-dt workflow: dt flags: "" teardown: true logging: true vgcEnabled: false - name: Upload results if: always() uses: actions/upload-artifact@v4 with: name: test-results-${{ github.run_id }} path: logs/ retention-days: 30
Happy Testing! 🚀