blob: f63c98ee25dc4fd58f5eb9de73b11c132662f2c2 [file] [log] [blame]
Brian Freeman31631512019-04-11 12:28:52 -05001# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
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,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15#!/bin/bash
16
17#
18# Run the testsuite for the passed tag. Valid tags are ete, health, closedloop, instantiate
19# Please clean up logs when you are done...
20# Note: Do not run multiple concurrent ete.sh as the --display is not parameterized and tests will collide
21#
22if [ "$1" == "" ] ; then
23 echo "Usage: eteHelm-k8s.sh namespace "
24 echo " list projects via helm list and runs health-check with those tags except dev and dev-consul "
25 exit
26fi
27
28set -x
29
30export NAMESPACE="$1"
31
32POD=$(kubectl --namespace $NAMESPACE get pods | sed 's/ .*//'| grep robot)
33
34PROJECTS=$(helm list | cut -d ' ' -f 1 | grep "-" | grep -v consul )
35
36TAGS=""
37for project in $PROJECTS ;
38do
39TAGS="$TAGS -i $project"
40done
41
42
43ETEHOME=/var/opt/ONAP
44export GLOBAL_BUILD_NUMBER=$(kubectl --namespace $NAMESPACE exec ${POD} -- bash -c "ls -1q /share/logs/ | wc -l")
45OUTPUT_FOLDER=$(printf %04d $GLOBAL_BUILD_NUMBER)_ete_helmlist
46DISPLAY_NUM=$(($GLOBAL_BUILD_NUMBER + 90))
47
48VARIABLEFILES="-V /share/config/vm_properties.py -V /share/config/integration_robot_properties.py -V /share/config/integration_preload_parameters.py"
49VARIABLES="-v GLOBAL_BUILD_NUMBER:$$"
50
51kubectl --namespace $NAMESPACE exec ${POD} -- ${ETEHOME}/runTags.sh ${VARIABLEFILES} ${VARIABLES} -d /share/logs/${OUTPUT_FOLDER} ${TAGS} --display $DISPLAY_NUM