From d874e4b0276b362ead04ebbcf3b3aa6445979c44 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 16 Oct 2025 20:19:08 +0200 Subject: [PATCH] MT#62763 Fix shellcheck issues Warned-by: shellcheck Change-Id: I2cd2c7142ddf64408eb623c884bdc78afdb42a49 --- bin/check.sh | 12 ++++++------ run_tests.sh | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/check.sh b/bin/check.sh index abdf2730..ae625caa 100755 --- a/bin/check.sh +++ b/bin/check.sh @@ -136,7 +136,7 @@ check_retrans_next() { echo "$(date) - Fix retransmissions enabled: try to test the next[+${step}] json file" kam_msg=$(basename "${next_msg}") - if [ -a "${next_msg}" ] ; then + if [ -e "${next_msg}" ] ; then if [[ "${test_ok[*]}" =~ ${kam_msg} ]] ; then echo "$(date) - ** skip ${kam_msg} already processed" return 1 @@ -165,7 +165,7 @@ check_retrans_next() { return 2 fi - if [ -a "${next_tap}" ] ; then + if [ -e "${next_tap}" ] ; then # Test using the next json file was a failure. # Next step is remove $next_tap file to don't create confusion during the additional checks rm "${next_tap}" @@ -193,7 +193,7 @@ check_retrans_prev() { echo "$(date) - Fix retransmissions enabled: try to test the previous[-${step}] json file" kam_msg=$(basename "${prev_msg}") - if [ -a "${prev_msg}" ] ; then + if [ -e "${prev_msg}" ] ; then if [[ "${test_ok[*]}" =~ ${kam_msg} ]] ; then echo "$(date) - ** skip ${kam_msg} already processed" return 1 @@ -222,7 +222,7 @@ check_retrans_prev() { return 2 fi - if [ -a "${prev_tap}" ] ; then + if [ -e "${prev_tap}" ] ; then # Test using the previous json file was a failure. # Next step is remove $prev_tap file to don't create confusion during the additional checks rm "${prev_tap}" @@ -806,11 +806,11 @@ if ! "$SKIP_RUNSIPP" ; then mapfile -t file_find < <(find "${LOG_DIR}" -maxdepth 1 -name '*.json' | sort) for json_file in "${file_find[@]}" ; do file_find=("${file_find[@]:1}") - if ! [ -a "${json_file}" ] ; then + if ! [ -e "${json_file}" ] ; then continue fi for next_json_file in "${file_find[@]}" ; do - if ! [ -a "${next_json_file}" ] ; then + if ! [ -e "${next_json_file}" ] ; then continue fi if ( diff -q -u <(tail -n3 "${json_file}") <(tail -n3 "${next_json_file}") &> /dev/null ) ; then diff --git a/run_tests.sh b/run_tests.sh index a0ec3c0b..504fc80e 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -159,11 +159,11 @@ fix_retransmissions() { mapfile -t file_find < <(find "${LOG_DIR}/${t}" -maxdepth 1 -name '*.json' | sort) for json_file in "${file_find[@]}" ; do file_find=("${file_find[@]:1}") - if ! [ -a "${json_file}" ] ; then + if ! [ -e "${json_file}" ] ; then continue fi for next_json_file in "${file_find[@]}" ; do - if ! [ -a "${next_json_file}" ] ; then + if ! [ -e "${next_json_file}" ] ; then continue fi # Check if both sip_in and Sip_out are equals