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