run revision 8dff4a773dd9525ec587cd31646a9f67252122c1
95d00ea81131488769296fa5765ed745cbf45207trawick# Run continuous integration tests.
95d00ea81131488769296fa5765ed745cbf45207trawick# Copyright (C) 2014 Red Hat
95d00ea81131488769296fa5765ed745cbf45207trawick# This program is free software; you can redistribute it and/or modify
95d00ea81131488769296fa5765ed745cbf45207trawick# it under the terms of the GNU General Public License as published by
95d00ea81131488769296fa5765ed745cbf45207trawick# the Free Software Foundation; either version 3 of the License, or
95d00ea81131488769296fa5765ed745cbf45207trawick# (at your option) any later version.
f08574f1098defdf1dc7e7f18a1e3664ee157150rederpj# This program is distributed in the hope that it will be useful,
f08574f1098defdf1dc7e7f18a1e3664ee157150rederpj# but WITHOUT ANY WARRANTY; without even the implied warranty of
f08574f1098defdf1dc7e7f18a1e3664ee157150rederpj# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f08574f1098defdf1dc7e7f18a1e3664ee157150rederpj# GNU General Public License for more details.
f08574f1098defdf1dc7e7f18a1e3664ee157150rederpj# You should have received a copy of the GNU General Public License
f08574f1098defdf1dc7e7f18a1e3664ee157150rederpj# along with this program. If not, see <http://www.gnu.org/licenses/>.
854c7bc4128fa2ad9fdfe0fc307d5ef30bcb5bb9wrowe# Minimum percentage of code lines covered by tests
854c7bc4128fa2ad9fdfe0fc307d5ef30bcb5bb9wrowe# Minimum percentage of code functions covered by tests
854c7bc4128fa2ad9fdfe0fc307d5ef30bcb5bb9wrowe# Output program usage information.
75f8e1cae5ca3a16a7400cdddf604815ab06b5a8rederpjUsage: `basename "$0"` [OPTION...]
75f8e1cae5ca3a16a7400cdddf604815ab06b5a8rederpjRun continuous integration tests.
2221ad59a355f17a27727dd12cfa14fdae87975agregames -h, --help Output this help message and exit.
2221ad59a355f17a27727dd12cfa14fdae87975agregames -p, --prefix=STRING Use STRING as the prefix to prepend to file and
2221ad59a355f17a27727dd12cfa14fdae87975agregames directory paths in output.
2221ad59a355f17a27727dd12cfa14fdae87975agregames -n, --no-deps Don't attempt to install dependencies.
2221ad59a355f17a27727dd12cfa14fdae87975agregames -e, --essential Run the essential subset of tests.
7f481efe04fdc4da7a447c14be62c155cbe00ddbbrianp -m, --moderate Run the moderate subset of tests.
7f481efe04fdc4da7a447c14be62c155cbe00ddbbrianp -r, --rigorous,
7f481efe04fdc4da7a447c14be62c155cbe00ddbbrianp -f, --full Run the rigorous (full) set of tests.
9ed34e5219ab3506ccfd2ca58751ce4c81b263a8rederpjDefault options: --essential
23b36269d124e7a6aaa5221891f7ae2ef3eeb158jerenkrantz# Output a file display path: a path relocated from base directory (BASE_DIR)
23b36269d124e7a6aaa5221891f7ae2ef3eeb158jerenkrantz# to base prefix (BASE_PFX).
e65b56dc229f063425fac589002e34c8246ad878trawick# Run a stage.
e65b56dc229f063425fac589002e34c8246ad878trawick# Args: id cmd [arg...]
fa16f10bc02e46bc5a6c2c2c6371926cd1dbe2edwrowe# Execute mock as is, or, if the user is not in the "mock" group, under sudo,
fa16f10bc02e46bc5a6c2c2c6371926cd1dbe2edwrowe# which has password prompt/input on the console, instead of stderr/stdin.
fa16f10bc02e46bc5a6c2c2c6371926cd1dbe2edwrowe# Args: [mock_arg...]
8d755accbdc5ae15bb0d00169b815d264c7de745minfrin prompt+="To run mock enter sudo password for $USER: "
7b0a3bcc0e689305df49f7d4da7abc35aa891862brianp# Execute mock_privileged with extra chroot configuration added.
7b0a3bcc0e689305df49f7d4da7abc35aa891862brianp# Args: chroot [mock_arg...]
1bae4591a85d90325ecdacedf7e54d1bbfe31037aaron# Input: extra configuration
a6f48cc01ab8f5377e570c61826dcdfc36741936trawick conf_dir=`mktemp --tmpdir --directory mock-config.XXXXXXXX`
2da345202997f8f5860c801d68f7913c02fc05fctrawick # Preserve timestamps to avoid unnecessary cache rebuilds
2da345202997f8f5860c801d68f7913c02fc05fctrawick cp -r --preserve=timestamps /etc/mock/* "$conf_dir"/
5bd562b1d7da51cb5715899d32bb4c79c54459b0wrowe touch --reference="/etc/mock/${chroot}.cfg" "${conf_dir}/${chroot}.cfg"
5bd562b1d7da51cb5715899d32bb4c79c54459b0wrowe mock_privileged --configdir="$conf_dir" --root="$chroot" "$@"
5bd562b1d7da51cb5715899d32bb4c79c54459b0wrowe# Execute mock_privileged with dependency package source configuration added.
1c06e98017400874d5ff6ad79f13145ec4589225striker# Args: chroot [mock_arg...]
99a041314eb3db0b0cca325c9c40d0a6c5fdf04fwrowe declare -r config=$(basename $(readlink -f "/etc/mock/${chroot_name}.cfg"))
bd120542ebe7e09cdbada5daf4924f4690e5ece3trawickconfig_opts['yum.conf'] += '''
bd120542ebe7e09cdbada5daf4924f4690e5ece3trawickname=Extra SSSD dependencies
68d439bc0482b2e41053480f748edc2574c2ea7btrawickbaseurl=http://copr-be.cloud.fedoraproject.org/results/lslebodn/sssd-deps/$repo/
68d439bc0482b2e41053480f748edc2574c2ea7btrawickskip_if_unavailable=true
e06675c51d084791089d79c3ac18aeae8dd465fcrbb# Run debug build checks.
e06675c51d084791089d79c3ac18aeae8dd465fcrbb # Extended glob pattern matching tests to run under Valgrind.
481c1206b6065a8f37ab75ca1fc26c947cb37852ianh declare -r valgrind_test_pattern="!(*.py|*/dlopen-tests|*/whitespace_test)"
6a7877447bcb8e6ff848d72f82f184c404ef4c0bminfrin test_dir=`mktemp --directory /dev/shm/ci-test-dir.XXXXXXXX`
9335cbd541cca1ca6038af329bbd1645310aabccminfrin # Not building "tests" due to https://fedorahosted.org/sssd/ticket/2350
9335cbd541cca1ca6038af329bbd1645310aabccminfrin stage make-tests make-check-wrap -j $CPU_NUM check -- true
f4c472b8dce3c2e559232dbb5b27ed2466922ea4jerenkrantz stage make-intgcheck make -j $CPU_NUM intgcheck \
7e31ef4870c7ef94838585004405e8854fefcc51ianh test_dir_distcheck=`mktemp --directory /dev/shm/ci-test-dir.XXXXXXXX`
7e31ef4870c7ef94838585004405e8854fefcc51ianh # Single thread due to https://fedorahosted.org/sssd/ticket/2354
791781f2ccc1f1f1bc1b1643861d3da23edfd147jerenkrantz stage mock-build mock_privileged_deps "default" \
a97c4ce2bea3dbf8ddc82c796cf93aa6b46765a4brianp# Run coverage build checks.
b7838ae85a698af19d90ba4ebe03e10bdc149eacjerenkrantz declare -r coverage_report_dir="ci-report-coverage"
1a7728c0205d607d5d87c6b6bf1b8837a9785a99ianh test_dir=`mktemp --directory /dev/shm/ci-test-dir.XXXXXXXX`
5e538c6ced13aa2f7c358e1a44f651d31dd5fab8brianp # Not building "tests" due to https://fedorahosted.org/sssd/ticket/2350
5e538c6ced13aa2f7c358e1a44f651d31dd5fab8brianp stage make-tests make-check-wrap -j $CPU_NUM check -- true
5e538c6ced13aa2f7c358e1a44f651d31dd5fab8brianp stage lcov-pre lcov --capture --initial --directory . \
bc6600a6207e5d15b895294e370e4e3320a803d8stoddard "$coverage_report_dir" \
bc6600a6207e5d15b895294e370e4e3320a803d8stoddard --title "sssd" --show-details \
bc6600a6207e5d15b895294e370e4e3320a803d8stoddard --legend --prefix "$BASE_DIR" \
5c214a63f9722864ac4983995da11353779515dbrederpj stage lcov-check eval 'lcov_check "$COVERAGE_MIN_LINES" \
5c214a63f9722864ac4983995da11353779515dbrederpj "$COVERAGE_MIN_FUNCS" \
9f20717d827f2113a23dfa45539813171cf626eaianh# Run a build inside a sub-directory.
a0db2f093595083300ad3438314f90921405ccf9wrowe# Args: id cmd [arg...]
61afed048a4d67ed923d52e5c865c0f10a8e9e73trawick# Main routine
ba2e14e474516f1c75a96b4f6d1a9dec332175efianheval set -- "$args_expr"
ec69fc6e323eb1f3112966e06e9e37be608d052cianhwhile true; do
749011213737e8d0cd6ca78d5eb532ec6f6b9fdfianh DEPS=false; shift;;
de42d3dfd83a4cc62f0dd6b79ee5cbcfa69fd503brianp shift; break;;
39dde7f4cd79d701cc14e5beac8ea528bc58d038wroweif [ $# != 0 ]; then