2021-07-05 06:50:25 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Release Engineering Core Functionality Testing
|
|
|
|
# Louis Abel <label@rockylinux.org> @nazunalika
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Settings and variables
|
|
|
|
|
|
|
|
# Exits on any non-zero exit status - Disabled for now.
|
|
|
|
#set -e
|
|
|
|
# Undefined variables will cause an exit
|
|
|
|
set -u
|
|
|
|
|
|
|
|
COMMON_EXPORTS='./common/exports.sh'
|
|
|
|
COMMON_IMPORTS='./common/imports.sh'
|
|
|
|
SELINUX=$(getenforce)
|
|
|
|
|
|
|
|
# End
|
|
|
|
################################################################################
|
|
|
|
|
2021-07-06 20:16:01 +00:00
|
|
|
# shellcheck source=/dev/null disable=SC2015
|
2021-07-05 06:50:25 +00:00
|
|
|
[ -f $COMMON_EXPORTS ] && source $COMMON_EXPORTS || { echo -e "\n[-] $(date): Variables cannot be sourced."; exit 1; }
|
2021-07-06 20:16:01 +00:00
|
|
|
# shellcheck source=/dev/null disable=SC2015
|
2021-07-05 06:50:25 +00:00
|
|
|
[ -f $COMMON_IMPORTS ] && source $COMMON_IMPORTS || { echo -e "\n[-] $(date): Functions cannot be sourced."; exit 1; }
|
|
|
|
# Init log
|
2021-07-06 20:16:01 +00:00
|
|
|
# shellcheck disable=SC2015
|
2021-07-05 06:50:25 +00:00
|
|
|
[ -e "$LOGFILE" ] && m_recycleLog || touch "$LOGFILE"
|
|
|
|
# SELinux check
|
|
|
|
if [ "$SELINUX" != "Enforcing" ]; then
|
|
|
|
echo -e "\n[-] $(date): SELinux is not enforcing."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-11-21 22:36:13 +00:00
|
|
|
r_checkEPELEnabled
|
|
|
|
is_epel=$?
|
|
|
|
if [[ "$is_epel" == "0" ]]; then
|
|
|
|
echo "EPEL enabled. Stop."
|
2022-11-21 22:31:00 +00:00
|
|
|
r_log "internal" "EPEL enabled. Stop."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-11-30 08:04:41 +00:00
|
|
|
r_checkTmpNoExec
|
|
|
|
|
2021-07-05 06:50:25 +00:00
|
|
|
r_log "internal" "Starting Release Engineering Core Tests"
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Script Work
|
|
|
|
|
|
|
|
# Skip tests in a list - some tests are already -x, so it won't be an issue
|
|
|
|
if [ -e skip.list ]; then
|
|
|
|
r_log "internal" "Disabling tests"
|
2021-07-06 20:16:01 +00:00
|
|
|
# shellcheck disable=SC2162
|
2021-07-05 06:50:25 +00:00
|
|
|
grep -E "^${RL_VER}" skip.list | while read line; do
|
2021-07-06 20:16:01 +00:00
|
|
|
# shellcheck disable=SC2086
|
|
|
|
testFile="$(echo $line | cut -d '|' -f 2)"
|
2021-07-05 06:50:25 +00:00
|
|
|
r_log "internal" "SKIP ${testFile}"
|
2021-07-06 20:16:01 +00:00
|
|
|
chmod -x "${testFile}"
|
2021-07-05 06:50:25 +00:00
|
|
|
done
|
|
|
|
r_log "internal" "WARNING: Tests above were disabled."
|
|
|
|
fi
|
|
|
|
|
|
|
|
# TODO: should we let $1 judge what directory is ran?
|
|
|
|
# TODO: get some stacks and lib in there
|
|
|
|
|
|
|
|
r_processor <(/usr/bin/find ./core -type f | sort -t'/')
|
|
|
|
#r_processor <(/usr/bin/find ./lib -type f | sort -t'/')
|
|
|
|
#r_processor <(/usr/bin/find ./stacks -type f | sort -t'/')
|
|
|
|
|
|
|
|
r_log "internal" "Core Tests completed"
|
|
|
|
exit 0
|