Add initial codes
[it/test.git] / ric_robot_suite / docker / ric-robot / ete.sh
1 # Copyright © 2019 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 function usage
17 {
18         echo "Usage: ete.sh <command> [<parameters>]"
19         echo " "
20         echo "       ete.sh health "
21         echo "               - Execute RIC health tests for each component"
22         echo "       ete.sh etetests"
23         echo "               - Execute RIC ete tests "
24         echo "       ete.sh appmgr"
25         echo "               - Execute RIC appmgr tests "
26         echo " "
27 }
28
29
30 #
31 # Run the testsuite for the passed tag. Valid tags are health
32 # Please clean up logs when you are done...
33 # Note: Do not run multiple concurrent ete.sh as the --display is not parameterized and tests will collide
34 #
35 if [ "$1" == "" ] ; then
36    echo "Usage: ete.sh  [ health  | etetests | xapptests]"
37    exit
38 fi
39
40 set -x
41
42
43 POD=ric-robot
44
45 TAGS="-i $1"
46
47 ETEHOME=/var/opt/RIC
48 export GLOBAL_BUILD_NUMBER=$(docker exec  -it ${POD}  bash -c "ls -1q /share/logs/ | wc -l")
49 GLOBAL_BUILD_NUMBER=$(echo $GLOBAL_BUILD_NUMBER | tr -d '\r')
50 OUTPUT_FOLDER=$(printf %04d $GLOBAL_BUILD_NUMBER)_ete_$1
51 DISPLAY_NUM=$(($GLOBAL_BUILD_NUMBER + 90))
52
53 VARIABLEFILES="-V /share/config/vm_properties.py -V /share/config/integration_robot_properties.py"
54 VARIABLES="-v GLOBAL_BUILD_NUMBER:$$"
55
56 docker  exec -it ${POD} ${ETEHOME}/runTags.sh ${VARIABLEFILES} ${VARIABLES} -d /share/logs/${OUTPUT_FOLDER} ${TAGS} --display $DISPLAY_NUM