run revision 3ce85a5f5264e7118beb6524e120fd8b53a13da4
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Run continuous integration tests.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Copyright (C) 2014 Red Hat
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# This program is free software; you can redistribute it and/or modify
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# it under the terms of the GNU General Public License as published by
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# the Free Software Foundation; either version 3 of the License, or
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# (at your option) any later version.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# This program is distributed in the hope that it will be useful,
0662ed52e814f8f08ef0e09956413a792584eddffuankg# but WITHOUT ANY WARRANTY; without even the implied warranty of
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# GNU General Public License for more details.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# You should have received a copy of the GNU General Public License
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# along with this program. If not, see <http://www.gnu.org/licenses/>.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesexport PATH=`dirname "\`readlink -f \"\$0\"\`"`:$PATH
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Minimum percentage of code lines covered by tests
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Minimum percentage of code functions covered by tests
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Output program usage information.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesUsage: `basename "$0"` [OPTION...]
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesRun continuous integration tests.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes -h, --help Output this help message and exit.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes -p, --prefix=STRING Use STRING as the prefix to prepend to file and
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes directory paths in output.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes -n, --no-deps Don't attempt to install dependencies.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes -e, --essential Run the essential subset of tests.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes -m, --moderate Run the moderate subset of tests.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes -r, --rigorous,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes -f, --full Run the rigorous (full) set of tests.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesDefault options: --essential
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg# Output a file display path: a path relocated from base directory (BASE_DIR)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# to base prefix (BASE_PFX).
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Run a stage.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Args: id cmd [arg...]
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Execute mock as is, or, if the user is not in the "mock" group, under sudo,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# which has password prompt/input on the console, instead of stderr/stdin.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Args: [mock_arg...]
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes prompt+="To run mock enter sudo password for $USER: "
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Execute mock_privileged with extra chroot configuration added.
0662ed52e814f8f08ef0e09956413a792584eddffuankg# Args: chroot [mock_arg...]
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Input: extra configuration
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes conf_dir=`mktemp --tmpdir --directory mock-config.XXXXXXXX`
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes mock_privileged --configdir="$conf_dir" --root="$chroot" "$@"
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Execute mock_privileged with dependency package source configuration added.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Args: chroot [mock_arg...]
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesconfig_opts['yum.conf'] += '''
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesname=Extra SSSD dependencies
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesbaseurl=http://copr-be.cloud.fedoraproject.org/results/lslebodn/sssd-deps/$repo/
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesskip_if_unavailable=true
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Run debug build checks.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes test_dir=`mktemp --directory /dev/shm/ci-test-dir.XXXXXXXX`
9046ab142ed19505e034af0afb8c15be512b8526bnicholes # Not building "tests" due to https://fedorahosted.org/sssd/ticket/2350
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes stage make-tests make-check-wrap -j $CPU_NUM check -- true
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # Ignored until issues found by Valgrind are fixed
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes test_dir_distcheck=`mktemp --directory /dev/shm/ci-test-dir.XXXXXXXX`
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # Single thread due to https://fedorahosted.org/sssd/ticket/2354
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg stage mock-epel6 mock_privileged_deps "epel-6-$ARCH" \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes stage mock-fedora20 mock_privileged_deps "fedora-20-$ARCH" \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Run coverage build checks.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes declare -r coverage_report_dir="ci-report-coverage"
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes test_dir=`mktemp --directory /dev/shm/ci-test-dir.XXXXXXXX`
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes stage configure scan-build "$BASE_DIR/configure" \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # Not building "tests" due to https://fedorahosted.org/sssd/ticket/2350
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes # Ignored until issues found by the scanner are fixed
0662ed52e814f8f08ef0e09956413a792584eddffuankg stage lcov-pre lcov --capture --initial --directory . \
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