Function test updates
[nonrtric.git] / test / auto-test / startMR.sh
1 #!/bin/bash
2
3 #  ============LICENSE_START===============================================
4 #  Copyright (C) 2021 Nordix Foundation. All rights reserved.
5 #  ========================================================================
6 #  Licensed under the Apache License, Version 2.0 (the "License");
7 #  you may not use this file except in compliance with the License.
8 #  You may obtain a copy of the License at
9 #
10 #       http://www.apache.org/licenses/LICENSE-2.0
11 #
12 #  Unless required by applicable law or agreed to in writing, software
13 #  distributed under the License is distributed on an "AS IS" BASIS,
14 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 #  See the License for the specific language governing permissions and
16 #  limitations under the License.
17 #  ============LICENSE_END=================================================
18 #
19
20 TC_ONELINE_DESCR="Starts DMAAP MR"
21
22 #App names to include in the test when running docker, space separated list
23 DOCKER_INCLUDED_IMAGES="MR DMAAPMR KUBEPROXY KAFKAPC"
24
25 #App names to include in the test when running kubernetes, space separated list
26 KUBE_INCLUDED_IMAGES="MR DMAAPMR KUBEPROXY KAFKAPC"
27 #Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
28 KUBE_PRESTARTED_IMAGES=""
29
30 #Ignore image in DOCKER_INCLUDED_IMAGES, KUBE_INCLUDED_IMAGES if
31 #the image is not configured in the supplied env_file
32 #Used for images not applicable to all supported profile
33 CONDITIONALLY_IGNORED_IMAGES=""
34
35 #Supported test environment profiles
36 SUPPORTED_PROFILES="ORAN-E-RELEASE ORAN-F-RELEASE ORAN-G-RELEASE ORAN-H-RELEASE"
37 #Supported run modes
38 SUPPORTED_RUNMODES="DOCKER KUBE"
39
40 . ../common/testcase_common.sh $@
41
42 setup_testenvironment
43
44 #### TEST BEGIN ####
45
46 clean_environment
47 start_kube_proxy
48 start_mr    "$MR_READ_TOPIC"  "/events" "users/policy-agent" \
49             "$MR_WRITE_TOPIC" "/events" "users/mr-stub"
50             #\
51             #"unauthenticated.dmaapadp.json" "/events" "dmaapadapterproducer/msgs" \
52             #"unauthenticated.dmaapmed.json" "/events" "maapmediatorproducer/STD_Fault_Messages"
53
54 start_kafkapc
55
56 kafkapc_api_reset 200
57
58 kafkapc_api_create_topic 201 "unauthenticated.dmaapadp.json" "application/json"
59
60 kafkapc_api_create_topic 201 "unauthenticated.dmaapmed.json" "application/json"
61
62 dmaap_api_print_topics
63
64 if [ $RUNMODE == "KUBE" ]; then
65     :
66 else
67     docker kill $MR_STUB_APP_NAME
68 fi
69
70
71