1#!/bin/bash
2# Copyright (C) 2015-2017 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
9export VSOMEIP_CONFIGURATION=application_test_no_dispatch_threads.json
10./application_test
11
12if [ $? -ne 0 ]
13then
14    ((FAIL+=1))
15fi
16
17export VSOMEIP_CONFIGURATION=application_test.json
18./application_test
19
20if [ $? -ne 0 ]
21then
22    ((FAIL+=1))
23fi
24
25cat <<End-of-message
26*******************************************************************************
27*******************************************************************************
28** Now running same tests with routingmanagerd
29*******************************************************************************
30*******************************************************************************
31End-of-message
32export VSOMEIP_CONFIGURATION=application_test_no_dispatch_threads_daemon.json
33../examples/routingmanagerd/./routingmanagerd &
34DAEMON_PID=$!
35./application_test
36if [ $? -ne 0 ]
37then
38    ((FAIL+=1))
39fi
40
41kill $DAEMON_PID
42wait $DAEMON_PID
43
44export VSOMEIP_CONFIGURATION=application_test_daemon.json
45../examples/routingmanagerd/./routingmanagerd &
46DAEMON_PID=$!
47./application_test
48if [ $? -ne 0 ]
49then
50    ((FAIL+=1))
51fi
52
53kill $DAEMON_PID
54
55# Check if both exited successfully
56if [ $FAIL -eq 0 ]
57then
58    exit 0
59else
60    exit 1
61fi
62