summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Franke <chris@opensourcerouting.org>2018-10-18 12:27:37 +0200
committerChristian Franke <chris@opensourcerouting.org>2018-11-29 16:51:27 +0100
commit3311145d703424dd346d3defa8ad4f0f892db2be (patch)
tree2908de211659483d6fa21d5de354be21b4e2936d
parentDocker: really cleanup when TOPOTEST_CLEAN is specified (diff)
downloadfrr-3311145d703424dd346d3defa8ad4f0f892db2be.tar.xz
frr-3311145d703424dd346d3defa8ad4f0f892db2be.zip
Docker: Allow executing topotests while in subdir of FRR repo
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
-rw-r--r--tests/topotests/Dockerfile10
-rwxr-xr-xtests/topotests/docker/build.sh (renamed from tests/topotests/docker/docker.sh)10
-rwxr-xr-xtests/topotests/docker/frr-topotests.sh7
-rwxr-xr-xtests/topotests/docker/inner/compile_frr.sh (renamed from tests/topotests/docker/compile_frr.sh)0
-rwxr-xr-xtests/topotests/docker/inner/entrypoint.sh (renamed from tests/topotests/docker/entrypoint.sh)0
-rwxr-xr-xtests/topotests/docker/inner/funcs.sh (renamed from tests/topotests/docker/funcs.sh)0
-rw-r--r--tests/topotests/docker/inner/motd.txt (renamed from tests/topotests/docker/motd.txt)0
7 files changed, 13 insertions, 14 deletions
diff --git a/tests/topotests/Dockerfile b/tests/topotests/Dockerfile
index d7b2cae35..4f418b3ac 100644
--- a/tests/topotests/Dockerfile
+++ b/tests/topotests/Dockerfile
@@ -58,11 +58,13 @@ 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/inner /opt/topotests
COPY . /root/topotests
-WORKDIR /root
-ENV PATH "$PATH:/root/topotests/docker"
-RUN echo "cat /root/topotests/docker/motd.txt" >> /root/.profile && \
+WORKDIR /root/topotests
+ENV PATH "$PATH:/opt/topotests"
+
+RUN echo "cat /opt/topotests/motd.txt" >> /root/.profile && \
echo "export PS1='(topotests) $PS1'" >> /root/.profile
-ENTRYPOINT [ "bash", "/root/topotests/docker/entrypoint.sh" ]
+ENTRYPOINT [ "bash", "/opt/topotests/entrypoint.sh" ]
diff --git a/tests/topotests/docker/docker.sh b/tests/topotests/docker/build.sh
index 4dcee218c..47b14df0b 100755
--- a/tests/topotests/docker/docker.sh
+++ b/tests/topotests/docker/build.sh
@@ -22,15 +22,7 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-# Load shared functions
-CDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-. $CDIR/funcs.sh
-
-#
-# Script begin
-#
-
exec docker build --pull \
--compress \
- -t frrrouting/topotests \
+ -t frrouting/topotests \
.
diff --git a/tests/topotests/docker/frr-topotests.sh b/tests/topotests/docker/frr-topotests.sh
index e5e91156a..3df31c5d6 100755
--- a/tests/topotests/docker/frr-topotests.sh
+++ b/tests/topotests/docker/frr-topotests.sh
@@ -105,7 +105,12 @@ if [ -z "$TOPOTEST_LOGS" ]; then
fi
if [ -z "$TOPOTEST_FRR" ]; then
- TOPOTEST_FRR="$(pwd)"
+ TOPOTEST_FRR="$(git rev-parse --show-toplevel || true)"
+ if [ -z "$TOPOTEST_FRR" ]; then
+ echo "Could not determine base of FRR tree." >&2
+ echo "frr-topotests only works if you have your tree in git." >&2
+ exit 1
+ fi
fi
if [ -z "$TOPOTEST_BUILDCACHE" ]; then
diff --git a/tests/topotests/docker/compile_frr.sh b/tests/topotests/docker/inner/compile_frr.sh
index 579994f83..579994f83 100755
--- a/tests/topotests/docker/compile_frr.sh
+++ b/tests/topotests/docker/inner/compile_frr.sh
diff --git a/tests/topotests/docker/entrypoint.sh b/tests/topotests/docker/inner/entrypoint.sh
index 707c52188..707c52188 100755
--- a/tests/topotests/docker/entrypoint.sh
+++ b/tests/topotests/docker/inner/entrypoint.sh
diff --git a/tests/topotests/docker/funcs.sh b/tests/topotests/docker/inner/funcs.sh
index acb8b55e9..acb8b55e9 100755
--- a/tests/topotests/docker/funcs.sh
+++ b/tests/topotests/docker/inner/funcs.sh
diff --git a/tests/topotests/docker/motd.txt b/tests/topotests/docker/inner/motd.txt
index 1e2f34f8f..1e2f34f8f 100644
--- a/tests/topotests/docker/motd.txt
+++ b/tests/topotests/docker/inner/motd.txt