blob: d10cd0ee6219e2987c7234e1e4abb091709e3cf3 [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"
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"
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"
Davanum Srinivas77a7d112015-06-22 16:44:13 -040043ALL_LIBS+=" oslo.cache oslo.reports"
Jamie Lennox21a90772015-07-03 11:54:38 +100044ALL_LIBS+=" keystoneauth"
Sean Dagueaecd1892014-11-19 15:19:51 -050045
46# Generate the above list with
47# echo ${!GITREPO[@]}
48
49function check_exists {
50 local thing=$1
51 local hash=$2
52 local key=$3
53 if [[ ! -z "$VERBOSE" ]]; then
54 echo "Checking for $hash[$key]"
55 fi
56 if [[ -z $thing ]]; then
57 echo "$hash[$key] does not exit!"
58 exit 1
59 else
60 if [[ ! -z "$VERBOSE" ]]; then
61 echo "$hash[$key] => $thing"
62 fi
63 fi
64}
65
66function test_all_libs_upto_date {
67 # this is all the magics
68 local found_libs=${!GITREPO[@]}
69 declare -A all_libs
70 for lib in $ALL_LIBS; do
71 all_libs[$lib]=1
72 done
73
74 for lib in $found_libs; do
75 if [[ -z ${all_libs[$lib]} ]]; then
76 echo "Library '$lib' not listed in unit tests, please add to ALL_LIBS"
77 exit 1
78 fi
79
80 done
81 echo "test_all_libs_upto_date PASSED"
82}
83
84function test_libs_exist {
85 local lib=""
86 for lib in $ALL_LIBS; do
87 check_exists "${GITREPO[$lib]}" "GITREPO" "$lib"
88 check_exists "${GITBRANCH[$lib]}" "GITBRANCH" "$lib"
89 check_exists "${GITDIR[$lib]}" "GITDIR" "$lib"
90 done
91
92 echo "test_libs_exist PASSED"
93}
94
95function test_branch_master {
96 for lib in $ALL_LIBS; do
97 if [[ ${GITBRANCH[$lib]} != "master" ]]; then
98 echo "GITBRANCH for $lib not master (${GITBRANCH[$lib]})"
99 exit 1
100 fi
101 done
102
103 echo "test_branch_master PASSED"
104}
105
106set -o errexit
107
108test_libs_exist
109test_branch_master
110test_all_libs_upto_date