summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/topotests/Dockerfile8
-rwxr-xr-xtests/topotests/docker/compile_frr.sh2
-rwxr-xr-xtests/topotests/docker/entrypoint.sh2
-rwxr-xr-xtests/topotests/docker/funcs.sh8
-rwxr-xr-xtests/topotests/docker/topotests_run.sh8
5 files changed, 16 insertions, 12 deletions
diff --git a/tests/topotests/Dockerfile b/tests/topotests/Dockerfile
index 8cd98c43a7..ecc91bc543 100644
--- a/tests/topotests/Dockerfile
+++ b/tests/topotests/Dockerfile
@@ -56,11 +56,11 @@ RUN echo "" >> /etc/security/limits.conf; \
echo "root hard core unlimited" >> /etc/security/limits.conf
# Copy run scripts to facilitate users wanting to run the tests
-COPY docker/ /opt/topotests
+COPY . /root/topotests
WORKDIR /root
-ENV PATH "$PATH:/opt/topotests"
+ENV PATH "$PATH:/root/topotests/docker"
-RUN echo "cat /opt/topotests/motd.txt" >> /root/.profile && \
+RUN echo "cat /root/topotests/docker/motd.txt" >> /root/.profile && \
echo "export PS1='(topotests) $PS1'" >> /root/.profile
-ENTRYPOINT [ "bash", "/opt/topotests/entrypoint.sh" ]
+ENTRYPOINT [ "bash", "/root/topotests/docker/entrypoint.sh" ]
diff --git a/tests/topotests/docker/compile_frr.sh b/tests/topotests/docker/compile_frr.sh
index d9d27b670e..55046f9edb 100755
--- a/tests/topotests/docker/compile_frr.sh
+++ b/tests/topotests/docker/compile_frr.sh
@@ -32,7 +32,7 @@ CDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ ! -f .sync_source -o $SYNC_SOURCE -ne 0 ]; then
log_info "Syncing FRR source with host..."
mkdir -p $FRR_BUILD_DIR >/dev/null 2>&1
- rsync -a --info=progress2 --chown root:root $FRR_DIR/. $FRR_BUILD_DIR/
+ rsync -a --info=progress2 --chown root:root $FRR_HOST_DIR/. $FRR_BUILD_DIR/
touch .sync_source
fi
diff --git a/tests/topotests/docker/entrypoint.sh b/tests/topotests/docker/entrypoint.sh
index d9defb424e..e227029586 100755
--- a/tests/topotests/docker/entrypoint.sh
+++ b/tests/topotests/docker/entrypoint.sh
@@ -61,7 +61,7 @@ ovs-appctl -t ovsdb-server \
env \
CLEAN=1 \
VERBOSE=0 \
- bash /opt/topotests/compile_frr.sh
+ bash "${CDIR}/compile_frr.sh"
log_info "Setting permissions on /tmp so we can generate logs"
chmod -v 1777 /tmp
diff --git a/tests/topotests/docker/funcs.sh b/tests/topotests/docker/funcs.sh
index 78640d3244..dae71de329 100755
--- a/tests/topotests/docker/funcs.sh
+++ b/tests/topotests/docker/funcs.sh
@@ -22,10 +22,14 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-FRR_DIR=/root/frr
-FRR_BUILD_DIR=/root/frr-build
+FRR_HOST_DIR=/root/host-frr
+FRR_BUILD_DIR=/root/persist/frr-build
TOPOTESTS_DIR=/root/topotests
+if [ ! -L "/root/frr" ]; then
+ ln -s $FRR_BUILD_DIR /root/frr
+fi
+
[ -z $CLEAN ] && CLEAN=0
[ -z $VERBOSE ] && VERBOSE=1
[ -z $DOC ] && DOC=0
diff --git a/tests/topotests/docker/topotests_run.sh b/tests/topotests/docker/topotests_run.sh
index 8bca756b89..a68896789a 100755
--- a/tests/topotests/docker/topotests_run.sh
+++ b/tests/topotests/docker/topotests_run.sh
@@ -117,16 +117,16 @@ fi
if [ -z "$TOPOTEST_PATH" ]; then
docker run --rm -ti \
-v "$TOPOTEST_LOGS:/tmp" \
- -v "$TOPOTEST_FRR:/root/frr:ro" \
- -v "$TOPOTEST_BUILDCACHE:/root/frr-build" \
+ -v "$TOPOTEST_FRR:/root/host-frr:ro" \
+ -v "$TOPOTEST_BUILDCACHE:/root/persist" \
--privileged \
$TOPOTEST_OPTIONS \
frrouting/topotests "$@"
else
docker run --rm -ti \
-v "$TOPOTEST_LOGS:/tmp" \
- -v "$TOPOTEST_FRR:/root/frr:ro" \
- -v "$TOPOTEST_BUILDCACHE:/root/frr-build" \
+ -v "$TOPOTEST_FRR:/root/host-frr:ro" \
+ -v "$TOPOTEST_BUILDCACHE:/root/persist" \
-v "$TOPOTEST_PATH:/root/topotests:ro" \
--privileged \
$TOPOTEST_OPTIONS \