Synch installs with it/dep and fix Dockerfile 03/903/2
authorBrian Freeman <bf1936@att.com>
Wed, 4 Sep 2019 00:08:12 +0000 (00:08 +0000)
committerBrian Freeman <bf1936@att.com>
Fri, 6 Sep 2019 15:52:09 +0000 (15:52 +0000)
Change-Id: I200538579fc91f7b560fe67aae966ad8c5d61f46
Signed-off-by: Brian Freeman <bf1936@att.com>
ric_robot_suite/docker/ric-robot/Dockerfile
ric_robot_suite/helm/README.md
ric_robot_suite/helm/ric-robot/demo-k8s.sh
ric_robot_suite/helm/ric-robot/ete-k8s.e2sim.sh
ric_robot_suite/helm/ric-robot/ete-k8s.sh
ric_robot_suite/helm/ric-robot/testAll.sh [new file with mode: 0755]
ric_robot_suite/helm/ric-robot/values.yaml
ric_robot_suite/helm/robot_install.sh
simulators/e2sim/helm/e2sim_install.sh

index 387c9d7..e44a47f 100644 (file)
@@ -68,7 +68,7 @@ RUN pip install robotframework==3.0.4 \
 
 COPY robot /var/opt/RIC/robot
 COPY red.xml /var/opt/RIC
-COPY ric-python-utils /var/opt/RIC
+COPY ric-python-utils /var/opt/RIC/ric-python-utils
 COPY runTags.sh /var/opt/RIC
 COPY setup.sh /var/opt/RIC
 COPY version.properties /var/opt/RIC
index 0a9787c..a2ee4ca 100644 (file)
@@ -30,3 +30,4 @@
 #  remember to run the init_robot tag to complete robot setup
 #  cd ric-robot
 #      ./demo-k8s.sh ricplt init_robot
+#
index ae3ae62..67a41c3 100755 (executable)
@@ -30,8 +30,8 @@ function usage
 
 # Set the defaults
 
