From: Ashwin Sridharan Date: Fri, 13 Dec 2019 15:02:29 +0000 (-0500) Subject: Added RIC subsequent Action and time to Wait in subscription request X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=69a830676cee9b8a37bea3b2e59261514551be23;p=ric-app%2Fadmin.git Added RIC subsequent Action and time to Wait in subscription request Updated unit tests Policy call back now routes based on policy type id Signed-off-by: Ashwin Sridharan Change-Id: Iceb3eb8f4fe7a7bb20837e1a72147effab0d26ce --- diff --git a/container-tag.yaml b/container-tag.yaml index 4983202..b72de81 100644 --- a/container-tag.yaml +++ b/container-tag.yaml @@ -1,2 +1,2 @@ --- -tag: '1.0.0' +tag: '1.0.1' diff --git a/src/E2AP-c/subscription/subscription_helper.hpp b/src/E2AP-c/subscription/subscription_helper.hpp index 433f0ca..80bfb5c 100644 --- a/src/E2AP-c/subscription/subscription_helper.hpp +++ b/src/E2AP-c/subscription/subscription_helper.hpp @@ -36,11 +36,14 @@ #include #include + +// Note : if no action definition specified, octet length of action definition is NULL +// If no subsequent action specified, default is subsequent_action = 0, time to wait is 0 struct Action { public: - Action(int id, int type): _is_def(false), _is_subs_act(false), _id(id), _type(type){}; + Action(int id, int type): _is_def(false), _is_subs_act(false), _id(id), _type(type), _next_action(0), _wait(0){}; Action(int id, int type, const void *def, size_t def_size, int next, int wait): _is_def(false), _is_subs_act(false), _id(id), _type(type){ if (def_size > 0){ diff --git a/src/E2AP-c/subscription/subscription_request.cc b/src/E2AP-c/subscription/subscription_request.cc index c087e2c..0f2836d 100644 --- a/src/E2AP-c/subscription/subscription_request.cc +++ b/src/E2AP-c/subscription/subscription_request.cc @@ -41,7 +41,11 @@ subscription_request::subscription_request(void){ action_array = (E2N_RICaction_ToBeSetup_ItemIEs_t *)calloc(INITIAL_REQUEST_LIST_SIZE, sizeof(E2N_RICaction_ToBeSetup_ItemIEs_t)); assert(action_array != 0); action_array_size = INITIAL_REQUEST_LIST_SIZE; - + // also need to add subsequent action and time to wait .. + for (unsigned int i = 0; i < action_array_size; i++){ + action_array[i].value.choice.RICaction_ToBeSetup_Item.ricSubsequentAction = (struct E2N_RICsubsequentAction *)calloc(1, sizeof(struct E2N_RICsubsequentAction)); + assert(action_array[i].value.choice.RICaction_ToBeSetup_Item.ricSubsequentAction != 0); + } e2ap_pdu_obj->choice.initiatingMessage = initMsg; e2ap_pdu_obj->present = E2N_E2AP_PDU_PR_initiatingMessage; @@ -70,6 +74,11 @@ subscription_request::~subscription_request(void){ ricsubscription_ie->ricAction_ToBeSetup_List.list.count = 0; ricsubscription_ie->ricAction_ToBeSetup_List.list.array = 0; } + + // clear subsequent action array + for (unsigned int i = 0; i < action_array_size; i++){ + free(action_array[i].value.choice.RICaction_ToBeSetup_Item.ricSubsequentAction ); + } free(action_array); E2N_RICsubscriptionRequest_t * subscription_request = &(initMsg->value.choice.RICsubscriptionRequest); @@ -190,22 +199,35 @@ bool subscription_request::set_fields( E2N_InitiatingMessage_t * init_msg, subsc // we don't care about contents, so just do a free/calloc if(action_array_size < ref_action_array->size()){ std::cout <<"re-allocating action array from " << action_array_size << " to " << 2 * ref_action_array->size() << std::endl; + // free subsequent allocation + for (unsigned int i = 0; i < action_array_size; i++){ + free(action_array[i].value.choice.RICaction_ToBeSetup_Item.ricSubsequentAction ); + } action_array_size = 2 * ref_action_array->size(); free(action_array); action_array = (E2N_RICaction_ToBeSetup_ItemIEs_t *)calloc(action_array_size, sizeof(E2N_RICaction_ToBeSetup_ItemIEs_t)); assert(action_array != 0); + + // also need to add subsequent action and time to wait .. + for (unsigned int i = 0; i < action_array_size; i++){ + action_array[i].value.choice.RICaction_ToBeSetup_Item.ricSubsequentAction = (struct E2N_RICsubsequentAction *)calloc(1, sizeof(struct E2N_RICsubsequentAction)); + assert(action_array[i].value.choice.RICaction_ToBeSetup_Item.ricSubsequentAction != 0); + } + } // reset the list count on ricAction_ToBeSetup_List; ricsubscription_ie->ricAction_ToBeSetup_List.list.count = 0; - for(int i = 0; i < ref_action_array->size(); i ++){ + for(unsigned int i = 0; i < ref_action_array->size(); i ++){ action_array[i].criticality = E2N_Criticality_ignore; action_array[i].id = E2N_ProtocolIE_ID_id_RICaction_ToBeSetup_Item ; action_array[i].value.present = E2N_RICaction_ToBeSetup_ItemIEs__value_PR_RICaction_ToBeSetup_Item; action_array[i].value.choice.RICaction_ToBeSetup_Item.ricActionID = (*ref_action_array)[i].get_id(); action_array[i].value.choice.RICaction_ToBeSetup_Item.ricActionType = (*ref_action_array)[i].get_type(); + action_array[i].value.choice.RICaction_ToBeSetup_Item.ricSubsequentAction->ricSubsequentActionType = (*ref_action_array)[i].get_subsequent_action(); + action_array[i].value.choice.RICaction_ToBeSetup_Item.ricSubsequentAction->ricTimeToWait = (*ref_action_array)[i].get_wait(); result = ASN_SEQUENCE_ADD(&ricsubscription_ie->ricAction_ToBeSetup_List, &(action_array[i])); if (result == -1){ @@ -258,9 +280,15 @@ bool subscription_request:: get_fields(E2N_InitiatingMessage_t * init_msg, subs for(int index = 0; index < ricsubscription->ricAction_ToBeSetup_List.list.count; index ++){ E2N_RICaction_ToBeSetup_ItemIEs_t * item = (E2N_RICaction_ToBeSetup_ItemIEs_t *)ricsubscription->ricAction_ToBeSetup_List.list.array[index]; - dout.add_action(item->value.choice.RICaction_ToBeSetup_Item.ricActionID, item->value.choice.RICaction_ToBeSetup_Item.ricActionType); + if (item->value.choice.RICaction_ToBeSetup_Item.ricSubsequentAction == NULL){ + dout.add_action(item->value.choice.RICaction_ToBeSetup_Item.ricActionID, item->value.choice.RICaction_ToBeSetup_Item.ricActionType); + } + else{ + std::string action_def = ""; // for now we are ignoring action definition + dout.add_action(item->value.choice.RICaction_ToBeSetup_Item.ricActionID, item->value.choice.RICaction_ToBeSetup_Item.ricActionType, action_def, item->value.choice.RICaction_ToBeSetup_Item.ricSubsequentAction->ricSubsequentActionType, item->value.choice.RICaction_ToBeSetup_Item.ricSubsequentAction->ricTimeToWait); + } }; - + break; } diff --git a/src/E2AP-c/subscription/subscription_request.hpp b/src/E2AP-c/subscription/subscription_request.hpp index 830eee9..76af723 100644 --- a/src/E2AP-c/subscription/subscription_request.hpp +++ b/src/E2AP-c/subscription/subscription_request.hpp @@ -34,6 +34,7 @@ #include #include #include +#include #define NUM_SUBSCRIPTION_REQUEST_IES 3 #define INITIAL_REQUEST_LIST_SIZE 4 diff --git a/src/README.md b/src/README.md index 8c30d4d..76429e9 100644 --- a/src/README.md +++ b/src/README.md @@ -73,7 +73,6 @@ A sample script ./run_xapp.sh is provided to illustrate and execute the xAPP -u : URL path for VES collector -g : comma separated list of gNodeBs to send subscription request to -i : time interval (in seconds) at which to post metrics to the VES collector --x : xapp-id string used to identify in A1 work flows -c : operation model (CONTROL, REPORT, E2AP_PROC_ONLY) * in the E2AP_PROC_ONLY mode, the Admission Control xAPP will simply process only the E2AP Indication part of the RMR message. It does not process the X2 portion of the message or invoke the sliding window algorithm or send a response back. This is useful to just test basic functionality without a valid X2 message. diff --git a/src/adm-ctrl-xapp.cc b/src/adm-ctrl-xapp.cc index 387ca1d..a5abeab 100644 --- a/src/adm-ctrl-xapp.cc +++ b/src/adm-ctrl-xapp.cc @@ -40,7 +40,22 @@ std::map plugin_rmr_map; // It still works with R2, but ideally should be modified since a single policy type could be applied to multiple plugins. void policy_handler(int message_type, const char * message, int message_len, std::string & response, bool set){ - auto it = plugin_rmr_map.find(message_type); + + // Extract policy id type : for now we assume exactly 1 plugin maps to each policy type + rapidjson::Pointer policy_type_ref("/policy_type_id"); + rapidjson::Document doc; + if (doc.Parse(message).HasParseError()){ + mdclog_write(MDCLOG_ERR, "Error: %s, %d :: Could not decode A1 JSON message %s\n", __FILE__, __LINE__, message); + return; + } + rapidjson::Value * ref = policy_type_ref.Get(doc); + if (ref == NULL){ + mdclog_write(MDCLOG_ERR, "Error : %s, %d:: Could not extract policy type id from %s\n", __FILE__, __LINE__, message); + return; + } + int policy_type_id = ref->GetInt(); + + auto it = plugin_rmr_map.find(policy_type_id); bool res; if (it != plugin_rmr_map.end()){ if (set){ @@ -65,7 +80,7 @@ void policy_handler(int message_type, const char * message, int message_len, st } } else{ - response = "{\"status\":\"FAIL\", \"message\":\"Could not find plugin associated with RMR message type = " + std::to_string(message_type) + "\"}"; + response = "{\"status\":\"FAIL\", \"message\":\"Could not find plugin associated with policy type id = " + std::to_string(policy_type_id) + "\"}"; mdclog_write(MDCLOG_ERR, "Error ! %s, %d : %s\n", __FILE__, __LINE__, response.c_str()); } }; @@ -185,7 +200,7 @@ int main(int argc, char *argv[]){ // Add reference to plugin list . // Plugin list is used by policy handler and metrics collector - plugin_rmr_map.insert(std::pair(A1_POLICY_REQ, Plugins[0].get())); + plugin_rmr_map.insert(std::pair(RATE_CONTROL_POLICY_ID, Plugins[0].get())); // instantiate ves thread (it polls all plugins and sends out their metrics) std::thread metrics_thread(metrics_collector, my_config.ves_collector_url, &Plugins, my_config.measurement_interval); diff --git a/src/adm-ctrl-xapp.hpp b/src/adm-ctrl-xapp.hpp index 5f9dc33..7860175 100644 --- a/src/adm-ctrl-xapp.hpp +++ b/src/adm-ctrl-xapp.hpp @@ -46,6 +46,7 @@ #define DEFAULT_XAPP_ID "ac-xapp-123" #define DEFAULT_VES_MEASUREMENT_INTERVAL 10 #define MAX_SUBSCRIPTION_ATTEMPTS 10 +#define RATE_CONTROL_POLICY_ID 21000 //================================================ // convenient typedef for the list of plugins to be loaded diff --git a/src/admission_init_routines.cc b/src/admission_init_routines.cc index 4958343..7d56ab3 100644 --- a/src/admission_init_routines.cc +++ b/src/admission_init_routines.cc @@ -82,9 +82,11 @@ void init::startup_subscribe_requests(void ){ int request_id = 2; // will be over-written by subscription handler int req_seq = 1; int function_id = 0; - int action_id = 4; + int action_id = 1; int action_type = config_ref->report_mode_only ? 0:1; - + int subsequent_action = 0; // continue + int time_to_wait = 4; // 10ms + int message_type = 1; int procedure_code = 27; std::string egnb_id = "Testgnb"; @@ -121,7 +123,7 @@ void init::startup_subscribe_requests(void ){ sgnb_add_subscr_req.clear(); sgnb_add_subscr_req.set_request(request_id, req_seq); sgnb_add_subscr_req.set_function_id(function_id); - sgnb_add_subscr_req.add_action(action_id, action_type); + sgnb_add_subscr_req.add_action(action_id, action_type, "", subsequent_action, time_to_wait); sgnb_add_subscr_req.set_event_def(&event_buf[0], event_buf_len); @@ -225,9 +227,11 @@ void init::shutdown_subscribe_deletes(){ //Request policies on start up // This is async : once query is sent. responses from A1 are handled on RMR threads +// Ideally this should be done on a per-plugin basis (but for now hard-coded :) ) +// Should match the same policy type in schemas/rate-control-policy.json void init::startup_get_policies(void){ - int policy_id = 21000; + int policy_id = RATE_CONTROL_POLICY_ID; // we simply create json from scratch for now since it is quite simple std::string policy_query = "{\"policy_id\":" + std::to_string(policy_id) + "}"; diff --git a/src/run_xapp.sh b/src/run_xapp.sh index ec8ba55..5ce5abb 100755 --- a/src/run_xapp.sh +++ b/src/run_xapp.sh @@ -8,6 +8,5 @@ VES_URL=http://127.0.0.1:6350 THREADS=1 gNodeB=NYC123 OP_MODE=REPORT -XAPP_ID="ric-xapp-1-sjwn"; #echo "Running ./adm-ctrl-xapp -s $SAMPLES -a $A1_SCHEMA -i $VES_POST_INTERVAL -g $gNodeB -v $VES_SCHEMA -t $THREADS"; -./adm-ctrl-xapp -s $SAMPLES -a $A1_SCHEMA -u $VES_URL -i $VES_POST_INTERVAL -g $gNodeB -v $VES_SCHEMA -t $THREADS -c $OP_MODE -x $XAPP_ID --verbose +./adm-ctrl-xapp -s $SAMPLES -a $A1_SCHEMA -u $VES_URL -i $VES_POST_INTERVAL -g $gNodeB -v $VES_SCHEMA -t $THREADS -c $OP_MODE --verbose diff --git a/test/Makefile b/test/Makefile index c75471c..52a338f 100644 --- a/test/Makefile +++ b/test/Makefile @@ -30,8 +30,6 @@ E2AP_C_DIR=../src/E2AP-c SUBSCR_DIR = ../src/E2AP-c/subscription E2SM_DIR=../src/E2SM X2AP_DIR=../src/X2AP -#JSON_DIR=../src/json -A1= ./a1 PROTECTOR=../src/protector-plugin CLOGFLAGS= `pkg-config mdclog --cflags` @@ -43,8 +41,6 @@ E2FLAGS= -I$(E2AP_C_DIR) -I$(ASN1C_DIR)/ SUBSCRFLAGS= -I$(SUBSCR_DIR) -I$(ASN1C_DIR) E2SMFLAGS = -I$(E2SM_DIR) -I$(ASN1C_DIR)/ X2FLAGS= -I$(X2AP_DIR) -I$(ASN1C_DIR)/ -A1FLAGS = -I$(A1) -#JSONFLAGS= -I$(JSON_DIR) PROTECTORFLAGS= -I$(PROTECTOR) LIBS= -lrmr_nng -lnng -lpthread -lm @@ -56,14 +52,12 @@ XAPP_UTILS_SRC= $(SRC_DIR)/xapp_utils.cc XAPP_MPROC_SRC= $(SRC_DIR)/message_processor_class.cc E2AP_SRC= $(wildcard $(E2AP)/*.cc) X2AP_SRC= $(wildcard $(X2AP_DIR)/*.cc) -A1_SRC= $(wildcard $(A1)/*.cc) PLUGINS_SRC = $(wildcard $(PLUGINS)/*.cc) E2AP_C_SRC= $(wildcard $(E2AP_C_DIR)/*.cc) SUBSCR_SRC= $(wildcard $(SUBSCR_DIR)/*.cc) E2SM_SRC= $(wildcard $(E2SM_DIR)/*.cc) X2AP_SRC = $(wildcard $(X2AP_DIR)/*.cc) ASN1C_SRC = $(wildcard $(ASN1C_DIR)/*.c) -#JSON_SRC = $(wildcard $(JSON_DIR)/*.cc) PROTECTOR_SRC = $(wildcard $(PROTECTOR)/*.cc) #=========================================== @@ -75,7 +69,6 @@ SUBSCRIPTION_FLOW_UNIT_TEST = unit_test_subscription_flow.o E2AP_IND_UNIT_TEST= unit_test_e2ap_indication.o E2AP_CTRL_UNIT_TEST= unit_test_e2ap_control.o E2SM_UNIT_TEST=unit_test_e2sm.o -#JSON_UNIT_TEST = unit_test_json.o SGNB_ADD_REQ_UNIT_TEST = unit_test_sgnb_addition_request.o MESSAGE_PROC_UNIT_TEST = unit_test_message_processor.o SLIDING_WINDOW_UNIT_TEST = unit_test_sliding_window.o @@ -91,21 +84,19 @@ XAPP_UTILS_OBJ = $(XAPP_UTILS_SRC:.cc=.o) XAPP_MPROC_OBJ= $(XAPP_MPROC_SRC:.cc=.o) E2AP_OBJ=$(E2AP_SRC:.cc=.o) X2AP_OBJ=$(X2AP_SRC:.cc=.o) -A1_OBJ= $(A1_SRC:.cc=.o) PLUGINS_OBJ = $(PLUGINS_SRC:.cc=.o) SUBSCR_OBJ= $(SUBSCR_SRC:.cc=.o) E2AP_C_OBJ = $(E2AP_C_SRC:.cc=.o) E2SM_OBJ = $(E2SM_SRC:.cc=.o) ASN1C_MODULES = $(ASN1C_SRC:.c=.o) X2AP_OBJ = $(X2AP_SRC:.cc=.o) -#JSON_OBJ = $(JSON_SRC:.cc=.o) PROTECTOR_OBJ = $(PROTECTOR_SRC:.cc=.o) #=========================================== $(XAPP_UTILS_OBJ) $(XAPP_UNIT_TEST) :export CPPFLAGS= $(BASEFLAGS) $(XAPPFLAGS) -$(A1_OBJ) $(MOCK_A1SERVER_OBJ) $(JSON_UNIT_TEST) :export CPPFLAGS= $(BASEFLAGS) $(A1FLAGS) $(XAPPFLAGS) +$(MOCK_A1SERVER_OBJ) :export CPPFLAGS= $(BASEFLAGS) $(XAPPFLAGS) $(XAPP_MPROC_OBJ) $(MESSAGE_PROC_UNIT_TEST) $(MOCK_SUB_CLIENT_OBJ): export CPPFLAGS=$(BASEFLAGS) $(XAPPFLAGS) $(E2FLAGS) $(X2FLAGS) $(SUBSCRFLAGS) $(PLUGINFLAGS) $(PROTECTORFLAGS) $(E2SMFLAGS) @@ -121,11 +112,10 @@ $(ASN1C_MODULES): export CFLAGS = $(C_BASEFLAGS) -I$(ASN1C_DIR)/ $(X2AP_OBJ) $(SGNB_ADD_REQ_UNIT_TEST) : export CPPFLAGS= $(X2FLAGS) $(BASEFLAGS) -$(PLUGINS_OBJ) : export CPPFLAGS = $(BASEFLAGS) $(JSONFLAGS) +$(PLUGINS_OBJ) : export CPPFLAGS = $(BASEFLAGS) $(MOCK_E2TERM_OBJ): export CPPFLAGS = $(BASEFLAGS) $(SUBSCRFLAGS) $(E2FLAGS) $(E2SMFLAGS) $(XAPPFLAGS) $(X2FLAGS) -#$(JSON_OBJ) $(JSON_UNIT_TEST): export CPPFLAGS= $(BASEFLAGS) $(JSONFLAGS) $(PROTECTOR_OBJ) $(SLIDING_WINDOW_UNIT_TEST) $(PROTECTOR_UNIT_TEST) $(ADMISSION_UNIT_TEST): export CPPFLAGS = $(BASEFLAGS) $(PLUGINFLAGS) $(PROTECTORFLAGS) $(X2FLAGS) @@ -151,19 +141,17 @@ TEST_E2SM: $(E2SM_OBJ) $(E2SM_UNIT_TEST) $(ASN1C_MODULES) TEST_X2_SGNB: $(X2AP_OBJ) $(SGNB_ADD_REQ_UNIT_TEST) $(ASN1C_MODULES) $(CXX) -o $@ $^ $(LIBS) $(LOGLIBS) -TEST_JSON: $(JSON_OBJ) $(JSON_UNIT_TEST) - $(CXX) -o $@ $^ $(LIBS) $(LOGLIBS) -TEST_MESSAGE_PROCESSOR: $(MESSAGE_PROC_UNIT_TEST) $(XAPP_MPROC_OBJ) $(ASN1C_MODULES) $(E2AP_C_OBJ) $(PROTECTOR_OBJ) $(E2SM_OBJ) $(X2AP_OBJ) $(SUBSCR_OBJ) $(JSON_OBJ) $(PLUGINS_OBJ) +TEST_MESSAGE_PROCESSOR: $(MESSAGE_PROC_UNIT_TEST) $(XAPP_MPROC_OBJ) $(ASN1C_MODULES) $(E2AP_C_OBJ) $(PROTECTOR_OBJ) $(E2SM_OBJ) $(X2AP_OBJ) $(SUBSCR_OBJ) $(PLUGINS_OBJ) $(CXX) -o $@ $^ $(LIBS) $(LOGLIBS) TEST_ADMISSION: $(ADMISSION_UNIT_TEST) $(PROTECTOR_OBJ) $(X2AP_OBJ) $(ASN1C_MODULES) $(PLUGINS_OBJ) $(CXX) -o $@ $^ $(LIBS) $(LOGLIBS) -TEST_PROTECTOR_PLUGIN: $(PROTECTOR_UNIT_TEST) $(PROTECTOR_OBJ) $(X2AP_OBJ) $(ASN1C_MODULES) $(PLUGINS_OBJ) $(JSON_OBJ) +TEST_PROTECTOR_PLUGIN: $(PROTECTOR_UNIT_TEST) $(PROTECTOR_OBJ) $(X2AP_OBJ) $(ASN1C_MODULES) $(PLUGINS_OBJ) $(CXX) -o $@ $^ $(LIBS) $(LOGLIBS) -TEST_SLIDING_WINDOW: $(SLIDING_WINDOW_UNIT_TEST) $(PROTECTOR_OBJ) $(X2AP_OBJ) $(ASN1C_MODULES) $(PLUGINS_OBJ) $(JSON_OBJ) +TEST_SLIDING_WINDOW: $(SLIDING_WINDOW_UNIT_TEST) $(PROTECTOR_OBJ) $(X2AP_OBJ) $(ASN1C_MODULES) $(PLUGINS_OBJ) $(CXX) -o $@ $^ $(LIBS) $(LOGLIBS) @@ -171,14 +159,14 @@ mock-e2term-server: $(XAPP_UTILS_OBJ) $(E2AP_C_OBJ) $(SUBSCR_OBJ) $(E2SM_OBJ) $( $(CXX) -o $@ $^ $(LIBS) $(LOGLIBS) $(CPPFLAGS) -mock-a1-tool: $(A1_OBJ) $(MOCK_A1SERVER_OBJ) $(XAPP_UTILS_OBJ) +mock-a1-tool: $(MOCK_A1SERVER_OBJ) $(XAPP_UTILS_OBJ) $(CXX) -o $@ $^ $(LIBS) $(LOGLIBS) -all_tests: TEST_XAPP TEST_SUBSCRIPTION TEST_ADMISSION TEST_E2AP_INDICATION TEST_E2AP_CONTROL TEST_E2SM TEST_X2_SGNB TEST_JSON TEST_SUBSCRIPTION_FLOW TEST_MESSAGE_PROCESSOR TEST_SLIDING_WINDOW TEST_PROTECTOR_PLUGIN +all_tests: TEST_XAPP TEST_SUBSCRIPTION TEST_ADMISSION TEST_E2AP_INDICATION TEST_E2AP_CONTROL TEST_E2SM TEST_X2_SGNB TEST_SUBSCRIPTION_FLOW TEST_MESSAGE_PROCESSOR TEST_SLIDING_WINDOW TEST_PROTECTOR_PLUGIN install: mock-e2term-server install -D mock-e2term-server /usr/local/bin/mock-e2term-server clean: - -rm TEST_* *.o e2e-test-client mock-e2term-server e2e-perf-client e2e-perf-server mock-a1-tool + -rm TEST_* *.o e2e-test-client mock-e2term-server e2e-perf-client e2e-perf-server mock-a1-server -cd ../src && make -f ../src/Makefile clean diff --git a/test/README.md b/test/README.md index 0171512..fe24b5f 100644 --- a/test/README.md +++ b/test/README.md @@ -28,3 +28,8 @@ Pre-requisities for running the mock ves collector are : 2. cherrypy module (pip install cherrypy) The mock ves collector can be simply invoked as python ./mock_ves_collector.py + + +3. A mock A1 mediator : The mock up a1 mediator executable sends various JSON (valid/invalid) payloads in sequence to illustrate the behaviour and response of the AC xAPP. It can be compiled as 'make mock-a1-server' +To execute the mock-a1-server, it requires as argument a port to listen and send on (can be any port that does not conflict with others). The A1 mediator uses rts send/receive and hence bypasses the routing table. +./mock-a1-server -p diff --git a/test/run_tests.sh b/test/run_tests.sh index 13ba4bf..a724bc3 100755 --- a/test/run_tests.sh +++ b/test/run_tests.sh @@ -1,8 +1,7 @@ #! /bin/bash -#test_cases=( "TEST_MESSAGE_PROCESSOR" "TEST_ADMISSION" "TEST_PROTECTOR_PLUGIN" "TEST_SUBSCRIPTION_FLOW" "TEST_SUBSCRIPTION" "TEST_E2AP_INDICATION" "TEST_E2AP_CONTROL" "TEST_E2SM" "TEST_JSON" "TEST_X2_SGNB" "TEST_SLIDING_WINDOW" ) +test_cases=( "TEST_MESSAGE_PROCESSOR" "TEST_ADMISSION" "TEST_PROTECTOR_PLUGIN" "TEST_SUBSCRIPTION_FLOW" "TEST_SUBSCRIPTION" "TEST_E2AP_INDICATION" "TEST_E2AP_CONTROL" "TEST_E2SM" "TEST_JSON" "TEST_X2_SGNB" "TEST_SLIDING_WINDOW" ) -test_cases=( "TEST_PROTECTOR_PLUGIN" ) # Run through test cases for((i = 0; i < ${#test_cases[@]}; i++)); do diff --git a/test/unit_test_subscription.cc b/test/unit_test_subscription.cc index 915201b..e443fac 100644 --- a/test/unit_test_subscription.cc +++ b/test/unit_test_subscription.cc @@ -87,7 +87,7 @@ TEST_CASE("E2AP PDU Subscription", "RIC Susbcription/Deletion Requests"){ din.clear(); for(int i = 0; i < num_act; i++){ int type = rand() % 3; - din.add_action(i, type); + din.add_action(i, type, "test", 1, 1); } buf_size = BUFFER_SIZE;