blob: 5b4ff32f2afca07282ffda8ee48045acff92ac23 [file] [log] [blame]
Sean Dagueaecd1892014-11-19 15:19:51 -05001#!/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
16TOP=$(cd $(dirname "$0")/.. && pwd)
17
18export TOP_DIR=$TOP
19
Sean Dague365421b2015-02-06 15:27:43 -050020# we don't actually care about the HOST_IP
21HOST_IP="don't care"
Sean Dagueaecd1892014-11-19 15:19:51 -050022# Import common functions
23source $TOP/functions
24source $TOP/stackrc
25source $TOP/lib/tls
26for i in $TOP/lib/*; do
27 if [[ -f $i ]]; then
28 source $i
29 fi
30done
31
James E. Blair9e220b92015-03-24 16:32:03 -070032ALL_LIBS="python-novaclient oslo.config pbr oslo.context"
Joshua Harlowee9064b2015-02-19 15:06:23 -080033ALL_LIBS+=" python-keystoneclient taskflow oslo.middleware pycadf"
Jordan Pittiera046b602016-05-02 11:59:52 +020034ALL_LIBS+=" python-glanceclient python-ironicclient"
xiaolihope8f985b62016-05-18 00:32:08 +080035ALL_LIBS+=" oslo.messaging oslo.log cliff stevedore"
Joshua Harlowee9064b2015-02-19 15:06:23 -080036ALL_LIBS+=" python-cinderclient glance_store oslo.concurrency oslo.db"
Dan Smithaca8a7f2015-03-03 08:50:27 -080037ALL_LIBS+=" oslo.versionedobjects oslo.vmware keystonemiddleware"
Sergey Lukjanov3381e092015-07-01 14:20:23 +030038ALL_LIBS+=" oslo.serialization django_openstack_auth"
Dean Troyer06f36392016-08-12 09:35:42 -050039ALL_LIBS+=" python-openstackclient osc-lib os-client-config oslo.rootwrap"
Dean Troyer9fecc2a2017-04-07 12:28:40 -050040ALL_LIBS+=" oslo.i18n oslo.utils python-openstacksdk python-swiftclient"
Joshua Harlowee9064b2015-02-19 15:06:23 -080041ALL_LIBS+=" python-neutronclient tooz ceilometermiddleware oslo.policy"
Matt Riedemannaefc9262017-05-31 15:39:48 -040042ALL_LIBS+=" debtcollector os-brick os-traits automaton futurist oslo.service"
Brianna Poulosf9c2a682017-04-14 13:00:19 -040043ALL_LIBS+=" oslo.cache oslo.reports osprofiler cursive"
Doug Wiegley86561c32016-02-10 18:37:21 -070044ALL_LIBS+=" keystoneauth ironic-lib neutron-lib oslo.privsep"
Ivan Kolodyazhny8d0d3112016-05-26 23:41:49 +030045ALL_LIBS+=" diskimage-builder os-vif python-brick-cinderclient-ext"
Kaitlin Farred7dbe52017-06-19 16:50:38 -040046ALL_LIBS+=" castellan python-barbicanclient"
Sean Dagueaecd1892014-11-19 15:19:51 -050047
48# Generate the above list with
49# echo ${!GITREPO[@]}
50
51function 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
68function 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
86function 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
97function 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
108set -o errexit
109
110test_libs_exist
111test_branch_master
112test_all_libs_upto_date