summaryrefslogtreecommitdiffstats
path: root/tests/topotests/docker
diff options
context:
space:
mode:
authorChristian Franke <chris@opensourcerouting.org>2018-10-17 20:31:52 +0200
committerChristian Franke <chris@opensourcerouting.org>2018-11-29 16:51:27 +0100
commitca64604f47a8d9f4753b53b9fa4354eb18e4c511 (patch)
treed5facd7a2884928139b6f6eb60acd8464ef3718f /tests/topotests/docker
parentdocker: reindent shell scripts (diff)
downloadfrr-ca64604f47a8d9f4753b53b9fa4354eb18e4c511.tar.xz
frr-ca64604f47a8d9f4753b53b9fa4354eb18e4c511.zip
docker: Install topotests into image
Also: Change directory layout so we can do an indempotent sync from host later. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Diffstat (limited to 'tests/topotests/docker')
-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
4 files changed, 12 insertions, 8 deletions
diff --git a/tests/topotests/docker/compile_frr.sh b/tests/topotests/docker/compile_frr.sh
index d9d27b670..55046f9ed 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 d9defb424..e22702958 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 78640d324..dae71de32 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 8bca756b8..a68896789 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 \