blob: a979c346b8dd868155d702793b5782900980412b [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"
Joshua Harlowee9064b2015-02-19 15:06:23 -080035ALL_LIBS+=" oslo.messaging oslo.log cliff python-heatclient stevedore"
36ALL_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"
Joshua Harlowee9064b2015-02-19 15:06:23 -080039ALL_LIBS+=" python-openstackclient oslo.rootwrap oslo.i18n"
Chris Dente9a47502015-06-27 11:29:09 +000040ALL_LIBS+=" oslo.utils python-swiftclient"
Joshua Harlowee9064b2015-02-19 15:06:23 -080041ALL_LIBS+=" python-neutronclient tooz ceilometermiddleware oslo.policy"
Davanum Srinivas18d1cca2015-06-18 06:32:00 -040042ALL_LIBS+=" debtcollector os-brick automaton futurist oslo.service"
Boris Pavlovicba0a6592016-01-14 17:31:40 -080043ALL_LIBS+=" oslo.cache oslo.reports osprofiler"
Doug Wiegley86561c32016-02-10 18:37:21 -070044ALL_LIBS+=" keystoneauth ironic-lib neutron-lib oslo.privsep"
Sergey Belous1258da62016-03-21 12:32:06 +030045ALL_LIBS+=" diskimage-builder os-vif"
Sean Dagueaecd1892014-11-19 15:19:51 -050046
47# Generate the above list with
48# echo ${!GITREPO[@]}
49
50function check_exists {
51 local thing=$1
52 local hash=$2
53 local key=$3
54 if [[ ! -z "$VERBOSE" ]]; then
55 echo "Checking for $hash[$key]"
56 fi
57 if [[ -z $thing ]]; then
58 echo "$hash[$key] does not exit!"
59 exit 1
60 else
61 if [[ ! -z "$VERBOSE" ]]; then
62 echo "$hash[$key] => $thing"
63 fi
64 fi
65}
66
67function test_all_libs_upto_date {
68 # this is all the magics
69 local found_libs=${!GITREPO[@]}
70 declare -A all_libs
71 for lib in $ALL_LIBS; do
72 all_libs[$lib]=1
73 done
74
75 for lib in $found_libs; do
76 if [[ -z ${all_libs[$lib]} ]]; then
77 echo "Library '$lib' not listed in unit tests, please add to ALL_LIBS"
78 exit 1
79 fi
80
81 done
82 echo "test_all_libs_upto_date PASSED"
83}
84
85function test_libs_exist {
86 local lib=""
87 for lib in $ALL_LIBS; do
88 check_exists "${GITREPO[$lib]}" "GITREPO" "$lib"
89 check_exists "${GITBRANCH[$lib]}" "GITBRANCH" "$lib"
90 check_exists "${GITDIR[$lib]}" "GITDIR" "$lib"
91 done
92
93 echo "test_libs_exist PASSED"
94}
95
96function test_branch_master {
97 for lib in $ALL_LIBS; do
98 if [[ ${GITBRANCH[$lib]} != "master" ]]; then
99 echo "GITBRANCH for $lib not master (${GITBRANCH[$lib]})"
100 exit 1
101 fi
102 done
103
104 echo "test_branch_master PASSED"
105}
106
107set -o errexit
108
109test_libs_exist
110test_branch_master
111test_all_libs_upto_date