]> git.proxmox.com Git - mirror_frr.git/commitdiff
docker: reindent shell scripts
authorChristian Franke <chris@opensourcerouting.org>
Wed, 17 Oct 2018 17:56:26 +0000 (19:56 +0200)
committerChristian Franke <chris@opensourcerouting.org>
Thu, 29 Nov 2018 15:51:27 +0000 (16:51 +0100)
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
tests/topotests/docker/compile_frr.sh
tests/topotests/docker/docker.sh
tests/topotests/docker/entrypoint.sh
tests/topotests/docker/funcs.sh

index 44b87405ea2729ee05222f9734cf19713af4df3b..d9d27b670e307d2951046ffcafc5309fb4b1f071 100755 (executable)
@@ -30,70 +30,70 @@ CDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 # Script begin
 #
 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/
-  touch .sync_source
+       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/
+       touch .sync_source
 fi
 
 log_info "Building FRR..."
 
 cd $FRR_BUILD_DIR || \
-  log_fatal "failed to find frr directory"
+       log_fatal "failed to find frr directory"
 
 if [ $CLEAN -ne 0 ]; then
-  make distclean >/dev/null 2>&1
-  rm -f Makefile configure
+       make distclean >/dev/null 2>&1
+       rm -f Makefile configure
 fi
 
 if [ ! -f configure ]; then
-  bash bootstrap.sh || \
-    log_fatal "failed to bootstrap configuration"
+       bash bootstrap.sh || \
+               log_fatal "failed to bootstrap configuration"
 fi
 
 if [ $DOC -ne 0 ]; then
-  EXTRA_CONFIGURE+=" --enable-doc "
+       EXTRA_CONFIGURE+=" --enable-doc "
 else
-  EXTRA_CONFIGURE+=" --disable-doc "
+       EXTRA_CONFIGURE+=" --disable-doc "
 fi
 
 if [ ! -f Makefile ]; then
-  if [ $SANITIZER -ne 0 ]; then
-    export CC="gcc"
-    export CFLAGS="-O1 -g -fsanitize=address -fno-omit-frame-pointer"
-    export LD="gcc"
-    export LDFLAGS="-g -fsanitize=address -ldl"
-    EXTRA_CONFIGURE+=" --enable-shared=no "
-    touch .address_sanitizer
-  else
-    rm -f .address_sanitizer
-  fi
+       if [ $SANITIZER -ne 0 ]; then
+               export CC="gcc"
+               export CFLAGS="-O1 -g -fsanitize=address -fno-omit-frame-pointer"
+               export LD="gcc"
+               export LDFLAGS="-g -fsanitize=address -ldl"
+               EXTRA_CONFIGURE+=" --enable-shared=no "
+               touch .address_sanitizer
+       else
+               rm -f .address_sanitizer
+       fi
 
-  bash configure >/dev/null \
-    --enable-multipath=64 \
-    --prefix=/usr \
-    --localstatedir=/var/run/frr \
-    --sbindir=/usr/lib/frr \
-    --sysconfdir=/etc/frr \
-    $EXTRA_CONFIGURE \
-    --with-pkg-extra-version=-topotests \
-    || log_fatal "failed to configure the sources"
+       bash configure >/dev/null \
+               --enable-multipath=64 \
+               --prefix=/usr \
+               --localstatedir=/var/run/frr \
+               --sbindir=/usr/lib/frr \
+               --sysconfdir=/etc/frr \
+               $EXTRA_CONFIGURE \
+               --with-pkg-extra-version=-topotests \
+               || log_fatal "failed to configure the sources"
 fi
 
 # if '.address_sanitizer' file exists it means we are using address sanitizer.
 if [ -f .address_sanitizer ]; then
-  make -C lib CFLAGS="-g -O2" LDFLAGS="-g" clippy
+       make -C lib CFLAGS="-g -O2" LDFLAGS="-g" clippy
 fi
 
 if [ $VERBOSE -ne 0 ]; then
-  make -j$(cpu_count) || \
-    log_fatal "failed to build the sources"
+       make -j$(cpu_count) || \
+               log_fatal "failed to build the sources"
 else
-  make -j$(cpu_count) >/dev/null || \
-    log_fatal "failed to build the sources"
+       make -j$(cpu_count) >/dev/null || \
+               log_fatal "failed to build the sources"
 fi
 
 make install >/dev/null || \
-  log_fatal "failed to install frr"
+       log_fatal "failed to install frr"
 
 exit 0
index c312e58206b7b795c1fe80978cbb6151696baeba..ac40e6c5afa9c379ad2b9c72705ee5469a6129dc 100755 (executable)
@@ -31,19 +31,19 @@ CDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 #
 
 OLD_IMAGE_SHA=$( \
-  docker images | \
-  egrep "^topotests" | \
-  sed -r "s/( )+/ /g" | \
-  cut -d " " -f 3 \
+       docker images | \
+       egrep "^topotests" | \
+       sed -r "s/( )+/ /g" | \
+       cut -d " " -f 3 \
 )
 
 docker build --force-rm --pull --compress -t topotests . || \
