blob: a2a6cb781cef409b9aad0f37ff84e7104640950a [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
Steve Martinelli20b027b2015-02-04 02:38:13 -050032ALL_LIBS="python-novaclient oslo.config pbr oslo.context python-troveclient python-keystoneclient taskflow oslo.middleware pycadf python-glanceclient python-ironicclient tempest-lib oslo.messaging oslo.log cliff python-heatclient stevedore python-cinderclient glance_store oslo.concurrency oslo.db oslo.vmware keystonemiddleware oslo.serialization python-saharaclient django_openstack_auth python-openstackclient oslo.rootwrap oslo.i18n python-ceilometerclient oslo.utils python-swiftclient python-neutronclient tooz ceilometermiddleware oslo.policy"
Sean Dagueaecd1892014-11-19 15:19:51 -050033
34# Generate the above list with
35# echo ${!GITREPO[@]}
36
37function check_exists {
38 local thing=$1
39 local hash=$2
40 local key=$3
41 if [[ ! -z "$VERBOSE" ]]; then
42 echo "Checking for $hash[$key]"
43 fi
44 if [[ -z $thing ]]; then
45 echo "$hash[$key] does not exit!"
46 exit 1
47 else
48 if [[ ! -z "$VERBOSE" ]]; then
49 echo "$hash[$key] => $thing"
50 fi
51 fi
52}
53
54function test_all_libs_upto_date {
55 # this is all the magics
56 local found_libs=${!GITREPO[@]}
57 declare -A all_libs
58 for lib in $ALL_LIBS; do
59 all_libs[$lib]=1
60 done
61
62 for lib in $found_libs; do
63 if [[ -z ${all_libs[$lib]} ]]; then
64 echo "Library '$lib' not listed in unit tests, please add to ALL_LIBS"
65 exit 1
66 fi
67
68 done
69 echo "test_all_libs_upto_date PASSED"
70}
71
72function test_libs_exist {
73 local lib=""
74 for lib in $ALL_LIBS; do
75 check_exists "${GITREPO[$lib]}" "GITREPO" "$lib"
76 check_exists "${GITBRANCH[$lib]}" "GITBRANCH" "$lib"
77 check_exists "${GITDIR[$lib]}" "GITDIR" "$lib"
78 done
79
80 echo "test_libs_exist PASSED"
81}
82
83function test_branch_master {
84 for lib in $ALL_LIBS; do
85 if [[ ${GITBRANCH[$lib]} != "master" ]]; then
86 echo "GITBRANCH for $lib not master (${GITBRANCH[$lib]})"
87 exit 1
88 fi
89 done
90
91 echo "test_branch_master PASSED"
92}
93
94set -o errexit
95
96test_libs_exist
97test_branch_master
98test_all_libs_upto_date