-echo "Number of parameters:" 
-echo $#
+#echo "Number of parameters:" 
+#echo $#
 
 if [ $# -lt 2 ];then
        usage
@@ -49,18 +49,13 @@ shift
 while [ $# -gt 0 ]
 do
        key="$1"
-        echo "KEY:"
-        echo $key
+        #echo "KEY:"
+        #echo $key
 
        case $key in
        init_robot)
                        TAG="UpdateWebPage"
-                       read -s -p "WEB Site Password for user 'test': " WEB_PASSWORD
-                       if [ "$WEB_PASSWORD" = "" ]; then
-                               echo ""
-                               echo "WEB Password is required for user 'test'"
-                               exit
-                       fi
+                       WEB_PASSWORD=test
                        VARIABLES="$VARIABLES -v WEB_PASSWORD:$WEB_PASSWORD"
                        shift
                        if [ $# -eq 2 ];then
@@ -76,7 +71,7 @@ do
        esac
 done
 
-set -x
+#set -x
 
 
 ETEHOME=/var/opt/RIC
index 4f947fb..dab6c26 100755 (executable)
@@ -22,8 +22,8 @@
 # Please clean up logs when you are done...
 # Note: Do not run multiple concurrent ete.sh as the --display is not parameterized and tests will collide
 #
-if [ "$1" == "" ] || [ "$2" == "" ]; then
-   echo "Usage: ete-k8s.sh <namespace> <tag> [input variable]"
+if [ "$1" == "" ] || [ "$2" == "" ] || [ "$3" == "" ]; then
+   echo "Usage: ete-k8s.sh <namespace> <tag> <override_file> [input variable]"
    echo "  [input variable] is added to runTags with "-v" prepended"
    echo "         example :   TEST_NODE_B_IP:10.240.0.217 "
    echo "         example :   \"TEST_NODE_B_IP:10.240.0.217 -v TEST_NODE_B_PORT:34622 -v TEST_NODE_B_NAME:BBBB654321\""
@@ -39,16 +39,20 @@ if [ "$1" == "" ] || [ "$2" == "" ]; then
    exit
 fi
 
+# setup a detail log file
+current_time=$(date "+%Y.%m.%d-%H.%M.%S")
+LOGFILE=/tmp/ete-k8s.e2sim.$current_time.log
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
 
-#/root/test/ric_robot_suite/helm
+
 # extract the base to find root to dep
 
 BASE=${DIR%/test*}
 
-BASEDIR50=$BASE/dep/ric-platform/50-RIC-Platform/
-OVERRIDEYAML=$BASE/dep/RECIPE_EXAMPLE/RIC_PLATFORM_RECIPE_EXAMPLE
+BASEDIR50=$BASE/dep/ric-platform/50-RIC-Platform
+#OVERRIDEYAML=$BASE/dep/RECIPE_EXAMPLE/ric-platform
+OVERRIDEYAML=$3
 
 echo "Using etc/ric.conf from $BASEDIR50"
 
@@ -83,8 +87,9 @@ wait_for_pods_running () {
   while [  $NUMPODS -lt $1 ]; do
     sleep 5
     NUMPODS=$(eval "$CMD2")
-    echo "> waiting for $NUMPODS/$1 pods running in namespace [$NS] with keyword [$KEYWORD]"
+    echo -n "."
   done
+  echo "."
 }
 
 wait_for_pods_terminated() {
@@ -104,16 +109,39 @@ wait_for_pods_terminated() {
   while [  $NUMPODS -gt $1 ]; do
     sleep 5
     NUMPODS=$(eval "$CMD2")
-    echo "> waiting for $NUMPODS/$1 pods terminated (gone) in namespace [$NS] with keyword [$KEYWORD]"
+    echo -n "."
+  done
+  echo "."
+}
+
+
+# wait_for_e2mgr
+#  e2mgr can take a few seconds after the POD is running to be up
+#  
+
+wait_for_e2mgr() {
+  E2MGR_IP=$(kubectl -n ricplt  get services | grep e2mgr-http | awk '{print $3}')
+  #echo $E2MGR_IP
+  CMD3="curl -s -o /dev/null -w \"%{http_code}\" http://$E2MGR_IP:3800/v1/nodeb-ids"
+  echo $CMD3
+  HTTP_CODE=$(eval "$CMD3")
+  echo $HTTP_CODE
+  while [  $HTTP_CODE  -ne 200 ]; do
+    sleep 1
+    HTTP_CODE=$(eval "$CMD3")
+    echo -n "."
   done
 }
 
 
-if [ "$3" != "" ] ; then
-    VARIABLES="-v $3"
+
+
+
+if [ "$4" != "" ] ; then
+    VARIABLES="-v $4"
 fi
 
-set -x
+#set -x
 
 export NAMESPACE="$1"
 
@@ -123,37 +151,37 @@ TAG="$2"
 TAGS="-i $2"
 
 
-# if $2 is e2setup or x2setup then helm delete/helm install 
+# if $2 is e2setup or x2setup then helm delete/helm install
 shift
 while [ $# -gt 0 ]
 do
         key="$1"
-        echo "KEY:"
+        echo -n "KEY:"
         echo $key
         case $key in
         e2setup|e2setup_dash|x2setup|x2setup_dash)
-                        #/root/dep/ric-platform/50-RIC-Platform/bin/harry-uninstall
-                        helm delete  ${RELEASE_NAME}-e2term   --purge
-                        helm delete  ${RELEASE_NAME}-e2mgr   --purge
-                       helm delete  ${RELEASE_NAME}-e2sim  --purge
+                        helm delete  ${RELEASE_NAME}-e2term   --purge  >> $LOGFILE
+                        helm delete  ${RELEASE_NAME}-e2mgr   --purge   >> $LOGFILE
+                        helm delete  ${RELEASE_NAME}-e2sim  --purge  >> $LOGFILE
                         wait_for_pods_terminated  0  $NAMESPACE e2sim
                         wait_for_pods_terminated  0  $NAMESPACE e2term
                         wait_for_pods_terminated  0  $NAMESPACE e2mgr
-                        helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-e2term" $BASEDIR50/helm/e2term
-                        helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-e2mgr" $BASEDIR50/helm/e2mgr
+                        helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-e2term" $BASEDIR50/helm/e2term >> $LOGFILE
+                        helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-e2mgr" $BASEDIR50/helm/e2mgr >> $LOGFILE
                         cd /root/test/simulators/e2sim/helm
-                       ./e2sim_install.sh
+                        ./e2sim_install.sh     >> $LOGFILE
                         wait_for_pods_running 1 $NAMESPACE e2term
                         wait_for_pods_running 1 $NAMESPACE e2mgr
                         wait_for_pods_running 1 $NAMESPACE e2sim
+                        # wait for application
+                        wait_for_e2mgr
                         E2SIMIP=$(kubectl -n ricplt get pod -o=wide | grep e2sim | sed 's/\s\s*/ /g' | cut -d ' ' -f6)
-                       echo $E2SIMIP
                         VARIABLES="$VARIABLES -v TEST_NODE_B_IP:$E2SIMIP"
-                       shift
-                       ;;
+                        shift
+                        ;;
         *)
-                       shift
-                       ;;
+                        shift
+                        ;;
         esac
 done
 
index c80d38b..9bbe82a 100755 (executable)
@@ -45,7 +45,7 @@ if [ "$3" != "" ] ; then
     VARIABLES="-v $3"
 fi
 
-set -x
+#set -x
 
 export NAMESPACE="$1"
 
diff --git a/ric_robot_suite/helm/ric-robot/testAll.sh b/ric_robot_suite/helm/ric-robot/testAll.sh
new file mode 100755 (executable)
index 0000000..054fda2
--- /dev/null
@@ -0,0 +1,14 @@
+# script to do all regression tags
+# fill in the file path to the override file
+#  
+OVERRIDE_FILE=__REPLACE_WITH_FILEPATH_TO_OVERRIDE_FILE__
+# only need to run demo-k8s.sh once  but doesnt hurt to repeat it
+./demo-k8s.sh ricplt init_robot
+./ete-k8s.sh ricplt health
+./ete-k8s.sh ricplt etetests
+sleep 5
+./ete-k8s.sh ricplt ci_tests
+./ete-k8s.e2sim.sh ricplt e2setup $OVERRIDE_FILE TEST_NODE_B_NAME:AAAA123456
+./ete-k8s.e2sim.sh ricplt e2setup_dash $OVERRIDE_FILE TEST_NODE_B_NAME:AAAA123456
+./ete-k8s.e2sim.sh ricplt x2setup  $OVERRIDE_FILE TEST_NODE_B_NAME:AAAA123456
+./ete-k8s.e2sim.sh ricplt x2setup_dash  $OVERRIDE_FILE TEST_NODE_B_NAME:AAAA123456
index 3c41fd5..d9a394a 100755 (executable)
@@ -35,7 +35,7 @@ fullnameOverride: ""
 
 config:
   dashboardExternalIp:  REPLACE_WITH_EXTERNAL_K8_IP_OF_DASHBOARD
-  dashboardExternalPort:  REPLACE_WITH_NODEPORT_OF_DASHBOARD
+  dashboardExternalPort:  REPLACE_WITH_NODEPORT_OF_KONG_PROXY_31080
 service:
   port: 88
   type: NodePort
@@ -83,3 +83,4 @@ ric:
    dbaas:
    e2mgr:
    e2term:
+
index 92b7b93..867eb98 100755 (executable)
@@ -1,6 +1,4 @@
-#!/bin/bash
-################################################################################
-#   Copyright (c) 2019 AT&T Intellectual Property.                             #
+opyright (c) 2019 AT&T Intellectual Property.                             #
 #   Copyright (c) 2019 Nokia.                                                  #
 #                                                                              #
 #   Licensed under the Apache License, Version 2.0 (the "License");            #
@@ -29,7 +27,7 @@ BASE=${DIR%/test*}
 
 # /data/ORAN-OSC/it/dep/ric-platform/50-RIC-Platform/bin/install
 BASEDIR50=$BASE/dep/ric-platform/50-RIC-Platform/
-BASEDIR_COMMON_TEMPLATE=$BASE/dep/ric-common/Common-Template/helm/ric-common
+BASEDIRCOMMON=$BASE/dep/ric-common/Common-Template/helm/ric-common
 
 echo "Using etc/ric.conf from $BASEDIR50"
 
@@ -56,9 +54,12 @@ echo "Platform Namespace: $PLT_NAMESPACE"
 echo "Helm Release Name: $RELEASE_NAME"
 
 
-COMMON_CHART_VERSION=$(cat $BASEDIR_COMMON_TEMPLATE/Chart.yaml | grep version | awk '{print $2}')
+#COMMON_CHART_VERSION=$(cat $BASEDIR50/helm/common/Chart.yaml | grep version | awk '{print $2}')
+COMMON_CHART_VERSION=$(cat $BASEDIRCOMMON/Chart.yaml | grep version | awk '{print $2}')
+
+
 
-helm package -d /tmp $BASEDIR_COMMON_TEMPLATE
+helm package -d /tmp $BASEDIRCOMMON
 
 
 for component in $RICPLT_COMPONENTS; do
index 745d82b..9b9a13c 100755 (executable)
@@ -29,7 +29,7 @@ BASE=${DIR%/test*}
 
 # /data/ORAN-OSC/it/dep/ric-platform/50-RIC-Platform/bin/install
 BASEDIR05=$BASE/dep/ric-platform/50-RIC-Platform/
-BASEDIR_COMMON_TEMPLATE=$BASE/dep/ric-common/Common-Template/helm/ric-common
+BASEDIRCOMMON=$BASE/dep/ric-common/Common-Template/helm/ric-common
 
 echo "Using etc/ric.conf from $BASEDIR05"
 
@@ -59,10 +59,9 @@ echo "Platform Namespace: $PLT_NAMESPACE"
 echo "Helm Release Name: $RELEASE_NAME"
 
 
-COMMON_CHART_VERSION=$(cat $BASEDIR_COMMON_TEMPLATE/Chart.yaml | grep version | awk '{print $2}')
+COMMON_CHART_VERSION=$(cat $BASEDIRCOMMON/Chart.yaml | grep version | awk '{print $2}')
 
-
-helm package -d /tmp $BASEDIR_COMMON_TEMPLATE
+helm package -d /tmp $BASEDIRCOMMON
 
 
 for component in $RICPLT_COMPONENTS; do