feat: v25.7.8 unbound_dnsbl migration #184
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: Functional-Tests Execution for PRs | |
| on: | |
| pull_request_target: | |
| branches: ['latest'] | |
| paths: | |
| - 'plugins/**.py' | |
| - 'tests/**.yml' | |
| - '.github/workflows/functional_test_pr.yml' | |
| - 'scripts/get_changed_modules.py' | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| environment: pr-test | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Query changes | |
| run: | | |
| sudo apt install curl >/dev/null 2>/dev/null | |
| curl -L https://api.github.com/repos/O-X-L/ansible-opnsense/pulls/${{ github.event.number }}/files | jq -r '.[].filename' > /tmp/changes.txt | |
| shell: bash | |
| - name: Checking which modules are required to be tested | |
| id: modules_to_test | |
| run: | | |
| python3 scripts/get_changed_modules.py /tmp/changes.txt /tmp/changed_modules.txt | |
| count="$(cat /tmp/changed_modules.txt | wc -l)" | |
| echo "count=${count}" >> $GITHUB_OUTPUT | |
| if [[ "$count" == "0" ]] | |
| then | |
| echo 'INFO: NO MODULES REQUIRE TESTING!' | |
| else | |
| echo "INFO: MODULES TO TEST = ${count}" | |
| fi | |
| shell: bash | |
| - name: Test Connection | |
| if: ${{ steps.modules_to_test.outputs.count != 0 }} | |
| run: | | |
| echo '10.0.0.1 ${{ vars.CI_TEST_FIREWALL_1 }}' | sudo tee -a /etc/hosts | |
| https_proxy=${{ secrets.CI_TEST_PROXY }} curl --fail-with-body https://${{ vars.CI_TEST_FIREWALL_1 }} --insecure > /tmp/test.html | |
| if grep -q 'DNS Rebind attack' < /tmp/test.html | |
| then | |
| echo 'ERROR: Firewall Hostname ${{ vars.CI_TEST_FIREWALL_1 }} not configured!' | |
| exit 1 | |
| fi | |
| shell: bash | |
| - name: Install requirements | |
| if: ${{ steps.modules_to_test.outputs.count != 0 }} | |
| run: pip install -r requirements_test.txt > /dev/null | |
| shell: bash | |
| - name: Running Integration-Tests | |
| if: ${{ steps.modules_to_test.outputs.count != 0 }} | |
| run: | | |
| echo "${{ secrets.CI_TEST_API_CREDENTIALS }}" > /tmp/api_credentials.txt | |
| chmod 600 /tmp/api_credentials.txt | |
| bash scripts/test_pr.sh | tee -a /tmp/test.log | |
| shell: bash | |
| env: | |
| TEST_FIREWALL: ${{ vars.CI_TEST_FIREWALL_1 }} | |
| TEST_API_KEY: /tmp/api_credentials.txt | |
| TEST_PROXY: ${{ secrets.CI_TEST_PROXY }} | |
| PYTHONUNBUFFERED: 1 | |
| PY_COLORS: 1 | |
| ANSIBLE_FORCE_COLOR: 1 | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-pr-${{ github.event.number }} | |
| path: /tmp/test.log | |
| retention-days: 14 |