summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
adccdd4)
Issue-ID: NONRTRIC-618
Signed-off-by: BjornMagnussonXA <bjorn.magnusson@est.tech>
Change-Id: I99426c99e0e33fbbeae06103428d9b452a72f3da
16 files changed:
TC_ONELINE_DESCR="Sanity test of Non-RT RIC Helm chats - all components - E-RELEASE"
# This script requires the helm charts for nonrtric, a1simulator and a1controller are installed
TC_ONELINE_DESCR="Sanity test of Non-RT RIC Helm chats - all components - E-RELEASE"
# This script requires the helm charts for nonrtric, a1simulator and a1controller are installed
-# There should be 2 simulator of version started
+# There should be 2 simulator of each A1 interface version started
#App names to include in the test when running docker, space separated list
DOCKER_INCLUDED_IMAGES="" # Not used - KUBE only test script
#App names to include in the test when running kubernetes, space separated list
#App names to include in the test when running docker, space separated list
DOCKER_INCLUDED_IMAGES="" # Not used - KUBE only test script
#App names to include in the test when running kubernetes, space separated list
-KUBE_INCLUDED_IMAGES=" MR CR PRODSTUB KUBEPROXY"
+KUBE_INCLUDED_IMAGES=" MR DMAAPMR CR PRODSTUB KUBEPROXY KAFKAPC"
#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
KUBE_PRESTARTED_IMAGES=" PA RICSIM CP ICS RC SDNC DMAAPMED DMAAPADP"
#Prestarted app (not started by script) to include in the test when running kubernetes, space separated list
KUBE_PRESTARTED_IMAGES=" PA RICSIM CP ICS RC SDNC DMAAPMED DMAAPADP"
-use_mr_http #MR only supports http?
use_cr_https
use_agent_rest_https
use_sdnc_https
use_simulator_https
use_ics_rest_https
use_prod_stub_https
use_cr_https
use_agent_rest_https
use_sdnc_https
use_simulator_https
use_ics_rest_https
use_prod_stub_https
if [ $ICS_VERSION == "V1-1" ]; then
use_rapp_catalogue_http # https not yet supported
if [ $ICS_VERSION == "V1-1" ]; then
use_rapp_catalogue_http # https not yet supported
start_kube_proxy
STD_NUM_RICS=2
start_kube_proxy
STD_NUM_RICS=2
echo " RIC MAPPING a1-sim-std2-0 : ric5"
echo " RIC MAPPING a1-sim-std2-1 : ric6"
echo " RIC MAPPING a1-sim-std2-0 : ric5"
echo " RIC MAPPING a1-sim-std2-1 : ric6"
+start_mr "$MR_READ_TOPIC" "/events" "users/policy-agent" \
+ "$MR_WRITE_TOPIC" "/events" "users/mr-stub" \
+ "unauthenticated.dmaapmed.json" "/events" "dmaapmediatorproducer/STD_Fault_Messages" \
+ "unauthenticated.dmaapadp.json" "/events" "dmaapadapterproducer/msgs"
+
+start_kafkapc
+
+kafkapc_api_create_topic 201 "unauthenticated.dmaapadp_kafka.text" "text/plain"
+
+kafkapc_api_start_sending 200 "unauthenticated.dmaapadp_kafka.text"
sim_equal "a1-sim-osc-"$i num_instances 2
done
sim_equal "a1-sim-osc-"$i num_instances 2
done
+cr_api_reset 0 # Reset CR to count new events
echo "ADD EVENT/STATUS CHECK"
echo "ADD MR CHECK"
echo "ADD EVENT/STATUS CHECK"
echo "ADD MR CHECK"
else
ics_api_edp_put_type_2 201 type1 testdata/ics/ei-type-1.json
ics_api_edp_get_type_2 200 type1
else
ics_api_edp_put_type_2 201 type1 testdata/ics/ei-type-1.json
ics_api_edp_get_type_2 200 type1
- ics_api_edp_get_type_ids 200 type1
+ ics_api_edp_get_type_ids 200 STD_Fault_Messages ExampleInformationTypeKafka ExampleInformationType type1
ics_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
ics_api_edp_put_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
ics_api_edp_put_producer_2 201 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
ics_api_edp_put_producer_2 200 prod-a $CB_JOB/prod-a $CB_SV/prod-a type1
if [ $ICS_VERSION == "V1-1" ]; then
prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
else
if [ $ICS_VERSION == "V1-1" ]; then
prodstub_check_jobdata 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
else
- if [[ "$ICS_FEATURE_LEVEL" == *"INFO-TYPES"* ]]; then
+ if [[ "$ICS_FEATURE3LEVEL" == *"INFO-TYPES"* ]]; then
prodstub_check_jobdata_3 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
else
prodstub_check_jobdata_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
prodstub_check_jobdata_3 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
else
prodstub_check_jobdata_2 200 prod-a job1 type1 $TARGET1 ricsim_g3_1 testdata/ics/job-template.json
start_dmaapmed NOPROXY $SIM_GROUP/$DMAAP_MED_COMPOSE_DIR/$DMAAP_MED_DATA_FILE
start_dmaapmed NOPROXY $SIM_GROUP/$DMAAP_MED_COMPOSE_DIR/$DMAAP_MED_DATA_FILE
-ics_equal json:ei-producer/v1/eiproducers 2 60
+ics_equal json:data-producer/v1/info-producers 3 120
-ics_api_idc_get_type_ids 200 ExampleInformationType STD_Fault_Messages
+ics_api_idc_get_type_ids 200 ExampleInformationType ExampleInformationTypeKafka STD_Fault_Messages type-1
-ics_api_edp_get_producer_ids_2 200 NOTYPE DmaapGenericInfoProducer DMaaP_Mediator_Producer
+ics_api_edp_get_producer_ids_2 200 NOTYPE prod-a DmaapGenericInfoProducer DMaaP_Mediator_Producer
for ((i=1; i<=$NUM_JOBS; i++))
do
for ((i=1; i<=$NUM_JOBS; i++))
do
for ((i=1; i<=$NUM_JOBS; i++))
do
ics_api_idc_put_job 201 joby$i ExampleInformationType $CR_SERVICE_MR_PATH_0/joby-data$i info-ownery$i $CR_SERVICE_MR_PATH_0/job_status_info-ownery$i testdata/dmaap-adapter/job-template.json
for ((i=1; i<=$NUM_JOBS; i++))
do
ics_api_idc_put_job 201 joby$i ExampleInformationType $CR_SERVICE_MR_PATH_0/joby-data$i info-ownery$i $CR_SERVICE_MR_PATH_0/job_status_info-ownery$i testdata/dmaap-adapter/job-template.json
+ ics_api_idc_put_job 201 jobz$i ExampleInformationTypeKafka $CR_SERVICE_MR_PATH_0/jobz-data$i info-ownerz$i $CR_SERVICE_MR_PATH_0/job_status_info-ownerz$i testdata/dmaap-adapter/job-template-1-kafka.json
done
for ((i=1; i<=$NUM_JOBS; i++))
do
ics_api_a1_get_job_status 200 jobx$i ENABLED 30
done
for ((i=1; i<=$NUM_JOBS; i++))
do
ics_api_a1_get_job_status 200 jobx$i ENABLED 30
+ ics_api_a1_get_job_status 200 joby$i ENABLED 30
+ ics_api_a1_get_job_status 200 jobz$i ENABLED 30
done
mr_api_send_json "/events/unauthenticated.dmaapmed.json" '{"msg":"msg-0"}'
mr_api_send_json "/events/unauthenticated.dmaapadp.json" '{"msg":"msg-1"}'
mr_api_send_json "/events/unauthenticated.dmaapmed.json" '{"msg":"msg-2"}'
mr_api_send_json "/events/unauthenticated.dmaapadp.json" '{"msg":"msg-3"}'
done
mr_api_send_json "/events/unauthenticated.dmaapmed.json" '{"msg":"msg-0"}'
mr_api_send_json "/events/unauthenticated.dmaapadp.json" '{"msg":"msg-1"}'
mr_api_send_json "/events/unauthenticated.dmaapmed.json" '{"msg":"msg-2"}'
mr_api_send_json "/events/unauthenticated.dmaapadp.json" '{"msg":"msg-3"}'
+kafkapc_api_post_msg 200 "unauthenticated.dmaapadp_kafka.text" "text/plain" 'Message-------4'
+kafkapc_api_post_msg 200 "unauthenticated.dmaapadp_kafka.text" "text/plain" 'Message-------6'
+
-cr_equal 0 received_callbacks $(($NUM_JOBS*2*2)) 60
+cr_equal 0 received_callbacks $(($NUM_JOBS*2*3)) 200
for ((i=1; i<=$NUM_JOBS; i++))
do
cr_equal 0 received_callbacks?id=jobx-data$i 2
cr_equal 0 received_callbacks?id=joby-data$i 2
for ((i=1; i<=$NUM_JOBS; i++))
do
cr_equal 0 received_callbacks?id=jobx-data$i 2
cr_equal 0 received_callbacks?id=joby-data$i 2
+ cr_equal 0 received_callbacks?id=jobz-data$i 2
done
for ((i=1; i<=$NUM_JOBS; i++))
done
for ((i=1; i<=$NUM_JOBS; i++))
cr_api_check_single_genric_json_event 200 0 jobx-data$i '{"msg":"msg-2"}'
cr_api_check_single_genric_json_event 200 0 joby-data$i '{"msg":"msg-1"}'
cr_api_check_single_genric_json_event 200 0 joby-data$i '{"msg":"msg-3"}'
cr_api_check_single_genric_json_event 200 0 jobx-data$i '{"msg":"msg-2"}'
cr_api_check_single_genric_json_event 200 0 joby-data$i '{"msg":"msg-1"}'
cr_api_check_single_genric_json_event 200 0 joby-data$i '{"msg":"msg-3"}'
+ cr_api_check_single_genric_json_event 200 0 jobz-data$i 'Message-------4'
+ cr_api_check_single_genric_json_event 200 0 jobz-data$i 'Message-------6'
->```./PM_EI_DEMO.sh remote-remove docker --env-file ../common/test_env-oran-e-release.sh```
+>```./PM_EI_DEMO.sh remote-remove docker release --env-file ../common/test_env-oran-e-release.sh```
->```./PM_EI_DEMO.sh remote-remove kube --env-file ../common/test_env-oran-e-release.sh```
+>```./PM_EI_DEMO.sh remote-remove kube release --env-file ../common/test_env-oran-e-release.sh```
+
+ORAN E-RELEASE with nonrtric deployed with helm charts for the "dep" repo
+>```../FTC_HELM_E_RELEASE.sh remote-remove kube release --env-file ../common/test_env-oran-e-release.sh --override override_ftc_helm_e_release.sh```
>```./PM_EI_DEMO.sh remote-remove kube release --env-file ../common/test_env-onap-istanbul.sh```
>```./PM_EI_DEMO.sh remote-remove kube release --env-file ../common/test_env-onap-istanbul.sh```
-Note: When istanbul is released, add the 'release' arg to run released images.
# limitations under the License. #
################################################################################
# limitations under the License. #
################################################################################
+# Override file for running the e-release helm recipe including all components
-KUBE_A1SIM_NAMESPACE="a1-sim"
+KUBE_A1SIM_NAMESPACE="nonrtric"
+KUBE_SDNC_NAMESPACE="nonrtric"
+RIC_SIM_COMMON_SVC_NAME="a1-sim"
+
+ICS_EXTERNAL_PORT=9082
+ICS_EXTERNAL_SECURE_PORT=9083
+
+POLICY_AGENT_EXTERNAL_PORT=9080
+POLICY_AGENT_EXTERNAL_SECURE_PORT=9081
+
+SDNC_EXTERNAL_PORT=8282
+SDNC_EXTERNAL_SECURE_PORT=8383
+
+RAPP_CAT_EXTERNAL_PORT=9085
+RAPP_CAT_EXTERNAL_SECURE_PORT=9086
# This function is called for prestarted apps not managed by the test script.
__RICSIM_kube_scale_zero_and_wait() {
#__kube_scale_and_wait_all_resources $KUBE_A1SIM_NAMESPACE app $KUBE_A1SIM_NAMESPACE"-"$RIC_SIM_PREFIX
# This function is called for prestarted apps not managed by the test script.
__RICSIM_kube_scale_zero_and_wait() {
#__kube_scale_and_wait_all_resources $KUBE_A1SIM_NAMESPACE app $KUBE_A1SIM_NAMESPACE"-"$RIC_SIM_PREFIX
- __kube_scale_and_wait_all_resources $KUBE_A1SIM_NAMESPACE app # the values of the app label is not known
+ __kube_scale_and_wait_all_resources $KUBE_A1SIM_NAMESPACE app $KUBE_A1SIM_NAMESPACE"-a1simulator"
}
# Delete all kube resouces for the app
}
# Delete all kube resouces for the app
__find_sim_host() {
if [ $RUNMODE == "KUBE" ]; then
ricname=$(echo "$1" | tr '_' '-') # Kube does not accept underscore in names as docker do
__find_sim_host() {
if [ $RUNMODE == "KUBE" ]; then
ricname=$(echo "$1" | tr '_' '-') # Kube does not accept underscore in names as docker do
- ric_setname="${ricname%-*}" #Extract the stateful set name
+ if [ -z "$RIC_SIM_COMMON_SVC_NAME" ]; then
+ ric_setname="${ricname%-*}" #Extract the stateful set name
+ else
+ ric_setname=$RIC_SIM_COMMON_SVC_NAME # Use the common svc name in the host name of the sims
+ fi
echo $RIC_SIM_HTTPX"://"$ricname.$ric_setname.$KUBE_A1SIM_NAMESPACE":"$RIC_SIM_PORT
else
if [ $DOCKER_COMPOSE_VERION == "V1" ]; then
echo $RIC_SIM_HTTPX"://"$ricname.$ric_setname.$KUBE_A1SIM_NAMESPACE":"$RIC_SIM_PORT
else
if [ $DOCKER_COMPOSE_VERION == "V1" ]; then
RIC_SIM_CERT_MOUNT_DIR="./cert"
RIC_SIM_COMPOSE_DIR="ric" # Dir in simulator group for docker compose
RIC_SIM_ALIVE_URL="/"
RIC_SIM_CERT_MOUNT_DIR="./cert"
RIC_SIM_COMPOSE_DIR="ric" # Dir in simulator group for docker compose
RIC_SIM_ALIVE_URL="/"
+RIC_SIM_COMMON_SVC_NAME="" # Name of svc if one common svc is used for all ric sim groups (stateful sets)
SDNC_APP_NAME="a1controller" # Name of the SNDC A1 Controller container
SDNC_DISPLAY_NAME="SDNC A1 Controller"
SDNC_APP_NAME="a1controller" # Name of the SNDC A1 Controller container
SDNC_DISPLAY_NAME="SDNC A1 Controller"
RIC_SIM_CERT_MOUNT_DIR="./cert"
RIC_SIM_COMPOSE_DIR="ric" # Dir in simulator group for docker compose
RIC_SIM_ALIVE_URL="/"
RIC_SIM_CERT_MOUNT_DIR="./cert"
RIC_SIM_COMPOSE_DIR="ric" # Dir in simulator group for docker compose
RIC_SIM_ALIVE_URL="/"
+RIC_SIM_COMMON_SVC_NAME="" # Name of svc if one common svc is used for all ric sim groups (stateful sets)
SDNC_APP_NAME="a1controller" # Name of the SNDC A1 Controller container
SDNC_DISPLAY_NAME="SDNC A1 Controller"
SDNC_APP_NAME="a1controller" # Name of the SNDC A1 Controller container
SDNC_DISPLAY_NAME="SDNC A1 Controller"
RIC_SIM_CERT_MOUNT_DIR="./cert"
RIC_SIM_COMPOSE_DIR="ric" # Dir in simulator group for docker compose
RIC_SIM_ALIVE_URL="/"
RIC_SIM_CERT_MOUNT_DIR="./cert"
RIC_SIM_COMPOSE_DIR="ric" # Dir in simulator group for docker compose
RIC_SIM_ALIVE_URL="/"
+RIC_SIM_COMMON_SVC_NAME="" # Name of svc if one common svc is used for all ric sim groups (stateful sets)
SDNC_APP_NAME="a1controller" # Name of the SNDC A1 Controller container
SDNC_DISPLAY_NAME="SDNC A1 Controller"
SDNC_APP_NAME="a1controller" # Name of the SNDC A1 Controller container
SDNC_DISPLAY_NAME="SDNC A1 Controller"
RIC_SIM_COMPOSE_DIR="ric" # Dir in simulator group for docker compose
RIC_SIM_ALIVE_URL="/" # Base path for alive check
RIC_SIM_COMPOSE_DIR="ric" # Dir in simulator group for docker compose
RIC_SIM_ALIVE_URL="/" # Base path for alive check
+RIC_SIM_COMMON_SVC_NAME="" # Name of svc if one common svc is used for all ric sim groups (stateful sets)
SDNC_APP_NAME="a1controller" # Name of the SNDC A1 Controller container
SDNC_DISPLAY_NAME="SDNC A1 Controller"
SDNC_APP_NAME="a1controller" # Name of the SNDC A1 Controller container
SDNC_DISPLAY_NAME="SDNC A1 Controller"
RIC_SIM_COMPOSE_DIR="ric" # Dir in simulator group for docker compose
RIC_SIM_ALIVE_URL="/" # Base path for alive check
RIC_SIM_COMPOSE_DIR="ric" # Dir in simulator group for docker compose
RIC_SIM_ALIVE_URL="/" # Base path for alive check
+RIC_SIM_COMMON_SVC_NAME="" # Name of svc if one common svc is used for all ric sim groups (stateful sets)
# Kept as reference for oran a1 adapter
# SDNC_APP_NAME="a1controller" # Name of the SNDC A1 Controller container
# Kept as reference for oran a1 adapter
# SDNC_APP_NAME="a1controller" # Name of the SNDC A1 Controller container
RIC_SIM_COMPOSE_DIR="ric" # Dir in simulator group for docker compose
RIC_SIM_ALIVE_URL="/" # Base path for alive check
RIC_SIM_COMPOSE_DIR="ric" # Dir in simulator group for docker compose
RIC_SIM_ALIVE_URL="/" # Base path for alive check
+RIC_SIM_COMMON_SVC_NAME="" # Name of svc if one common svc is used for all ric sim groups (stateful sets)
# Kept as reference for oran a1 adapter
# SDNC_APP_NAME="a1controller" # Name of the SNDC A1 Controller container
# SDNC_DISPLAY_NAME="SDNC A1 Controller"
# Kept as reference for oran a1 adapter
# SDNC_APP_NAME="a1controller" # Name of the SNDC A1 Controller container
# SDNC_DISPLAY_NAME="SDNC A1 Controller"
echo ""
# auto adding system apps
echo ""
# auto adding system apps
echo -e $BOLD"Auto adding system apps"$EBOLD
if [ $RUNMODE == "KUBE" ]; then
INCLUDED_IMAGES=$INCLUDED_IMAGES" "$TESTENV_KUBE_SYSTEM_APPS
echo -e $BOLD"Auto adding system apps"$EBOLD
if [ $RUNMODE == "KUBE" ]; then
INCLUDED_IMAGES=$INCLUDED_IMAGES" "$TESTENV_KUBE_SYSTEM_APPS
for iapp in "$TMP_APPS"; do
file_pointer=$(echo $iapp | tr '[:upper:]' '[:lower:]')
file_pointer="../common/"$file_pointer"_api_functions.sh"
for iapp in "$TMP_APPS"; do
file_pointer=$(echo $iapp | tr '[:upper:]' '[:lower:]')
file_pointer="../common/"$file_pointer"_api_functions.sh"
- echo " Auto-adding system app $iapp. Sourcing $file_pointer"
+ padded_iapp=$iapp
+ while [ ${#padded_iapp} -lt 16 ]; do
+ padded_iapp=$padded_iapp" "
+ done
+ echo " Auto-adding system app $padded_iapp Sourcing $file_pointer"
+ __added_apps=" $iapp "$__added_apps
done
else
echo " None"
fi
done
else
echo " None"
fi
+if [ $RUNMODE == "KUBE" ]; then
+ TMP_APPS=$INCLUDED_IMAGES" "$KUBE_PRESTARTED_IMAGES
+else
+ TMP_APPS=$INCLUDED_IMAGES
+fi
+
echo -e $BOLD"Auto adding included apps"$EBOLD
echo -e $BOLD"Auto adding included apps"$EBOLD
- for iapp in $INCLUDED_IMAGES; do
- file_pointer=$(echo $iapp | tr '[:upper:]' '[:lower:]')
- file_pointer="../common/"$file_pointer"_api_functions.sh"
- padded_iapp=$iapp
- while [ ${#padded_iapp} -lt 16 ]; do
- padded_iapp=$padded_iapp" "
- done
- echo " Auto-adding included app $padded_iapp Sourcing $file_pointer"
- . $file_pointer
- if [ ! -f "$file_pointer" ]; then
- echo " Include file $file_pointer for app $iapp does not exist"
- exit 1
+ for iapp in $TMP_APPS; do
+ if [[ "$__added_apps" != *"$iapp"* ]]; then
+ file_pointer=$(echo $iapp | tr '[:upper:]' '[:lower:]')
+ file_pointer="../common/"$file_pointer"_api_functions.sh"
+ padded_iapp=$iapp
+ while [ ${#padded_iapp} -lt 16 ]; do
+ padded_iapp=$padded_iapp" "
+ done
+ echo " Auto-adding included app $padded_iapp Sourcing $file_pointer"
+ . $file_pointer
+ if [ ! -f "$file_pointer" ]; then
+ echo " Include file $file_pointer for app $iapp does not exist"
+ exit 1
+ fi
export PVC_CLEANER_NAMESPACE=$2
export PVC_CLEANER_CLAIMNAME=$3
export PVC_CLEANER_RM_PATH=$4
export PVC_CLEANER_NAMESPACE=$2
export PVC_CLEANER_CLAIMNAME=$3
export PVC_CLEANER_RM_PATH=$4
+ export PVC_CLEANER_APP_NAME
input_yaml=$SIM_GROUP"/"$PVC_CLEANER_COMPOSE_DIR"/"pvc-cleaner.yaml
output_yaml=$PWD/tmp/$2-pvc-cleaner.yaml
input_yaml=$SIM_GROUP"/"$PVC_CLEANER_COMPOSE_DIR"/"pvc-cleaner.yaml
output_yaml=$PWD/tmp/$2-pvc-cleaner.yaml
WORKDIR /usr/src/app
COPY http_proxy.js .
WORKDIR /usr/src/app
COPY http_proxy.js .
-CMD [ "node", "http_proxy.js" ]
\ No newline at end of file
+CMD [ "node", "http_proxy.js" ]
func startToSend(w http.ResponseWriter, req *http.Request) {
t, topicId, exist := getTopicFromRequest(w, req)
func startToSend(w http.ResponseWriter, req *http.Request) {
t, topicId, exist := getTopicFromRequest(w, req)
+ fmt.Printf("Start to send to topic: %v\n", topicId)
fmt.Printf("Cannot create producer for topic: %v, error details: %v\n", topicId, err)
return
}
fmt.Printf("Cannot create producer for topic: %v, error details: %v\n", topicId, err)
return
}
- defer func() { p.Close() }()
+ defer func() {
+ fmt.Printf("Closing producer for topic: %v\n", topicId)
+ p.Close()
+ }()
for {
q := t.messages.send
if q == nil {
for {
q := t.messages.send
if q == nil {
globalCounters.sent.step()
msg := fmt.Sprintf("%v", m)
if len(msg) < 500 {
globalCounters.sent.step()
msg := fmt.Sprintf("%v", m)
if len(msg) < 500 {
- fmt.Printf("Message sent on topic: %v, len: %v, msg: %v", topicId, len(msg), msg)
+ fmt.Printf("Message sent on topic: %v, len: %v, msg: %v\n", topicId, len(msg), msg)
- fmt.Printf("Message sent on topic: %v, len: %v, is larger than 500...not printed", topicId, len(msg))
+ fmt.Printf("Message sent on topic: %v, len: %v, is larger than 500...not printed\n", topicId, len(msg))
- fmt.Printf("Failed to send message on topic: %v. Discarded. Error details: %v", topicId, err)
+ fmt.Printf("Failed to send message on topic: %v. Discarded. Error details: %v\n", topicId, err)
msg, err := c.ReadMessage(maxDur)
if err == nil {
if len(msg.Value) < 500 {
msg, err := c.ReadMessage(maxDur)
if err == nil {
if len(msg.Value) < 500 {
- fmt.Printf("Message received on topic: %v, partion: %v, len: %v, msg: %v", topicId, msg.TopicPartition, len(msg.Value), string(msg.Value))
+ fmt.Printf("Message received on topic: %v, partion: %v, len: %v, msg: %v\n", topicId, msg.TopicPartition, len(msg.Value), string(msg.Value))
- fmt.Printf("Message received on topic: %v, partion: %v, len: %v is larger than 500...not printed", topicId, msg.TopicPartition, len(msg.Value))
+ fmt.Printf("Message received on topic: %v, partion: %v, len: %v is larger than 500...not printed\n", topicId, msg.TopicPartition, len(msg.Value))
}
err = t.messages.received.Enqueue(string(msg.Value))
if err != nil {
}
err = t.messages.received.Enqueue(string(msg.Value))
if err != nil {
// Post a message to a topic
// POST /send content type is specified in content type
func sendToTopic(w http.ResponseWriter, req *http.Request) {
// Post a message to a topic
// POST /send content type is specified in content type
func sendToTopic(w http.ResponseWriter, req *http.Request) {
t, topicId, exist := getTopicFromRequest(w, req)
t, topicId, exist := getTopicFromRequest(w, req)
+ fmt.Printf("Send to topic: %v\n", topicId)
b, err := ioutil.ReadAll(req.Body)
if err == nil {
if len(b) < 500 {
b, err := ioutil.ReadAll(req.Body)
if err == nil {
if len(b) < 500 {
- fmt.Printf("Json payload to send on topic: %v, msg: %v", topicId, string(b))
+ fmt.Printf("Json payload to send on topic: %v, msg: %v\n", topicId, string(b))
- fmt.Printf("Json payload to send on topic: %v larger than 500 bytes, not printed...", topicId)
+ fmt.Printf("Json payload to send on topic: %v larger than 500 bytes, not printed...\n", topicId)
+ } else {
+ fmt.Printf("Json payload to send on topic: %v cannnot be decoded, err: %v\n", topicId, err)
}
err = q.Enqueue(string(b))
if err != nil {
}
err = q.Enqueue(string(b))
if err != nil {
b, err := ioutil.ReadAll(req.Body)
if err == nil {
if len(b) < 500 {
b, err := ioutil.ReadAll(req.Body)
if err == nil {
if len(b) < 500 {
- fmt.Printf("Text payload to send on topic: %v, msg: %v", topicId, string(b))
+ fmt.Printf("Text payload to send on topic: %v, msg: %v\n", topicId, string(b))
- fmt.Printf("Text payload to send on topic: %v larger than 500 bytes, not printed...", topicId)
+ fmt.Printf("Text payload to send on topic: %v larger than 500 bytes, not printed...\n", topicId)
+ } else {
+ fmt.Printf("Text payload to send on topic: %v cannnot be decoded, err: %v\n", topicId, err)
}
err = q.Enqueue(string(b))
if err != nil {
}
err = q.Enqueue(string(b))
if err != nil {
# ============LICENSE_START===============================================
# ============LICENSE_START===============================================
-# Copyright (C) 2020 Nordix Foundation. All rights reserved.
+# Copyright (C) 2021 Nordix Foundation. All rights reserved.
# ========================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ========================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
-CMD [ "./start.sh" ]
\ No newline at end of file
while True:
if (len(generic_messages)):
while True:
if (len(generic_messages)):
- for topicname in generic_messages.keys(): #topicname contains the path of the topics, eg. "/event/<topic>"
+ keys_copy = list(generic_messages.keys())
+ for topicname in keys_copy: #topicname contains the path of the topics, eg. "/event/<topic>"
topic_queue=generic_messages[topicname]
if (len(topic_queue)>0):
if (topicname.endswith(".text")):
topic_queue=generic_messages[topicname]
if (len(topic_queue)>0):
if (topicname.endswith(".text")):
containers:
- name: pvc-cleaner
image: $PVC_CLEANER_IMAGE
containers:
- name: pvc-cleaner
image: $PVC_CLEANER_IMAGE
+ securityContext:
+ runAsUser: 0
command: ["/bin/sh","-c"]
command: ["/bin/sh","-c"]
- args: ["rm -rf $PVC_CLEANER_RM_PATH/*"]
+ args: ["rm -rf $PVC_CLEANER_RM_PATH/* ; if [ $? -ne 0 ]; then echo 'Delete failure: '$PVC_CLEANER_RM_PATH; else echo 'Delete OK: '$PVC_CLEANER_RM_PATH; fi"]
volumeMounts:
- mountPath: $PVC_CLEANER_RM_PATH
name: pvc-cleaner-m-vol
volumeMounts:
- mountPath: $PVC_CLEANER_RM_PATH
name: pvc-cleaner-m-vol