run revision a907aa07340ef0051cd74bbab9618820e1bca1b8
c30ef289fe64ac7fedc44cfcc6b439f0f8458b4cgregames# Run continuous integration tests.
98e28ee4e3e3972abeb1bfd509c0e79c54c871f6nd# Copyright (C) 2014 Red Hat
98e28ee4e3e3972abeb1bfd509c0e79c54c871f6nd# This program is free software; you can redistribute it and/or modify
a111fb25c1fab056a6dbadb18d84018088671fd9minfrin# it under the terms of the GNU General Public License as published by
a111fb25c1fab056a6dbadb18d84018088671fd9minfrin# the Free Software Foundation; either version 3 of the License, or
a111fb25c1fab056a6dbadb18d84018088671fd9minfrin# (at your option) any later version.
50e23f7dca0da305e324349792fb7c27d8e04b60minfrin# This program is distributed in the hope that it will be useful,
50e23f7dca0da305e324349792fb7c27d8e04b60minfrin# but WITHOUT ANY WARRANTY; without even the implied warranty of
50e23f7dca0da305e324349792fb7c27d8e04b60minfrin# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50e23f7dca0da305e324349792fb7c27d8e04b60minfrin# GNU General Public License for more details.
217f75ac21f879b5d71892790e536cd80184db8dminfrin# You should have received a copy of the GNU General Public License
217f75ac21f879b5d71892790e536cd80184db8dminfrin# along with this program. If not, see <http://www.gnu.org/licenses/>.
08df8c976ef7d6c1362cba072cadf0e1e6c91975trawickdeclare -r CI_DIR=`dirname "\`readlink -f \"\$0\"\`"`
03a3ed87983471816561562f957390ed935d7b3bnd# Minimum percentage of code lines covered by tests
03a3ed87983471816561562f957390ed935d7b3bnd# Minimum percentage of code functions covered by tests
da5472c259c9dad08fd805c3e97a629f9428e7fend# Those values are a sum up of the default warnings in all our
da5472c259c9dad08fd805c3e97a629f9428e7fend# supported distros in our CI.
33c6c050363f8b571cec0477008390a95b41523and# debian_testing: E121,E123,E126,E226,E24,E704,W503
33c6c050363f8b571cec0477008390a95b41523and# fedora22:
33c6c050363f8b571cec0477008390a95b41523and# fedora23:
68ed4d659ab8f6deb93fe6d520b5d3ee65645493nd# fedora24: E121,E123,E126,E226,E24,E704
68ed4d659ab8f6deb93fe6d520b5d3ee65645493nd# fedora25: E121,E123,E126,E226,E24,E704
68ed4d659ab8f6deb93fe6d520b5d3ee65645493nd# fedora26: E121,E123,E126,E226,E24,E704
68ed4d659ab8f6deb93fe6d520b5d3ee65645493nd# fedora27: E121,E123,E126,E226,E24,E704
2bfe4d90e1d374e14fd5db16a799e6f5e0944748nd# fedora_rawhide: E121,E123,E126,E226,E24,E704
2bfe4d90e1d374e14fd5db16a799e6f5e0944748nddeclare PEP8_IGNORE="--ignore=E121,E123,E126,E226,E24,E704,W503"
97789c9dcc4cc724c9b80fb9b428d128c58e3e0and# Output program usage information.
41369ed0bc7f2db6272278c27025f6aabf97fe63ndUsage: `basename "$0"` [OPTION...]
41369ed0bc7f2db6272278c27025f6aabf97fe63ndRun continuous integration tests.
496f8f3966319d43455675630a849bae019d2a32nd -h, --help Output this help message and exit.
13ed2a88decd6dbe13b11467e7f648f2996b7a70jorton -p, --prefix=STRING Use STRING as the prefix to prepend to file and
13ed2a88decd6dbe13b11467e7f648f2996b7a70jorton directory paths in output.
13ed2a88decd6dbe13b11467e7f648f2996b7a70jorton -n, --no-deps Don't attempt to install dependencies.
13ed2a88decd6dbe13b11467e7f648f2996b7a70jorton -e, --essential Run the essential subset of tests.
9e8c2603790f490398a0fabf97866b6815748a54ianh -m, --moderate Run the moderate subset of tests.
9e8c2603790f490398a0fabf97866b6815748a54ianh -r, --rigorous,
9e8c2603790f490398a0fabf97866b6815748a54ianh -f, --full Run the rigorous (full) set of tests.
a21b3b9d8ebb12fd51fa1d17e44d5644a35a9a5fndDefault options: --essential
5fcef4390e6414ad7754c2f004974982bc33cac2nd# Output a file display path: a path relocated from base directory (BASE_DIR)
5fcef4390e6414ad7754c2f004974982bc33cac2nd# to base prefix (BASE_PFX).
5fcef4390e6414ad7754c2f004974982bc33cac2nd# Args: path
1fbcf7a8e7b18be1b0e77b7bc38b7b71f8dfb052nd# Run a stage.
e6c244ee56578707b20a86e0e938498299a93b6cnd# Args: id cmd [arg...]
af8dee354a287249dd9f3f77bbe850108e5afe43trawick# Execute mock as is, or, if the user is not in the "mock" group, under sudo,
af8dee354a287249dd9f3f77bbe850108e5afe43trawick# which has password prompt/input on the console, instead of stderr/stdin.
14763a0db22322626dd8cd59dfbc3a4fcc655d99trawick# Args: [mock_arg...]
f78505c7d260473bf11002f5028186f27d0ed8a0geoff# Execute mock_privileged with extra chroot configuration added.
a8a509c9b67eea07a4a239e7f36c9f3de6022585trawick# Args: chroot [mock_arg...]
a8a509c9b67eea07a4a239e7f36c9f3de6022585trawick# Input: extra configuration
ced699ca391a4fb7d70cfeb995c58d4bf62f00a8trawick conf_dir=`mktemp --tmpdir --directory mock-config.XXXXXXXX`
ced699ca391a4fb7d70cfeb995c58d4bf62f00a8trawick # Preserve timestamps to avoid unnecessary cache rebuilds
d57b793ddd42a997c2cb3bd389bbcf1161226fd8trawick cp -r --preserve=timestamps /etc/mock/* "$conf_dir"/
d57b793ddd42a997c2cb3bd389bbcf1161226fd8trawick touch --reference="/etc/mock/${chroot}.cfg" "${conf_dir}/${chroot}.cfg"
f881e72fe4f91fd1445c5d81c95f66d6a4a3ee5btrawick mock_privileged --configdir="$conf_dir" --root="$chroot" "$@"
d11bf78168abbb07d8ed9f54d7ea0953d46aad83nd# Execute mock_privileged with dependency package source configuration added.
d11bf78168abbb07d8ed9f54d7ea0953d46aad83nd# Args: chroot [mock_arg...]
bf28a00d8218aa76a56eddabca308e8d0e691626nd declare -r config=$(basename $(readlink -f "/etc/mock/${chroot_name}.cfg"))
5bcdf2cd27ab0c91a3c7eaffbff4cb8505389dc1ndconfig_opts['yum.conf'] += '''
5bcdf2cd27ab0c91a3c7eaffbff4cb8505389dc1nd[sssd-deps]
5bcdf2cd27ab0c91a3c7eaffbff4cb8505389dc1ndname=Extra SSSD dependencies
02b0660d7f44ff8106bd5095653e9c19e39ec37dndbaseurl=http://copr-be.cloud.fedoraproject.org/results/lslebodn/sssd-deps/$repo/
02b0660d7f44ff8106bd5095653e9c19e39ec37dndskip_if_unavailable=true
a9ee8e9bd3dffd23ca49be8d0bdf0e33cd0bcce2jorton# Run debug build checks.
3b86be5b30d5cbacc1f942b05dff8a9365449d30jorton # Extended glob pattern matching tests to run under Valgrind.
8aad5258d3ecde3751559bc685a3185e63cbde9aianh declare valgrind_test_pattern="!(*.py|*/whitespace_test|"
8aad5258d3ecde3751559bc685a3185e63cbde9aianh declare -r valgrind_test_pattern+="*/double_semicolon_test)"
49a82db11388cff9b29ff861b4241bbce69c76fdtrawick test_dir=`mktemp --directory /dev/shm/ci-test-dir.XXXXXXXX`
f23c50b3628a8571da2ff3277ae58ef1d675554ftrawick # Not building "tests" due to https://fedorahosted.org/sssd/ticket/2350
8dc154408549195c828b823e9dc7396f107f2512jorton stage make-tests make -j $CPU_NUM check LOG_COMPILER=true
6126fad8adeca94e9813812c691747afeca164dftrawick valgrind-condense 99 \
7ed5992392d5babab20be4ce4029ad17ae062b5aianh --trace-children=yes \
7ed5992392d5babab20be4ce4029ad17ae062b5aianh --trace-children-skip='*/bin/*,*/sbin/*,./dummy-child' \
b7973a1e572a3ff7cdedb48ed1f9481ece700bf9trawick --leak-check=full \
36f2369ee230c310fed3b600e9e99cf5770804a3wrowe --gen-suppressions=all \
b7973a1e572a3ff7cdedb48ed1f9481ece700bf9trawick --suppressions=\"$CI_DIR/sssd.supp\" \
73291de2e17c97d3549f2f8aa085ca43d27e108and test_dir_distcheck=`mktemp --directory /dev/shm/ci-test-dir.XXXXXXXX`
73291de2e17c97d3549f2f8aa085ca43d27e108and # Single thread due to https://fedorahosted.org/sssd/ticket/2354
a4dd3688dd6645faf0c1c1bfb22017c8f03d5b24nd# Run coverage build checks.
7de6cb79f71a9007ba2b1e786cbad8b84f05d101nd if [[ "$DISTRO_BRANCH" == -redhat-redhatenterprise*-6.*- ||
aa9b03a5f32732c0caaef03a7ed78ffb290e29e4trawick # git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162384
3b872593fd5f61981d9dd69a4b0b5d5f5f668929trawick test_dir=`mktemp --directory /dev/shm/ci-test-dir.XXXXXXXX`
fc25339741311efd7d460f18b6287ef38d76bbe6madhum # Not building "tests" due to https://fedorahosted.org/sssd/ticket/2350
fcdca175a52fe517f2317ba0e2b6e6d14522b869madhum stage make-tests make -j $CPU_NUM check LOG_COMPILER=true
92a2439559cf1161742650ed9c50c6483bd029cemadhum stage lcov-pre lcov --capture --initial --directory . \
4caa28863a3418d26cc20a998dc368c3de3b7e19jerenkrantz stage genhtml eval 'genhtml --output-directory \
4caa28863a3418d26cc20a998dc368c3de3b7e19jerenkrantz "$coverage_report_dir" \
a3f2646ef3d8a3a5234a5601de0f95f10308c2a6jerenkrantz --title "sssd" --show-details \
a3f2646ef3d8a3a5234a5601de0f95f10308c2a6jerenkrantz --legend --prefix "$BASE_DIR" \
9e398d701dd430f073ff5418fb720642e064046ajerenkrantz printf "%-$((TITLE_WIDTH + RESULT_WIDTH))s%s\n" \
9e398d701dd430f073ff5418fb720642e064046ajerenkrantz "`disppath \"\$coverage_report_dir/index.html\"`"
1a5b9e0071f0c662036250b482d566ad87ff0b4bjerenkrantz stage lcov-check eval 'lcov_check "$COVERAGE_MIN_LINES" \
1a5b9e0071f0c662036250b482d566ad87ff0b4bjerenkrantz "$COVERAGE_MIN_FUNCS" \
ba6c07204bd224fa5d4cd0e6b8bf256d6daffb74nd# Run a build inside a sub-directory.
db5837bbc9bef214303e755fa52122140366cb6fianh# Args: id cmd [arg...]
ab8c0315521735c73ce16c8072f91e17c406ca5bnd# Main routine
4567cfc6a65328bd3e8dd2b758ca926b389c7058brianpwhile true; do
2f408250e9111c4b85b2b4b9b8836e83987efdefstoddard DEPS=false; shift;;
6646a289c2d4778c8cd43d62b5a1cc966a356f85jerenkrantz shift; break;;
ad451e2e428a069086d1c18c9e3372f8846ec617wroweif [ $# != 0 ]; then