aboutsummaryrefslogtreecommitdiffstats
path: root/functest/ci
diff options
context:
space:
mode:
authorLinda Wang <wangwulin@huawei.com>2017-05-25 08:51:48 +0000
committerLinda Wang <wangwulin@huawei.com>2017-06-21 09:04:14 +0000
commit7140b86629af0958358be5628895c4b5f1fd1ea4 (patch)
treed110974d4ff45dd7374dfde2950a611193a5bbe2 /functest/ci
parenta48bf0c8306e566f15877f3bd72882cf8b7663db (diff)
Enable https insecure for functest
1. When running in https environment, functest should provide an option to disable server certificate verification. 2. For check_os.sh, the param "--insecure" is passed to openstack cli, e.g.. openstack --insecure server list. JIRA: FUNCTEST-828 Change-Id: Ie2c5b14152c92e87318fcfaf8b234f59275eb6b8 Signed-off-by: Linda Wang <wangwulin@huawei.com>
Diffstat (limited to 'functest/ci')
-rwxr-xr-xfunctest/ci/check_os.sh24
1 files changed, 15 insertions, 9 deletions
diff --git a/functest/ci/check_os.sh b/functest/ci/check_os.sh
index ce0bc20c..7b66f3da 100755
--- a/functest/ci/check_os.sh
+++ b/functest/ci/check_os.sh
@@ -6,12 +6,18 @@
# jose.lausuch@ericsson.com
#
+if [[ ${OS_INSECURE,,} == "true" ]]; then
+ options='--insecure'
+else
+ options=''
+fi
+
declare -A service_cmd_array
-service_cmd_array['nova']='openstack server list'
-service_cmd_array['neutron']='openstack network list'
-service_cmd_array['keystone']='openstack endpoint list'
-service_cmd_array['cinder']='openstack volume list'
-service_cmd_array['glance']='openstack image list'
+service_cmd_array['nova']="openstack $options server list"
+service_cmd_array['neutron']="openstack $options network list"
+service_cmd_array['keystone']="openstack $options endpoint list"
+service_cmd_array['cinder']="openstack $options volume list"
+service_cmd_array['glance']="openstack $options image list"
MANDATORY_SERVICES='nova neutron keystone glance'
OPTIONAL_SERVICES='cinder'
@@ -41,7 +47,7 @@ check_service() {
required=$2
fi
echo ">>Checking ${service} service..."
- if ! openstack service list | grep -i ${service} > /dev/null; then
+ if ! openstack $options service list | grep -i ${service} > /dev/null; then
if [ "$required" == 'false' ]; then
echo "WARN: Optional Service ${service} is not enabled!"
return
@@ -67,7 +73,7 @@ fi
echo "Checking OpenStack endpoints:"
-publicURL=$(openstack catalog show identity |awk '/public/ {print $4}')
+publicURL=$(openstack $options catalog show identity |awk '/public/ {print $4}')
publicIP=$(echo $publicURL|sed 's/^.*http.*\:\/\///'|sed 's/.[^:]*$//')
publicPort=$(echo $publicURL|grep -Po '(?<=:)\d+')
https_enabled=$(echo $publicURL | grep 'https')
@@ -99,11 +105,11 @@ for service in $OPTIONAL_SERVICES; do
done
echo "Checking External network..."
-networks=($(neutron net-list -F id | tail -n +4 | head -n -1 | awk '{print $2}'))
+networks=($(neutron $options net-list -F id | tail -n +4 | head -n -1 | awk '{print $2}'))
is_external=False
for net in "${networks[@]}"
do
- is_external=$(neutron net-show $net|grep "router:external"|awk '{print $4}')
+ is_external=$(neutron $options net-show $net|grep "router:external"|awk '{print $4}')
if [ $is_external == "True" ]; then
echo "External network found: $net"
break