blob: 1f7169c68948ab7441aa3ae34c498a58a8439897 [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"
34ALL_LIBS+=" python-glanceclient python-ironicclient tempest-lib"
35ALL_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"
38ALL_LIBS+=" oslo.serialization python-saharaclient django_openstack_auth"
Joshua Harlowee9064b2015-02-19 15:06:23 -080039ALL_LIBS+=" python-openstackclient oslo.rootwrap oslo.i18n"
40ALL_LIBS+=" python-ceilometerclient oslo.utils python-swiftclient"
41ALL_LIBS+=" python-neutronclient tooz ceilometermiddleware oslo.policy"
Davanum Srinivas18d1cca2015-06-18 06:32:00 -040042ALL_LIBS+=" debtcollector os-brick automaton futurist oslo.service"
Steve Martinelli531017c2015-06-27 03:37:39 +000043ALL_LIBS+=" oslo.cache"
Sean Dagueaecd1892014-11-19 15:19:51 -050044
45# Generate the above list with
46# echo ${!GITREPO[@]}
47
48function check_exists {
49 local thing=$1
50 local hash=$2
51 local key=$3
52 if [[ ! -z "$VERBOSE" ]]; then
53 echo "Checking for $hash[$key]"
54 fi
55 if [[ -z $thing ]]; then
56 echo "$hash[$key] does not exit!"
57 exit 1
58 else
59 if [[ ! -z "$VERBOSE" ]]; then
60 echo "$hash[$key] => $thing"
61 fi
62 fi
63}
64
65function test_all_libs_upto_date {
66 # this is all the magics
67 local found_libs=${!GITREPO[@]}
68 declare -A all_libs
69 for lib in $ALL_LIBS; do
70 all_libs[$lib]=1
71 done
72
73 for lib in $found_libs; do
74 if [[ -z ${all_libs[$lib]} ]]; then
75 echo "Library '$lib' not listed in unit tests, please add to ALL_LIBS"
76 exit 1
77 fi
78
79 done
80 echo "test_all_libs_upto_date PASSED"
81}
82
83function test_libs_exist {
84 local lib=""
85 for lib in $ALL_LIBS; do
86 check_exists "${GITREPO[$lib]}" "GITREPO" "$lib"
87 check_exists "${GITBRANCH[$lib]}" "GITBRANCH" "$lib"
88 check_exists "${GITDIR[$lib]}" "GITDIR" "$lib"
89 done
90
91 echo "test_libs_exist PASSED"
92}
93
94function test_branch_master {
95 for lib in $ALL_LIBS; do
96 if [[ ${GITBRANCH[$lib]} != "master" ]]; then
97 echo "GITBRANCH for $lib not master (${GITBRANCH[$lib]})"
98 exit 1
99 fi
100 done
101
102 echo "test_branch_master PASSED"
103}
104
105set -o errexit
106
107test_libs_exist
108test_branch_master
109test_all_libs_upto_date