ci: fix ShellCheck linting for BATS tests (#3347)

* updated `lint.sh` to lint BATS (again)
* fix linting errors
This commit is contained in:
Georg Lauterbach 2023-05-23 16:33:58 +02:00 committed by GitHub
parent 1d2df8d499
commit abd72b6f10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 51 additions and 14 deletions

View file

@ -193,6 +193,7 @@ function _should_be_configured_to_fqdn() {
assert_success
# Amavis
# shellcheck disable=SC2016
_run_in_container grep '^\$myhostname' /etc/amavis/conf.d/05-node_id
assert_output "\$myhostname = \"${EXPECTED_FQDN}\";"
assert_success

View file

@ -179,12 +179,12 @@ function _should_restart_when_killed() {
function _check_if_process_is_running() {
local PROCESS=${1}
local MIN_SECS_RUNNING
[[ -n ${2} ]] && MIN_SECS_RUNNING="--older ${2}"
[[ -n ${2:-} ]] && MIN_SECS_RUNNING=('--older' "${2}")
local IS_RUNNING=$(docker exec "${CONTAINER_NAME}" pgrep --list-full ${MIN_SECS_RUNNING} "${PROCESS}")
local IS_RUNNING=$(docker exec "${CONTAINER_NAME}" pgrep --list-full "${MIN_SECS_RUNNING[@]}" "${PROCESS}")
# When no matches are found, nothing is returned. Provide something we can assert on (helpful for debugging):
if [[ ! ${IS_RUNNING} =~ "${PROCESS}" ]]
if [[ ! ${IS_RUNNING} =~ ${PROCESS} ]]
then
echo "'${PROCESS}' is not running"
return 1