]> git.puffer.fish Git - mirror/frr.git/commitdiff
topotests: Allow runing under both docker and podman 17525/head
authorfamfo <famfo@famfo.xyz>
Tue, 26 Nov 2024 18:42:03 +0000 (19:42 +0100)
committerfamfo <famfo@famfo.xyz>
Thu, 28 Nov 2024 13:59:29 +0000 (14:59 +0100)
Signed-off-by: famfo <famfo@famfo.xyz>
tests/topotests/docker/build.sh
tests/topotests/docker/frr-topotests.sh

index aec20587ba395717391e077da5a24a9c715f1df0..20d08e4979f23f83b660981eb465962318c1d988 100755 (executable)
@@ -1,11 +1,11 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # SPDX-License-Identifier: MIT
 #
 # Copyright 2018 Network Device Education Foundation, Inc. ("NetDEF")
 
 cd "$(dirname "$0")"/..
 
-exec docker build --pull \
+exec $(command -v docker || command -v podman) build --pull \
                  --compress \
                  -t frrouting/topotests:latest \
                  .
index bd37055147a7445c29399323ae3a854bf8d450c2..8de8e7b1f676d4cfde91c228b9a7bc304fd38e6b 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # SPDX-License-Identifier: MIT
 #
 # Copyright 2018 Network Device Education Foundation, Inc. ("NetDEF")
@@ -113,10 +113,12 @@ if [ -z "$TOPOTEST_FRR" ]; then
        git -C "$TOPOTEST_FRR" ls-files -z > "${TOPOTEST_LOGS}/git-ls-files"
 fi
 
+cmd="$(command -v docker || command -v podman)"
+
 if [ -z "$TOPOTEST_BUILDCACHE" ]; then
        TOPOTEST_BUILDCACHE=topotest-buildcache
-       docker volume inspect "${TOPOTEST_BUILDCACHE}" &> /dev/null \
-               || docker volume create "${TOPOTEST_BUILDCACHE}"
+       "${cmd}" volume inspect "${TOPOTEST_BUILDCACHE}" &> /dev/null \
+               || "${cmd}" volume create "${TOPOTEST_BUILDCACHE}"
 fi
 
 if [[ -n "$TMUX" ]]; then
@@ -145,4 +147,4 @@ if [ -t 0 ]; then
        set -- -t "$@"
 fi
 
-exec docker run "$@"
+exec "${cmd}" run "$@"