[COMMON] Fix & add to bashisms CI failover scripts 43/126143/3
authorguillaume.lambert <guillaume.lambert@orange.com>
Wed, 8 Dec 2021 09:14:09 +0000 (10:14 +0100)
committerguillaume.lambert <guillaume.lambert@orange.com>
Wed, 8 Dec 2021 12:59:05 +0000 (13:59 +0100)
Issue-ID: OOM-2643
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: Icf139e50d44aed0315d0e4cb21c59ad05a5a3bdb

kubernetes/sdnc/components/sdnc-prom/resources/bin/sdnc.failover
tox.ini

index d9133e8..1a74c1e 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 {{/*
 
 # Copyright © 2018 Amdocs
@@ -30,7 +30,7 @@ fi
 APP_BIN=/app/bin
 
 debugLog(){
-  if [ "$enableDebugLogging" == true ]; then
+  if [ "$enableDebugLogging" = true ]; then
      if [ $# -eq 0 ]; then
        echo "" >> $LOGFILE
      else
@@ -41,7 +41,7 @@ debugLog(){
 
 EXC_SIMPLE_FAILOVER=`${APP_BIN}/switchVoting.sh`
 
-if [ "$EXC_SIMPLE_FAILOVER" == "success" ]; then
+if [ "$EXC_SIMPLE_FAILOVER" = "success" ]; then
    debugLog "Simple failover success. SDNC failover completed."
 else
    # Simple failover failed. Trying catastrophic failover ...
diff --git a/tox.ini b/tox.ini
index 61acbbb..dee4f3a 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -65,7 +65,9 @@ commands =
         || (echo "checkbashisms command not found - please install it (e.g. sudo apt-get install devscripts | \
         yum install devscripts-minimal )" >&2 && exit 1)'
     find . -not -path '*/\.*' -name *.sh -exec checkbashisms \{\} +
+    find . -not -path '*/\.*' -name *.failover -exec checkbashisms -f \{\} +
     sh -c "! find . -not -path '*/\.*' -name *.sh -exec grep 'local .*=' \{\} + || exit 2"
+    sh -c "! find . -not -path '*/\.*' -name *.failover -exec grep 'local .*=' \{\} + || exit 2"
 
 [testenv:autopep8]
 deps =