diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-05 09:56:23 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-05 09:56:23 +0000 |
commit | c15d6efd40655f717841d00839a43df1ead5cb26 (patch) | |
tree | 35d579f9a19170e2b39085669ca92533c2d161b4 /docker | |
parent | Adding upstream version 10.0.1. (diff) | |
download | frr-upstream.tar.xz frr-upstream.zip |
Adding upstream version 10.1.upstream/10.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | docker/debian/Dockerfile | 2 | ||||
-rw-r--r-- | docker/ubuntu-ci/Dockerfile | 26 | ||||
-rwxr-xr-x | docker/ubuntu-ci/docker-start | 5 | ||||
-rw-r--r-- | docker/ubuntu22-ci/README.md | 21 |
4 files changed, 32 insertions, 22 deletions
diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index d136538..b317b05 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -24,5 +24,5 @@ RUN chown -R frr:frr /etc/frr /var/run/frr ENTRYPOINT ["/usr/bin/tini", "--"] # Default CMD starts watchfrr -COPY docker-start /usr/lib/frr/docker-start +COPY --chmod=0755 docker-start /usr/lib/frr/docker-start CMD ["/usr/lib/frr/docker-start"] diff --git a/docker/ubuntu-ci/Dockerfile b/docker/ubuntu-ci/Dockerfile index 5a49806..5c4649d 100644 --- a/docker/ubuntu-ci/Dockerfile +++ b/docker/ubuntu-ci/Dockerfile @@ -23,13 +23,17 @@ RUN apt update && apt upgrade -y && \ libreadline-dev \ libsnmp-dev \ libsqlite3-dev \ + lsb-release \ libtool \ + lcov \ make \ perl \ pkg-config \ python3-dev \ python3-sphinx \ + screen \ texinfo \ + tmux \ && \ # Protobuf build requirements apt-get install -y \ @@ -89,18 +93,14 @@ RUN groupadd -r -g 92 frr && \ echo 'frr ALL = NOPASSWD: ALL' | tee /etc/sudoers.d/frr && \ mkdir -p /home/frr && chown frr.frr /home/frr -USER frr:frr +# Install FRR built packages +RUN mkdir -p /etc/apt/keyrings && \ + curl -s -o /etc/apt/keyrings/frrouting.gpg https://deb.frrouting.org/frr/keys.gpg && \ + echo deb '[signed-by=/etc/apt/keyrings/frrouting.gpg]' https://deb.frrouting.org/frr \ + $(lsb_release -s -c) "frr-stable" > /etc/apt/sources.list.d/frr.list && \ + apt-get update && apt-get install -y librtr-dev libyang2-dev libyang2-tools -# build and install libyang2 -RUN cd && pwd && ls -al && \ - git clone https://github.com/CESNET/libyang.git && \ - cd libyang && \ - git checkout v2.1.128 && \ - mkdir build; cd build && \ - cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr \ - -DCMAKE_BUILD_TYPE:String="Release" .. && \ - make -j $(nproc) && \ - sudo make install +USER frr:frr COPY --chown=frr:frr . /home/frr/frr/ @@ -111,6 +111,10 @@ RUN cd ~/frr && \ --sysconfdir=/etc \ --localstatedir=/var \ --sbindir=/usr/lib/frr \ + --enable-gcov \ + --enable-dev-build \ + --enable-mgmtd-test-be-client \ + --enable-rpki \ --enable-sharpd \ --enable-multipath=64 \ --enable-user=frr \ diff --git a/docker/ubuntu-ci/docker-start b/docker/ubuntu-ci/docker-start index 9a45c72..c383ea8 100755 --- a/docker/ubuntu-ci/docker-start +++ b/docker/ubuntu-ci/docker-start @@ -1,8 +1,5 @@ #!/bin/bash - if [ $(uname -a | grep -ci Ubuntu) -ge 1 ]; then - #for topotests under ubuntu host - sudo modprobe mpls-router mpls-iptunnel - sudo /etc/init.d/openvswitch-switch start + sudo modprobe mpls-router mpls-iptunnel vrf fi while true ; do sleep 365d ; done diff --git a/docker/ubuntu22-ci/README.md b/docker/ubuntu22-ci/README.md index 73f4a10..617192e 100644 --- a/docker/ubuntu22-ci/README.md +++ b/docker/ubuntu22-ci/README.md @@ -8,10 +8,18 @@ This builds an ubuntu 22.04 container for dev / test docker build -t frr-ubuntu22:latest -f docker/ubuntu-ci/Dockerfile . ``` -# Running Full Topotest +# Run ``` -docker run --init -it --privileged --name frr-ubuntu22 -v /lib/modules:/lib/modules frr-ubuntu22:latest bash -c 'cd ~/frr/tests/topotests ; sudo pytest -nauto --dist=loadfile' +docker run -d --init --privileged --name frr-ubuntu22 --mount type=bind,source=/lib/modules,target=/lib/modules frr-ubuntu22:latest +``` + +# Running full topotest (container stops at end) + +``` +docker run --init -it --privileged --name frr-ubuntu22 \ + -v /lib/modules:/lib/modules frr-ubuntu22:latest \ + bash -c 'cd /home/frr/frr/tests/topotests; sudo pytest -nauto --dist=loadfile' ``` # Extract results from the above run into `run-results` dir and analyze @@ -20,10 +28,11 @@ docker run --init -it --privileged --name frr-ubuntu22 -v /lib/modules:/lib/modu tests/topotests/analyze.py -C frr-ubuntu22 -Ar run-results ``` -# Running +# Extract coverage from a stopped container into host FRR source tree ``` -docker run -d --init --privileged --name frr-ubuntu22 --mount type=bind,source=/lib/modules,target=/lib/modules frr-ubuntu22:latest +docker export frr-ubuntu22 | tar --strip=3 --wildcards -vx '*.gc??' +lcov -b $(pwd) --capture --directory . --output-file=coverage.info ``` # make check @@ -38,10 +47,10 @@ docker exec frr-ubuntu22 bash -c 'cd ~/frr ; make check' docker exec -it frr-ubuntu22 bash ``` -# topotest -- when Host O/S is Ubuntu only +# Run a specific topotest ``` -docker exec frr-ubuntu22 bash -c 'cd ~/frr/tests/topotests/ospf_topo1 ; sudo pytest test_ospf_topo1.py' +docker exec frr-ubuntu22 bash -c 'cd ~/frr/tests/topotests ; sudo pytest ospf_topo1/test_ospf_topo1.py' ``` # stop & remove container |