Check exit status of translate_ciphers.py
If a call to translate_ciphers.py from compat.sh returns an exit 1
status, the error message will be echod and the program will exit
Signed-off-by: Joe Subbiani <joe.subbiani@arm.com>
diff --git a/tests/compat.sh b/tests/compat.sh
index e814e9d..e532604 100755
--- a/tests/compat.sh
+++ b/tests/compat.sh
@@ -236,6 +236,14 @@
G_CIPHERS=""
}
+check_translation()
+{
+ if [ $? -eq 1 ]; then
+ echo $T
+ exit 1
+ fi
+}
+
# Ciphersuites that can be used with all peers.
# Since we currently have three possible peers, each ciphersuite should appear
# three times: in each peer's list (with the name that this peer uses).
@@ -320,11 +328,13 @@
M_CIPHERS="$M_CIPHERS $CIPHERS"
- G=`python3 scripts/translate_ciphers.py g "$CIPHERS"`
- G_CIPHERS="$G_CIPHERS $G"
+ T=`python3 scripts/translate_ciphers.py g "$CIPHERS"`
+ check_translation $? $T
+ G_CIPHERS="$G_CIPHERS $T"
- O=`python3 scripts/translate_ciphers.py o "$CIPHERS"`
- O_CIPHERS="$O_CIPHERS $O"
+ T=`python3 scripts/translate_ciphers.py o "$CIPHERS"`
+ check_translation $? $T
+ O_CIPHERS="$O_CIPHERS $T"
}
# Ciphersuites usable only with Mbed TLS and OpenSSL
@@ -406,8 +416,9 @@
M_CIPHERS="$M_CIPHERS $CIPHERS"
- O=`python3 scripts/translate_ciphers.py o "$CIPHERS"`
- O_CIPHERS="$O_CIPHERS $O"
+ T=`python3 scripts/translate_ciphers.py o "$CIPHERS"`
+ check_translation $? $T
+ O_CIPHERS="$O_CIPHERS $T"
}
# Ciphersuites usable only with Mbed TLS and GnuTLS
@@ -539,8 +550,9 @@
M_CIPHERS="$M_CIPHERS $CIPHERS"
- G=`python3 scripts/translate_ciphers.py g "$CIPHERS"`
- G_CIPHERS="$G_CIPHERS $G"
+ T=`python3 scripts/translate_ciphers.py g "$CIPHERS"`
+ check_translation $? $T
+ G_CIPHERS="$G_CIPHERS $T"
}
# Ciphersuites usable only with Mbed TLS (not currently supported by another