run revision 8dff4a773dd9525ec587cd31646a9f67252122c1
843e19887f64dde75055cf8842fc4db2171eff45johnlev# Run continuous integration tests.
843e19887f64dde75055cf8842fc4db2171eff45johnlev# Copyright (C) 2014 Red Hat
843e19887f64dde75055cf8842fc4db2171eff45johnlev# This program is free software; you can redistribute it and/or modify
843e19887f64dde75055cf8842fc4db2171eff45johnlev# it under the terms of the GNU General Public License as published by
843e19887f64dde75055cf8842fc4db2171eff45johnlev# the Free Software Foundation; either version 3 of the License, or
843e19887f64dde75055cf8842fc4db2171eff45johnlev# (at your option) any later version.
843e19887f64dde75055cf8842fc4db2171eff45johnlev# This program is distributed in the hope that it will be useful,
843e19887f64dde75055cf8842fc4db2171eff45johnlev# but WITHOUT ANY WARRANTY; without even the implied warranty of
843e19887f64dde75055cf8842fc4db2171eff45johnlev# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
843e19887f64dde75055cf8842fc4db2171eff45johnlev# GNU General Public License for more details.
843e19887f64dde75055cf8842fc4db2171eff45johnlev# You should have received a copy of the GNU General Public License
843e19887f64dde75055cf8842fc4db2171eff45johnlev# along with this program. If not, see <http://www.gnu.org/licenses/>.
843e19887f64dde75055cf8842fc4db2171eff45johnlevdeclare -r CI_DIR=`dirname "\`readlink -f \"\$0\"\`"`
843e19887f64dde75055cf8842fc4db2171eff45johnlev# Minimum percentage of code lines covered by tests
843e19887f64dde75055cf8842fc4db2171eff45johnlev# Minimum percentage of code functions covered by tests
843e19887f64dde75055cf8842fc4db2171eff45johnlev# Output program usage information.
843e19887f64dde75055cf8842fc4db2171eff45johnlevUsage: `basename "$0"` [OPTION...]
843e19887f64dde75055cf8842fc4db2171eff45johnlevRun continuous integration tests.
843e19887f64dde75055cf8842fc4db2171eff45johnlev -h, --help Output this help message and exit.
843e19887f64dde75055cf8842fc4db2171eff45johnlev -p, --prefix=STRING Use STRING as the prefix to prepend to file and
843e19887f64dde75055cf8842fc4db2171eff45johnlev directory paths in output.
843e19887f64dde75055cf8842fc4db2171eff45johnlev -n, --no-deps Don't attempt to install dependencies.
843e19887f64dde75055cf8842fc4db2171eff45johnlev -e, --essential Run the essential subset of tests.
843e19887f64dde75055cf8842fc4db2171eff45johnlev -m, --moderate Run the moderate subset of tests.
843e19887f64dde75055cf8842fc4db2171eff45johnlev -r, --rigorous,
843e19887f64dde75055cf8842fc4db2171eff45johnlev -f, --full Run the rigorous (full) set of tests.
843e19887f64dde75055cf8842fc4db2171eff45johnlevDefault options: --essential
843e19887f64dde75055cf8842fc4db2171eff45johnlev# Output a file display path: a path relocated from base directory (BASE_DIR)
843e19887f64dde75055cf8842fc4db2171eff45johnlev# to base prefix (BASE_PFX).
843e19887f64dde75055cf8842fc4db2171eff45johnlev# Args: path
a0900badd8eb6bcca99411c8906b483e84f2da91Garrett D'Amore printf "%s" "$BASE_PFX${path:${#BASE_DIR}+1}"
843e19887f64dde75055cf8842fc4db2171eff45johnlev# Run a stage.
843e19887f64dde75055cf8842fc4db2171eff45johnlev# Args: id cmd [arg...]
843e19887f64dde75055cf8842fc4db2171eff45johnlev# Execute mock as is, or, if the user is not in the "mock" group, under sudo,
843e19887f64dde75055cf8842fc4db2171eff45johnlev# which has password prompt/input on the console, instead of stderr/stdin.
843e19887f64dde75055cf8842fc4db2171eff45johnlev# Args: [mock_arg...]
843e19887f64dde75055cf8842fc4db2171eff45johnlev prompt+="To run mock enter sudo password for $USER: "
843e19887f64dde75055cf8842fc4db2171eff45johnlev# Execute mock_privileged with extra chroot configuration added.
843e19887f64dde75055cf8842fc4db2171eff45johnlev# Args: chroot [mock_arg...]
843e19887f64dde75055cf8842fc4db2171eff45johnlev# Input: extra configuration
843e19887f64dde75055cf8842fc4db2171eff45johnlev conf_dir=`mktemp --tmpdir --directory mock-config.XXXXXXXX`
843e19887f64dde75055cf8842fc4db2171eff45johnlev # Preserve timestamps to avoid unnecessary cache rebuilds
843e19887f64dde75055cf8842fc4db2171eff45johnlev cp -r --preserve=timestamps /etc/mock/* "$conf_dir"/
843e19887f64dde75055cf8842fc4db2171eff45johnlev touch --reference="/etc/mock/${chroot}.cfg" "${conf_dir}/${chroot}.cfg"
843e19887f64dde75055cf8842fc4db2171eff45johnlev mock_privileged --configdir="$conf_dir" --root="$chroot" "$@"
843e19887f64dde75055cf8842fc4db2171eff45johnlev# Execute mock_privileged with dependency package source configuration added.
843e19887f64dde75055cf8842fc4db2171eff45johnlev# Args: chroot [mock_arg...]
843e19887f64dde75055cf8842fc4db2171eff45johnlev declare -r config=$(basename $(readlink -f "/etc/mock/${chroot_name}.cfg"))
config_opts['yum.conf'] += '''
status=0
--gen-suppressions=all \
--verbose ||
status=$?
status=0
status=$?
unset CFLAGS
ci.info |& tee ci-genhtml.out'
unset CFLAGS
--longoptions help,prefix:,no-deps \
eval set -- "$args_expr"
-h|--help)
-p|--prefix)
DEPS=false; shift;;
-e|--essential)
-m|--moderate)
if "$DEPS"; then
if "$RIGOROUS"; then
trap - EXIT
echo SUCCESS