summaryrefslogtreecommitdiff
path: root/test/subscribe_notify_tests
diff options
context:
space:
mode:
Diffstat (limited to 'test/subscribe_notify_tests')
-rw-r--r--test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_master_udp.json2
-rw-r--r--test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_same_service_id_master_udp.json2
-rw-r--r--test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_same_service_id_slave_udp.json2
-rw-r--r--test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_slave_udp.json2
-rw-r--r--test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_same_ports_master_udp.json2
-rw-r--r--test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_same_ports_slave_udp.json2
-rwxr-xr-xtest/subscribe_notify_tests/subscribe_notify_test_master_starter.sh20
-rw-r--r--test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_client.cpp12
-rwxr-xr-xtest/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_master_starter.sh7
-rw-r--r--test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_service.cpp39
-rwxr-xr-xtest/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_slave_starter.sh12
-rw-r--r--test/subscribe_notify_tests/subscribe_notify_test_service.cpp37
-rwxr-xr-xtest/subscribe_notify_tests/subscribe_notify_test_slave_starter.sh15
13 files changed, 106 insertions, 48 deletions
diff --git a/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_master_udp.json b/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_master_udp.json
index e09d807..8413dda 100644
--- a/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_master_udp.json
+++ b/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_master_udp.json
@@ -1,5 +1,5 @@
{
- "unicast":"10.0.3.1",
+ "unicast":"XXX.XXX.XXX.XXX",
"logging":
{
"level":"warning",
diff --git a/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_same_service_id_master_udp.json b/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_same_service_id_master_udp.json
index 91e9ef8..bb2280c 100644
--- a/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_same_service_id_master_udp.json
+++ b/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_same_service_id_master_udp.json
@@ -1,5 +1,5 @@
{
- "unicast":"10.0.3.1",
+ "unicast":"XXX.XXX.XXX.XXX",
"logging":
{
"level":"warning",
diff --git a/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_same_service_id_slave_udp.json b/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_same_service_id_slave_udp.json
index 83e6963..d07c1e3 100644
--- a/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_same_service_id_slave_udp.json
+++ b/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_same_service_id_slave_udp.json
@@ -1,5 +1,5 @@
{
- "unicast":"10.0.3.2",
+ "unicast":"XXX.XXX.XXX.XXX",
"logging":
{
"level":"warning",
diff --git a/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_slave_udp.json b/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_slave_udp.json
index f379642..bda8fe0 100644
--- a/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_slave_udp.json
+++ b/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_slave_udp.json
@@ -1,5 +1,5 @@
{
- "unicast":"10.0.3.2",
+ "unicast":"XXX.XXX.XXX.XXX",
"logging":
{
"level":"warning",
diff --git a/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_same_ports_master_udp.json b/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_same_ports_master_udp.json
index a6dde19..649d1ba 100644
--- a/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_same_ports_master_udp.json
+++ b/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_same_ports_master_udp.json
@@ -1,5 +1,5 @@
{
- "unicast":"10.0.3.1",
+ "unicast":"XXX.XXX.XXX.XXX",
"logging":
{
"level":"warning",
diff --git a/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_same_ports_slave_udp.json b/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_same_ports_slave_udp.json
index 7e65f41..314737f 100644
--- a/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_same_ports_slave_udp.json
+++ b/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_same_ports_slave_udp.json
@@ -1,5 +1,5 @@
{
- "unicast":"10.0.3.2",
+ "unicast":"XXX.XXX.XXX.XXX",
"logging":
{
"level":"warning",
diff --git a/test/subscribe_notify_tests/subscribe_notify_test_master_starter.sh b/test/subscribe_notify_tests/subscribe_notify_test_master_starter.sh
index 9e009b4..f14550d 100755
--- a/test/subscribe_notify_tests/subscribe_notify_test_master_starter.sh
+++ b/test/subscribe_notify_tests/subscribe_notify_test_master_starter.sh
@@ -12,15 +12,17 @@
if [ $# -lt 1 ]
then
- echo "Please pass a json file to this script."
- echo "For example: $0 subscribe_notify_test_diff_client_ids_diff_ports_master.json"
+ echo "Please pass a json file and event reliability type to this script."
+ echo "For example: $0 UDP subscribe_notify_test_diff_client_ids_diff_ports_master.json"
echo "To use the same service id but different instances on the node pass SAME_SERVICE_ID as third parameter"
exit 1
fi
# replace master with slave to be able display the correct json file to be used
# with the slave script
-MASTER_JSON_FILE=$1
+RELIABILITY_TYPE=$1
+MASTER_JSON_FILE=$2
+SAME_SERVICE_ID=$3
CLIENT_JSON_FILE=${MASTER_JSON_FILE/master/slave}
FAIL=0
@@ -28,30 +30,30 @@ FAIL=0
# Start the services
export VSOMEIP_APPLICATION_NAME=subscribe_notify_test_service_one
export VSOMEIP_CONFIGURATION=$MASTER_JSON_FILE
-./subscribe_notify_test_service 1 $2 &
+./subscribe_notify_test_service 1 $RELIABILITY_TYPE $3 &
export VSOMEIP_APPLICATION_NAME=subscribe_notify_test_service_two
export VSOMEIP_CONFIGURATION=$MASTER_JSON_FILE
-./subscribe_notify_test_service 2 $2 &
+./subscribe_notify_test_service 2 $RELIABILITY_TYPE $3 &
export VSOMEIP_APPLICATION_NAME=subscribe_notify_test_service_three
export VSOMEIP_CONFIGURATION=$MASTER_JSON_FILE
-./subscribe_notify_test_service 3 $2 &
+./subscribe_notify_test_service 3 $RELIABILITY_TYPE $3 &
sleep 1
if [ ! -z "$USE_LXC_TEST" ]; then
echo "starting subscribe_notify_test_slave_starter.sh on slave LXC with parameters $CLIENT_JSON_FILE $2"
- ssh -tt -i $SANDBOX_ROOT_DIR/commonapi_main/lxc-config/.ssh/mgc_lxc/rsa_key_file.pub -o StrictHostKeyChecking=no root@$LXC_TEST_SLAVE_IP "bash -ci \"set -m; cd \\\$SANDBOX_TARGET_DIR/vsomeip_lib/test; ./subscribe_notify_test_slave_starter.sh $CLIENT_JSON_FILE $2\"" &
+ ssh -tt -i $SANDBOX_ROOT_DIR/commonapi_main/lxc-config/.ssh/mgc_lxc/rsa_key_file.pub -o StrictHostKeyChecking=no root@$LXC_TEST_SLAVE_IP "bash -ci \"set -m; cd \\\$SANDBOX_TARGET_DIR/vsomeip_lib/test; ./subscribe_notify_test_slave_starter.sh $RELIABILITY_TYPE $CLIENT_JSON_FILE $3\"" &
echo "remote ssh job id: $!"
elif [ ! -z "$USE_DOCKER" ]; then
- docker exec $DOCKER_IMAGE sh -c "cd $DOCKER_TESTS && ./subscribe_notify_test_slave_starter.sh $CLIENT_JSON_FILE $2" &
+ docker exec $DOCKER_IMAGE sh -c "cd $DOCKER_TESTS && ./subscribe_notify_test_slave_starter.sh $RELIABILITY_TYPE $CLIENT_JSON_FILE $3" &
else
cat <<End-of-message
*******************************************************************************
*******************************************************************************
** Please now run:
-** subscribe_notify_test_slave_starter.sh $CLIENT_JSON_FILE $2
+** subscribe_notify_test_slave_starter.sh $RELIABILITY_TYPE $CLIENT_JSON_FILE $3
** from an external host to successfully complete this test.
**
** You probably will need to adapt the 'unicast' settings in
diff --git a/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_client.cpp b/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_client.cpp
index 1971c1e..9d09394 100644
--- a/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_client.cpp
+++ b/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_client.cpp
@@ -67,18 +67,22 @@ public:
its_groups.insert(info_.eventgroup_id);
app_->request_event(info_.service_id, info_.instance_id,
info_.event_id, its_groups,
- vsomeip::event_type_e::ET_FIELD);
+ vsomeip::event_type_e::ET_FIELD,
+ (use_tcp_ ? vsomeip::reliability_type_e::RT_RELIABLE : vsomeip::reliability_type_e::RT_UNRELIABLE));
app_->request_event(info_.service_id, info_.instance_id,
static_cast<vsomeip::event_t>(info_.event_id + 2),
- its_groups, vsomeip::event_type_e::ET_FIELD);
+ its_groups, vsomeip::event_type_e::ET_FIELD,
+ (use_tcp_ ? vsomeip::reliability_type_e::RT_RELIABLE : vsomeip::reliability_type_e::RT_UNRELIABLE));
its_groups.erase(info_.eventgroup_id);
its_groups.insert(static_cast<vsomeip::eventgroup_t>(info_.eventgroup_id +1));
app_->request_event(info_.service_id, info_.instance_id,
static_cast<vsomeip::event_t>(info_.event_id+1),
- its_groups, vsomeip::event_type_e::ET_FIELD);
+ its_groups, vsomeip::event_type_e::ET_FIELD,
+ (use_tcp_ ? vsomeip::reliability_type_e::RT_RELIABLE : vsomeip::reliability_type_e::RT_UNRELIABLE));
app_->request_event(info_.service_id, info_.instance_id,
static_cast<vsomeip::event_t>(info_.event_id+2),
- its_groups, vsomeip::event_type_e::ET_FIELD);
+ its_groups, vsomeip::event_type_e::ET_FIELD,
+ (use_tcp_ ? vsomeip::reliability_type_e::RT_RELIABLE : vsomeip::reliability_type_e::RT_UNRELIABLE));
return true;
}
diff --git a/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_master_starter.sh b/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_master_starter.sh
index 943ef10..8da1ded 100755
--- a/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_master_starter.sh
+++ b/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_master_starter.sh
@@ -20,6 +20,7 @@ fi
# replace master with slave to be able display the correct json file to be used
# with the slave script
+RELIABILITY_TYPE=$1
MASTER_JSON_FILE=$2
if [ $1 == "UDP" ]; then
SLAVE_JSON_FILE=${MASTER_JSON_FILE/master/udp_slave}
@@ -41,16 +42,16 @@ sleep 1
if [ ! -z "$USE_LXC_TEST" ]; then
echo "starting subscribe_notify_test_slave_starter.sh on slave LXC with parameters $SLAVE_JSON_FILE"
- ssh -tt -i $SANDBOX_ROOT_DIR/commonapi_main/lxc-config/.ssh/mgc_lxc/rsa_key_file.pub -o StrictHostKeyChecking=no root@$LXC_TEST_SLAVE_IP "bash -ci \"set -m; cd \\\$SANDBOX_TARGET_DIR/vsomeip_lib/test; ./subscribe_notify_test_one_event_two_eventgroups_slave_starter.sh $SLAVE_JSON_FILE\"" &
+ ssh -tt -i $SANDBOX_ROOT_DIR/commonapi_main/lxc-config/.ssh/mgc_lxc/rsa_key_file.pub -o StrictHostKeyChecking=no root@$LXC_TEST_SLAVE_IP "bash -ci \"set -m; cd \\\$SANDBOX_TARGET_DIR/vsomeip_lib/test; ./subscribe_notify_test_one_event_two_eventgroups_slave_starter.sh $RELIABILITY_TYPE $SLAVE_JSON_FILE\"" &
echo "remote ssh job id: $!"
elif [ ! -z "$USE_DOCKER" ]; then
- docker exec $DOCKER_IMAGE sh -c "cd $DOCKER_TESTS && ./subscribe_notify_test_one_event_two_eventgroups_slave_starter.sh $SLAVE_JSON_FILE" &
+ docker exec $DOCKER_IMAGE sh -c "cd $DOCKER_TESTS && ./subscribe_notify_test_one_event_two_eventgroups_slave_starter.sh $RELIABILITY_TYPE $SLAVE_JSON_FILE" &
else
cat <<End-of-message
*******************************************************************************
*******************************************************************************
** Please now run:
-** subscribe_notify_test_one_event_two_eventgroups_slave_starter.sh $SLAVE_JSON_FILE
+** subscribe_notify_test_one_event_two_eventgroups_slave_starter.sh $RELIABILITY_TYPE $SLAVE_JSON_FILE
** from an external host to successfully complete this test.
**
** You probably will need to adapt the 'unicast' settings in
diff --git a/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_service.cpp b/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_service.cpp
index 6710892..a0f4894 100644
--- a/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_service.cpp
+++ b/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_service.cpp
@@ -22,11 +22,12 @@
class subscribe_notify_test_one_event_two_eventgroups_service {
public:
- subscribe_notify_test_one_event_two_eventgroups_service(subscribe_notify_test::service_info _info) :
+ subscribe_notify_test_one_event_two_eventgroups_service(subscribe_notify_test::service_info _info, bool _use_tcp) :
app_(vsomeip::runtime::get()->create_application()),
wait_for_shutdown_(true),
info_(_info),
- notify_thread_(std::bind(&subscribe_notify_test_one_event_two_eventgroups_service::wait_for_shutdown, this)) {
+ notify_thread_(std::bind(&subscribe_notify_test_one_event_two_eventgroups_service::wait_for_shutdown, this)),
+ use_tcp_(_use_tcp) {
}
~subscribe_notify_test_one_event_two_eventgroups_service() {
@@ -70,24 +71,28 @@ public:
app_->offer_event(info_.service_id, info_.instance_id,
info_.event_id, its_groups, vsomeip::event_type_e::ET_FIELD,
std::chrono::milliseconds::zero(),
- false, true, nullptr, vsomeip::reliability_type_e::RT_UNKNOWN);
+ false, true, nullptr,
+ (use_tcp_ ? vsomeip::reliability_type_e::RT_RELIABLE : vsomeip::reliability_type_e::RT_UNRELIABLE));
app_->offer_event(info_.service_id, info_.instance_id,
static_cast<vsomeip::event_t>(info_.event_id + 2),
its_groups, vsomeip::event_type_e::ET_FIELD,
std::chrono::milliseconds::zero(),
- false, true, nullptr, vsomeip::reliability_type_e::RT_UNKNOWN);
+ false, true, nullptr,
+ (use_tcp_ ? vsomeip::reliability_type_e::RT_RELIABLE : vsomeip::reliability_type_e::RT_UNRELIABLE));
its_groups.erase(info_.eventgroup_id);
its_groups.insert(static_cast<vsomeip::eventgroup_t>(info_.eventgroup_id + 1));
app_->offer_event(info_.service_id, info_.instance_id,
static_cast<vsomeip::event_t>(info_.event_id + 1),
its_groups, vsomeip::event_type_e::ET_FIELD,
std::chrono::milliseconds::zero(),
- false, true, nullptr, vsomeip::reliability_type_e::RT_UNKNOWN);
+ false, true, nullptr,
+ (use_tcp_ ? vsomeip::reliability_type_e::RT_RELIABLE : vsomeip::reliability_type_e::RT_UNRELIABLE));
app_->offer_event(info_.service_id, info_.instance_id,
static_cast<vsomeip::event_t>(info_.event_id + 2),
its_groups, vsomeip::event_type_e::ET_FIELD,
std::chrono::milliseconds::zero(),
- false, true, nullptr, vsomeip::reliability_type_e::RT_UNKNOWN);
+ false, true, nullptr,
+ (use_tcp_ ? vsomeip::reliability_type_e::RT_RELIABLE : vsomeip::reliability_type_e::RT_UNRELIABLE));
payload_ = vsomeip::runtime::get()->create_payload();
return true;
@@ -186,6 +191,7 @@ private:
subscribe_notify_test::service_info info_;
std::thread notify_thread_;
+ bool use_tcp_;
};
#ifndef VSOMEIP_ENABLE_SIGNAL_HANDLING
@@ -197,11 +203,12 @@ private:
}
#endif
+static bool use_tcp;
TEST(someip_subscribe_notify_test_one_event_two_eventgroups, wait_for_attribute_set)
{
subscribe_notify_test_one_event_two_eventgroups_service its_service(
- subscribe_notify_test::service_info_subscriber_based_notification);
+ subscribe_notify_test::service_info_subscriber_based_notification, use_tcp);
#ifndef VSOMEIP_ENABLE_SIGNAL_HANDLING
its_service_ptr = &its_service;
signal(SIGINT, handle_signal);
@@ -216,6 +223,24 @@ TEST(someip_subscribe_notify_test_one_event_two_eventgroups, wait_for_attribute_
int main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
+ if(argc < 2) {
+ std::cerr << "Please specify a offer type of the service, like: " << argv[0] << " UDP" << std::endl;
+ std::cerr << "Valid offer types include:" << std::endl;
+ std::cerr << "[UDP, TCP]" << std::endl;
+ return 1;
+ }
+
+ if(std::string("TCP") == std::string(argv[1])) {
+ use_tcp = true;
+ } else if(std::string("UDP") == std::string(argv[1])) {
+ use_tcp = false;
+ } else {
+ std::cerr << "Wrong subscription type passed, exiting" << std::endl;
+ std::cerr << "Valid subscription types include:" << std::endl;
+ std::cerr << "[UDP, TCP]" << std::endl;
+ return 1;
+ }
+
return RUN_ALL_TESTS();
}
#endif
diff --git a/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_slave_starter.sh b/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_slave_starter.sh
index aa2784b..d9f0161 100755
--- a/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_slave_starter.sh
+++ b/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_slave_starter.sh
@@ -10,21 +10,23 @@
# the testcase simply executes this script. This script then runs the services
# and checks that all exit successfully.
-if [ $# -lt 1 ]; then
- echo "Please pass a json file to this script."
- echo "For example: $0 subscribe_notify_test_one_event_two_eventgroups_slave.json"
+if [ $# -lt 2 ]; then
+ echo "Please pass a json file and a subscription type to this script."
+ echo "Valid subscription types include:"
+ echo " [UDP, TCP]"
+ echo "For example: $0 UDP subscribe_notify_test_one_event_two_eventgroups_udp_slave.json"
exit 1
fi
FAIL=0
-export VSOMEIP_CONFIGURATION=$1
+export VSOMEIP_CONFIGURATION=$2
# start daemon
../examples/routingmanagerd/./routingmanagerd &
PID_VSOMEIPD=$!
# Start the services
-./subscribe_notify_test_one_event_two_eventgroups_service &
+./subscribe_notify_test_one_event_two_eventgroups_service $1 &
PID_SERVICE=$!
# wait until service exits successfully
diff --git a/test/subscribe_notify_tests/subscribe_notify_test_service.cpp b/test/subscribe_notify_tests/subscribe_notify_test_service.cpp
index 6f13d39..c522d1a 100644
--- a/test/subscribe_notify_tests/subscribe_notify_test_service.cpp
+++ b/test/subscribe_notify_tests/subscribe_notify_test_service.cpp
@@ -24,7 +24,8 @@
class subscribe_notify_test_service {
public:
subscribe_notify_test_service(struct subscribe_notify_test::service_info _service_info,
- std::array<subscribe_notify_test::service_info, 7> _service_infos) :
+ std::array<subscribe_notify_test::service_info, 7> _service_infos,
+ vsomeip::reliability_type_e _reliability_type) :
service_info_(_service_info),
service_infos_(_service_infos),
app_(vsomeip::runtime::get()->create_application()),
@@ -37,7 +38,8 @@ public:
wait_for_notify_(true),
notify_thread_(std::bind(&subscribe_notify_test_service::notify, this)),
subscription_state_handler_called_(0),
- subscription_error_occured_(false) {
+ subscription_error_occured_(false),
+ reliability_type_(_reliability_type) {
if (!app_->init()) {
ADD_FAILURE() << "Couldn't initialize application";
return;
@@ -61,7 +63,7 @@ public:
app_->offer_event(service_info_.service_id, service_info_.instance_id,
service_info_.event_id, its_eventgroups,
vsomeip::event_type_e::ET_FIELD, std::chrono::milliseconds::zero(),
- false, true, nullptr, vsomeip::reliability_type_e::RT_UNKNOWN);
+ false, true, nullptr, reliability_type_);
// register availability for all other services and request their event.
@@ -85,7 +87,7 @@ public:
std::set<vsomeip::eventgroup_t> its_eventgroups;
its_eventgroups.insert(i.eventgroup_id);
- app_->request_event(i.service_id, i.instance_id, i.event_id, its_eventgroups, vsomeip::event_type_e::ET_FIELD);
+ app_->request_event(i.service_id, i.instance_id, i.event_id, its_eventgroups, vsomeip::event_type_e::ET_FIELD, reliability_type_);
other_services_available_[std::make_pair(i.service_id, i.instance_id)] = false;
other_services_received_notification_[std::make_pair(i.service_id, i.method_id)] = 0;
@@ -450,21 +452,26 @@ private:
std::atomic<bool> subscription_error_occured_;
std::mutex subscribers_mutex_;
+ vsomeip::reliability_type_e reliability_type_;
};
static unsigned long service_number;
static bool use_same_service_id;
+vsomeip::reliability_type_e reliability_type = vsomeip::reliability_type_e::RT_UNKNOWN;
+
TEST(someip_subscribe_notify_test, send_ten_notifications_to_service)
{
if(use_same_service_id) {
subscribe_notify_test_service its_sample(
subscribe_notify_test::service_infos_same_service_id[service_number],
- subscribe_notify_test::service_infos_same_service_id);
+ subscribe_notify_test::service_infos_same_service_id,
+ reliability_type);
} else {
subscribe_notify_test_service its_sample(
subscribe_notify_test::service_infos[service_number],
- subscribe_notify_test::service_infos);
+ subscribe_notify_test::service_infos,
+ reliability_type);
}
}
@@ -473,19 +480,33 @@ int main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
if(argc < 2) {
- std::cerr << "Please specify a service number, like: " << argv[0] << " 2 SAME_SERVICE_ID" << std::endl;
+ std::cerr << "Please specify a service number and event reliability type, like: " << argv[0] << " 2 UDP SAME_SERVICE_ID" << std::endl;
std::cerr << "Valid service numbers are in the range of [1,6]" << std::endl;
+ std::cerr << "Valid event reliability types are [UDP, TCP, TCP_AND_UDP]" << std::endl;
std::cerr << "If SAME_SERVICE_ID is specified as third parameter the test is run w/ multiple instances of the same service" << std::endl;
return 1;
}
service_number = std::stoul(std::string(argv[1]), nullptr);
- if (argc >= 3 && std::string("SAME_SERVICE_ID") == std::string(argv[2])) {
+ if (argc >= 3) {
+ if (std::string("TCP")== std::string(argv[2])) {
+ reliability_type = vsomeip::reliability_type_e::RT_RELIABLE;
+ } else if (std::string("UDP")== std::string(argv[2])) {
+ reliability_type = vsomeip::reliability_type_e::RT_UNRELIABLE;
+ } else if (std::string("TCP_AND_UDP")== std::string(argv[2])) {
+ reliability_type = vsomeip::reliability_type_e::RT_BOTH;
+ }
+ }
+
+ if (argc >= 4 && std::string("SAME_SERVICE_ID") == std::string(argv[3])) {
use_same_service_id = true;
} else {
use_same_service_id = false;
}
+
+
+
return RUN_ALL_TESTS();
}
#endif
diff --git a/test/subscribe_notify_tests/subscribe_notify_test_slave_starter.sh b/test/subscribe_notify_tests/subscribe_notify_test_slave_starter.sh
index 20362c7..dca9e71 100755
--- a/test/subscribe_notify_tests/subscribe_notify_test_slave_starter.sh
+++ b/test/subscribe_notify_tests/subscribe_notify_test_slave_starter.sh
@@ -18,20 +18,23 @@ then
exit 1
fi
+RELIABILITY_TYPE=$1
+SLAVE_JSON_FILE=$2
+SAME_SERVICE_ID=$3
FAIL=0
# Start the services
export VSOMEIP_APPLICATION_NAME=subscribe_notify_test_service_four
-export VSOMEIP_CONFIGURATION=$1
-./subscribe_notify_test_service 4 $2 &
+export VSOMEIP_CONFIGURATION=$SLAVE_JSON_FILE
+./subscribe_notify_test_service 4 $RELIABILITY_TYPE $3 &
export VSOMEIP_APPLICATION_NAME=subscribe_notify_test_service_five
-export VSOMEIP_CONFIGURATION=$1
-./subscribe_notify_test_service 5 $2 &
+export VSOMEIP_CONFIGURATION=$SLAVE_JSON_FILE
+./subscribe_notify_test_service 5 $RELIABILITY_TYPE $3 &
export VSOMEIP_APPLICATION_NAME=subscribe_notify_test_service_six
-export VSOMEIP_CONFIGURATION=$1
-./subscribe_notify_test_service 6 $2 &
+export VSOMEIP_CONFIGURATION=$SLAVE_JSON_FILE
+./subscribe_notify_test_service 6 $RELIABILITY_TYPE $3 &
# Wait until all applications are finished
for job in $(jobs -p)