Add test folder to the smo package installation
[it/dep.git] / smo-install / test / a1-validation / validate-a1.sh
1 #!/bin/bash
2
3 ###
4 # ============LICENSE_START=======================================================
5 # ORAN SMO Package
6 # ================================================================================
7 # Copyright (C) 2021 AT&T Intellectual Property. All rights
8 #                             reserved.
9 # ================================================================================
10 # Licensed under the Apache License, Version 2.0 (the "License");
11 # you may not use this file except in compliance with the License.
12 # You may obtain a copy of the License at
13 #
14 # http://www.apache.org/licenses/LICENSE-2.0
15 #
16 # Unless required by applicable law or agreed to in writing, software
17 # distributed under the License is distributed on an "AS IS" BASIS,
18 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 # See the License for the specific language governing permissions and
20 # limitations under the License.
21 # ============LICENSE_END============================================
22 # ===================================================================
23
24 ###
25
26 set +x
27
28 if ! [ -x "$(command -v jq)" ]; then
29   echo 'Error: jq is not installed. Try to install it with APT-GET, YUM or APK' >&2
30   echo 'e.g:    sudo apt-get update && apt-get -y install jq'
31
32   exit 1
33 fi
34
35
36 dmaap_port=3904
37 ecs_port=8083
38 a1_sim_port=8085
39 policy_agent_port=8081
40 sdnc_port=8282
41
42 # get ip of dmaap
43 dmaap_url=`kubectl get services message-router -n onap |grep message-router | awk '{print $3}'`:$dmaap_port
44 echo "Dmaap Address:" $dmaap_url
45
46 # get ip of enrichment service
47 ecs_url=`kubectl get services enrichmentservice -n nonrtric | grep enrichmentservice | awk '{print $3}'`:$ecs_port
48 echo "Enrichment Service Address:" $ecs_url
49
50 # get ip of A1 simulators
51 a1_osc_url=`kubectl describe pods a1-sim-osc-0 -n nonrtric | grep IP: | sed -n '2p' | awk  '{print $2}'`:$a1_sim_port
52 echo "A1 SIM OSC Address 0:" $a1_osc_url
53
54 a1_std_url=`kubectl describe pods a1-sim-std-0 -n nonrtric | grep IP: | sed -n '2p' | awk  '{print $2}'`:$a1_sim_port
55 echo "A1 SIM STD Address 0:" $a1_std_url
56
57 a1_std2_url=`kubectl describe pods a1-sim-std2-0 -n nonrtric | grep IP: | sed -n '2p' | awk  '{print $2}'`:$a1_sim_port
58 echo "A1 SIM STD Address 2:" $a1_std2_url
59
60 policy_agent_url=`kubectl get service -n onap | grep 'a1policymanagement ' | awk  '{print $3}'`:$policy_agent_port
61 echo "Policy Agent IP:" $policy_agent_url
62
63 sdnc_url=`kubectl get service -n onap | grep sdnc-oam  | awk  '{print $3}'`:$sdnc_port
64 echo "A1 Controller IP:" $sdnc_url
65
66 cd ./subscripts
67 ./health_check.sh $ecs_url $a1_osc_url $a1_std_url $a1_std2_url $policy_agent_url $sdnc_url
68 ./prepareDmaapMsg.sh $dmaap_url $a1_osc_url $a1_std_url $a1_std2_url $policy_agent_url
69 ./preparePmsData.sh $a1_osc_url $a1_std2_url $policy_agent_url
70 ./prepareEcsData.sh $ecs_url