-  log_fatal "failed to generate topotest docker image"
+       log_fatal "failed to generate topotest docker image"
 
 if [ ! -z "$OLD_IMAGE_SHA" ]; then
-  log_info "Removing old topotest image"
-  docker rmi $OLD_IMAGE_SHA || \
-    log_warning "failed to remove old image"
+       log_info "Removing old topotest image"
+       docker rmi $OLD_IMAGE_SHA || \
+               log_warning "failed to remove old image"
 fi
 
 exit 0
index f62fa41b882261141eeee1c5ef0e751df5545a99..d9defb424ef20a68f4dd30456d968fb14a93208a 100755 (executable)
@@ -34,11 +34,11 @@ log_info "Configuring OpenvSwitch...."
 # Configure OpenvSwitch so we are able to run mininet
 mkdir -p /var/run/openvswitch
 ovsdb-tool create /etc/openvswitch/conf.db \
-  /usr/share/openvswitch/vswitch.ovsschema
+       /usr/share/openvswitch/vswitch.ovsschema
 ovsdb-server /etc/openvswitch/conf.db \
-  --remote=punix:/var/run/openvswitch/db.sock \
-  --remote=ptcp:6640 --pidfile=ovsdb-server.pid >/dev/null 2>/dev/null & \
-  disown
+       --remote=punix:/var/run/openvswitch/db.sock \
+       --remote=ptcp:6640 --pidfile=ovsdb-server.pid >/dev/null 2>/dev/null & \
+       disown
 ovs-vswitchd >/dev/null 2>/dev/null & disown
 
 sleep 2
@@ -46,22 +46,22 @@ sleep 2
 ovs-vsctl --no-wait -- init
 ovs_version=$(ovs-vsctl -V | grep ovs-vsctl | awk '{print $4}')
 ovs_db_version=$(\
-  ovsdb-tool schema-version /usr/share/openvswitch/vswitch.ovsschema)
+       ovsdb-tool schema-version /usr/share/openvswitch/vswitch.ovsschema)
 ovs-vsctl --no-wait -- set Open_vSwitch . db-version="${ovs_db_version}"
 ovs-vsctl --no-wait -- set Open_vSwitch . ovs-version="${ovs_version}"
 ovs-vsctl --no-wait -- set Open_vSwitch . system-type="docker-ovs"
 ovs-vsctl --no-wait -- set Open_vSwitch . system-version="0.1"
 ovs-vsctl --no-wait -- \
-  set Open_vSwitch . external-ids:system-id=`cat /proc/sys/kernel/random/uuid`
+       set Open_vSwitch . external-ids:system-id=`cat /proc/sys/kernel/random/uuid`
 ovs-vsctl --no-wait -- set-manager ptcp:6640
 ovs-appctl -t ovsdb-server \
-  ovsdb-server/add-remote db:Open_vSwitch,Open_vSwitch,manager_options
+       ovsdb-server/add-remote db:Open_vSwitch,Open_vSwitch,manager_options
 
 # Build FRR
 env \
-  CLEAN=1 \
-  VERBOSE=0 \
-  bash /opt/topotests/compile_frr.sh
+       CLEAN=1 \
+       VERBOSE=0 \
+       bash /opt/topotests/compile_frr.sh
 
 log_info "Setting permissions on /tmp so we can generate logs"
 chmod -v 1777 /tmp
index 8c46c8dcb241cc8292421918b1695f219893e83b..78640d32446c8f19cb50941af2b91197eb5b8884 100755 (executable)
@@ -33,38 +33,38 @@ TOPOTESTS_DIR=/root/topotests
 [ -z $SYNC_SOURCE ] && SYNC_SOURCE=0
 
 log_info() {
-  local msg=$1
+       local msg=$1
 
-  echo -e "=> $msg"
+       echo -e "=> $msg"
 }
 
 log_error() {
-  local msg=$1
+       local msg=$1
 
-  echo -e "E: $msg" 2>&1
+       echo -e "E: $msg" 2>&1
 }
 
 log_warning() {
-  local msg=$1
+       local msg=$1
 
-  echo -e "W: $msg" 2>&1
+       echo -e "W: $msg" 2>&1
 }
 
 log_fatal() {
-  local msg=$1
+       local msg=$1
 
-  echo -e "F: $msg" 2>&1
+       echo -e "F: $msg" 2>&1
 
-  exit 1
+       exit 1
 }
 
 cpu_count() {
-  local cpu_count
+       local cpu_count
 
-  cpu_count=$(cat /proc/cpuinfo  | grep -w processor | wc -l)
-  if [ $? -eq 0 ]; then
-    echo -n $cpu_count
-  else
-    echo -n 2
-  fi
+       cpu_count=$(cat /proc/cpuinfo   | grep -w processor | wc -l)
+       if [ $? -eq 0 ]; then
+               echo -n $cpu_count
+       else
+               echo -n 2
+       fi
 }