-## Access to RAPP Catalogue
-# Host name may be changed if app started by kube
-# Direct access from script
-RC_HTTPX="http"
-RC_HOST_NAME=$LOCALHOST_NAME
-RC_PATH=$RC_HTTPX"://"$RC_HOST_NAME":"$RAPP_CAT_EXTERNAL_PORT
-# RC_ADAPTER used for switch between REST and DMAAP (only REST supported currently)
-RC_ADAPTER_TYPE="REST"
-RC_ADAPTER=$RC_PATH
-
-
-###########################
-### RAPP Catalogue
-###########################
-
-# Set http as the protocol to use for all communication to the RAPP Catalogue
+################ Test engine functions ################
+
+# Create the image var used during the test
+# arg: [<image-tag-suffix>] (selects staging, snapshot, release etc)
+# <image-tag-suffix> is present only for images with staging, snapshot,release tags
+__RC_imagesetup() {
+ __check_and_create_image_var RC "RAPP_CAT_IMAGE" "RAPP_CAT_IMAGE_BASE" "RAPP_CAT_IMAGE_TAG" $1 "$RAPP_CAT_DISPLAY_NAME"
+}
+
+# Pull image from remote repo or use locally built image
+# arg: <pull-policy-override> <pull-policy-original>
+# <pull-policy-override> Shall be used for images allowing overriding. For example use a local image when test is started to use released images
+# <pull-policy-original> Shall be used for images that does not allow overriding
+# Both arg var may contain: 'remote', 'remote-remove' or 'local'
+__RC_imagepull() {
+ __check_and_pull_image $1 "$c" $RAPP_CAT_APP_NAME RAPP_CAT_IMAGE
+}
+
+# Generate a string for each included image using the app display name and a docker images format string
+# If a custom image repo is used then also the source image from the local repo is listed
+# arg: <docker-images-format-string> <file-to-append>
+__RC_image_data() {
+ echo -e "$RAPP_CAT_DISPLAY_NAME\t$(docker images --format $1 $RAPP_CAT_IMAGE)" >> $2
+ if [ ! -z "$RAPP_CAT_IMAGE_SOURCE" ]; then
+ echo -e "-- source image --\t$(docker images --format $1 $RAPP_CAT_IMAGE_SOURCE)" >> $2
+ fi
+}
+
+# Scale kubernetes resources to zero
+# All resources shall be ordered to be scaled to 0, if relevant. If not relevant to scale, then do no action.
+# This function is called for apps fully managed by the test script
+__RC_kube_scale_zero() {
+ __kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest RC
+}
+
+# Scale kubernetes resources to zero and wait until this has been accomplished, if relevant. If not relevant to scale, then do no action.
+# This function is called for prestarted apps not managed by the test script.
+__RC_kube_scale_zero_and_wait() {
+ __kube_scale_and_wait_all_resources $KUBE_NONRTRIC_NAMESPACE app "$KUBE_NONRTRIC_NAMESPACE"-rappcatalogueservice
+}
+
+# Delete all kube resouces for the app
+# This function is called for apps managed by the test script.
+__RC_kube_delete_all() {
+ __kube_delete_all_resources $KUBE_NONRTRIC_NAMESPACE autotest RC
+}
+
+# Store docker logs
+# This function is called for apps managed by the test script.
+# args: <log-dir> <file-prexix>
+__RC_store_docker_logs() {
+ if [ $RUNMODE == "KUBE" ]; then
+ kubectl logs -l "autotest=RC" -n $KUBE_NONRTRIC_NAMESPACE --tail=-1 > $1$2_rc.log 2>&1
+ else
+ docker logs $RAPP_CAT_APP_NAME > $1$2_rc.log 2>&1
+ fi
+}
+
+# Initial setup of protocol, host and ports
+# This function is called for apps managed by the test script.
+# args: -
+__RC_initial_setup() {
+ use_rapp_catalogue_http
+}
+
+#######################################################
+
+# Set http as the protocol to use for all communication to the Rapp catalogue