Sean Dague | aecd189 | 2014-11-19 15:19:51 -0500 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | |
| 15 | |
| 16 | TOP=$(cd $(dirname "$0")/.. && pwd) |
| 17 | |
| 18 | export TOP_DIR=$TOP |
| 19 | |
Sean Dague | 365421b | 2015-02-06 15:27:43 -0500 | [diff] [blame] | 20 | # we don't actually care about the HOST_IP |
| 21 | HOST_IP="don't care" |
Sean Dague | aecd189 | 2014-11-19 15:19:51 -0500 | [diff] [blame] | 22 | # Import common functions |
| 23 | source $TOP/functions |
| 24 | source $TOP/stackrc |
| 25 | source $TOP/lib/tls |
| 26 | for i in $TOP/lib/*; do |
| 27 | if [[ -f $i ]]; then |
| 28 | source $i |
| 29 | fi |
| 30 | done |
| 31 | |
James E. Blair | 9e220b9 | 2015-03-24 16:32:03 -0700 | [diff] [blame] | 32 | ALL_LIBS="python-novaclient oslo.config pbr oslo.context" |
Joshua Harlow | ee9064b | 2015-02-19 15:06:23 -0800 | [diff] [blame] | 33 | ALL_LIBS+=" python-keystoneclient taskflow oslo.middleware pycadf" |
| 34 | ALL_LIBS+=" python-glanceclient python-ironicclient tempest-lib" |
| 35 | ALL_LIBS+=" oslo.messaging oslo.log cliff python-heatclient stevedore" |
| 36 | ALL_LIBS+=" python-cinderclient glance_store oslo.concurrency oslo.db" |
Dan Smith | aca8a7f | 2015-03-03 08:50:27 -0800 | [diff] [blame] | 37 | ALL_LIBS+=" oslo.versionedobjects oslo.vmware keystonemiddleware" |
Sergey Lukjanov | 3381e09 | 2015-07-01 14:20:23 +0300 | [diff] [blame] | 38 | ALL_LIBS+=" oslo.serialization django_openstack_auth" |
Joshua Harlow | ee9064b | 2015-02-19 15:06:23 -0800 | [diff] [blame] | 39 | ALL_LIBS+=" python-openstackclient oslo.rootwrap oslo.i18n" |
| 40 | ALL_LIBS+=" python-ceilometerclient oslo.utils python-swiftclient" |
| 41 | ALL_LIBS+=" python-neutronclient tooz ceilometermiddleware oslo.policy" |
Davanum Srinivas | 18d1cca | 2015-06-18 06:32:00 -0400 | [diff] [blame] | 42 | ALL_LIBS+=" debtcollector os-brick automaton futurist oslo.service" |
Davanum Srinivas | 77a7d11 | 2015-06-22 16:44:13 -0400 | [diff] [blame] | 43 | ALL_LIBS+=" oslo.cache oslo.reports" |
Jamie Lennox | 21a9077 | 2015-07-03 11:54:38 +1000 | [diff] [blame] | 44 | ALL_LIBS+=" keystoneauth" |
Sean Dague | aecd189 | 2014-11-19 15:19:51 -0500 | [diff] [blame] | 45 | |
| 46 | # Generate the above list with |
| 47 | # echo ${!GITREPO[@]} |
| 48 | |
| 49 | function check_exists { |
| 50 | local thing=$1 |
| 51 | local hash=$2 |
| 52 | local key=$3 |
| 53 | if [[ ! -z "$VERBOSE" ]]; then |
| 54 | echo "Checking for $hash[$key]" |
| 55 | fi |
| 56 | if [[ -z $thing ]]; then |
| 57 | echo "$hash[$key] does not exit!" |
| 58 | exit 1 |
| 59 | else |
| 60 | if [[ ! -z "$VERBOSE" ]]; then |
| 61 | echo "$hash[$key] => $thing" |
| 62 | fi |
| 63 | fi |
| 64 | } |
| 65 | |
| 66 | function test_all_libs_upto_date { |
| 67 | # this is all the magics |
| 68 | local found_libs=${!GITREPO[@]} |
| 69 | declare -A all_libs |
| 70 | for lib in $ALL_LIBS; do |
| 71 | all_libs[$lib]=1 |
| 72 | done |
| 73 | |
| 74 | for lib in $found_libs; do |
| 75 | if [[ -z ${all_libs[$lib]} ]]; then |
| 76 | echo "Library '$lib' not listed in unit tests, please add to ALL_LIBS" |
| 77 | exit 1 |
| 78 | fi |
| 79 | |
| 80 | done |
| 81 | echo "test_all_libs_upto_date PASSED" |
| 82 | } |
| 83 | |
| 84 | function test_libs_exist { |
| 85 | local lib="" |
| 86 | for lib in $ALL_LIBS; do |
| 87 | check_exists "${GITREPO[$lib]}" "GITREPO" "$lib" |
| 88 | check_exists "${GITBRANCH[$lib]}" "GITBRANCH" "$lib" |
| 89 | check_exists "${GITDIR[$lib]}" "GITDIR" "$lib" |
| 90 | done |
| 91 | |
| 92 | echo "test_libs_exist PASSED" |
| 93 | } |
| 94 | |
| 95 | function test_branch_master { |
| 96 | for lib in $ALL_LIBS; do |
| 97 | if [[ ${GITBRANCH[$lib]} != "master" ]]; then |
| 98 | echo "GITBRANCH for $lib not master (${GITBRANCH[$lib]})" |
| 99 | exit 1 |
| 100 | fi |
| 101 | done |
| 102 | |
| 103 | echo "test_branch_master PASSED" |
| 104 | } |
| 105 | |
| 106 | set -o errexit |
| 107 | |
| 108 | test_libs_exist |
| 109 | test_branch_master |
| 110 | test_all_libs_upto_date |