summaryrefslogtreecommitdiff
path: root/test/network_tests/event_tests/event_test_slave_starter.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/network_tests/event_tests/event_test_slave_starter.sh')
-rwxr-xr-xtest/network_tests/event_tests/event_test_slave_starter.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/network_tests/event_tests/event_test_slave_starter.sh b/test/network_tests/event_tests/event_test_slave_starter.sh
new file mode 100755
index 0000000..c1bd489
--- /dev/null
+++ b/test/network_tests/event_tests/event_test_slave_starter.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+# Copyright (C) 2015-2018 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+FAIL=0
+
+if [ $# -lt 1 ]
+then
+ echo "Please pass a operation and communication mode to this script."
+ echo "For example: $0 UDP"
+ echo "Valid communication modes include [UDP, TCP]"
+ exit 1
+fi
+COMMUNICATIONMODE=$1
+
+if [ "$COMMUNICATIONMODE" = "TCP" ]; then
+ export VSOMEIP_CONFIGURATION=event_test_slave_tcp.json
+elif [ "$COMMUNICATIONMODE" = "UDP" ]; then
+ export VSOMEIP_CONFIGURATION=event_test_slave_udp.json
+fi
+
+
+../../examples/routingmanagerd/./routingmanagerd &
+PID_VSOMEIPD=$!
+
+./event_test_service $COMMUNICATIONMODE &
+PID_SERVICE=$!
+
+# Wait until all clients and services are finished
+for job in $PID_SERVICE
+do
+ # Fail gets incremented if a client exits with a non-zero exit code
+ echo "waiting for $job"
+ wait $job || FAIL=$(($FAIL+1))
+done
+
+# kill the services
+kill $PID_VSOMEIPD
+sleep 1
+
+# Check if everything went well
+exit $FAIL