summaryrefslogtreecommitdiffstats
path: root/version.properties
blob: 864741aeaf5b26a21529a34bd1a5137722ce11bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
###########################################################
# Versioning variables
# Note that these variables cannot be structured (e.g. : version.release or version.snapshot etc... )
# because they are used in Jenkins, whose plug-in doesn't support

major=1
minor=3
patch=0

base_version=${major}.${minor}.${patch}

release_version=${base_version}
snapshot_version=${base_version}-SNAPSHOT
or: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
#!/bin/bash
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2018
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

set -o errexit
set -o nounset
set -o pipefail
#set -o xtrace

source _common_test.sh
source _functions.sh
source _common.sh

if [ ${1:+1} ]; then
    if [ "$1" == "--external" ]; then
        master_ip=$(kubectl cluster-info | grep "Kubernetes master" | \
            awk -F ":" '{print $2}' | awk -F "//" '{print $2}')
        onap_svc_node_port=30498
        base_url="http://$master_ip:$onap_svc_node_port/v1"
    fi
fi

base_url=${base_url:-"http://localhost:9015/v1"}
kubeconfig_path="$HOME/.kube/config"
csar_eaa_id=8030a02a-7253-11ea-bc55-0242ac130003
csar_sample_app_id=150da0b3-aa8c-481e-b661-2620b810765e
rb_eaa_name="eaa"
rb_sample_app_name="sample_app"
rb_version="plugin_test"
chart_eaa_name="eaa"
chart_sample_app_name="sample-app"
profile_eaa_name="test_eaa_profile"
profile_sample_app_name="test_sample_app_profile"
release_name="test-release"
namespace_eaa="openness"
namespace_sample_app="default"
cloud_region_id="kud"
cloud_region_owner="localhost"

# Setup
install_deps
populate_CSAR_eaa_rbdefinition "$csar_eaa_id"

print_msg "Registering resource bundle for EAA"
payload="$(cat <<EOF
{
    "rb-name": "${rb_eaa_name}",
    "rb-version": "${rb_version}",
    "chart-name": "${chart_eaa_name}"
}
EOF
)"
call_api -d "${payload}" "${base_url}/rb/definition"

print_msg "Uploading resource bundle content for EAA"
call_api --data-binary "@${CSAR_DIR}/${csar_eaa_id}/rb_definition.tar.gz" \
         "${base_url}/rb/definition/${rb_eaa_name}/${rb_version}/content"

print_msg "Registering rb's profile for EAA"
payload="$(cat <<EOF
{
    "rb-name": "${rb_eaa_name}",
    "rb-version": "${rb_version}",
    "profile-name": "${profile_eaa_name}",
    "release-name": "${release_name}",
    "namespace": "${namespace_eaa}"
}
EOF
)"
call_api -d "${payload}" "${base_url}/rb/definition/${rb_eaa_name}/${rb_version}/profile"

print_msg "Uploading profile data for EAA"
call_api --data-binary "@${CSAR_DIR}/${csar_eaa_id}/rb_profile.tar.gz" \
         "${base_url}/rb/definition/${rb_eaa_name}/${rb_version}/profile/${profile_eaa_name}/content"

print_msg "Setup cloud data"
payload="$(cat <<EOF
{
    "cloud-region": "$cloud_region_id",
    "cloud-owner": "$cloud_region_owner"
}
EOF
)"
call_api -F "metadata=$payload" \
         -F "file=@$kubeconfig_path" \
         "${base_url}/connectivity-info" >/dev/null #massive output

print_msg "Creating EAA"
payload="$(cat <<EOF
{
    "rb-name": "${rb_eaa_name}",
    "rb-version": "${rb_version}",
    "profile-name": "${profile_eaa_name}",
    "cloud-region": "${cloud_region_id}"
}
EOF
)"
response="$(call_api -d "${payload}" "${base_url}/instance")"
echo "$response"
vnf_eaa_id="$(jq -r '.id' <<< "${response}")"

wait_for_deployment eaa 1

#Create sample producer and sample consumer
populate_CSAR_eaa_sample_app_rbdefinition "$csar_sample_app_id"

