| 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" | 
| Jordan Pittier | a046b60 | 2016-05-02 11:59:52 +0200 | [diff] [blame] | 34 | ALL_LIBS+=" python-glanceclient python-ironicclient" | 
| xiaolihope | 8f985b6 | 2016-05-18 00:32:08 +0800 | [diff] [blame] | 35 | ALL_LIBS+=" oslo.messaging oslo.log cliff stevedore" | 
| Joshua Harlow | ee9064b | 2015-02-19 15:06:23 -0800 | [diff] [blame] | 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" | 
| Dean Troyer | 06f3639 | 2016-08-12 09:35:42 -0500 | [diff] [blame] | 39 | ALL_LIBS+=" python-openstackclient osc-lib os-client-config oslo.rootwrap" | 
| Dean Troyer | 9fecc2a | 2017-04-07 12:28:40 -0500 | [diff] [blame] | 40 | ALL_LIBS+=" oslo.i18n oslo.utils python-openstacksdk python-swiftclient" | 
| Joshua Harlow | ee9064b | 2015-02-19 15:06:23 -0800 | [diff] [blame] | 41 | ALL_LIBS+=" python-neutronclient tooz ceilometermiddleware oslo.policy" | 
| Matt Riedemann | aefc926 | 2017-05-31 15:39:48 -0400 | [diff] [blame] | 42 | ALL_LIBS+=" debtcollector os-brick os-traits automaton futurist oslo.service" | 
| Brianna Poulos | f9c2a68 | 2017-04-14 13:00:19 -0400 | [diff] [blame] | 43 | ALL_LIBS+=" oslo.cache oslo.reports osprofiler cursive" | 
| Doug Wiegley | 86561c3 | 2016-02-10 18:37:21 -0700 | [diff] [blame] | 44 | ALL_LIBS+=" keystoneauth ironic-lib neutron-lib oslo.privsep" | 
| Ivan Kolodyazhny | 8d0d311 | 2016-05-26 23:41:49 +0300 | [diff] [blame] | 45 | ALL_LIBS+=" diskimage-builder os-vif python-brick-cinderclient-ext" | 
| Kaitlin Farr | ed7dbe5 | 2017-06-19 16:50:38 -0400 | [diff] [blame] | 46 | ALL_LIBS+=" castellan python-barbicanclient" | 
| Sean Dague | aecd189 | 2014-11-19 15:19:51 -0500 | [diff] [blame] | 47 |  | 
|  | 48 | # Generate the above list with | 
|  | 49 | # echo ${!GITREPO[@]} | 
|  | 50 |  | 
|  | 51 | function check_exists { | 
|  | 52 | local thing=$1 | 
|  | 53 | local hash=$2 | 
|  | 54 | local key=$3 | 
|  | 55 | if [[ ! -z "$VERBOSE" ]]; then | 
|  | 56 | echo "Checking for $hash[$key]" | 
|  | 57 | fi | 
|  | 58 | if [[ -z $thing ]]; then | 
|  | 59 | echo "$hash[$key] does not exit!" | 
|  | 60 | exit 1 | 
|  | 61 | else | 
|  | 62 | if [[ ! -z "$VERBOSE" ]]; then | 
|  | 63 | echo "$hash[$key] => $thing" | 
|  | 64 | fi | 
|  | 65 | fi | 
|  | 66 | } | 
|  | 67 |  | 
|  | 68 | function test_all_libs_upto_date { | 
|  | 69 | # this is all the magics | 
|  | 70 | local found_libs=${!GITREPO[@]} | 
|  | 71 | declare -A all_libs | 
|  | 72 | for lib in $ALL_LIBS; do | 
|  | 73 | all_libs[$lib]=1 | 
|  | 74 | done | 
|  | 75 |  | 
|  | 76 | for lib in $found_libs; do | 
|  | 77 | if [[ -z ${all_libs[$lib]} ]]; then | 
|  | 78 | echo "Library '$lib' not listed in unit tests, please add to ALL_LIBS" | 
|  | 79 | exit 1 | 
|  | 80 | fi | 
|  | 81 |  | 
|  | 82 | done | 
|  | 83 | echo "test_all_libs_upto_date PASSED" | 
|  | 84 | } | 
|  | 85 |  | 
|  | 86 | function test_libs_exist { | 
|  | 87 | local lib="" | 
|  | 88 | for lib in $ALL_LIBS; do | 
|  | 89 | check_exists "${GITREPO[$lib]}" "GITREPO" "$lib" | 
|  | 90 | check_exists "${GITBRANCH[$lib]}" "GITBRANCH" "$lib" | 
|  | 91 | check_exists "${GITDIR[$lib]}" "GITDIR" "$lib" | 
|  | 92 | done | 
|  | 93 |  | 
|  | 94 | echo "test_libs_exist PASSED" | 
|  | 95 | } | 
|  | 96 |  | 
|  | 97 | function test_branch_master { | 
|  | 98 | for lib in $ALL_LIBS; do | 
|  | 99 | if [[ ${GITBRANCH[$lib]} != "master" ]]; then | 
|  | 100 | echo "GITBRANCH for $lib not master (${GITBRANCH[$lib]})" | 
|  | 101 | exit 1 | 
|  | 102 | fi | 
|  | 103 | done | 
|  | 104 |  | 
|  | 105 | echo "test_branch_master PASSED" | 
|  | 106 | } | 
|  | 107 |  | 
|  | 108 | set -o errexit | 
|  | 109 |  | 
|  | 110 | test_libs_exist | 
|  | 111 | test_branch_master | 
|  | 112 | test_all_libs_upto_date |