blob: 839e3a132801df7c3669e2c11dda5e37570b36f9 [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"
Przemyslaw Szczerbik1ab63132021-07-06 14:26:40 +020047ALL_LIBS+=" castellan python-barbicanclient ovsdbapp os-ken os-resource-classes"
melanie wittc7791302021-10-01 17:24:10 +000048ALL_LIBS+=" oslo.limit"
Sean Dagueaecd1892014-11-19 15:19:51 -050049
50# Generate the above list with
51# echo ${!GITREPO[@]}
52
53function check_exists {
54 local thing=$1
55 local hash=$2
56 local key=$3
57 if [[ ! -z "$VERBOSE" ]]; then
58 echo "Checking for $hash[$key]"
59 fi
60 if [[ -z $thing ]]; then
61 echo "$hash[$key] does not exit!"
62 exit 1
63 else
64 if [[ ! -z "$VERBOSE" ]]; then
65 echo "$hash[$key] => $thing"
66 fi
67 fi
68}
69
70function test_all_libs_upto_date {
71 # this is all the magics
72 local found_libs=${!GITREPO[@]}
73 declare -A all_libs
74 for lib in $ALL_LIBS; do
75 all_libs[$lib]=1
76 done
77
78 for lib in $found_libs; do
79 if [[ -z ${all_libs[$lib]} ]]; then
80 echo "Library '$lib' not listed in unit tests, please add to ALL_LIBS"
81 exit 1
82 fi
83
84 done
85 echo "test_all_libs_upto_date PASSED"
86}
87
88function test_libs_exist {
89 local lib=""
90 for lib in $ALL_LIBS; do
91 check_exists "${GITREPO[$lib]}" "GITREPO" "$lib"
92 check_exists "${GITBRANCH[$lib]}" "GITBRANCH" "$lib"
93 check_exists "${GITDIR[$lib]}" "GITDIR" "$lib"
94 done
95
96 echo "test_libs_exist PASSED"
97}
98
Jens Harbott (frickler)57bc01b2018-08-27 13:23:18 +000099function test_branch_master {
100 for lib in $ALL_LIBS; do
101 if [[ ${GITBRANCH[$lib]} != "master" ]]; then
102 echo "GITBRANCH for $lib not master (${GITBRANCH[$lib]})"
103 exit 1
104 fi
105 done
106
107 echo "test_branch_master PASSED"
108}
109
Sean Dagueaecd1892014-11-19 15:19:51 -0500110set -o errexit
111
112test_libs_exist
Jens Harbott (frickler)57bc01b2018-08-27 13:23:18 +0000113test_branch_master
Sean Dagueaecd1892014-11-19 15:19:51 -0500114test_all_libs_upto_date