blob: c3b445717152d8f6be38f35c1b13c3d5145048d3 [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"
Akihiro Motokif8dc5582017-12-24 08:17:01 +090038ALL_LIBS+=" oslo.serialization"
Roman Podoliakaa066abe2017-04-18 16:18:14 +030039ALL_LIBS+=" python-openstackclient osc-lib osc-placement"
40ALL_LIBS+=" os-client-config oslo.rootwrap"
Monty Taylor236250f2018-03-23 08:27:57 -050041ALL_LIBS+=" oslo.i18n oslo.utils openstacksdk python-swiftclient"
Joshua Harlowee9064b2015-02-19 15:06:23 -080042ALL_LIBS+=" python-neutronclient tooz ceilometermiddleware oslo.policy"
Matt Riedemannaefc9262017-05-31 15:39:48 -040043ALL_LIBS+=" debtcollector os-brick os-traits automaton futurist oslo.service"
Brianna Poulosf9c2a682017-04-14 13:00:19 -040044ALL_LIBS+=" oslo.cache oslo.reports osprofiler cursive"
Doug Wiegley86561c32016-02-10 18:37:21 -070045ALL_LIBS+=" keystoneauth ironic-lib neutron-lib oslo.privsep"
Ivan Kolodyazhny8d0d3112016-05-26 23:41:49 +030046ALL_LIBS+=" diskimage-builder os-vif python-brick-cinderclient-ext"
Kaitlin Farred7dbe52017-06-19 16:50:38 -040047ALL_LIBS+=" castellan python-barbicanclient"
Sean Dagueaecd1892014-11-19 15:19:51 -050048
49# Generate the above list with
50# echo ${!GITREPO[@]}
51
52function 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
69function 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
87function 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
Jens Harbott (frickler)57bc01b2018-08-27 13:23:18 +000098function 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
Sean Dagueaecd1892014-11-19 15:19:51 -0500109set -o errexit
110
111test_libs_exist
Jens Harbott (frickler)57bc01b2018-08-27 13:23:18 +0000112test_branch_master
Sean Dagueaecd1892014-11-19 15:19:51 -0500113test_all_libs_upto_date