• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2# Copyright (C) 2015-2018 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
3# This Source Code Form is subject to the terms of the Mozilla Public
4# License, v. 2.0. If a copy of the MPL was not distributed with this
5# file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7FAIL=0
8
9if [ $# -lt 1 ]
10then
11    echo "Please pass a operation and communication mode to this script."
12    echo "For example: $0 UDP"
13    echo "Valid communication modes include [UDP, TCP]"
14    exit 1
15fi
16COMMUNICATIONMODE=$1
17
18if [ "$COMMUNICATIONMODE" = "TCP" ]; then
19    export VSOMEIP_CONFIGURATION=event_test_slave_tcp.json
20elif [ "$COMMUNICATIONMODE" = "UDP" ]; then
21    export VSOMEIP_CONFIGURATION=event_test_slave_udp.json
22fi
23
24
25../examples/routingmanagerd/./routingmanagerd &
26PID_VSOMEIPD=$!
27
28./event_test_service $COMMUNICATIONMODE &
29PID_SERVICE=$!
30
31# Wait until all clients and services are finished
32for job in $PID_SERVICE
33do
34    # Fail gets incremented if a client exits with a non-zero exit code
35    echo "waiting for $job"
36    wait $job || FAIL=$(($FAIL+1))
37done
38
39# kill the services
40kill $PID_VSOMEIPD
41sleep 1
42
43# Check if everything went well
44exit $FAIL
45