From bbd8ce79f248b360821ff04a28a95511a9dd419a Mon Sep 17 00:00:00 2001 From: Pier Carlo Chiodi Date: Wed, 23 Jun 2021 19:34:11 +0200 Subject: [PATCH 1/5] Logging customization via local files --- CHANGES.rst | 9 +++++++++ docs/CONFIG.rst | 22 ++++++++++++++++++++-- pierky/arouteserver/builder.py | 17 +++++++++++++++-- templates/bird/header.j2 | 4 ++++ templates/fingerprints.yml | 4 ++-- templates/openbgpd/header.j2 | 4 ++++ 6 files changed, 54 insertions(+), 6 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 1bff42e9..5289e543 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -3,6 +3,15 @@ Change log .. note:: **Upgrade notes**: after upgrading, run the ``arouteserver setup-templates`` command to sync the local templates with those distributed with the new version. More details on the `Upgrading `__ section of the documentation. +next release +------------ + +- Improvement: add the ``logging`` option to ``--use-local-files`` argument, to allow customization of logging settings. + + Details on the documentation: `Site-specific custom configuration files `__. + + See also `GitHub issue 75 `_. + 1.7.0 ----- diff --git a/docs/CONFIG.rst b/docs/CONFIG.rst index a552af9b..53764678 100644 --- a/docs/CONFIG.rst +++ b/docs/CONFIG.rst @@ -350,9 +350,9 @@ Local files inclusion can be enabled by a command line argument, ``--use-local-f To determine in which point of the configuration file the local files identified by the labels above are inserted, please refer to the template files of each BGP speaker (you can search for ``include_local_file``): -- `BIRD `__: see `main.j2 `__, `clients.j2 `__ and `rpki.j2 `__. +- `BIRD `__: see `main.j2 `__, `header.j2 `__, `clients.j2 `__ and `rpki.j2 `__. -- `OpenBGPD `__: see `main.j2 `__, `filters.j2 `__, `rpki.j2 `__, `clients.j2 `__, `irrdb.j2 `__. +- `OpenBGPD `__: see `main.j2 `__, `header.j2 `__, `filters.j2 `__, `rpki.j2 `__, `clients.j2 `__, `irrdb.j2 `__. One or more of these labels must be used as the argument's value in order to enable the relative inclusion points. For each enabled label, an *include* statement is added to the generated configuration in the point identified by the label itself. To modify the base directory, the ``--local-files-dir`` command line option can be used. @@ -429,6 +429,24 @@ These files must be present on the host running the route server. The example above uses the ``client`` label, that is used to add an ``include`` statement into every neighbor configuration. Also, the base directory is set to ``/etc/``. +The ``logging`` label has a special meaning: when it's used in the ``--local-files-dir`` option, the default logging settings of the BGP speaker are omitted, and they are replaced by the *include* statement. + +- Example, BIRD, ``logging`` being used: + + .. code:: + + router id 192.0.2.123; + define rs_as = 65500; + + include "/etc/bird/logging.local"; + + timeformat base iso long; + timeformat log iso long; + timeformat protocol iso long; + timeformat route iso long; + +As you can see, the default logging settings are omitted and replaced with the *include* statement for *logging.local*. + .. _bird-hooks: BIRD hooks diff --git a/pierky/arouteserver/builder.py b/pierky/arouteserver/builder.py index 7623bb5f..fc20436e 100644 --- a/pierky/arouteserver/builder.py +++ b/pierky/arouteserver/builder.py @@ -621,6 +621,17 @@ def is_ipver(data, ip_ver): prefix = data return IPNetwork(prefix).version == ip_ver + def is_local_file_used(local_file_id): + if local_file_id not in self.LOCAL_FILES_IDS: + raise AssertionError( + "Local file ID '{}' is referenced in J2 " + "templates but is not in LOCAL_FILES_IDS.".format( + local_file_id + ) + ) + local_files = self.local_files or [] + return local_file_id in local_files + def include_local_file(local_file_id): # The 'rpki_rtr_config' local_file_id is always allowed # to be included, because it's referenced directly in @@ -674,6 +685,7 @@ def community_is_set(comm): ) env.tests["current_ipver"] = current_ipver env.tests["is_ipver"] = is_ipver + env.tests["used_local_file"] = is_local_file_used env.filters["community_is_set"] = community_is_set env.filters["ipaddr_ver"] = ipaddr_ver env.filters["include_local_file"] = include_local_file @@ -719,7 +731,8 @@ class BIRDConfigBuilder(ConfigBuilder): the output configuration. Details: https://arouteserver.readthedocs.io/en/latest/CONFIG.html#bird-hooks """ - LOCAL_FILES_IDS = ["header", "header4", "header6", + LOCAL_FILES_IDS = ["logging", + "header", "header4", "header6", "footer", "footer4", "footer6", "client", "client4", "client6"] LOCAL_FILES_BASE_DIR = "/etc/bird" @@ -859,7 +872,7 @@ class OpenBGPDConfigBuilder(ConfigBuilder): """OpenBGPD configuration builder. """ - LOCAL_FILES_IDS = ["header", + LOCAL_FILES_IDS = ["logging", "header", "pre-irrdb", "post-irrdb", "pre-clients", "post-clients", "client", "pre-filters", "post-filters", diff --git a/templates/bird/header.j2 b/templates/bird/header.j2 index 5df1d82e..dd1be966 100644 --- a/templates/bird/header.j2 +++ b/templates/bird/header.j2 @@ -1,9 +1,13 @@ router id {{ cfg.router_id }}; define rs_as = {{ cfg.rs_as }}; +{% if not "logging" is used_local_file %} log "/var/log/bird.log" all; log syslog all; debug protocols { states, routes, filters, interfaces, events }; +{% else %} +{{ "logging"|include_local_file -}} +{% endif %} timeformat base iso long; timeformat log iso long; diff --git a/templates/fingerprints.yml b/templates/fingerprints.yml index 30802b87..95153f5b 100644 --- a/templates/fingerprints.yml +++ b/templates/fingerprints.yml @@ -1,7 +1,7 @@ bird: clients.j2: 82b1af98ce33c51681459f8fdf54f9a55854c7cd5c82afb8378c8035f6763e61290b518e362fd3c67b7b089e67a5c5516e53aa2a9a5881d4369ca2c8f28e2363 common.j2: 0a40c697607158c08ada0f212855b0254a43a81c5f9d05010e2a07a595dffd4f0e4f303c3522fced81e021d4f72e6f163153901331762e3901b37753482a297d - header.j2: 584f9db6b8ee3f7c0be57d11323aac3e6b984cf5c495bbcb3d37b551c3525edc45baf1066d2d10b8af173a2159bc7e699a57f3fe4de4434ce244f12278df34a1 + header.j2: 25f219ef4d0a4ee64c18b338bc557c246c4759b438f31865a7483ebef8a9a3795e09c85ba301da24d7036b474f7936f7a9ed758f93d66bca36e0624c23729170 irrdb.j2: ba14f717104b1ace6b208046d1028e0e9bda456f7bbec31fb57e04d8e75133a3925a49e91b047dc8d73b96cc6a2be8df7fa5134ef42e4937f4f2e8245e712c2f macros.j2: 0dd53486a495edb4a486f2c82a7482a255748654651c7e06ac29b1c7726ea2ccd7078d831b75e5350400b95c8927779a20f9c9c5b1d52f0f9f725d3e90f5c23a main.j2: ed32987ac71837a00e6065f135198080e493e9a92d41b056c608c9fb6821bd896f492f6b3ed2242c31b3c9ae868e9dd705d681b4e1dbe8aa63a1ec1706972cf0 @@ -15,7 +15,7 @@ irr-as-set: openbgpd: clients.j2: 518191e01b4b7194bd246b06977e54b83c53e66b0af2896c356bf1a81a41595b8dbb1e088c6f88e6d40042f3a3752d03a89c16c02e71204e41db8f7451fe3095 filters.j2: 9eacf1262e058ed488ff862055ebad170dcf722389e8129f0959e5b5f4c805d0c1cda5337cbe95688e3b2b2748faf78ec328de8a88d0cb0ac5c5666e231f859e - header.j2: 590c978e039c147251e855b04ed55e8981c18da570d59d265bc003b9d7d7c53d1df8f76fd9a8526ad7c9332f7a4218797c637dd89bafbb62651fcbfa14f76f82 + header.j2: 6d01b917dd01267e089c5b9bf887b918539e532d1fd99da297d3ede013c6678e737fb4f02d28da5ba9af81754795cac5516e940f1d2f6feb40549d982a7dbeac irrdb.j2: a41aff6077c4b7ddd8ae03f0ac33f3ff47c9812350204d929a8b02fe63d023a813e802a7c9183528058b55d7502f7aeaef77a65acc906022586510f37453b88a macros.j2: 2a2edfebbcc29835c91723da117052374b1d07c1d9e66a23717d248768cd628b7ea831971be28d42e57c58f59d27fa92333b3b0e66eb439029a0bbf9f69b85c4 main.j2: c81d8a3d4052a440f3d404ebdadeeae181966447463f9733768d8d9da4304cd6ea1505a9fdb58e3df55521c44bd03174efa3d3f35b5b79b8d7dda17ee9589061 diff --git a/templates/openbgpd/header.j2 b/templates/openbgpd/header.j2 index 972bfa7f..23e2c8a5 100644 --- a/templates/openbgpd/header.j2 +++ b/templates/openbgpd/header.j2 @@ -2,7 +2,11 @@ AS {{ cfg.rs_as }} router-id {{ cfg.router_id }} fib-update no +{% if not "logging" is used_local_file %} log updates +{% else %} +{{ "logging"|include_local_file -}} +{% endif %} nexthop qualify via default From 446edb05e3521f2bb7d782c2ac656741b376304b Mon Sep 17 00:00:00 2001 From: Pier Carlo Chiodi Date: Wed, 23 Jun 2021 19:34:19 +0200 Subject: [PATCH 2/5] v1.7.1-alpha1 --- pierky/arouteserver/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pierky/arouteserver/version.py b/pierky/arouteserver/version.py index a5f566b4..0b22f606 100644 --- a/pierky/arouteserver/version.py +++ b/pierky/arouteserver/version.py @@ -13,5 +13,5 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -__version__ = "1.7.0-post1" # pragma: no cover +__version__ = "1.7.1-alpha1" # pragma: no cover COPYRIGHT_YEAR = 2021 # pragma: no cover From 61492465ade33dfcd09c12e3a5b63647952787a3 Mon Sep 17 00:00:00 2001 From: Pier Carlo Chiodi Date: Wed, 23 Jun 2021 21:16:02 +0200 Subject: [PATCH 3/5] Simplify and fix the CICD pipelines Hopefully it'll work... --- .../{docker_image_tests.yml => cicd.yml} | 158 +++++++++++++++++- .github/workflows/docker_publish.yml | 64 ------- .github/workflows/publish_on_pypi.yaml | 42 ----- .github/workflows/test_external_resources.yml | 1 + .github/workflows/tests.yml | 59 ------- README.rst | 4 +- docs/LIVETESTS.rst | 2 +- docs/README_footer.txt | 4 +- tests/README.rst | 2 +- tests/live_tests/README.rst | 2 +- 10 files changed, 165 insertions(+), 173 deletions(-) rename .github/workflows/{docker_image_tests.yml => cicd.yml} (57%) delete mode 100644 .github/workflows/docker_publish.yml delete mode 100644 .github/workflows/publish_on_pypi.yaml delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/docker_image_tests.yml b/.github/workflows/cicd.yml similarity index 57% rename from .github/workflows/docker_image_tests.yml rename to .github/workflows/cicd.yml index 3801cd49..b41ee6f8 100644 --- a/.github/workflows/docker_image_tests.yml +++ b/.github/workflows/cicd.yml @@ -1,10 +1,68 @@ -name: Docker image tests +name: Tests and push to PyPi and DockerHub on: push jobs: + tests: + name: Run tests + + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: [3.6] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install bgpq3 / bgpq4 + run: | + ./tests/external_resources/install_bgpq3.sh + ./tests/external_resources/install_bgpq4.sh + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 coveralls nose + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Flake8 + run: flake8 pierky/ scripts/ + + - name: Test CLI + run: ./tests/cli + + - name: Test external resources + run: nosetests -vs --tests=tests/external_resources/ + env: + TRAVIS: 1 + + - name: Fetch Docker images used by tests + run: | + echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin + docker pull pierky/bird:1.6.8 + docker pull pierky/bird:2.0.8 + docker pull pierky/openbgpd:6.8p1 + docker pull pierky/openbgpd:7.0p0 + docker pull pierky/exabgp:4.2.7 + docker pull nlnetlabs/routinator:v0.8.3 + env: + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Tests + run: nosetests -vs -x --tests=tests/static/,tests/live_tests/ + env: + TRAVIS: 1 + docker-image-tests: name: Docker image tests + runs-on: ubuntu-latest steps: @@ -217,3 +275,101 @@ jobs: egrep 'header.local|footer.local' | \ wc -l | \ grep 2 + + push_to_pypi: + name: Push to PyPi + + needs: tests + + runs-on: ubuntu-latest + + if: startsWith(github.ref, 'refs/tags/v') + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: 3.6 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Build and push the release + run: >- + python setup.py sdist + + # All the tags go to PyPI test + - name: Publish distribution to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + + # Only non-alpha releases go to the official PyPi + - name: Publish distribution to PyPI (official release) + if: contains(github.ref, 'alpha') != true + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_API_TOKEN }} + + push_to_registry: + name: Push Docker image to Docker Hub + + needs: [tests, docker-image-tests] + + runs-on: ubuntu-latest + + if: startsWith(github.ref, 'refs/tags/v') + + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Get the release + run: echo "::set-output name=CURRENT_RELEASE::$(python -c 'from pierky.arouteserver.version import __version__; print(__version__)')" + id: get_the_release + + - name: Is it a stable? + run: echo "::set-output name=IS_STABLE_RELEASE::$(python -c 'from pierky.arouteserver.version import __version__; import re; import sys; re.match(r"^\d+\.\d+\.\d+$", __version__); sys.stdout.write(str(bool(re.match(r"^\d+\.\d+\.\d+$", __version__))))')" + id: is_stable_release + + - name: Show the arguments + run: echo "Release ${{ steps.get_the_release.outputs.CURRENT_RELEASE }} - stable ${{ steps.is_stable_release.outputs.IS_STABLE_RELEASE }}" + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Push to Docker Hub (current release) + uses: docker/build-push-action@v2 + with: + push: true + file: ./docker/Dockerfile + tags: pierky/arouteserver:${{ steps.get_the_release.outputs.CURRENT_RELEASE }} + + - name: Push to Docker Hub (latest) + if: steps.is_stable_release.outputs.IS_STABLE_RELEASE == 'True' + uses: docker/build-push-action@v2 + with: + push: true + file: ./docker/Dockerfile + tags: pierky/arouteserver:latest + + - name: Update Docker Hub description + uses: peter-evans/dockerhub-description@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + # This must be the DockerHub password, since AToW + # Docker Hub doesn't allow to use tokens to update + # the README. + # https://github.com/peter-evans/dockerhub-description/issues/10 + password: ${{ secrets.DOCKERHUB_PASSWORD }} + repository: pierky/arouteserver + short-description: ARouteServer official Docker images + readme-filepath: ./docker/README.md diff --git a/.github/workflows/docker_publish.yml b/.github/workflows/docker_publish.yml deleted file mode 100644 index a921407c..00000000 --- a/.github/workflows/docker_publish.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Publish Docker image - -# on: push # This needs the with.ref in actions/checkout@v2. - -on: - release: - types: [created, edited] - -jobs: - push_to_registry: - name: Push Docker image to Docker Hub - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v2 - # Add the following 'with' to run this using the - # 'on: push' trigger - # with: - # ref: v1.4.0 - - - name: Get the release - run: echo "::set-output name=CURRENT_RELEASE::$(python -c 'from pierky.arouteserver.version import __version__; print(__version__)')" - id: get_the_release - - - name: Is it a stable? - run: echo "::set-output name=IS_STABLE_RELEASE::$(python -c 'from pierky.arouteserver.version import __version__; import re; import sys; re.match(r"^\d+\.\d+\.\d+$", __version__); sys.stdout.write(str(bool(re.match(r"^\d+\.\d+\.\d+$", __version__))))')" - id: is_stable_release - - - name: Show the arguments - run: echo "Release ${{ steps.get_the_release.outputs.CURRENT_RELEASE }} - stable ${{ steps.is_stable_release.outputs.IS_STABLE_RELEASE }}" - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Push to Docker Hub (current release) - uses: docker/build-push-action@v2 - with: - push: true - file: ./docker/Dockerfile - tags: pierky/arouteserver:${{ steps.get_the_release.outputs.CURRENT_RELEASE }} - - - name: Push to Docker Hub (latest) - if: steps.is_stable_release.outputs.IS_STABLE_RELEASE == 'True' - uses: docker/build-push-action@v2 - with: - push: true - file: ./docker/Dockerfile - tags: pierky/arouteserver:latest - - - name: Update Docker Hub description - uses: peter-evans/dockerhub-description@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - # This must be the DockerHub password, since AToW - # Docker Hub doesn't allow to use tokens to update - # the README. - # https://github.com/peter-evans/dockerhub-description/issues/10 - password: ${{ secrets.DOCKERHUB_PASSWORD }} - repository: pierky/arouteserver - short-description: ARouteServer official Docker images - readme-filepath: ./docker/README.md diff --git a/.github/workflows/publish_on_pypi.yaml b/.github/workflows/publish_on_pypi.yaml deleted file mode 100644 index b2f84515..00000000 --- a/.github/workflows/publish_on_pypi.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: Publish on PyPi - -on: - workflow_run: - workflows: ["CI"] - types: [completed] - -jobs: - push_to_pypi: - name: Push to PyPi - runs-on: ubuntu-latest - if: | - ${{ github.event.workflow_run.conclusion == 'success' }} && - startsWith(github.ref, 'refs/tags/v') - steps: - - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: 3.6 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - - name: Build and push the release - run: >- - python setup.py sdist - - - name: Publish distribution to Test PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository_url: https://test.pypi.org/legacy/ - - - name: Publish distribution to PyPI (official release) - if: contains(github.ref, 'alpha') != true - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/test_external_resources.yml b/.github/workflows/test_external_resources.yml index 2185ed09..5e409bf1 100644 --- a/.github/workflows/test_external_resources.yml +++ b/.github/workflows/test_external_resources.yml @@ -4,6 +4,7 @@ on: schedule: # * is a special character in YAML so you have to quote this string - cron: '16 9 * * *' + workflow_dispatch: jobs: test_ext_res: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index b478e9fc..00000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: CI - -on: push - -jobs: - ci: - runs-on: ubuntu-latest - - strategy: - matrix: - python-version: [3.6] - - steps: - - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Install bgpq3 / bgpq4 - run: | - ./tests/external_resources/install_bgpq3.sh - ./tests/external_resources/install_bgpq4.sh - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 coveralls nose - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - - name: Flake8 - run: flake8 pierky/ scripts/ - - - name: Test CLI - run: ./tests/cli - - - name: Test external resources - run: nosetests -vs --tests=tests/external_resources/ - env: - TRAVIS: 1 - - - name: Fetch Docker images used by tests - run: | - echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin - docker pull pierky/bird:1.6.8 - docker pull pierky/bird:2.0.8 - docker pull pierky/openbgpd:6.8p1 - docker pull pierky/openbgpd:7.0p0 - docker pull pierky/exabgp:4.2.7 - docker pull nlnetlabs/routinator:v0.8.3 - env: - DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Tests - run: nosetests -vs -x --tests=tests/static/,tests/live_tests/ - env: - TRAVIS: 1 diff --git a/README.rst b/README.rst index abe235fc..22c72ecf 100644 --- a/README.rst +++ b/README.rst @@ -225,8 +225,8 @@ Blog: https://blog.pierky.com Twitter: `@pierky `_ .. |Documentation| image:: https://readthedocs.org/projects/arouteserver/badge/?version=latest :target: https://arouteserver.readthedocs.org/en/latest/?badge=latest -.. |Build Status| image:: https://github.com/pierky/arouteserver/actions/workflows/tests.yml/badge.svg?branch=master - :target: https://github.com/pierky/arouteserver/actions/workflows/tests.yml +.. |Build Status| image:: https://github.com/pierky/arouteserver/actions/workflows/cicd.yml/badge.svg?branch=master + :target: https://github.com/pierky/arouteserver/actions/workflows/cicd.yml .. |Unique test cases| image:: https://img.shields.io/badge/dynamic/json.svg?uri=https://raw.githubusercontent.com/pierky/arouteserver/master/tests/last.json&label=unique%20test%20cases&query=$.unique_test_cases&colorB=47C327 :target: https://github.com/pierky/arouteserver/blob/master/tests/last .. |PYPI Version| image:: https://img.shields.io/pypi/v/arouteserver.svg diff --git a/docs/LIVETESTS.rst b/docs/LIVETESTS.rst index d56a6528..81a49bc2 100644 --- a/docs/LIVETESTS.rst +++ b/docs/LIVETESTS.rst @@ -17,7 +17,7 @@ Example: in a configuration where blackhole filtering is enabled, an instance of next_hop="192.0.2.66", std_comms=["65535:666"], lrg_comms=[]) -`GitHub Actions log file `_ contains the latest built-in live tests results. +`GitHub Actions log file `_ contains the latest built-in live tests results. Since (AFAIK) OpenBGPD can't be run on GitHub Actions platform, the full live tests results, including those run on OpenBGPD, can be found on `this file `_. Starting with version 6.5, the Portable edition of OpenBGPD has been used to run some tests on GitHub Actions too. diff --git a/docs/README_footer.txt b/docs/README_footer.txt index c752bed5..297715bc 100644 --- a/docs/README_footer.txt +++ b/docs/README_footer.txt @@ -7,8 +7,8 @@ Blog: https://blog.pierky.com Twitter: `@pierky `_ .. |Documentation| image:: https://readthedocs.org/projects/arouteserver/badge/?version=latest :target: https://arouteserver.readthedocs.org/en/latest/?badge=latest -.. |Build Status| image:: https://github.com/pierky/arouteserver/actions/workflows/tests.yml/badge.svg?branch=master - :target: https://github.com/pierky/arouteserver/actions/workflows/tests.yml +.. |Build Status| image:: https://github.com/pierky/arouteserver/actions/workflows/cicd.yml/badge.svg?branch=master + :target: https://github.com/pierky/arouteserver/actions/workflows/cicd.yml .. |Unique test cases| image:: https://img.shields.io/badge/dynamic/json.svg?uri=https://raw.githubusercontent.com/pierky/arouteserver/master/tests/last.json&label=unique%20test%20cases&query=$.unique_test_cases&colorB=47C327 :target: https://github.com/pierky/arouteserver/blob/master/tests/last .. |PYPI Version| image:: https://img.shields.io/pypi/v/arouteserver.svg diff --git a/tests/README.rst b/tests/README.rst index de101918..bc8f80a3 100644 --- a/tests/README.rst +++ b/tests/README.rst @@ -11,6 +11,6 @@ The following directories contain code that is used to test ARouteServer: - **real**: some `realistic scenarios `_ built on the basis of lists of clients pulled from actual IXPs' members lists. -The latest results of *static*, *live* and *external_resources* tests can be found within the **last** file (and also on `GitHub Actions log file `_, except for OpenBGPD focused tests). +The latest results of *static*, *live* and *external_resources* tests can be found within the **last** file (and also on `GitHub Actions log file `_, except for OpenBGPD focused tests). Results for the *real* tests are reported within the **tests/real/last** file. diff --git a/tests/live_tests/README.rst b/tests/live_tests/README.rst index 8bbffe2d..d70176f1 100644 --- a/tests/live_tests/README.rst +++ b/tests/live_tests/README.rst @@ -15,7 +15,7 @@ Example: in a configuration where blackhole filtering is enabled, an instance of next_hop="192.0.2.66", std_comms=["65535:666"], lrg_comms=[]) -`GitHub Actions log file `_ contains the latest built-in live tests results. +`GitHub Actions log file `_ contains the latest built-in live tests results. Since (AFAIK) OpenBGPD can't be run on GitHub Actions platform, the full live tests results including those run on OpenBGPD can be found on `this file `_. More details on the `Live tests `_ page on the official documentation. From 1b773d5a481f8d57a657bf79177119744b721648 Mon Sep 17 00:00:00 2001 From: bluikko <14869000+bluikko@users.noreply.github.com> Date: Thu, 24 Jun 2021 09:08:22 +0700 Subject: [PATCH 4/5] Proposed referring to default logging configuration --- docs/CONFIG.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/CONFIG.rst b/docs/CONFIG.rst index 53764678..00be16d8 100644 --- a/docs/CONFIG.rst +++ b/docs/CONFIG.rst @@ -431,6 +431,12 @@ These files must be present on the host running the route server. The ``logging`` label has a special meaning: when it's used in the ``--local-files-dir`` option, the default logging settings of the BGP speaker are omitted, and they are replaced by the *include* statement. +To determine the default logging configuration, please refer to the template files: + +- `BIRD `__: see `header.j2 `__ + +- `OpenBGPD `__: see `header.j2 `__ + - Example, BIRD, ``logging`` being used: .. code:: From 521994cbc70f3a0552e3f09ad6e81b12c2c2fc6f Mon Sep 17 00:00:00 2001 From: Pier Carlo Chiodi Date: Fri, 25 Jun 2021 12:16:11 +0200 Subject: [PATCH 5/5] Improve doc for logging local file --- docs/CONFIG.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/CONFIG.rst b/docs/CONFIG.rst index 00be16d8..ee9a94b6 100644 --- a/docs/CONFIG.rst +++ b/docs/CONFIG.rst @@ -429,6 +429,9 @@ These files must be present on the host running the route server. The example above uses the ``client`` label, that is used to add an ``include`` statement into every neighbor configuration. Also, the base directory is set to ``/etc/``. +Logging configuration of the BGP daemon +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + The ``logging`` label has a special meaning: when it's used in the ``--local-files-dir`` option, the default logging settings of the BGP speaker are omitted, and they are replaced by the *include* statement. To determine the default logging configuration, please refer to the template files: @@ -437,6 +440,8 @@ To determine the default logging configuration, please refer to the template fil - `OpenBGPD `__: see `header.j2 `__ +As you can see in the next example, the default logging settings are omitted and replaced with the *include* statement for *logging.local*. + - Example, BIRD, ``logging`` being used: .. code:: @@ -451,8 +456,6 @@ To determine the default logging configuration, please refer to the template fil timeformat protocol iso long; timeformat route iso long; -As you can see, the default logging settings are omitted and replaced with the *include* statement for *logging.local*. - .. _bird-hooks: BIRD hooks