2. **A1 Mediator** : The A1 mediator is responsible for sending policies to the xAPPs over RMR to configure their behaviour. A mock-up of the A1 mediator can be built and executed as follows :
- - *make mock-a1-server* builds the executable.
- - The executable can be run as *./mock-a1-server -p <port number>* where port number can be any port not conflicting with the xAPP and E2 Term.
- - Note that the A1 mediator also uses RMR and hence the environment variable *RMR_SEED_RT* must also be set when executing *mock-a1-server* (if static routes are being used).
- - On start up, the *mock-a1-mediator* will send a stream of valid/invalid JSON messages containing policies to test the xAPP.
+ - *make mock-a1-tool* builds the executable.
+ - The executable can be run as *./mock-a1-tool -p <port number> <options>* where port number can be any port not conflicitng with the xAPP and E2 Term ports.
+ - Note that the A1 mediator also uses RMR and hence the environment variable *RMR_SEED_RT* must also be set when executing *mock-a1-tool* (if static routes are being used).
+ - Run ./mock-a1-tool -h to see various options.
-3. **VES Collector** : This component is responsible for receiving metrics from xAPPs as JSON payloads. A simple mock-up is available under *test/* which is basically a *cherrypy* web-server that receives JSON and prints out relevant messages. It can be invoked as *python ./mock_ves_collector.py*.
+3. **VES Collector** : This component is responsible for receiving metrics from xAPPs as JSON payloads. A simple mock-up is available under *test/* which is basically a *cherrypy* web-server that receives VES messages from the Admission Control Xapp and prints out relevant messages. It can be invoked as *python ./mock_ves_collector.py*.
- Pre-requisites for the VES collector are the *cherrypy* and *requests* Python modules. They can be installed via pip : *pip install cherrypy requests*.
void usage(char *command){
- std::cout <<"Usage : " << command << " ";
- std::cout <<" --name[-n] xapp_instance_name ";
- std::cout <<" --port[-p] port to listen on (default is tcp:4561) ";
- std::cout <<"--schema[-s] schema file";
-
+ std::cout <<"Usage : " << command << " " << std::endl;
+ std::cout <<" --name[-n] xapp_instance_name " << std::endl;
+ std::cout <<" --port[-p] port to listen on (default is tcp:4561) " << std::endl;
+ std::cout << " --op[-o] operation mode from {0, 1, 2} : 0 is CREATE, 1 is UPDATE, 2 is DELETE" << std::endl;
+ std::cout << " --window [-w] window size in seconds (default is 60 seconds)" << std::endl;
+ std::cout << " --blockrate [-b] blocking rate percentage (default is 90%)" << std::endl;
+ std::cout << " --trigger[-t] trigger threshold (default is 40 requests in window)" << std::endl;
+ std::cout << " --enforce set policy to enforce if flag prvoided (default is 0 i.e not enforce)" << std::endl;
+ std::cout << " --class [-c] subscriber profile id to which policy must be applied (default is 5)" << std::endl;
+ std::cout << " --instance[-i] policy instance id (default is ac-xapp-1)" << std::endl;
std::cout << std::endl;
}
#! /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_XAPP" "TEST_X2_SGNB" "TEST_SLIDING_WINDOW" )
-test_cases=( "TEST_PROTECTOR_PLUGIN" )
# Run through test cases
for((i = 0; i < ${#test_cases[@]}; i++)); do
/*
+ // basically just set size to be larger than allowed even if actual
+ // message is small
==================================================================================
Copyright (c) 2018-2019 AT&T Intellectual Property.
num_dropped_pkts++;
}
-bool pong_a1(rmr_mbuf_t *rcv_msg){
- rcv_msg->mtype = A1_POLICY_RESP;
- num_ping_pkts++;
- return true;
-}
-
bool pong_x(rmr_mbuf_t *rcv_msg){
rcv_msg->mtype = 102; //ping port
REQUIRE(num_pong_pkts == NumPkts);
- // Re-run experiment but now with A1 message type when
- // ping responds
- pong_xapp.StartThread(pong_a1);
- sleep(1);
-
- failed_tx = 0;
- num_ping_pkts = 0;
- num_pong_pkts = 0;
-
-
- for(i = 0; i < NumPkts; i++){
- clock_gettime(CLOCK_REALTIME, &(my_message.ts));
- snprintf(my_message.payload, MESSAGE_SIZE, "hello world %d", i);
- bool res = ping_xapp.Send(101, sizeof(Test_message), (void *) (&my_message));
- if (!res){
- failed_tx ++;
- }
- }
-
- sleep(1);
ping_xapp.Stop();
- pong_xapp.Stop();
-
- std::cerr <<"Pong received ping pkts = " << num_ping_pkts << " Ping received a1 packets = " << num_pong_pkts << " failures = " << failed_tx << std::endl;
-
- REQUIRE(num_ping_pkts >= NumPkts);
- REQUIRE(num_pong_pkts >= NumPkts);
- REQUIRE(failed_tx == 0);
-
-
-
}
}
sleep(1);
// Test sending a message of size larger than allowed
+ // basically just set size to be larger than allowed even if actual
+ // message is small
res = test_xapp.Send(102, RMR_BUFFER_SIZE + 100, (void *)(&my_message));
REQUIRE(res == false);
- res = test_xapp.Send(102, RMR_BUFFER_SIZE + 100, (void *)(&my_message), "id");
+ res = test_xapp.Send(102, RMR_BUFFER_SIZE + 100, (void *)(&my_message), my_meid);
REQUIRE(res == false);
test_xapp.Stop();