print_msg "Registering resource bundle for Sample App"
payload="$(cat <<EOF
{
    "rb-name": "${rb_sample_app_name}",
    "rb-version": "${rb_version}",
    "chart-name": "${chart_sample_app_name}"
}
EOF
)"
call_api -d "${payload}" "${base_url}/rb/definition"

print_msg "Uploading resource bundle content for Sample App"
call_api --data-binary "@${CSAR_DIR}/${csar_sample_app_id}/rb_definition.tar.gz" \
         "${base_url}/rb/definition/${rb_sample_app_name}/${rb_version}/content"

print_msg "Registering rb's profile for Sample App"
payload="$(cat <<EOF
{
    "rb-name": "${rb_sample_app_name}",
    "rb-version": "${rb_version}",
    "profile-name": "${profile_sample_app_name}",
    "release-name": "${release_name}",
    "namespace": "${namespace_sample_app}"
}
EOF
)"
call_api -d "${payload}" "${base_url}/rb/definition/${rb_sample_app_name}/${rb_version}/profile"

print_msg "Uploading profile data for Sample App"
call_api --data-binary "@${CSAR_DIR}/${csar_sample_app_id}/rb_profile.tar.gz" \
         "${base_url}/rb/definition/${rb_sample_app_name}/${rb_version}/profile/${profile_sample_app_name}/content"

print_msg "Creating Sample Apps: producer and consumer"
payload="$(cat <<EOF
{
    "rb-name": "${rb_sample_app_name}",
    "rb-version": "${rb_version}",
    "profile-name": "${profile_sample_app_name}",
    "cloud-region": "${cloud_region_id}"
}
EOF
)"
response="$(call_api -d "${payload}" "${base_url}/instance")"
echo "$response"
vnf_sample_app_id="$(jq -r '.id' <<< "${response}")"

wait_for_deployment producer 1
wait_for_deployment consumer 1

print_msg "Validating EAA is running"
kubectl get --namespace=${namespace_eaa} pods | grep eaa

print_msg "Validating sample producer and sample consumer are running"
kubectl get --namespace=${namespace_sample_app}  pods | grep producer
kubectl get --namespace=${namespace_sample_app} pods | grep consumer

print_msg "Validating logs of EAA"
EAA=`kubectl get --namespace=${namespace_eaa} pods | grep eaa | awk '{print $1}'`
kubectl logs --namespace=${namespace_eaa}  ${EAA}

print_msg "Validating logs of sample producer and sample consumer"
# sleep 5 seconds to let producer and consumer generate some logs
sleep 5
PRODUCER=`kubectl get --namespace=${namespace_sample_app} pods | grep producer | awk '{print $1}'`
CONSUMER=`kubectl get --namespace=${namespace_sample_app} pods | grep consumer | awk '{print $1}'`
kubectl logs --namespace=${namespace_sample_app} ${PRODUCER}
kubectl logs --namespace=${namespace_sample_app} ${CONSUMER}

print_msg "Retrieving EAA details"
call_api "${base_url}/instance/${vnf_eaa_id}"

print_msg "Retrieving Sample App details"
call_api "${base_url}/instance/${vnf_sample_app_id}"

#Teardown
print_msg "Deleting sample apps: producer and consumer"
delete_resource "${base_url}/instance/${vnf_sample_app_id}"

print_msg "Deleting Profile for sample app"
delete_resource "${base_url}/rb/definition/${rb_sample_app_name}/${rb_version}/profile/${profile_sample_app_name}"

print_msg "Deleting Resource Bundle for sample app"
delete_resource "${base_url}/rb/definition/${rb_sample_app_name}/${rb_version}"

print_msg "Deleting EAA"
delete_resource "${base_url}/instance/${vnf_eaa_id}"

print_msg "Deleting Profile for EAA"
delete_resource "${base_url}/rb/definition/${rb_eaa_name}/${rb_version}/profile/${profile_eaa_name}"

print_msg "Deleting Resource Bundle for EAA"
delete_resource "${base_url}/rb/definition/${rb_eaa_name}/${rb_version}"

print_msg "Deleting ${cloud_region_id} cloud region connection"
delete_resource "${base_url}/connectivity-info/${cloud_region_id}"